Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.0
Author Message
Tazz
New Member
New Member



Joined: Mar 18, 2004
Posts: 10

PostPosted: Sat Apr 24, 2004 4:16 pm Reply with quote

Hello all,

I am trying to add a link in the admin block area, I know the code to add for the link and can get it to work fine, what I want to do is put an if statement on it so only superadmins will see it.

Still new to coding , but here is a sample I tried.

Code:


/////////////////
after die statement
////////////////
$result = sql_query("select radminsuper from ".$prefix."_authors where aid='$aid'", $dbi);
list($radminsuper) = sql_fetch_row($result, $dbi);
$ab2=$radminsuper;

////////////////
in admin block are
///////////////
$ab2 is globaled as well


if ($ab2){
   /*Waiting Approvals code for NDreviews*/
   $num = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_ndreviews where ractive='0'"));
   $content .= "<strong><big>&middot;</big></strong>&nbsp;<a href=\"admin.php?op=NDreviewsAdmin\">Reviews Waiting</a>: $num<br>";
   /*end of NDreviews Waiting code*/
   }


This failed to work, but has worked in other situations, I am still very newbish with php, I understand that only admins can see this area, but like having it set so only the proper admins can see what they are suppose to, This code generates this error.

Code:
Fatal error: Call to undefined function: sql_query() in mainfile.php on line 71


Which of course is the above query.

Anyone have any suggestions on how I can set this link to only show for super admins?
 
View user's profile Send private message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Sat Apr 24, 2004 7:28 pm Reply with quote

I think you would be best off to stick with the nuke model rather than a home grown way. Look at admin/modules/authors.php to see how it is done.
 
View user's profile Send private message
Tazz







PostPosted: Sat Apr 24, 2004 7:50 pm Reply with quote

Thank you for the reply, I thumbed threw the authors.php, I have set access via admin to the proper admins, The module I am working with is a custom review module that has and upload option in it as well. I have it laid out so normal admins can add reviews to it, but I dont want them to have access to the editing or deleting options built in the module. I was able to do something similar to the above to block the commands from them in the normal admin functions. Just wanted to set the link in the admin block to go directly to the approve review page instead of the base admin page.
 
Raven







PostPosted: Sat Apr 24, 2004 7:53 pm Reply with quote

Use the admin/links and admin/case structure.
 
Raven







PostPosted: Sat Apr 24, 2004 8:05 pm Reply with quote

See if this helps [ Only registered users can see links on this board! Get registered or login! ]
 
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.0

View next topic
View previous topic
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 can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©