News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Disable Template Eval

Started by SMF Customization Team, August 09, 2009, 01:39:17 PM

Previous topic - Next topic

SMF Customization Team

Link to Mod

Disable Template Eval




Original Author: Arantor | Current Author: SMF Customization Team
Supported Languages: English, Spanish

Link To Mod | Mod Discussion | Other SMF Customization Team Mods



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

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.

kingkingston


babjusi


Arantor

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 :)

tyty1234

Nice mod Arantor! ;)
It certainly would help everyone when it comes to support and debugging. :D
My Activity: Inactive
My Links: tyty1234's SMF Site | SMF Package Parser | SMF Helper | My Mods [5]
Subscribe to my SMF blog for updates
PMs for support will not be accepted, unless requested otherwise.

Arantor

That's precisely why I wrote it, not to mention the performance boost, but I think it'll be useful to have around :)

feline

Very good option ... thanks  ;)

Fel

busterone


Ben K

I think this should be in SMF it self, with out a mod.

Arantor

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.

Blinker

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.

Arantor

Thanks - yeah, it just reads the current state as it installs.

Antechinus

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.

Hoodie

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?

Arantor

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.

Hoodie

So I won't get the template parse error anymore and it will try to load the page or is that something else?

Arantor

No, you'll still get template parse errors but it'll be a different one that we can help you fix better.

Sabre™

One of the more 'useful' mods to date.
Congrats and thanks mate :)
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


mirahalo

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!

Arantor

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!

Arantor

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)

TheListener

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

Arantor

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.

TheListener


villasg


Arantor

Updated for 2.0 RC2 support.

tyty1234

It looks like this mod is now a feature in RC2. :D



It's the same right?
My Activity: Inactive
My Links: tyty1234's SMF Site | SMF Package Parser | SMF Helper | My Mods [5]
Subscribe to my SMF blog for updates
PMs for support will not be accepted, unless requested otherwise.

Arantor

Indeed it is, though the mod is still fine for the Charter release (which doesn't have this feature in it)

~DS~

"There is no god, and that's the simple truth. If every trace of any single religion were wiped out and nothing were passed on, it would never be created exactly that way again. There might be some other nonsense in its place, but not that exact nonsense. If all of science were wiped out, it would still be true and someone would find a way to figure it all out again."
~Penn Jillette – God, NO! – 2011

Norv

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?
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

~DS~

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
"There is no god, and that's the simple truth. If every trace of any single religion were wiped out and nothing were passed on, it would never be created exactly that way again. There might be some other nonsense in its place, but not that exact nonsense. If all of science were wiped out, it would still be true and someone would find a way to figure it all out again."
~Penn Jillette – God, NO! – 2011

Norv

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.
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

gbsothere

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
My apologies, but I am taking a break from accepting PM requests for support.  If I am not currently assisting you, please do not ask as long as this notice is posted.  Thank you.

I Don't Want To Grow Old Alone


It has been proven that Steely Dan reduces the occurrence of road rage, according to an independent study.



A reminder about admin / ftp passwords etc.

Norv

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.
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

gbsothere

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.)   ;)
My apologies, but I am taking a break from accepting PM requests for support.  If I am not currently assisting you, please do not ask as long as this notice is posted.  Thank you.

I Don't Want To Grow Old Alone


It has been proven that Steely Dan reduces the occurrence of road rage, according to an independent study.



A reminder about admin / ftp passwords etc.

Arantor

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.

Norv

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.
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

Arantor

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.

gbsothere

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".   :)
My apologies, but I am taking a break from accepting PM requests for support.  If I am not currently assisting you, please do not ask as long as this notice is posted.  Thank you.

I Don't Want To Grow Old Alone


It has been proven that Steely Dan reduces the occurrence of road rage, according to an independent study.



A reminder about admin / ftp passwords etc.

Arantor

gbsothere: Yup, only one box. But it'll show you *exactly* where the error is.

Norv

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.
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

gbsothere

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
My apologies, but I am taking a break from accepting PM requests for support.  If I am not currently assisting you, please do not ask as long as this notice is posted.  Thank you.

I Don't Want To Grow Old Alone


It has been proven that Steely Dan reduces the occurrence of road rage, according to an independent study.



A reminder about admin / ftp passwords etc.

Arantor

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 :)

gbsothere

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?

My apologies, but I am taking a break from accepting PM requests for support.  If I am not currently assisting you, please do not ask as long as this notice is posted.  Thank you.

I Don't Want To Grow Old Alone


It has been proven that Steely Dan reduces the occurrence of road rage, according to an independent study.



A reminder about admin / ftp passwords etc.

Norv

Fixed.
I meant their support topic initial post, Arantor.

gbsothere: yes.
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

Arantor

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.

Norv

To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

gbsothere

I'm actually anticipating the error, then.   ;)


Thanks, much, Arantor and Norv! 
My apologies, but I am taking a break from accepting PM requests for support.  If I am not currently assisting you, please do not ask as long as this notice is posted.  Thank you.

I Don't Want To Grow Old Alone


It has been proven that Steely Dan reduces the occurrence of road rage, according to an independent study.



A reminder about admin / ftp passwords etc.

Am'

اذا أحس أحد انه لم يخطأ ابدا في حياته, فهذا يعني أنه لم يجرب أي جديد في حياته
My Mods For SMF 2 RC3 : XQuote XCode - Vbulletin Style New Meta Tags

~DS~

"There is no god, and that's the simple truth. If every trace of any single religion were wiped out and nothing were passed on, it would never be created exactly that way again. There might be some other nonsense in its place, but not that exact nonsense. If all of science were wiped out, it would still be true and someone would find a way to figure it all out again."
~Penn Jillette – God, NO! – 2011

Arantor

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.

Masterd

What will happen if I install this mod on SMF 2.0 RC3. I didn't read the description.   

Norv

You don't need it on RC3. It would be useless... since the functionality is already there. You can just uninstall it.
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

theiceman

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 ? :/

Oya


Masterd

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.

snoopy_virtual

#56
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.

El verdadero sabio es aquel que lo ve todo, lo estudia todo, lo analiza todo y molesta poco.
A true wise man is he who sees everything, studies everything, analyses everything and hardly ever annoys.

snoopy_virtual


El verdadero sabio es aquel que lo ve todo, lo estudia todo, lo analiza todo y molesta poco.
A true wise man is he who sees everything, studies everything, analyses everything and hardly ever annoys.

Advertisement: