Results 1 to 15 of 64
Page 1 of 5
FirstFirst 1 2 3 ... LastLast

Thread: [RELEASE] Template Control Panel for 2.0

  1. #1
    Former Lead Developer, vBulletin Kier is a jewel in the rough Kier is a jewel in the rough Kier is a jewel in the rough Kier is a jewel in the rough Kier's Avatar
    Join Date
    Sep 2000
    Location
    Reading, UK
    Posts
    8,228
    Blog Entries
    6
    UPDATED 28-02-2001



    This hack for vB2.0 Beta 2 will allow you to edit a single template set, or all of them at the same time, is dramatically less bandwidth-hungry than the current system, and allows quick searches through the templates by clicking in the <select> element and pressing a key; for example, if you want to find the 'header' template, just click in the select and press 'h' on your keyboard...

    To install, follow the following instructions:

    First, open the file forums/admin/adminfunctions.php and find the line
    Code:
    OPTION  {COLOR: #51485F; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; FONT-SIZE: 10px}
    and replace it with this:
    Code:
    OPTION    {FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; FONT-SIZE: 10px}
    This will allow the text of the <select> elements to be green or red in the templates page...

    Next, open the file forums/admin/template.php and find the block of code that looks like this:
    PHP Code:
    // ###################### Start Modify #######################
    if ($action=="modify") {

    (
    lots of code in here)

    }

    // ###################### Start search ####################### 
    and comment out the code between the { } like this:
    PHP Code:
    // ###################### Start Modify #######################
    if ($action=="modify") {

    /*
    (lots of code in here)
    */
    }

    // ###################### Start search ####################### 
    Next, just after the first open brace, add a line so that the final code looks like this:
    PHP Code:
    // ###################### Start Modify #######################
    if ($action=="modify") {
    include 
    "./ktemplate.php";
    /*
    (lots of code in here)
    */
    }

    // ###################### Start search ####################### 
    Next, find the section of text within the template.php code that looks like this:
    PHP Code:
    $DB_site->query("INSERT INTO template (templateid,templatesetid,title,template) VALUES (NULL,'$templatesetid','".addslashes("$title")."','".addslashes("$template")."')"); 
    and replace it with this:
    PHP Code:
    $result $DB_site->query("INSERT INTO template (templateid,templatesetid,title,template) VALUES (NULL,'$templatesetid','".addslashes("$title")."','".addslashes("$template")."')");
    $templateid $DB_site->insert_id($result); 
    Finally, upload the attached file to your forums/admin/ folder, rename it to ktemplate.php and you're all ready to go.

    19th Feb 2001 Additions:
    The hack will now auto-select the last template you edited when you return to the list from submitting an edit, or adding a new custom template.
    Cookie functions can be disabled for users who do not use output_buffering
    Lots of minor bug fixes (this one actually works )
    Please note: if you do not have output_buffering=On in your php.ini, you should comment out the '$usecookies' line at the top of ktemplate.php
    28th Feb 2001 Additions:
    I have now restored the original template.php's 'view original' functionality through the use of a little javascript. I have tested the script with browsers going back to Nutscrape 4.6, and they all work fine.
    Just as an added extra, the hack now tells you how many global and custom templates you have...
    28th Feb 2001 Additions: (more )
    I just modified the code a little so that you can double-click in the menus for a default event:
    Double-clicking a global template name will activate the 'add' function, giving you the option to create a customized template.
    Double-clicking a customized/added template will open the edit page for the selected template.
    Right-clicking a customized template will display the original template of that name. (Right-click functionality is IE only.)
    Last edited by Kier; Fri 9th Mar '01 at 11:14am.
    Meh. | Twitter: @KierDarby | Web: KierDarby.com
     

  2. #2
    Senior Member Dark_Wizard has disabled reputation
    Join Date
    Jan 2001
    Location
    North Carolina
    Age
    52
    Posts
    345
    Very nice...thank you so much!
     

  3. #3
    Senior Member WildWayz is on a distinguished road
    Join Date
    May 2000
    Age
    31
    Posts
    583
    Excellent hack!

    --JAmes
     

  4. #4
    Senior Member Dark_Wizard has disabled reputation
    Join Date
    Jan 2001
    Location
    North Carolina
    Age
    52
    Posts
    345
    Had to post another thank you for making my job easier....Excellent Hack!
     

  5. #5
    Former Lead Developer, vBulletin Kier is a jewel in the rough Kier is a jewel in the rough Kier is a jewel in the rough Kier is a jewel in the rough Kier's Avatar
    Join Date
    Sep 2000
    Location
    Reading, UK
    Posts
    8,228
    Blog Entries
    6
    A slight enhancement -

    This is a new version of the file ktemplate.php, which now gives you the option to specify the size of the <select> items - just open up the code and find the lines at the top of the code that read:
    PHP Code:
    $global_max_size 10;
    $custom_max_size 15
    Edit these numbers to taste - their meanings should be fairly self-explanitory. The defaults of 10,15 are what I have found to be most usable, but everything depends on the display resolution you are running.

    Note: if you set the value to 1, the select menu will become a pop-up menu, rather than a list.
    Last edited by Kier; Sun 18th Feb '01 at 1:04am.
     

  6. #6
    Member CGiFORCE is on a distinguished road
    Join Date
    Jan 2001
    Location
    Norway
    Age
    23
    Posts
    37
    great hack man!
    thanks alot
     

  7. #7
    Senior Member fastforward is on a distinguished road
    Join Date
    Nov 2000
    Location
    NC, USA
    Posts
    1,013
    This is a great hack kier. It certainly speeds up template editing!

    Now... if only you could select a default style/template set so that whenever you come into the edit screen it is selected. I've lost count how many times I've overwritten the default one by mistake!

    We'll just never be satisfied.

    By the way... I'd like to say thanks to the Jelsoft developers/designers of this template concept. It truly is the dogs bollox! There is nothing you can't change with this system. (although my wife isn't too happy with the amount of time I'm spending playing with it)
    Last edited by fastforward; Sat 17th Feb '01 at 1:59am.
     

  8. #8
    Senior Member gekko is on a distinguished road
    Join Date
    Jul 2000
    Location
    29 Palms, CA
    Age
    24
    Posts
    191
    Great script! This makes template editing a lot easier, and now when you just edited a template, went to your forum, realized you didn't get it perfect and need to go back the that template you only go to the custom, and not sort through the whole list. Nice job.

    Now i'm just wondering why i have 12 header templates.
     

  9. #9
    Former Lead Developer, vBulletin Kier is a jewel in the rough Kier is a jewel in the rough Kier is a jewel in the rough Kier is a jewel in the rough Kier's Avatar
    Join Date
    Sep 2000
    Location
    Reading, UK
    Posts
    8,228
    Blog Entries
    6
    Originally posted by fastforward
    Now... if only you could select a default style/template set so that whenever you come into the edit screen it is selected. I've lost count how many times I've overwritten the default one by mistake!
    Coming right up...
    Meh. | Twitter: @KierDarby | Web: KierDarby.com
     

  10. #10
    Former Lead Developer, vBulletin Kier is a jewel in the rough Kier is a jewel in the rough Kier is a jewel in the rough Kier is a jewel in the rough Kier's Avatar
    Join Date
    Sep 2000
    Location
    Reading, UK
    Posts
    8,228
    Blog Entries
    6
    Okay, the hack will now remember which template set you were editing, until you click the [Edit a different template set] link.

    Please note that this version of the script requires on of two things to be active:

    You must either have GZip encoding turned on for your forum, or you must have
    Code:
    output_buffering = On;
    set in your php.ini configuration file. output_buffering is PHP4 only. Without one of these two items, the cookie-setting mechanism will fail, resulting in an error message.

    Once the final version of vB2 is out, I will make the necessary modifications to the script to remove these requirements, but for now, it would require too much messing about with the code to make it worth my while.
    Last edited by Kier; Sun 18th Feb '01 at 1:04am.
    Meh. | Twitter: @KierDarby | Web: KierDarby.com
     

  11. #11
    Senior Member fastforward is on a distinguished road
    Join Date
    Nov 2000
    Location
    NC, USA
    Posts
    1,013
    You da man!
     

  12. #12
    Member SoulReaver is on a distinguished road
    Join Date
    Nov 2000
    Location
    Germany
    Posts
    31

    WOW

    SUPER

    I like to see it in Beta2

    Thanks.....


    cya
     

  13. #13
    Member pestilence has disabled reputation pestilence's Avatar
    Join Date
    Feb 2001
    Location
    scotland
    Age
    41
    Posts
    72

    looks kewl

    looks fab great improvement and much easier for people like me..i get this spat out at the top of the page though when i enter the templates in vbb admin
    Warning: Cannot add header information - headers already sent by (output started at /home/doasquad/public_html/forums/admin/adminfunctions.php:17) in /home/doasquad/public_html/forums/admin/ktemplate.php on line 28
    ?? any ideas ?
     

  14. #14
    Former Lead Developer, vBulletin Kier is a jewel in the rough Kier is a jewel in the rough Kier is a jewel in the rough Kier is a jewel in the rough Kier's Avatar
    Join Date
    Sep 2000
    Location
    Reading, UK
    Posts
    8,228
    Blog Entries
    6

    Re: looks kewl

    Originally posted by pestilence
    looks fab great improvement and much easier for people like me..i get this spat out at the top of the page though when i enter the templates in vbb admin
    Warning: Cannot add header information - headers already sent by (output started at /home/doasquad/public_html/forums/admin/adminfunctions.php:17) in /home/doasquad/public_html/forums/admin/ktemplate.php on line 28
    ?? any ideas ?
    Like I said above, if you don't use gzip compression for your boards, or you don't have output_buffering enabled in your php.ini, then the cookie function will cause the error you are getting.

    I will post a new version with enhanced functionality in a few minutes, and a quick fix for this error.
    Meh. | Twitter: @KierDarby | Web: KierDarby.com
     

  15. #15
    Former Lead Developer, vBulletin Kier is a jewel in the rough Kier is a jewel in the rough Kier is a jewel in the rough Kier is a jewel in the rough Kier's Avatar
    Join Date
    Sep 2000
    Location
    Reading, UK
    Posts
    8,228
    Blog Entries
    6
    I've updated the hack and posted new instructions at the top of this page.
    Meh. | Twitter: @KierDarby | Web: KierDarby.com
     

Page 1 of 5
FirstFirst 1 2 3 ... LastLast

Similar Threads

  1. [RELEASE] ADVANCED MOD CONTROL PANEL v2.0
    By Unplugged in forum Releases: Version 2.x
    Replies: 35
    Last Post: Sat 27th Oct '01, 10:08pm

Bookmarks

Posting Permissions

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