![]() |
Edit Templates On Fly - A step towards easy-to-install modifications
Description:
This will enable modifications writers to edit templates on fly, to make there modifications as easy-to-install as possible. It consists of some functions, which had been written to ease template edits, without any actual editing from the webmasters side, Installation: Just import the XML file as a product. Click install to receive updates and support. Documentation: All functions are declared in the hook init_startup, with Execution Order of 1, to be the first plug-in which is being executed in the whole scripts. Current version contains the following functions:
Restrictions:
Examples:
Notes for coders: Feel free to use those functions in your mods, and please don't forget to add a dependency for this product (edit_templates_onfly). This will guarantee that every user of your mod will install this modification, so your mod will function properly, this mod will be a centralized method to edit templates, a method which is subject to be developed well, so you can't copy those functions in your mods. Your suggestions and participations are welcomed. Change log:
Credits: The first person whom I saw uses this method to edit templates is Zero Tolerance in his vBShout mod, I learned it there. |
good idea for new functions...
actually you do not need to check function_exists ... there is no such functions in vBulletin anyway... |
Installed, waiting for user feedback..
|
Isn't this just basically renaming str_replace? From a deployment standpoint, I'm not sure a prettier function is worth the cost of a dependency. There's really no actual gain.
However, if you were to create a function that utilizies preg_replace (or ereg_replace, respectively) to help simplify the joys of Regex for some of the greener developers, that would probably be more well adopted. I'm not knocking it, I think it's great that someone is taking an initiative. I'm just thinking down the road, as a developer, of possible support quandries that could arise when having to explain to end users about dependencies, etc. |
Will try when I get home.
|
yes, ist nothing other then str_replace
heres i much better method http://www.vbhacks-germany.org/showthread.php?t=5572 |
Quote:
oh, and btw, this is not a Mod or a Addon... it's just some functions that would help coders in some situations... please DO NOT INSTALL if you don't know what to do with this... |
Quote:
|
Here's an example from one of my modifications using preg_replace in order to make on-the-fly template changes to all templates -- including modified ones:
PHP Code:
HTML Code:
<div> HTML Code:
<div class="alt1"> PHP Code:
PHP Code:
PHP Code:
|
Quote:
its not on the fly, it changes on the hack install, or on your change(you have a field template change in de acp) there you can set a search string and a change string.... like this method here, but not on fly... sorry for the bad english, i hope i helped |
Quote:
You presented a very good points, I'll implement them for sure. I hadn't thought about preg_replace ereg_replace and preg_match, they must be used. Thank you very much. |
All times are GMT. The time now is 07:14 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|