Jump to content

Admin Mode


seventheyejosh

Recommended Posts

Hey all. I was wondering if someone could give me a quick snippet that'll change every instance of one class to another onclick. So i can have an 'admin side of a forum without an actual one :D'.

 

basically just a button ->

 

<input type=button value="Enable Admin Mode" onclick="enable();">

 

and a little function that will change all of the classes. note: i know a bit of js, but obviosuly the following example would never ever work :D

 


function enable(){

foreach element with class of 'adminhidden' update to class of 'admindisplayed'

}//end function

 

thanks :D

 

 

Link to comment
https://forums.phpfreaks.com/topic/164684-admin-mode/
Share on other sites

well im using (on this site) the smarty template engine, im not sure if you're familiar, but basically on the php side i'll do

 

<?

 

if (isset($is_admin)){

 

$smarty->assign('variable with admin divs',$variable);

 

}

 

?>

 

then the smarty will be

 

$variable_with_admin_divs

 

so basically, if the php perms dont match, not only will the 'button' never be created, but the divs it unlocks wont be either :D

 

it wont even be in the source code.

 

Link to comment
https://forums.phpfreaks.com/topic/164684-admin-mode/#findComment-869273
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.