Results 1 to 15 of 50

Thread: yea i just keep noticin odd things today

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    pirate heartbreaker The Man's Avatar
    Join Date
    Mar 2002
    Location
    Sarasota, FL
    Posts
    10,946

    Default

    (Edit: BooB posted before me like the BooB that he is. Yeah, I figured it would require SOME upkeep.
    Still, it really only boils down to twelve or fifteen templates that you'd probably end up needing to do a thorough
    search of; the others (i.e. postbit_offline) you could just do a search for variables (easily located because of the "$"
    that precedes them) and check to make sure they're all intact.)

    Ok, it took more than a second, and I'm posting it in the thread on the off-chance it might help any other aspiring
    vB administrators out there. This is probably gonna be a double-post, as well, but it's long and you might want to
    copy it somewhere where you won't lose it, so it might be more convenient to leave it as a double-post.

    Ok

    Here is how to use debug mode to its fullest!

    In admin/index.php, find:

    PHP Code:
    if($debug==1)
        
    makenavoption("Edit Settings","setting.php?action=modify","<br>");
        
    makenavoption("Add Setting","setting.php?action=add","<br>");
        
    makenavoption("Add Setting Group","setting.php?action=addgroup");

    Replace that with:

    PHP Code:
    //if($debug==1) { //commented out because i want to leave debug mode on
        
    makenavoption("Edit Settings","setting.php?action=modify","<br />");
        
    makenavoption("Add Setting","setting.php?action=add","<br />");
        
    makenavoption("Add Setting Group","setting.php?action=addgroup");
    //} 
    Find:

    PHP Code:
    if ($debug==1) {
        
    makenavoption("Download Set","template.php?action=downloadset","<br>");
        
    makenavoption("Upload Set","template.php?action=uploadset","<br>");
        
    makenavoption("Do <img> Tags","template.php?action=imgtags");

    Replace that with:

    PHP Code:
    //if ($debug==1) {
        
    makenavoption("Download Set","template.php?action=downloadset","<br />");
        
    makenavoption("Upload Set","template.php?action=uploadset","<br />");
        
    makenavoption("Do <img> Tags","template.php?action=imgtags");
    //} 
    In admin/template.php, find:

    PHP Code:
      makechoosercode("Template set","templatesetid","templateset",iif(isset($templatesetid),$templatesetid,-1),iif($debug,"All - global to all template sets","")); 
    Replace that with:

    PHP Code:
      makechoosercode("Template set","templatesetid","templateset",iif(isset($templatesetid),$templatesetid,-1),/*iif($debug,*/"All - global to all template sets"/*,"")*/); 
    Find:

    PHP Code:
      if ($debug) {
            if (isset(
    $searchstring)) {
                
    $sqlinsert=" AND INSTR(template,'".addslashes($searchstring)."')>0 ";
            }
            
    // display global templates
            
    echo "<li><b>Global templates</b> ".makelinkcode("add custom template","template.php?s=$session[sessionhash]&action=add&templatesetid=-1").
            
    makelinkcode("show all","template.php?s=$session[sessionhash]&action=modify&expandset=-1&group=all").
          
    makelinkcode("collapse groups","template.php?s=$session[sessionhash]&action=modify&expandset=-1").
          
    "<ul>\n"
    Replace the first line of that code with:

    PHP Code:
    //  if ($debug) { 
    Find:

    PHP Code:
                echo "<li>$template[title]".
                    
    makelinkcode("edit","template.php?s=$session[sessionhash]&action=edit&templateid=$template[templateid]&group=$group").
                    
    makelinkcode("remove","template.php?s=$session[sessionhash]&action=remove&templateid=$template[templateid]&group=$group").
                    
    "</li>\\n";

            }
            echo 
    "</ul></li>\\n";
      } 
    Replace the last line of that with:

    PHP Code:
    //  } 
    In forum/replacement.php find:

    PHP Code:
      makechoosercode("Replacement set","replacementsetid","replacementset",iif(isset($replacementsetid),$replacementsetid,-1),iif($debug,"All - global to all replacement sets","")); 
    Replace that with:

    PHP Code:
      makechoosercode("Replacement set","replacementsetid","replacementset",iif(isset($replacementsetid),$replacementsetid,-1),/*iif($debug,*/"All - global to all replacement sets"/*,"")*/); 
    Find:

    PHP Code:
      makechoosercode("Replacement set","replacementsetid","replacementset",$replacement[replacementsetid],iif ($debug,"All - global to all replacement sets","")); 
    Replace that with:

    PHP Code:
      makechoosercode("Replacement set","replacementsetid","replacementset",$replacement[replacementsetid],/*iif ($debug,*/"All - global to all replacement sets"/*,"")*/); 
    Find:

    PHP Code:
      if ($debug) {
            
    // display global replacements 
    Replace it with:

    PHP Code:
    //  if ($debug) {
            // display global replacements 
    Lastly, find:

    PHP Code:
                echo "<li>".htmlspecialchars($replacement[findword])." is replaced by ".htmlspecialchars($replacement[replaceword])." <a href='replacement.php?s=$session[sessionhash]&action=edit&replacementid=$replacement[replacementid]'>[edit]</a> <a href='replacement.php?s=$session[sessionhash]&action=remove&replacementid=$replacement[replacementid]'>[remove]</a></li>\n";

            }
            echo 
    "</ul></li>\n";
      } 
    Replace the last line of that with:

    PHP Code:
    //  } 
    Come to think of it, I think there was an easier method for enabling debug mode that allowed you to just set $debug
    to 1 and bypass all this crap (you can probably just stick it somewhere in global.php and it'll be fine, but i'm not sure
    how safe that is); I'd need to go rummaging around to find it though. If I find it, I'll edit this post and you'll be notified.

    You are now finished enabling debug mode in the admin control panel! If you go any farther you will be
    extending your board into futher "hack-intensive" territory, since you won't have the original vbulletin default
    templates anymore, but you will also be able to perform modifications to the board with far greater speed.


    Now you will be able to edit the default settings of the board. This means that without having to use custom
    templates for any reason you'll be able to modify the appearance of the vb however you want, and it'll affect
    all style sets that don't have custom templates specified for that template. Thus, it will be extremely easy
    to manage multiple style sets, such as EoFF uses, and new style sets will require little time to create, need
    almost zero upkeep after future hacks are installed, and introduce little to no additional strain on the server.

    Basically, what you'll want to do is take all the custom templates and replacements from your current forum style,
    paste them over the vBulletin standards, and then delete the custom templates from the standard forum style. You'll
    want to delete most of the custom templates in other styles as well except where they're different from your
    NEW defaults. Unfortunately, that will be a tedious search and replace more or less by hand, but on the fortunate
    side of things you'll only have to do it once. And once you've done it, you can simply edit your main template set
    whenever you need to make a template change, and it will then affect all style sets! That way you don't have to go
    editing each template multiple times, which is probably more tedious than the search and replace.

    The extra-nice thing about enabling vBulletin debug mode, though, is that it allows you to create new "default"
    templates. Which is where the SSI stuff comes in! What you can do is create new templates for whatever you
    want to insert onto the main page, then go into the PHP and hack in an eval code for each template with the
    proper values. (If you need me to show you how to modify one of these, just ask). This means you'll be able to use
    whatever templates you want more or less wherever you want.

    The only downside to this that I can think of, apart from the "non-standard" problem, is more or less related: you'll
    want to make backups of your templates before editing them in case you screw up. More than once I've messed
    up default templates accidentally, and was forced to retrieve a recent backup to correct things. (You'll also want
    to inform your sub-admins to do the same before they edit templates, just in case you can't be there to correct things
    quickly enough for things to sort themselves out. If the forumhome template got messed up everyone would be in
    a pickle, for obvious reasons). However, it's overall been quite a time-saver (especially since I have something like
    forty style sets). Quite frankly, FG wouldn't be half as customised (or as quick to get things done, to a certain
    extent) as it is if not for debug mode.

    There's more (probably lots more - I've only glanced over the vBhome hack, and I'm not yet sure what it's fully
    capable of), but I think this is a fair kickoff intro and I should probably start getting ready for class now. Besides,
    I think you said you were going to work.
    Last edited by The Man; 02-12-2004 at 10:03 PM.
    Don't delay, add The Pimp today! Don't delay, add The Pimp today!
    Fool’s Gold tlsfflast.fm (warning: album artwork may sometimes be nsfw)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •