test for username?
Rushian 0
From: -
From: -
Notice
This topic is archived. New comments cannot be posted and votes cannot be cast.Responses to this topic
1 Re: test for username?
Rushian
OP
0
From: -
From: -
test for username?
Lol, yes, that fixed it. I've now added a few 'admin only' links to the main menu.. Thank you.
Lol, yes, that fixed it. I've now added a few 'admin only' links to the main menu.. Thank you.
1 Re: test for username?
Philipp
From: Vienna, Austria
Administrator
1340From: Vienna, Austria
test for username?
Maybe because the cookie is called esselbachst and not ESSELBACH_ST. Sorry
Maybe because the cookie is called esselbachst and not ESSELBACH_ST. Sorry
1 Re: test for username?
Rushian
OP
0
From: -
From: -
test for username?
Originally posted by Philipp:
Err, wait. This isn't working for me..
Nothing prints in the page where I inserted the $html var.. I tried both logged on and out.. I'm running 1.72c if it matters and running it from the site_header template..
Edit: As near as I can tell $cookiedata[0] is null... :x
Originally posted by Philipp:
Something like this should work:
$cookiedata = explode (":!:", addslashes(base64_decode($_COOKIE["ESSELBACH_ST"])));
if ($cookiedata[0] == "Rushian") $html = "You are the webmaster!";
Err, wait. This isn't working for me..
Nothing prints in the page where I inserted the $html var.. I tried both logged on and out.. I'm running 1.72c if it matters and running it from the site_header template..
Edit: As near as I can tell $cookiedata[0] is null... :x
1 Re: test for username?
Rushian
OP
0
From: -
From: -
test for username?
Super!
Is there a list of global vars that I can insert into my templates? (Besides what's already in the template docs?) (Stuff like user data, page views, times, dates, number of items, etc..) I've tried snooping through some of the code, but when I try to output the vars (say, $mystats), nothing prints.
Super!
Is there a list of global vars that I can insert into my templates? (Besides what's already in the template docs?) (Stuff like user data, page views, times, dates, number of items, etc..) I've tried snooping through some of the code, but when I try to output the vars (say, $mystats), nothing prints.
1 Re: test for username?
Philipp
From: Vienna, Austria
Administrator
1340From: Vienna, Austria
test for username?
Something like this should work:
Something like this should work:
$cookiedata = explode (":!:", addslashes(base64_decode($_COOKIE["ESSELBACH_ST"])));
if ($cookiedata[0] == "Rushian") $html = "You are the webmaster!";
How can I test for a certain username (or ID) and then print some HTML code?
I want to print a few special links if I'm logged on.
Psedo-code: