Resource icon

Template Modification System (TMS) 1.3.1

No permission to download

Kintaro

Well-known member
You can use Preg Replace with Search
Guiltar is there a way to match multiple strings and replace them with other different strings?
Something like:

Code:
#^([A-Z]+).+([0-9]+)#s
and the replace will be
Code:
$1
/*code replacing ([A-Z]+)*/
$2
/*code replacing ([0-9]+)*/
 

faeronsayn

Well-known member
You can create an addon and export mods with it. Or you can export them like templates with any style if they are custom.
Let's say I wanted to update a style from v1.1.2 to v1.1.3. I would have to create an add-on to keep my modifications? Can't I just overwrite the old style with the updated one and it's .xml file? Would that delete the modifications ?
 

Gleedo

Active member
So I am about to setup a new forum. Should this be installed before anything else? I want to use XenPorta too with the DXF-Red style. I hope all are compatible :coffee:
 

guiltar

Well-known member
Let's say I wanted to update a style from v1.1.2 to v1.1.3. I would have to create an add-on to keep my modifications? Can't I just overwrite the old style with the updated one and it's .xml file? Would that delete the modifications ?
You don't need addon for upgrade. All mods will stay on forum.
So I am about to setup a new forum. Should this be installed before anything else? I want to use XenPorta too with the DXF-Red style. I hope all are compatible :coffee:
No. It should be installed only before addons using TMS.
 

DRE

Well-known member
I lost some template modifications I made for some reason when I turned the TMS system off and on.

I am looking at my backup, where are my template modifications stored at? Are they stored on the website folders or are they stored in the database and if so in the database what's the prefix?
 

sonnb

Well-known member
Script Execution timeout might occur on addon active/deactive that use quite big number of TMS modifition due to TMS_DataWriter_AddOn->_postSave( ) takes around 40-50 seconds to be completed.
 

guiltar

Well-known member
Script Execution timeout might occur on addon active/deactive that use quite big number of TMS modifition due to TMS_DataWriter_AddOn->_postSave( ) takes around 40-50 seconds to be completed.
Yes. That can happen. If so, turn off "Compile templates on modification save and switch" in options.
You'll need to rebuild templates to take effect after actions.
 

Arty

Well-known member
Suggestion: allow parameters in PHP callback of template modification. Fields search_value and replace_value can be used as parameters.

Its quite easy to implement without breaking backwards compatibility: in library/TMS/Template/Compiler.php find
Code:
                            call_user_func_array(array($mod['callback_class'], $mod['callback_method']), array(&$this->_text, &$mod['apply_count'], $styleId));
and add before it
Code:
                            try
                            {
                                call_user_func_array(array($mod['callback_class'], $mod['callback_method']), array(&$this->_text, &$mod['apply_count'], $styleId, $mod['search_value'], $mod['replace_value']));
                                break;
                            }
                            catch (Exception $e) { }
 

Arty

Well-known member
Hm, actually, PHP doesn't trigger exception when there are too many parameters.

So no need to catch exception. Replace that line with
Code:
call_user_func_array(array($mod['callback_class'], $mod['callback_method']), array(&$this->_text, &$mod['apply_count'], $styleId, $mod['search_value'], $mod['replace_value']));
instead.
 

Arty

Well-known member
hi, is it possible to uninstall TMS and if so how to do it?
thanks!
Same as any other add-on. Click "Add-ons" button in admin control panel, in right side of TMS row you should see "Controls" menu item. Move mouse over it, popup will open and there you'll find option to uninstall add-on.

Before doing that make sure you don't have any other add-ons installed that require TMS.
 

Fiaterniser

New member
Hello Arty, tanks to you. I did not see that in option menu, even not 'tms' but might be to late in the evening for my eyes:sleep:
I will look at it after work.
So, if i have an addon that require TMS i should remove it before removing TMS i supose(?)
Thanks again
 

Tize

Active member
I have a problem mate,
In Spanish releese
You do not have permission to view this page or perform this action.
In german is good i dont understand.
Thanks.
 

fredrikse

Active member
When I try to add a template modification with TMS I get this error message: "The requested template modification could not be found."

What's wrong? The modification is not created.
 

fredrikse

Active member
When I try to add a template modification with TMS I get this error message: "The requested template modification could not be found."

What's wrong? The modification is not created.
I just realized I can't create two separate modifications for the same template. I put the two together and now it worked :)
 
Top