Export All vBulletin Templates to Html Files

Discussion in 'Content Management System' started by shabbir, Mar 26, 2011.

  1. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    Wish you could work with your favorite HTML editor to edit vBulletin templates. You can do this with a hidden vBulletin feature.
    1. Your vBulletin needs to be running in debug mode. Add $config['Misc']['debug'] = true; into your config.php file
    2. Create a folder in your forum root called template_dump and give full read, write and execute permissions (chmod 0777).
    Now visit http://domain.com/forumpath/admincp/template.php?do=createfiles&dostyleid=XXX

    It will create HTML files for each template in the template_dump folder.

    Replace XXX with your Style ID and -1 for Master Style.

    Move the files to another directory if exporting templates from multiple styles or else previous ones will be overwritten.

    Now let us use the HTML files instead of the vBulletin interface to modify the theme.

    In functions.php in fetch_template there is a really useful little piece of code which is commented out.
    PHP:
        // **************************
        /*
        if ($template == '<<< FILE >>>')
        {
            $template = addslashes(implode('', file("./templates/$templatename.html")));
            $vbulletin->templatecache["$templatename"] = $template;
        }
        */
        // **************************
    Uncomment the above code and copy content of template_dump into templates folder. Now create a child theme and name it '<<< FILE >>>'.

    Now the template will be fetched from the filesystem instead of database.

    Enjoy !!!

    Remember, there is no import feature (I know off currently) and so you have to manually compare your changes and paste them back into their templates.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice