Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons

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
  #2  
Old 02-26-2008, 06:02 PM
TTG's Avatar
TTG TTG is offline
 
Join Date: May 2004
Location: Sth London
Posts: 1,042
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great news .. this could help designers produce more interesting themes / skins.
Reply With Quote
  #3  
Old 02-27-2008, 01:19 AM
Jafo232 Jafo232 is offline
 
Join Date: May 2004
Posts: 1,122
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Using smarty conditionals will definitely make things easier that is for sure..
Reply With Quote
  #4  
Old 02-27-2008, 04:17 PM
Jon_Simmonds Jon_Simmonds is offline
 
Join Date: Nov 2005
Location: UK
Posts: 103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Yeah, I would like to get some feedback on how this is all working for you..
Reply With Quote
  #6  
Old 02-27-2008, 11:00 PM
goyo goyo is offline
 
Join Date: Mar 2002
Posts: 89
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

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

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

Did you edit the functions.php file as laid out in the readme?
Reply With Quote
  #10  
Old 02-29-2008, 11:51 AM
alessai alessai is offline
 
Join Date: Feb 2006
Posts: 153
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yes i did

the file functions.php is in this path right??? /public_html/vb/includes

PHP Code:
    if ($vbulletin->options['addtemplatename'] AND $gethtmlcomments)
    {
        
$templatename preg_replace('#[^a-z0-9_]#i'''$templatename);
        return 
"<!-- BEGIN TEMPLATE: $templatename -->\n$template\n<!-- END TEMPLATE: $templatename -->";
    }
############### SMARTY

global $smarty$tempusagecache;
if (
is_object($smarty)) {
$vbulletin->temp_output $template;
$template $smarty->fetch('db:'$templatename ''); 
}

############### /SMARTY

    
return $template;

Reply With Quote
Reply

Thread Tools

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 11:48 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.04440 seconds
  • Memory Usage 2,295KB
  • Queries Executed 23 (?)
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
  • (2)bbcode_code
  • (1)bbcode_php
  • (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
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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