Want to add "if admin" in this section...

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Want to add "if admin" in this section...
swzman
CZ Super Newbie
swzman has been a member for over 20 year's 20 Year Member
usa.gif alabama.gif
Occupation: Database Administrator
Gender: Male
Fav. Sports Team: Nebraska Cornhuskers
Website:
Status: Offline
Joined: Oct 07, 2004
0.00 posts per day
Posts: 35
Points: 4,220
   
I don't know how to add if you are admin, display the admin link and graphic in this section of code.

Can someone please tell me how to do this?

  . "<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" background=\"themes/Sapphire/images/header_bg.gif\">"
  . "   <tr>"
  . "      <td rowspan=\"3\" align=\"left\"><a title=\"Home\" href=\"index.php\">"
  . "      <img border=\"0\" src=\"themes/Sapphire/images/logo.gif\" width=\"500\" height=\"90\"></a></td>"
  . "      <td align=\"right\">"
  . "      <img border=\"0\" src=\"themes/Sapphire/images/button_header.gif\" width=\"300\" height=\"12\"></td>"
  . "   </tr>"
  . "   <tr>"
  . "      <td align=\"right\">"
  . "      <a title=\"Home\" href=\"index.php\">"
  . "      <img border=\"0\" src=\"themes/Sapphire/images/button_home.gif\" width=\"60\" height=\"60\"></a><a title=\"Your Account\" href=\"account.html\"><img border=\"0\" src=\"themes/Sapphire/images/button_account.gif\" width=\"60\" height=\"60\"></a><a title=\"Downloads\" href=\"downloads.html\"><img border=\"0\" src=\"themes/Sapphire/images/button_downloads.gif\" width=\"60\" height=\"60\"></a><a title=\"Forums\" href=\"forums.html\"><img border=\"0\" src=\"themes/Sapphire/images/button_forums.gif\" width=\"60\" height=\"60\"></a><a title=\"Admin\" href=\"admin.php\"><img border=\"0\" src=\"themes/Sapphire/images/button_admin.gif\" width=\"60\" height=\"60\"></a></td>"
  . "   </tr>"
  . "   <tr>"
  . "      <td align=\"right\">"
  . "      <img border=\"0\" src=\"themes/Sapphire/images/button_footer.gif\" width=\"300\" height=\"18\"></td>"
  . "   </tr>"
  . "</table>"


Thanks in advance!
{SW}Z-MAN


Back to top Reply with quote
#2   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,430
   
Can you post a little more of the code please. Or just attach the whole file and place some //Comments where you want it.




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#3   
swzman
CZ Super Newbie
swzman has been a member for over 20 year's 20 Year Member
usa.gif alabama.gif
Occupation: Database Administrator
Gender: Male
Fav. Sports Team: Nebraska Cornhuskers
Website:
Status: Offline
Joined: Oct 07, 2004
0.00 posts per day
Posts: 35
Points: 4,220
   
The start of header section is where the graphic is located. I just want a select few people to be able to see the icon and link. I don't know how to accomplish this other than adding if admin and I don't know how to do that even. Depending on your userid, you will or will not see the link. Can this be done?

Here is the file.

Thanks
{SW}Z-MAN



Attached Files
theme.txt (20.04 KB, Downloaded: 5236 Time(s))


Back to top Reply with quote
#4   re: Want to add "if admin" in this section...
swzman
CZ Super Newbie
swzman has been a member for over 20 year's 20 Year Member
usa.gif alabama.gif
Occupation: Database Administrator
Gender: Male
Fav. Sports Team: Nebraska Cornhuskers
Website:
Status: Offline
Joined: Oct 07, 2004
0.00 posts per day
Posts: 35
Points: 4,220
   
*Bump*



Back to top Reply with quote
#5   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,430
   
Try this one...



Attached Files
swzman.zip (4.15 KB, Downloaded: 5232 Time(s))



_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#6   re: Want to add "if admin" in this section...
swzman
CZ Super Newbie
swzman has been a member for over 20 year's 20 Year Member
usa.gif alabama.gif
Occupation: Database Administrator
Gender: Male
Fav. Sports Team: Nebraska Cornhuskers
Website:
Status: Offline
Joined: Oct 07, 2004
0.00 posts per day
Posts: 35
Points: 4,220
   
Wonderful, works like a charm! Thank you very much.

Is there a way to put in a userid or two as well. I want to be able to get to the admin page by clicking the link....lazy typist....but I don't want everyone to be able to if you know what I mean. (They should have to type it if they are going to try to go where they don't belong!)

Maybe I can edit the file and put in the userid's that I want to be able to see the link?? Is this even possible?

Thanks again,
{SW}Z-MAN



Back to top Reply with quote
#7   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,430
   
Where i edited the code add this just before it:


global $cookie, $user;
cookiedecode($user);
$uid = $cookie[0];


Now change the part I added to:


if ((is_admin($admin)) AND ($uid == 2) OR ($uid == 3)) {




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#8   re: Want to add "if admin" in this section...
swzman
CZ Super Newbie
swzman has been a member for over 20 year's 20 Year Member
usa.gif alabama.gif
Occupation: Database Administrator
Gender: Male
Fav. Sports Team: Nebraska Cornhuskers
Website:
Status: Offline
Joined: Oct 07, 2004
0.00 posts per day
Posts: 35
Points: 4,220
   
Great! It didn't work at first until I took out the line:

Cookidecode....

It gave me the following error:

Fatal error: Call to undefined function: cookidecode() in C:\Program Files\Apache Group\Apache2\nuke\html\themes\Sapphire\theme.php on line 194

After removing the line and leaving the rest, it works like a charm. Thank you very much for the help!



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum