![]() |
Smarty Integration With Vbulletin - BETA
This modification will allow you to use Smarty tags in your Vbulletin templates and even allow you to write PHP code in your templates.
I have tested this for the last 3-4 months before I posted it here and am pretty confident that it is all working properly but it should be fully tested on your site before released into production. I am still considering it BETA software. This does require one small source code edit and there really is no way around it that I can find. There is no hook in the fetch_template() function at this time, so it is required. After you install the modification, you can enter tags like this in your templates: Code:
<% Or for PHP: Code:
<%php%> If you find this useful, please: Brought to you by WorldWideCreations.com. |
Great news .. this could help designers produce more interesting themes / skins.
|
Using smarty conditionals will definitely make things easier that is for sure..
|
Have used smarty with some CMS's in the past, and they did prove usefull for some things will have a play on my test server with this
|
Yeah, I would like to get some feedback on how this is all working for you..
|
Smarty - to my knowledge - is the best and most flexible PHP template system. I love it.
Is there anybody who have experience with server performance when running this add-on in vB ? |
In my tests, I found it hardly noticeable. It will not improve performance as templates are still evaluated by Vbulletin. It would IMO although help performance if plugins were built around it. You would really not need the plugin system as we know it with this method as you could execute PHP right in the templates (ideally, with includes).
Also, in custom templates, you could in essence eliminate the need for bit templates as Smarty opens up loops which are not available in Vbulletin template conditionals. |
hey didnt work for me please help
what i had from the test is : #######START CODE echo "Hello World! The timestamp for now is " . TIMENOW; and i really need php |
Did you edit the functions.php file as laid out in the readme?
|
yes i did
the file functions.php is in this path right??? /public_html/vb/includes PHP Code:
|
Ok, and I assume you uploaded the files to their proper places, and set the directory permissions on the templates_c folder to 777?
Could you paste the code exactly as you put it in the template here (not the entire template please). |
yup uploaded templates_c and smarty inside the forum folder (vb) and i did set the permissions to 777
the code is Quote:
|
Sorry so many questions, but you did install the product file too right? And you have plugins turned on in your vbulletin options?
|
yes its activatied
p.s. ask as much as u want i really want the php thing works |
Have you had any experience using this on a load balanced server setup? I have 2 web front end servers and a shared (can use either CIFS or NFS) filesystem but when I enable this plugin, the servers all seem to slow down quite a bit. Do you know if I absolutely need to have the templates_c directory shared between all web servers? It seems that when smarty compiles to a remote filesystem that is where the slowdown occurs. I know this isn't a problem related specifically to your plugin, but thought I'd ask here anyway. BTW, my link between servers is all at 100mbps so there is plenty of bandwidth there to take care of things, but I may be limited by either the NFS or the CIFS services throughput. Your thoughts?
|
Quote:
|
Quote:
Code:
$smarty->compile_dir = DIR . '/templates_c'; Code:
$smarty->compile_dir = '/some/other/path/onyour/server'; |
i found :
%%1E^1E8^1E8F45E3%%db%3Anewpost_quote.php %%40^403^40326BD9%%db%3Aeditor_jsoptions_size.php %%67^676^67664761%%db%3Aeditor_jsoptions_font.php and no index file |
Hmm, then it is processing it..
Can you put that PHP code in the header template and confirm it still isn't working? |
still doesnt work,,,,
i use 3.6.8,,, is it possibe that the server disabled some things that affecting the addon ? or another addon ? |
I cannot think of any reason why it would not work on your server at this point. If you have the product installed, and have edited and saved functions.php, I cannot think of any reason why it is not working.
If you have a cache of some type installed on VB, you may want to try disabling it. |
i dont have much experience with the smarty template system but this is deffinitely a unique mod and gets a big thumbs up and a MOTM nod. :)
|
Thanks, I know this won't be a huge plugin for the masses, but I hope power users will understand the implications of it. Thanks again.
|
alessai, any luck?
|
Just a note: The default vBulletin template system does not allow including PHP for security reasons (except a very few predefined functions that can be used in conditionals). Allowing PHP in templates will reduce security!
|
I do not see how including PHP in templates will reduce security any more than allowing javascript in templates..
|
I should also add, that if the PHP really bothers you, you can turn it off in Smarty.
|
Great add-on for sure. I started a simpler version to re-create another version of the archive using Smarty caching. I will play around this one and see.
|
Let me know how it turns out for ya.
|
All times are GMT. The time now is 09:48 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:
|