Log in

View Full Version : A little problem


auto
07-30-2001, 06:00 PM
I've decided to do away with the vB icons and change them to text...
http://www.automotiveforums.com/vbulletin/index.php
you can see how on top it says Free Registration! in red and all other links on the right.

I tried to make it so that only guests will see the Free Registration! link.

In global.php I added this:


if ($bbuserinfo['userid']!=0) {
$registertext=" ";
} else {
$registertext="<A HREF=\"register.php?s=$session[sessionhash]&action=signup\"><b><font face=\"verdana\" size=\"1\" color=\"red\">Free Registration!</a></b></font>";
}

But for some reason the text doesnt dissappear for the logged in users. What am I doing wrong?

thanks

Pingu
07-30-2001, 07:41 PM
if ($bbuserinfo['userid']!=0) {
$registertext=" ";
means something like: if the visitor already has a userid, then don't display the register link.
Why would you want to display the register link to people who are already registered?

I guess the script works like it should :)

auto
07-30-2001, 09:18 PM
Originally posted by Pingu
if the visitor already has a userid, then don't display the register link.

that is what i am trying to do :)

BradC
07-30-2001, 10:31 PM
do you have this yet?


if ($bbuserinfo['userid'] == 0)
{
$registertext="<A HREF=\"register.php?s=$session[sessionhash]&action=signup\"><b><font face=\"verdana\" size=\"1\" color=\"red\">Free Registration!</a></b></font>";
}
else
{
//do nothing cause the member is logged in
// or add :
$blanketme = "<b></b>";
$registertext = $blanketme;
}


would have to play with it.. to figure it out.. but I am sure you can.. without any help :)

auto
07-30-2001, 10:42 PM
nope, still doesnt work :(

still shows up no matter what, even if the person is logged in.

Pingu
07-30-2001, 10:57 PM
Completely missed the "diss" in dissappear :o

Anyway, there's something to be learned from this part:
$unregwelcomemessage='';

in index.php, all the way at the bottom

auto
07-30-2001, 11:01 PM
my code finally worked when Brad suggested that I move it to another location inside global.php... :D

BradC
07-30-2001, 11:01 PM
ok.. auto can post the code used.. but in the global.php file you search and find this line :

// ###################### Referrer Stuff #########################

and right above that... you place the code.. then it will work.. or so it seems :)

add this above that :)


if ($bbuserinfo['userid']!=0) {
$registertext=" ";
} else {
$registertext="<A HREF=\"register.php?s=$session[sessionhash]&action=signup\"><b><font face=\"verdana\" size=\"1\" color=\"red\">Free Registration!</a></b></font>";
}


Great job auto! :)

it is really a nice hack or addition to the site, especially the way you have it setup and want to set it up :)

Rapdis
03-26-2002, 01:50 PM
i like your registerpopup.js where can i get that?