PDA

View Full Version : [ACP] Style available only for you


deathemperor
10-19-2005, 10:00 PM
The purpose:

I have a site with a style customized but me, but my admins keep editing it of course that's ok as long as he didn't pull out any error for me to fix. And life is not that simple, I have to fix the errors times by times. I quitted, and today I force myself to change that. Find a way to make the style only available for me to edit/upload/download, etc.

This hack modify one file: adminfunctions_template.php, and the function cache_styles() so that it won't select the style you specify in the query.

in adminfunctions_template.php FIND:

$styles = $vbulletin->db->query_read("SELECT * FROM " . TABLE_PREFIX . "style ORDER BY displayorder");

replace it with:

if($vbulletin->userinfo['userid'] == 1)
{
$styles = $vbulletin->db->query_read("SELECT * FROM " . TABLE_PREFIX . "style ORDER BY displayorder");
}
else
{
$styles = $vbulletin->db->query_read("SELECT * FROM " . TABLE_PREFIX . "style WHERE styleid != 11 ORDER BY displayorder");
}

the style with id 11 won't be available to edit/download/upload/export/import for everyone except the user with userid = 1.


and that's it. anyone see this useful ? ^^ maybe not but well it helps me now, I can have peace nights.

Snake
10-20-2005, 02:49 PM
Wow that's what I've been looking for! Thanks!

deathemperor
10-20-2005, 02:52 PM
click install ? ^^