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
Let PHP Live! (Allow PHP code in templates) Details »»
Let PHP Live! (Allow PHP code in templates)
Version: 1.00, by King Internet King Internet is offline
Developer Last Online: Jul 2011 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 3.6.0 Rating:
Released: 08-15-2006 Last Update: 08-15-2006 Installs: 76
Uses Plugins Template Edits
 
No support by the author.

I got frustrated that the vBulletin template system limited me in this way so... I wrote a hack around it.

Just use <? <?php <?= as you would normally in the templates.

I'd like to see PHP based templates in the future, vBulletin! <if> is useless if I can just type <? if ?> !

Things to Remember

You cannot break up PHP blocks.

<? if (0): ?>
Hello!!!
<? endif ?>

will not work, and you'll get a nice error message about how it didn't. If it's really a concern for anyone, I can try to get it working. In my opinion, that's not a big deal. I think PHP support sans breaking up blocks in 10 lines of hack code is pretty nice, myself.

That's a limitation of eval anyway

Variables aren't always the same in PHP mode!

While you can use $vboptions[bbtitle] in your main code and get it working, vBulletin is doing behind the scenes voodoo on stuff.

To access $vboptions[x]: $GLOBALS['vbulletin']->options['x']

Show Your Support

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

Comments
  #32  
Old 09-08-2007, 06:45 PM
Millenium IT Millenium IT is offline
 
Join Date: Nov 2006
Posts: 77
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I would not advise you to use php in your templates. The vBulletin plugin/hook alocation system is not only much easier on a global scale, but also much more reliable and secure. Mixing php in your templates could cause difficulties or problems in your forum script as you go along.
Reply With Quote
  #33  
Old 09-08-2007, 10:15 PM
Cole2026 Cole2026 is offline
 
Join Date: Feb 2004
Location: Pittsburgh, PA
Posts: 224
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I would be curious to know how much time this would add to a page's processing time.
Reply With Quote
  #34  
Old 12-22-2007, 01:43 PM
CrazyCanuck CrazyCanuck is offline
 
Join Date: Dec 2007
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks for this addon
Reply With Quote
  #35  
Old 12-22-2007, 02:23 PM
odonel odonel is offline
 
Join Date: Sep 2006
Posts: 80
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I understand where VB is coming from in regard to some threats pose to forums with php codes but a lot of us users want to add custom code to our forums and VB is aware of that.
This is one thing VB lacks, integration with an external page. Why not give us easier ways to do these sort of things VB ?? tips/guides templates anything.........

thanx for this addon i will play with it to see if i can use it
Reply With Quote
  #36  
Old 06-12-2008, 06:11 PM
DonHouston DonHouston is offline
 
Join Date: Aug 2006
Posts: 25
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks alot, exactly what i was looking for!
Reply With Quote
  #37  
Old 08-28-2008, 05:25 PM
Freddy.k's Avatar
Freddy.k Freddy.k is offline
 
Join Date: Mar 2008
Location: Fran?e
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Merci cool
Reply With Quote
  #38  
Old 09-30-2008, 10:25 AM
Hitterman's Avatar
Hitterman Hitterman is offline
 
Join Date: May 2008
Location: Tutorialistic.net
Posts: 172
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Its really awesomeeeeeee.e
Great work. really nice.
Hurray!!!!!!!!!!!
"Installed" & "Nominated" because it works with 3.7.x also.
Reply With Quote
  #39  
Old 06-18-2009, 01:42 PM
GNeRaL GNeRaL is offline
 
Join Date: Nov 2006
Location: Samsun, Turkiye
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great work, thanks!

To access $vboptions[x]: $GLOBALS['vbulletin']->options['x']

I've one question, I want to use postid with PHP. How to use?

And can you explain ?

Thanks for your answer.
Reply With Quote
  #40  
Old 09-14-2009, 04:31 PM
angeljs's Avatar
angeljs angeljs is offline
 
Join Date: Aug 2005
Location: UK
Posts: 384
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is so cool, and works great, thanks
Reply With Quote
  #41  
Old 01-24-2010, 11:07 AM
Spinball's Avatar
Spinball Spinball is offline
 
Join Date: Feb 2002
Location: Telford, England
Posts: 705
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just a note to say that a Russian hacker used this plugin to point Google to a Canadian Pharmacy store when it visited our home page.
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 04:45 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.08791 seconds
  • Memory Usage 2,300KB
  • Queries Executed 27 (?)
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
  • (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
  • (3)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_postinfo_query
  • fetch_postinfo
  • 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