The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
i need to do the following in non-vB pages:
(1) if the user already logged use their cookies and display a welcome $username + logout link (2) if the user is not logged use the login form before displaying the page content. (3) When the user logs in successfully, plant a cookie. appreciate your help ... thanks in advance |
|
#2
|
||||
|
||||
|
I need help with this too. I have gone through all the nonvb login box posts and none of them have helped - I really can't see why this is so hard. Please help some one.
|
|
#3
|
||||
|
||||
|
start by including global.php, if your above the forum root do a chdir('./vb/') then include('global.php') then just do a if($bbuserinfo[userid] != 0) {DISPLAY WELCOME;} else {DISPLAY LOGIN BOX}
just copy the code from the templates to the page |
|
#4
|
||||
|
||||
|
Thanks i'll give that a go now.
|
|
#5
|
||||
|
||||
|
Mr e,
I have put this into my index.php file on my www.mysite.com/index.php: Code:
<?
chdir("forum/");
require('global.php');
chdir("../");
$templatesused='webwelcome_welcometext,webwebwelcome_logincode,webwelcome_logoutcode,webwelcome_unregmessage,webwelcome_pmloggedin';
?>
Code:
<? // if user is know, then welcome
if ($bbuserinfo['userid']!=0) {
$username=$bbuserinfo['username'];
eval("\$welcometext = \"".gettemplate('webwelcome_welcometext')."\";");
eval("\$logincode = \"".gettemplate('webwelcome_logoutcode')."\";");
} else {
$welcometext = "";
eval("\$logincode = \"".gettemplate('webwelcome_logincode')."\";");
}
if ($bbuserinfo['userid']==0) {
eval("\$unregwelcomemessage = \"".gettemplate('webwelcome_unregmessage')."\";");
}
?>
Everythings working fine except I get this at the top of my index file: Warning: Cannot modify header information - headers already sent by (output started at /home/marulat/public_html/lib/mtlibrary.lib:19) in /home/marulat/public_html/forum/admin/functions.php on line 1652 |
|
#6
|
||||
|
||||
|
There is a thread which explains the header errors in the hacking hints and tips forum. You might want to take a read of it
:https://vborg.vbsupport.ru/showthrea...threadid=47126 Regards - miSt |
|
#7
|
||||
|
||||
|
Thanks for the link miSt! I think the offending code is:
Code:
<?php require '/home/marulat/public_html/lib/******.lib';
chdir("forum/");
require('global.php');
chdir("../");
$templatesused='webwelcome_welcometext,webwebwelcome_logincode,webwelcome_logoutcode,webwelcome_unregmessage,webwelcome_pmloggedin';
?>
Code:
<?php require '/home/marulat/public_html/lib/******.lib'; ?> |
|
#8
|
||||
|
||||
|
Your Welcome
- i hope your problem is now solved ![]() - miSt |
|
#9
|
||||
|
||||
|
perfect all done. Thanks a million everybody for you help!
oh one more thing: Where I have my login box include, it leave a HUGE gap above it. any ideas? |
|
#10
|
|||
|
|||
|
when i try this i keep getting the following
Fatal error: Call to undefined function: gettemplate() in /home/****/public_html/overallfoot.php on line 55 But why only on that template? the ones before it worked fine. line 55 is: eval("\$logincode = \"".gettemplate('webwelcome_logincode')."\";"); |
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|