PHP Web Host - Quality Web Hosting For All PHP Applications Free RavenNuke(tm) Add Ons
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
Author Message
Tazz
New Member
New Member


Joined: Mar 18, 2004
Posts: 10

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

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: 16987
Location: Kansas

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

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 Visit poster's website AIM Address Yahoo Messenger
Tazz
New Member
New Member


Joined: Mar 18, 2004
Posts: 10

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

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.
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

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

Use the admin/links and admin/case structure.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

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

See if this helps
Only registered users can see links on this board!
Get registered or login to the forums!
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
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.

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum