Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: SMF Customization Team on August 09, 2009, 01:39:17 PM

Title: Disable Template Eval
Post by: SMF Customization Team on August 09, 2009, 01:39:17 PM
Link to Mod (https://custom.simplemachines.org/mods/index.php?mod=2054)

Disable Template Eval




Original Author: Arantor (https://www.simplemachines.org/community/index.php?action=profile;u=265135) | Current Author: SMF Customization Team (https://www.simplemachines.org/community/index.php?action=profile;u=1)
Supported Languages: English, Spanish

Link To Mod (https://custom.simplemachines.org/mods/index.php?mod=2054) | Mod Discussion (http://www.simplemachines.org/community/index.php?topic=329878.0) | Other SMF Customization Team Mods (https://custom.simplemachines.org/mods/index.php?action=profile;u=1)



Summary:
In a number of cases, in support topics with an error concerning 'template eval()', the first answer from the Support Team will be to disable this.

This mod provides an easy tick-box configuration option for this in Server Settings / General (2.0), and Server Settings / Feature Configuration (1.1) - please see the screenshots attached.

Note also for bigger board users: if you're using a cache such as XCache, disabling template eval() will give you a performance boost.

Compatibility:
Compatible with SMF 1.1 & 2.0 upto RC1 (Standard Feature in 2.0 RC2 onward)

Installation Information:
The Package Manager should work in most cases, if you have problems installing please use the discussion thread as well as Manual Installation of Mods (http://docs.simplemachines.org/index.php?topic=402)

Change Log:
Version 1.2 - October 22, 2009
! Restructured mod slightly

Version 1.1 - August 12, 2009
+ Added English British and Spanish (both _es and _latin) translations. Thanks to 130860 for the Spanish translations.

Version 1.0 - August 9, 2009
  Initial release



Copyright (c) 2015, Simple Machines, under BSD 3-Clause License.
All rights reserved.
Title: Re: Disable Template Eval
Post by: kingkingston on August 09, 2009, 02:47:11 PM
Thanks,great mod
Title: Re: Disable Template Eval
Post by: babjusi on August 09, 2009, 02:48:40 PM
Great work Arantor, again. We had a discusion about such a mod here.

http://www.simplemachines.org/community/index.php?topic=329889.0
Title: Re: Disable Template Eval
Post by: Arantor on August 09, 2009, 03:28:38 PM
Yeah, I didn't notice the reply here until I'd seen your other thread. Having it as an option in both 1.1 and 2.0 does make life easier :)
Title: Re: Disable Template Eval
Post by: tyty1234 on August 09, 2009, 03:51:21 PM
Nice mod Arantor! ;)
It certainly would help everyone when it comes to support and debugging. :D
Title: Re: Disable Template Eval
Post by: Arantor on August 09, 2009, 03:56:25 PM
That's precisely why I wrote it, not to mention the performance boost, but I think it'll be useful to have around :)
Title: Re: Disable Template Eval
Post by: feline on August 09, 2009, 04:11:43 PM
Very good option ... thanks  ;)

Fel
Title: Re: Disable Template Eval
Post by: busterone on August 09, 2009, 04:31:04 PM
Nice.  :)
Title: Re: Disable Template Eval
Post by: Ben K on August 09, 2009, 04:54:19 PM
I think this should be in SMF it self, with out a mod.
Title: Re: Disable Template Eval
Post by: Arantor on August 09, 2009, 04:58:01 PM
So do I, Ben K, but the team have a good reason for not including it. You and I don't know what that is... but there must have been a reason. There are other hidden settings too that can easily break a forum as well, so I'm not including those in a mod.
Title: Re: Disable Template Eval
Post by: Blinker on August 09, 2009, 07:56:32 PM
Nice work Arantor.

I noticed when I installed that it detected the current state and the box was already ticked because I turned off eval a while ago.
Title: Re: Disable Template Eval
Post by: Arantor on August 09, 2009, 08:00:14 PM
Thanks - yeah, it just reads the current state as it installs.
Title: Re: Disable Template Eval
Post by: Antechinus on August 09, 2009, 08:13:08 PM
Quote from: Arantor on August 09, 2009, 04:58:01 PM
So do I, Ben K, but the team have a good reason for not including it. You and I don't know what that is... but there must have been a reason. There are other hidden settings too that can easily break a forum as well, so I'm not including those in a mod.
I don't know what the reason is either, but you can bet I'll be talking to the devs about it. Very handy mod. I'm definitely installing it.
Title: Re: Disable Template Eval
Post by: Hoodie on August 09, 2009, 08:42:08 PM
What exactly does this do?  haven't received an error with this in it..  Also, are there any bad things that could happen with this turned off?
Title: Re: Disable Template Eval
Post by: Arantor on August 09, 2009, 08:48:21 PM
Before running any theme files, SMF does a sanity check of them, which can be good for security and stability of forum, but bad for debugging. This turns off the sanity check.

Bad things: only if there are problems, but then you can see the problems better and help us help you quicker.

Also: side benefit, forum *will* go faster, especially on big boards.
Title: Re: Disable Template Eval
Post by: Hoodie on August 09, 2009, 08:51:41 PM
So I won't get the template parse error anymore and it will try to load the page or is that something else?
Title: Re: Disable Template Eval
Post by: Arantor on August 09, 2009, 08:54:48 PM
No, you'll still get template parse errors but it'll be a different one that we can help you fix better.
Title: Re: Disable Template Eval
Post by: Sabre™ on August 09, 2009, 11:53:52 PM
One of the more 'useful' mods to date.
Congrats and thanks mate :)
Title: Re: Disable Template Eval
Post by: mirahalo on August 12, 2009, 12:35:13 PM
ok, this is the right topic for this :)

Nice mod Arantor!, if you accept translations, here is spanish_es/latin both utf8:

Help.spanish_es   Help.spanish_latin :

$helptxt['disableTemplateEval'] = 'Esta opción deshabilita la revisión que SMF realiza en los templates antes de mostrarlos al usuario. esto puede ser muy util para encontrar errores, y en algunos servidores, ayudará a incrementar el rendimiento de tu foro SMF.';

Help.spanish_es-utf8  and latin-utf8


$helptxt['disableTemplateEval'] = 'Esta opción deshabilita la revisión que SMF realiza en los templates antes de mostrarlos al usuario. esto puede ser muy util para encontrar errores, y en algunos servidores, ayudará a incrementar el rendimiento de tu foro SMF.';


ManageSettings.spanish_es spanish_latin

$txt['disableTemplateEval'] = '¿ Deshabilitar el eval template?';

utf8 version:

$txt['disableTemplateEval'] = '¿Deshabilitar el eval template?';


greetings!
Title: Re: Disable Template Eval
Post by: Arantor on August 12, 2009, 05:14:48 PM
Thanks for the translation - I did see it previously (and did bookmark it for followup) but haven't had time to do so.

I'll repackage this tonight to include Spanish, many thanks!
Title: Re: Disable Template Eval
Post by: Arantor on August 12, 2009, 05:51:42 PM
I've repackaged it - just about to upload to the mod site. It's now version 1.1 featuring the new languages (no need to update if you're not added lang support)
Title: Re: Disable Template Eval
Post by: TheListener on September 04, 2009, 07:57:00 PM
Installed the mod.

No errors on install.

Parse error: syntax error, unexpected T_VARIABLE in /Themes/default/languages/Help.english.php on line 634

Attachment supplied
Title: Re: Disable Template Eval
Post by: Arantor on September 04, 2009, 09:30:39 PM
This is actually an error in the PM attachments mod not ending its line correctly.

It isn't a bug in the Disable Template Eval mod at all. I have flagged it in the appropriate topic.

In the interim, find this line:
$helptxt['pmattachments_remove_all'] = 'This will remove all PM Attachments from and sent to all members, including yourself.  Should be used as a last resort.<br /><br />Some scenario\'s that may warrant a need for you to do this, are as follows:<br />If you just don\'t have the space on your server for these files anymore.  If you plan on starting fresh and/or want to reduce or increase the size for the PM Attachments Directory, or change the directory and you don\'t want any files in this directory before you make any changes.  If many users are abusing the use of PM Attachments on your server, and many other reasons for this as well.'

And add a ; to the end.
Title: Re: Disable Template Eval
Post by: TheListener on September 04, 2009, 09:59:44 PM
Thanks Arantor.
Title: Re: Disable Template Eval
Post by: villasg on September 09, 2009, 12:42:44 PM
thanks  smf 1.1.0 all ok
Title: Re: Disable Template Eval
Post by: Arantor on October 22, 2009, 08:02:11 AM
Updated for 2.0 RC2 support.
Title: Re: Disable Template Eval
Post by: tyty1234 on November 09, 2009, 02:39:32 AM
It looks like this mod is now a feature in RC2. :D

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fi38.tinypic.com%2F2ps5091.jpg&hash=2c5bada678af78e3b6be4890e777430e27926eb9)

It's the same right?
Title: Re: Disable Template Eval
Post by: Arantor on November 09, 2009, 07:13:19 AM
Indeed it is, though the mod is still fine for the Charter release (which doesn't have this feature in it)
Title: Re: Disable Template Eval
Post by: ~DS~ on March 09, 2010, 03:57:07 PM
Wasn't this updated...
Title: Re: Disable Template Eval
Post by: Norv on March 09, 2010, 04:17:21 PM
This mod doesn't need an update to SMF 2.0 RC3, since in RC3 (and RC2 it seems) the feature it provides is a default feature. This note was added to the mod description.

Is there any particular reason why it should be used on RC3, then?
Title: Re: Disable Template Eval
Post by: ~DS~ on March 09, 2010, 04:19:32 PM
Quote from: Norv on March 09, 2010, 04:17:21 PM
This mod doesn't need an update to SMF 2.0 RC3, since in RC3 (and RC2 it seems) the feature it provides is a default feature. This note was added to the mod description.
Great thank you. So this mod is no longer needed after all expect for SMF 1
Title: Re: Disable Template Eval
Post by: Norv on March 09, 2010, 04:21:45 PM
For SMF 1.1.11, the mod should work. (there is no such feature in SMF 1.1.x)
For 2.0 RC3 at least, as I see it, it is no longer needed.
Title: Re: Disable Template Eval
Post by: gbsothere on March 09, 2010, 04:23:03 PM
No "Link To Mod" on the first post, so off I go to find it...

That's right; make the Grandpappy work for it.     :D
Title: Re: Disable Template Eval
Post by: Norv on March 09, 2010, 04:24:32 PM
Oh, that's odd. Sorry about that!
Please find it here: http://custom.simplemachines.org/mods/index.php?mod=2054

I will look into why that happened.
Title: Re: Disable Template Eval
Post by: gbsothere on March 09, 2010, 04:25:34 PM
Quote from: Norv on March 09, 2010, 04:24:32 PM
Oh, that's odd. Sorry about that!
Please find it here: http://custom.simplemachines.org/mods/index.php?mod=2054

I will look into why that happened.



Thanks, Norv!  (Those long trips wear me out.)   ;)
Title: Re: Disable Template Eval
Post by: Arantor on March 09, 2010, 04:28:59 PM
Quote from: Norv on March 09, 2010, 04:24:32 PM
Oh, that's odd. Sorry about that!
Please find it here: http://custom.simplemachines.org/mods/index.php?mod=2054

I will look into why that happened.

Because at the time I originally wrote this I was using my fuller variant of mod page which didn't have the link at the top (since it's added just into the post as regular text)

As to why it won't be updated, no, as of RC2 Public (note, not Charter, which is why I got it tagged with RC2 since the menu option wasn't in the Charter Preview) it's an option in Server Settings anyway.

I didn't expect it to be added into RC2 Public so I didn't worry about leaving it tagged RC2 though.
Title: Re: Disable Template Eval
Post by: Norv on March 09, 2010, 04:38:13 PM
Quote from: Arantor on March 09, 2010, 04:28:59 PM
Quote from: Norv on March 09, 2010, 04:24:32 PM
Oh, that's odd. Sorry about that!
Please find it here: http://custom.simplemachines.org/mods/index.php?mod=2054

I will look into why that happened.
Because at the time I originally wrote this I was using my fuller variant of mod page which didn't have the link at the top (since it's added just into the post as regular text)
I don't know what you mean, can you please elaborate?

Quote from: Arantor on March 09, 2010, 04:28:59 PM
As to why it won't be updated, no, as of RC2 Public (note, not Charter, which is why I got it tagged with RC2 since the menu option wasn't in the Charter Preview) it's an option in Server Settings anyway.
That's what was said before, if I understand correctly.
Title: Re: Disable Template Eval
Post by: Arantor on March 09, 2010, 04:41:52 PM
Norv: I originally wrote this mod, and at the time I had a template I used for all my mods, an example of which is http://custom.simplemachines.org/mods/index.php?mod=1920

I used to just copy/paste the formatted version from the mod page to the mod thread so they were consistent, which also means removing the Link To Mod that would normally be added on mod approval.

On mod approval, whatever text is on the mod page, prepended with the mod link, is thrown at createPost to create the mod's thread. At that point it's a totally regular thread, so I just overwrote that with the template I used to use, which also meant losing the link at the top, because there was one in the template anyway.

When this was transferred to Cust Team last September, SiNaN edited the post and mod page to remove my boilerplate text with the links to the mod thread and mod etc (as well as the donate to me link) but for whatever reason forgot to add the link back at the top of the page.
Title: Re: Disable Template Eval
Post by: gbsothere on March 09, 2010, 04:42:21 PM
Only 1 tick box, Feature Config (1.1.11)?  (Check)

Thanks, guys!   Johny B is gone and he and I, try as we might, never could figure out why his ColorizePost was throwing so many occurrences of forum errors (and he did try) so I just got used to emptying about 20 pages of the same error every day. 

If this works, I'll just "turn it off".   :)
Title: Re: Disable Template Eval
Post by: Arantor on March 09, 2010, 04:44:36 PM
gbsothere: Yup, only one box. But it'll show you *exactly* where the error is.
Title: Re: Disable Template Eval
Post by: Norv on March 09, 2010, 04:45:44 PM
Quote from: Arantor on March 09, 2010, 04:41:52 PM
Norv: I originally wrote this mod, and at the time I had a template I used for all my mods, an example of which is http://custom.simplemachines.org/mods/index.php?mod=1920

I used to just copy/paste the formatted version from the mod page to the mod thread so they were consistent, which also means removing the Link To Mod that would normally be added on mod approval.

On mod approval, whatever text is on the mod page, prepended with the mod link, is thrown at createPost to create the mod's thread. At that point it's a totally regular thread, so I just overwrote that with the template I used to use, which also meant losing the link at the top, because there was one in the template anyway.

When this was transferred to Cust Team last September, SiNaN edited the post and mod page to remove my boilerplate text with the links to the mod thread and mod etc (as well as the donate to me link) but for whatever reason forgot to add the link back at the top of the page.

Ah, I see, thank you for the explanations. I know it should be done automatically, I suspected the customize site of playing games. ;D
So the link was missing prior to my changes today, oh, I was hoping I broke it, but it seems I missed this one. I'll try with others. *sagenods*
So I'll have to check and eventually fix more mods who have this problem.
Title: Re: Disable Template Eval
Post by: gbsothere on March 09, 2010, 04:46:13 PM
Quote from: Arantor on March 09, 2010, 04:44:36 PM
gbsothere: Yup, only one box. But it'll show you *exactly* where the error is.


Like I'm going to know what to do with it, when it shows me where it is.   ;D
Title: Re: Disable Template Eval
Post by: Arantor on March 09, 2010, 04:49:51 PM
gbsothere: It'll tell you what line and what file. It's usually easier to backtrack an error when you know that :) I have it on for all my development work, including actually adding it to my one-click installer (I have this which is good for completely refreshing an install in a matter of seconds) for testing purposes.

Norv: I can't see anything that's broken with it :)
Title: Re: Disable Template Eval
Post by: gbsothere on March 09, 2010, 04:52:39 PM
So, disabling the template eval doesn't mean that the error won't show up but that, when it does, it's a more precise description of what's going on?

Title: Re: Disable Template Eval
Post by: Norv on March 09, 2010, 04:53:22 PM
Fixed.
I meant their support topic initial post, Arantor.

gbsothere: yes.
Title: Re: Disable Template Eval
Post by: Arantor on March 09, 2010, 04:54:09 PM
Exactly it.

Often the template eval step will mask the true location. Sometimes it's not a huge issue and it's possible to backtrack without having to dig too hard, sometimes it's a nightmare.
Title: Re: Disable Template Eval
Post by: Norv on March 09, 2010, 04:55:13 PM
Please eventually see this topic, there is a bit of explanation about it:
How to Enable/Disable Eval (http://www.simplemachines.org/community/index.php?topic=290186.0)
http://www.simplemachines.org/community/index.php?topic=50227.0
Title: Re: Disable Template Eval
Post by: gbsothere on March 09, 2010, 04:55:16 PM
I'm actually anticipating the error, then.   ;)


Thanks, much, Arantor and Norv! 
Title: Re: Disable Template Eval
Post by: Am' on March 13, 2010, 12:12:08 PM
by default in rc3 ?
Title: Re: Disable Template Eval
Post by: ~DS~ on March 13, 2010, 12:30:24 PM
Quote from: Am' on March 13, 2010, 12:12:08 PM
by default in rc3 ?
Yes.
Title: Re: Disable Template Eval
Post by: Arantor on March 13, 2010, 01:21:36 PM
See Admin > Server Settings, second option from bottom.

Also in RC2 public, though wasn't in RC2 Charter which is why this mod is tagged for 2.0 RC2.
Title: Re: Disable Template Eval
Post by: Masterd on June 22, 2010, 05:44:30 AM
What will happen if I install this mod on SMF 2.0 RC3. I didn't read the description.   
Title: Re: Disable Template Eval
Post by: Norv on June 24, 2010, 02:18:09 AM
You don't need it on RC3. It would be useless... since the functionality is already there. You can just uninstall it.
Title: Re: Disable Template Eval
Post by: theiceman on November 06, 2010, 02:51:34 PM
Quote from: Norv on June 24, 2010, 02:18:09 AM
You don't need it on RC3. It would be useless... since the functionality is already there. You can just uninstall it.

where ? :/
Title: Re: Disable Template Eval
Post by: Oya on November 06, 2010, 02:57:24 PM
it's in server settings
Title: Re: Disable Template Eval
Post by: Masterd on November 06, 2010, 03:53:31 PM
Quote from: Norv on June 24, 2010, 02:18:09 AM
You don't need it on RC3. It would be useless... since the functionality is already there. You can just uninstall it.

Yes, I know that, but I forgot this post. I solved that.
Title: Re: Disable Template Eval
Post by: snoopy_virtual on March 03, 2011, 11:34:41 AM
Another brilliant mod from Arantor that I didn't know.

Great work as always.

Anyway I have found a small mistake in the Spanish language. All the strings for spanish_latin are using html entities but all the strings for spanish_es don't. Also all the strings for Spanish (both normal and utf8) are encoded using ISO-8859-15.

As already discussed in the translators sub-forum is better to avoid html entities always and separate the language strings in 2 different files, one encoded using ISO-8859-15 and another one using UTF-8.

I have already done it to install this mod in my forums so I have attached it here (already corrected) just in case another Spanish friend has the same problem.
Title: Re: Disable Template Eval
Post by: snoopy_virtual on March 03, 2011, 02:34:41 PM
Done  ;)