Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
Some Possible PHP in Templates Details »»
Some Possible PHP in Templates
Version: , by HeTz HeTz is offline
Developer Last Online: Mar 2005 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 11-18-2003 Last Update: Never Installs: 0
 
No support by the author.

I've read the posts around here concerning PHP in templates and found that it is nearly impossible. I was wondering if there were possibly ways around it. Here's what I'm trying to do:

I'm designing a new feature for our RX-8 Club. It allows you to add your vehicle information into your profile. We have three types of owners we're aiming at: Mazda Protege, Mazda RX-7, and Mazda RX-8. Now... when a user's goes to add their car, they have 4 HTML form boxes: Year, Model, Color, and Options. These boxes are automatically filled from an SQL database when they select a certain item. Such as, if they select 2004, only the Prot?g? and RX-8 will be available Models... If they Select 1995, only the Prot?g? and the RX-7 will be available Models... and so on for Color and Options. Now - These HTML select boxes operate off of PHP code. This is an example of one of the select boxes' code:

<?php
SelectBox ("Year", "reg_caryear");
?>

That's for the Vehicle Year (also has Model, Color, Options). Then, also I need this PHP function:

<?php
function SelectBox( $Label, $selectName ){
?>
<tr ALIGN="LEFT">
<td width="15%"><?php echo $Label ?></td>
<td align="left">
<select name="<?php echo $selectName ?>">
<option></option><option></option><option></option>
<option>--------- Not Yet Loaded ---------</option>
</select>
</td>
</tr>
<?php
}
?>

Here's a demo of what I'm talking about:
http://www.lanops.net/rx8club/test/select.php

Is this possible any other way? This is the only way I have figured out how to do auto-populated form boxes... Thanks everyone for your help.

Show Your Support

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

Comments
  #2  
Old 11-19-2003, 10:49 PM
sabret00the's Avatar
sabret00the sabret00the is offline
 
Join Date: Jan 2003
Location: London
Posts: 5,268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

to my knowledge the closest you'll get is the 'conditional templates hack' but don't quote me on that
Reply With Quote
  #3  
Old 11-20-2003, 05:43 AM
assassingod's Avatar
assassingod assassingod is offline
 
Join Date: Jul 2002
Posts: 3,337
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

sabe is right. Except that will only allow things such as
if ()
{

}

etc etc (IIRC)

You might want to try embedded PHP in templates by filburt
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 12:37 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.04010 seconds
  • Memory Usage 2,203KB
  • Queries Executed 16 (?)
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
  • (3)post_thanks_box
  • (3)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit_info
  • (2)postbit
  • (3)postbit_onlinestatus
  • (3)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete