Go4Expert (http://www.go4expert.com/)
-   Content Management System (http://www.go4expert.com/articles/cms/)
-   -   Export All vBulletin Templates to Html Files (http://www.go4expert.com/articles/export-vbulletin-templates-html-files-t25345/)

shabbir 26Mar2011 12:24

Export All vBulletin Templates to Html Files
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 Code:

    // **************************
    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.

All times are GMT +5.5. The time now is 20:47.