Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Smarty Integration With Vbulletin - BETA Details »»
Smarty Integration With Vbulletin - BETA
Version: 1.00, by Jafo232 Jafo232 is offline
Developer Last Online: Oct 2022 Show Printable Version Email this Page

Category: Integration with vBulletin - Version: 3.6.8 Rating:
Released: 02-25-2008 Last Update: Never Installs: 17
Uses Plugins
Code Changes Additional Files Is in Beta Stage  
No support by the author.

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

## Whatever smarty code you want

%>

Or for PHP:

Code:
<%php%>
echo "Hello World! The timestamp for now is " . TIMENOW;
<%/php%>

If you find this useful, please:


Brought to you by WorldWideCreations.com.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 02-29-2008, 01:24 PM
Jafo232 Jafo232 is offline
 
Join Date: May 2004
Posts: 1,122
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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).
Reply With Quote
  #13  
Old 02-29-2008, 02:04 PM
alessai alessai is offline
 
Join Date: Feb 2006
Posts: 153
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yup uploaded templates_c and smarty inside the forum folder (vb) and i did set the permissions to 777
the code is
Quote:
<%php%>
echo "Hello World! The timestamp for now is " . TIMENOW;
<%/php%>
Reply With Quote
  #14  
Old 02-29-2008, 02:27 PM
Jafo232 Jafo232 is offline
 
Join Date: May 2004
Posts: 1,122
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry so many questions, but you did install the product file too right? And you have plugins turned on in your vbulletin options?
Reply With Quote
  #15  
Old 02-29-2008, 02:52 PM
alessai alessai is offline
 
Join Date: Feb 2006
Posts: 153
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yes its activatied

p.s. ask as much as u want i really want the php thing works
Reply With Quote
  #16  
Old 02-29-2008, 04:10 PM
GCC LLC GCC LLC is offline
 
Join Date: Oct 2005
Posts: 90
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #17  
Old 02-29-2008, 04:45 PM
Jafo232 Jafo232 is offline
 
Join Date: May 2004
Posts: 1,122
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by alessai View Post
yes its activatied

p.s. ask as much as u want i really want the php thing works
Look in your templates_c directory, are there any files in there other than index.html?
Reply With Quote
  #18  
Old 02-29-2008, 04:51 PM
Jafo232 Jafo232 is offline
 
Join Date: May 2004
Posts: 1,122
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by GCC LLC View Post
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?
Hmm, probably more of a Smarty question. I am not very experienced in the load balancing area but if you want to, you can try using a local directory for the templates_c. You would have to edit the plugin code. The plugin named "Start Up Smarty", find:

Code:
$smarty->compile_dir = DIR . '/templates_c';
You can change that to whatever you wish, example:

Code:
$smarty->compile_dir = '/some/other/path/onyour/server';
Just make sure the directory is writable.
Reply With Quote
  #19  
Old 02-29-2008, 05:24 PM
alessai alessai is offline
 
Join Date: Feb 2006
Posts: 153
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #20  
Old 02-29-2008, 06:17 PM
Jafo232 Jafo232 is offline
 
Join Date: May 2004
Posts: 1,122
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm, then it is processing it..

Can you put that PHP code in the header template and confirm it still isn't working?
Reply With Quote
  #21  
Old 03-01-2008, 08:40 AM
alessai alessai is offline
 
Join Date: Feb 2006
Posts: 153
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

still doesnt work,,,,
i use 3.6.8,,, is it possibe that the server disabled some things that affecting the addon ? or another addon ?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:38 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06635 seconds
  • Memory Usage 2,307KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete