View Full Version : How can I create a member panel on my homepage
Darren Lewis
04-03-2002, 08:15 PM
I've seen a few people asking about this, but I can't work out how to do it.
On my homepage (http://www.thebookforum.com) I want to create a panel in the right column, which says one of the following.
If member logged in:
Welcome, back..... excalty like on the main forums page.
If member not logged in:
Box with login options etc like on the main forums page.
I've been trying to create something using some custom templates in vBulletin and modifying a copy of the index.php file.
I can get it to work when my modified php file is in the forums diectory (see here (http://www.thebookforum.com/forums/webhome_panel.php) ) but when I insert this PHP file into my homepage (which is a php file too) it doesn't work :(
I think it's to do with the paths to the templates, but I can't find where vBulletin stores its templates.
I've seen lots of websites using this feature (eg this one (http://www.pctechtalk.com/)), but I think they are using somehing like vbPortal which I don't want to use (rather wait for vb3).
Admin
04-04-2002, 04:57 AM
Install the Welcome Panel hack
Darren Lewis
04-04-2002, 05:28 AM
This looks like it's for use on the main forum page. I want to create something similar to this on my website's homepage ie a non-vB page.
Thanks.
Darren.
The Book Forum (http://www.thebookforum.com)
damn i got this done...... www.fiendworld.com <--the page is a bit ****ed but the side thing works..... tell me if thats what u want it says UserCP then Welcome back Darren Lewis.. but seen as ur not registered it'll have the login code.... if this is what u want tell me it takes like 3 custom templates and a bit of php code.. or u can use too templates already on ur board..
Darren Lewis
04-04-2002, 08:06 AM
Yes, that's what I want :)
Is there any way that it can not diplay the "welcome back, unregistered" unless you are registered and it would then say "Welcome back username".
It would also be great if it could then say, "there have been x number of posts and x threads since your last visit. Click here to enter the forums"
Thanks for taking the trouble to try this, I appreciate your help.
Darren.
yes there is.. ima edit it so it says that now
i dont have the code for the "there have been X posts" so i cant add it... lol i deleted it from my forum :)
Darren Lewis
04-04-2002, 08:45 AM
Thank you very much. I don't have time at the moment to set this up, but I'll get some time over the weekend (hopefully!)
Darren.
<a href="https://vborg.vbsupport.ru/showthread.php?s=&threadid=36756" target="_blank">https://vborg.vbsupport.ru/showt...threadid=36756</a>
^^that doesnt have the user panel... u have too add it urself :)
Darren Lewis
04-05-2002, 05:43 PM
I followed your instructions. I created the templates, and put the PHP code into a file. I then inserted this into another PHP webpage using the include function.
It generated this error:-
Fatal error: Call to undefined function: gettemplate() in path to PHP file/homelogin.php on line 8
What am I doing wrong?
This is the full PHP file I created (called homelogin.php)
<?
//User Center ****************
if ($bbuserinfo['userid']!=0) {
eval("\$login = \"".gettemplate('home_logout')."\";");
} else {
eval("\$login = \"".gettemplate('home_login')."\";");
}eval("\$userbits .= \"".gettemplate('home_user')."\";");
?>
Darren Lewis
04-06-2002, 05:11 PM
E,
Am I supposed to be using your code together with the vBHome (Lite) hack?
where did u put it.. what is line 8?
Andy Z
04-06-2002, 09:29 PM
You have to require vB's admin/functions.php in that file (I think) as that is where gettemplate() is defined.
Darren Lewis
04-07-2002, 08:19 AM
I've nearly managed to solve the problem.
Have a look here (http://www.thebookforum.com/test.php) for the result.
Thanks for all the help. I'm slowly starting to understand how powerful PHP (and vB) can be.
If I delete my cookie, I get this message
Warning: Cannot add header information - headers already sent by (output started at server path/test.php:11) in server path/forums/admin/functions.php on line 1545
Line 11 of test.php is the link to my website's style sheet (CSS). The problem still exists if I edit out the link to the style sheet.
It must be something to do with the cookie as when I log in the probelm disappears.
Darren Lewis
04-07-2002, 02:43 PM
Managed to solve it and get the script working OK now.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.