Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Limited PHP scripts functionality for templates v1.0 Details »»
Limited PHP scripts functionality for templates v1.0
Version: 1.00, by JohnWoo JohnWoo is offline
Developer Last Online: Apr 2014 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 01-01-2003 Last Update: Never Installs: 4
 
No support by the author.

Hello all !

Here is small funny hack (5 strings of new code only in one script That may help to bring more power to vb templates
Features:
- executing php scripts (with modified syntax) from templates. Changing\creating php variables from templates, conditional actions and database requests without editing scripts.
It is all

PS changes in 1.1
- normal php variables syntax (with $)
- added example of database request from template
- support for several PHP blocks in one template

Show Your Support

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

Comments
  #12  
Old 01-03-2003, 08:21 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

@Velo: yeh, but sometimes this can be usefull to, if you just want to calculate some values (ppd directly in the template instead of the code)
Reply With Quote
  #13  
Old 01-04-2003, 08:45 PM
The Prohacker's Avatar
The Prohacker The Prohacker is offline
 
Join Date: Oct 2001
Location: Dayton, Ohio
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm... The 1.1 zip seems to be empty...
Reply With Quote
  #14  
Old 01-04-2003, 09:19 PM
JohnWoo's Avatar
JohnWoo JohnWoo is offline
 
Join Date: Jan 2002
Posts: 128
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Updated
It downloads fine for me (and before it was fine too)
Reply With Quote
  #15  
Old 01-05-2003, 12:18 AM
Brad Brad is offline
 
Join Date: Nov 2001
Posts: 4,765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by VeoMorphine
nice. we should release template mods with this(they might like this on www.vbulletintemplates.com to.
We have our own wrapper that works from the phpinclude template. Its a bit more work to code with it but it keeps us from hacking files. We have many of the hacks here working with only the phpinclude.
Reply With Quote
  #16  
Old 01-05-2003, 07:00 AM
JohnWoo's Avatar
JohnWoo JohnWoo is offline
 
Join Date: Jan 2002
Posts: 128
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

But phpinclude will be executed on any page of forum, and think that it is not good
Reply With Quote
  #17  
Old 01-05-2003, 10:20 AM
Brad Brad is offline
 
Join Date: Nov 2001
Posts: 4,765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Acully no. for example this would only be ran on index.php, The query it exucutes will only be done on that page, its ignored on all others.

PHP Code:
if (strpos($_SERVER['PHP_SELF'], 'index.php') != false)
{
   
$query='code here'

Reply With Quote
  #18  
Old 01-05-2003, 10:21 AM
Chris M's Avatar
Chris M Chris M is offline
 
Join Date: Dec 2001
Location: Northampton, England
Posts: 6,186
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice Idea

@Anime-loo - Wouldn't "$DB_site->query" be better?

Satan
Reply With Quote
  #19  
Old 01-05-2003, 10:42 AM
JohnWoo's Avatar
JohnWoo JohnWoo is offline
 
Join Date: Jan 2002
Posts: 128
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes. It is another way. But what if you need to execute some code inside some loop ? Think that for example calculating something different for each post on showthread.php must be impossible using phpinclude only...
Reply With Quote
  #20  
Old 01-05-2003, 11:09 AM
Brad Brad is offline
 
Join Date: Nov 2001
Posts: 4,765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by hellsatan
Nice Idea

@Anime-loo - Wouldn't "$DB_site->query" be better?

Satan
yes, i was only showing a example this would be the correct useage if you where ganna show the result of the query on index.php

$query=$DB_site->query_frist
Reply With Quote
  #21  
Old 01-05-2003, 11:13 AM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

also it's not good to expand the phpinclude template such a lot.
rembember it's loaded on everypage, also if everything is in an if-clause it has to be loaded and so on.
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 11:03 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.04926 seconds
  • Memory Usage 2,298KB
  • 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
  • (1)bbcode_php
  • (2)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
  • (1)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