Note: this for use with local vBulletin installations.
Explanation
Say if you are working on a new project (articles, for example). Once configured, it would read all of the article_ prefixed templates as HTML files into a new ./templates folder. You can open one up in your favorite HTML editor, makes a few changes.
Now we're stuck. This would mean you would have to copy paste the file contents into the AdminCP, so vB can recompile the template into raw PHP again. Nope! This will do it for you.
Say if you use Firefox, keep a tab open with this file opened, and you will have a few options:
- Save All - Takes each HTML document and saves it back to the database safely. It will use the styleID, product and version you specify. It will even create new HTML files found.
- Update All - To initially import, or update your HTML files with any changes made directly to the database, run this. It does the opposite as the above. Though, if you run the above first, this will obviously have no effect.
- Remove Missing - This will compare your file system with the templates in the database and prune out any files that no longer have online counterparts.
Each of the following 3 actions will not only just use the prefix you specify (leaves your other templates out of it!) but you can also filter the processing further. There is a filter box above the main data table, where you could enter articles_view. It would then list the templates starting with that. You could then easily just save/update all of those at once. Redirecting back works with the prefixes as well (to maintain your sanity).
If you find yourself constantly saving/refreshing a file, you can press the 'Save' or 'Update' buttons on their own to prevent a redirect back to where you were.
Benefits
The main benefit is the ability to work outside of "alt-tab" constraints which I found myself hating more and more every day. No, screen real estate wasn't the problem. Instead of copying, switching into the vB AdminCP, pasting, saving then refreshing (not to mention multiple templates!), you can now just save, click, refresh. Simple, fast, easy.
The other benefit is if you use any source code control software (ex: CVS). You can share the templates much easier. I personally had to add another step for this - a cron job to synch them, but that's not really relevant.
The Code
I'm only sharing this because I found this extremely useful, and I'm sure others will too. Feel free to improve it, and use it for your own needs. I originally wrote this for vBlogetin, so there was last minute shuffling to get rid of the dependency on it, but I think it's okay.
You only need to edit the few lines under the config comment. I suggest leaving styleid and path as they are. Anyway, here it is.
forums/template.php You must first be a
registered member to view any code.