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>·</big></strong> <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?
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 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