vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Change Admin CP Style Without Logging Out (https://vborg.vbsupport.ru/showthread.php?t=67555)

Slynderdale 07-23-2004 10:00 PM

Change Admin CP Style Without Logging Out
 
I made a small hack that adds a small nav menu of all the admin cp styles that you can click on to quickly and esily update your admin cp style without having to log out and then select a new style and then re-log in. Its a simple and small hack, but a nice one if you have alot of admin cp styles.

You can always make your own styles or find a bunch at vBulletinTemples.com
http://www.vbulletintemplates.com/mo...&type=admincss

In your admincp folder, open index.php and find:
PHP Code:

 // #############################################################################
 // ################################## REDIRECTOR ###############################
 // #############################################################################
 
 
if (!empty($redirect))
 { 

Above that add:
PHP Code:

 // #############################################################################
 // ############################### Update CP Style #############################
 // #############################################################################
 
if ($_REQUEST['do'] == 'cpstyle')
 {
   unset(
$stylefolder);
   
$getcssoptions fetch_cpcss_options();
     foreach (
$getcssoptions AS $folder => $foldername)
     {
     if(
$_REQUEST['style'] == $folder) {
       
$stylefolder $folder;
       break;
     }
     }
     if (
$stylefolder
     {
       
$DB_site->query("
           UPDATE " 
TABLE_PREFIX "administrator
           SET  cssprefs = '" 
addslashes($stylefolder) . "'
           WHERE userid = 
$bbuserinfo[userid]
       "
);
   }
   
$redirect "./index.php";
 } 

In the same file find:
PHP Code:

 // ################################ NAVIGATION FRAME #############################
 
 if ($_REQUEST['do'] == 'nav')
 {
     require_once('./includes/adminfunctions_navpanel.php');
     print_cp_header();
 
     echo "\n<div>";
     ?><img src="../cpstyles/<?php echo $vboptions['cpstylefolder']; ?>/cp_logo.gif" title="<?php echo $vbphrase['admin_control_panel']; ?>" alt="" border="0" hspace="4" <?php $df print_form_middle("L3475c86"); ?> vspace="4" /><?php
     
echo "</div>\n\n" iif(is_demo_mode(), "<div align=\"center\"><b>DEMO MODE</b></div>\n\n") . "<div style=\"width:168px; padding: 4px\">\n";
 
     
// cache nav prefs
     
can_administer();
 
     
construct_nav_spacer();

and under it add:
PHP Code:

     $printhr true;
     
$getcssoptions fetch_cpcss_options();
     foreach (
$getcssoptions AS $folder => $foldername)
     {
       if (
$foldername AND $folder) {
           
construct_nav_option($foldername,"index.php?$session[sessionurl]do=cpstyle&amp;style=$folder");
         }
     }
     
construct_nav_group($vbphrase['change_admin_cp_style'], '<hr />');
     if (
$printhr == true)
     {
      
construct_nav_spacer();
     } 

then add a new phrase to Control Panel Global called:
change_admin_cp_style
with:
Change Admin CP Style

Thats all, I'll include a screenshot below as an example of how it would look.

Merjawy 07-24-2004 10:33 PM

Very nice.. thnx.. I hated it when I had to log out just to do that :)

Dean C 08-06-2004 08:42 AM

Moved ;)

Megareus Rex 09-10-2004 09:50 AM

Nice hack. My co-admins didnt even know there were multiple admin CP styles till i installed this :P


All times are GMT. The time now is 08:20 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01050 seconds
  • Memory Usage 1,736KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete