Resource icon

Template Modification System (TMS) 1.3.1

No permission to download

guiltar

Well-known member
guiltar submitted a new resource:

Template Modification System (TMS) (version Beta 1) - Modify templates before compilation

Addons allows to modify templates before they are compiled.
Modifications are applied using search/replace method. Regular expressions are planned.
This improves performance compare to template hooks and is more flexible.

Feel free to modify, refactor and extend the addon. It would be great to be implemented in the core when become stable. In one word: BSD.

Screenshot4.webp

Read more about this resource...
 
First Resource that goes on my Watch List!

Many Thanks Guiltar. When I finally convert my main site and use this, I will surely be sending a donation your way.
 
It's empty :(
It should be empty since you havent created any.
For example you want to add banner. So fill out the form and save it.
And you may create modifications only for custom templates.
Enable debug mode and go to master style (easiest way) or you have to do any change in your test style to create a custom template.
ScreenshotBanner.webp
Code:
{xen:raw $sidebar}
<div class="section">
<div class="secondaryContent">
<h3 class="textHeading larger">{xen:phrase xenforo}</h3>
  <div style="text-align:center;background-color: #176093;">
    <a href="http://xenforo.com" >
            <img src="http://xenforo.com/styles/default/xfsite/logo.png">
        </a>         
  </div>
</div>
 
guiltar updated Template Modification System (TMS) with a new update entry:

New features added, usability improved.

Added Features:
  • Modifications of 3 types: search/replace, regular expression, callback.
  • Modification now associated with any template default, custom or inherited.
  • Export/import modifications together with addon (just like templates).
  • Export/import modifications together with style (just like templates).
  • Integration with template's editing.
  • Advanced options for performance.
The addon now allows to make other addons using template modifications instead of...

Read the rest of this update entry...
 
Got the following errors when trying to upgrade

1st try - uploaded xml


Code:
Server Error
 
Mysqli statement execute error : Can't DROP 'template_final'; check that column/key exists
 
Zend_Db_Statement_Mysqli->_execute() in Zend/Db/Statement.php at line 317
Zend_Db_Statement->execute() in Zend/Db/Adapter/Abstract.php at line 479
Zend_Db_Adapter_Abstract->query() in TMS/Manufacture.php at line 112
TMS_Manufacture->_installVersion2() in TMS/Manufacture.php at line 59
TMS_Manufacture::build()
call_user_func() in XenForo/Model/AddOn.php at line 214
XenForo_Model_AddOn->installAddOnXml() in XenForo/Model/AddOn.php at line 169
XenForo_Model_AddOn->installAddOnXmlFromFile() in XenForo/ControllerAdmin/AddOn.php at line 212
XenForo_ControllerAdmin_AddOn->actionUpgrade() in XenForo/FrontController.php at line 310
XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 132
XenForo_FrontController->run() in /var/www/forums/admin.php at line 13


2nd try via server install (not upload)

Code:
Server Error
 
Mysqli statement execute error : Unknown column 'search_string' in 'tms_modification'
 
Zend_Db_Statement_Mysqli->_execute() in Zend/Db/Statement.php at line 317
Zend_Db_Statement->execute() in Zend/Db/Adapter/Abstract.php at line 479
Zend_Db_Adapter_Abstract->query() in TMS/Manufacture.php at line 106
TMS_Manufacture->_installVersion2() in TMS/Manufacture.php at line 59
TMS_Manufacture::build()
call_user_func() in XenForo/Model/AddOn.php at line 214
XenForo_Model_AddOn->installAddOnXml() in XenForo/Model/AddOn.php at line 169
XenForo_Model_AddOn->installAddOnXmlFromFile() in XenForo/ControllerAdmin/AddOn.php at line 212
XenForo_ControllerAdmin_AddOn->actionUpgrade() in XenForo/FrontController.php at line 310
XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 132
XenForo_FrontController->run() in /var/www/forums/admin.php at line 13

Figured I could maybe try to un-install and do new install

Un-install gave following error (but seemingly is un-installed)

Code:
Mysqli statement execute error : Can't DROP 'template_final'; check that column/key exists
 
Zend_Db_Statement_Mysqli->_execute() in Zend/Db/Statement.php at line 317
Zend_Db_Statement->execute() in Zend/Db/Adapter/Abstract.php at line 479
Zend_Db_Adapter_Abstract->query() in TMS/Manufacture.php at line 152
TMS_Manufacture->_uninstallStep1() in TMS/Manufacture.php at line 138
TMS_Manufacture::destroy()
call_user_func() in XenForo/DataWriter/AddOn.php at line 193
XenForo_DataWriter_AddOn->_postDelete() in XenForo/DataWriter.php at line 1738
XenForo_DataWriter->delete() in XenForo/ControllerAdmin/AddOn.php at line 116
XenForo_ControllerAdmin_AddOn->actionDelete() in XenForo/FrontController.php at line 310
XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 132
XenForo_FrontController->run() in /var/www/forums/admin.php at line 13

Tried to install RC1 with the following error (no install)

Code:
Server Error
 
Mysqli statement execute error : Duplicate column name 'template_modifications'
 
Zend_Db_Statement_Mysqli->_execute() in Zend/Db/Statement.php at line 317
Zend_Db_Statement->execute() in Zend/Db/Adapter/Abstract.php at line 479
Zend_Db_Adapter_Abstract->query() in TMS/Manufacture.php at line 72
TMS_Manufacture->_installVersion1() in TMS/Manufacture.php at line 59
TMS_Manufacture::build()
call_user_func() in XenForo/Model/AddOn.php at line 214
XenForo_Model_AddOn->installAddOnXml() in XenForo/Model/AddOn.php at line 169
XenForo_Model_AddOn->installAddOnXmlFromFile() in XenForo/ControllerAdmin/AddOn.php at line 178
XenForo_ControllerAdmin_AddOn->actionInstall() in XenForo/FrontController.php at line 310
XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 132
XenForo_FrontController->run() in /var/www/forums/admin.php at line 13
 
Got the following errors when trying to upgrade

Oh. I will check it. Try following:
drop all of these fields if they exist:
xf_template.template_modified
xf_template.template_modifications
xf_template_map.template_final
xf_template_map.template_modifications
drop table:
tms_modification

Then install it from scratch. I will check installer now.
 
I just installed this and on installation / saving any template I get a Server 500 error with this showing up in my apache log:

Code:
PHP Fatal error:  Call to undefined method XenForo_Application::getOptions() in /var/vhosts/ss/trunk/community/library/TMS/Model/Template.php on line 92, referer: http://www.shadowedsoul.net/community/admin.php?styles/save

Any ideas?
 
I just installed this and on installation / saving any template I get a Server 500 error with this showing up in my apache log:

Code:
PHP Fatal error:  Call to undefined method XenForo_Application::getOptions() in /var/vhosts/ss/trunk/community/library/TMS/Model/Template.php on line 92, referer: http://www.shadowedsoul.net/community/admin.php?styles/save

Any ideas?
Almost sure that you use old version of XF. The method XenForo_Application::getOptions() exists in 1.1.2
What exactly is your version? Honestly I was doing and testing the addon only on the last 1.1.2.
 
Almost sure that you use old version of XF. The method XenForo_Application::getOptions() exists in 1.1.2
What exactly is your version? Honestly I was doing and testing the addon only on the last 1.1.2.
I feel like a complete idiot now...I forgot to update my local test server to 1.1.2

Thanks Guiltar
 
Hi guiltar,

First of all let me say this is an amazing add-on!
I was looking into using this to wrap up template edits for one of my add-ons, however I have encountered a problem with template names.
Your 'tms_modification' table has 'template_title' set to varchar(25) but it should be varchar(50) as it is in the 'xf_template' table.

Other than that, I am still playing with it but it looks absolutely great.
 
Back
Top Bottom