Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-21-2002, 09:43 PM
DrkFusion's Avatar
DrkFusion DrkFusion is offline
 
Join Date: Nov 2001
Posts: 1,926
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default multiple variable includes

like for example in register there is $action, and it says close to the top if $action==(nothing) then action==$signup or something like that.

How would I have 2 variable includes, so action, and page, so if $page and $action== nothing, then by default $page=main will be used, and if action=dostuff, then $page will be ignored...etc

If this is even possible at all, please help, if it isn't, please warn me ahead of time, before I hunt for tutorials.
Reply With Quote
  #2  
Old 08-21-2002, 09:50 PM
NTLDR's Avatar
NTLDR NTLDR is offline
Coder
 
Join Date: Apr 2002
Location: Bristol, UK
Posts: 3,644
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think I get what you are asking, you want something along the lines of:

PHP Code:
if (!$page && !$action)
// no page or action specified
{
eval(
"dooutput(\"".gettemplate('main')."\");");

else
eval(
"dooutput(\"".gettemplate("notmain")."\");"); 
Reply With Quote
  #3  
Old 08-22-2002, 12:43 AM
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Location: CA University
Posts: 1,696
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try using:

PHP Code:
if($action == '' && $page == '') {
  
$page "main";
}

if(
$action == "dostuff"){
  
$page '';

Reply With Quote
  #4  
Old 08-22-2002, 11:22 PM
DrkFusion's Avatar
DrkFusion DrkFusion is offline
 
Join Date: Nov 2001
Posts: 1,926
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for replying.

I want to keep $page and $action seperate, like in Velocd tip,
on the 2nd if, it says
if $action=dostuff, then $page = '';

I think it would be easier if I put it kind of like this, how would I do 2 dynamic variable includes.

Lets pretend
I have an Information Section, Media Section, Reviews Setion, and a Main Section

so, each of them have there own variable
$information
$media
$reviews
$main

I am aiming to do this...
If $information, $media, $reviews have no value, then $main include news.html
Ex: index.php <--When nothing is specified news.html will be loaded where $main is to be invluded

but when its like..
index.php?information=info/bio.html or something similar, then bio.html will load where $inforation is in the php file, and so on.

Sorry that I am bad at explaining.

I want to do something around this line
Code:
if($action == '' && $page == '') {
  $page = "main";
}

###### page=Main ######
if($page == "main"){
include ("news.html");
}

###### Action Sent ######
if($action == "sent"){
include ("sent.html");
}
Reply With Quote
  #5  
Old 08-23-2002, 01:08 AM
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Location: CA University
Posts: 1,696
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Let me ask this first:
Why are you trying to include an HTML file? Just do whatever your doing in the HTML within a template, and then use dooutput in the index.php file to output the template, when called.

PHP Code:
 if($action == "main") {
  eval(
"dooutput(\"".gettemplate('main')."\");");

Create a new template called main, then put the stuff you would put in that HTML file in that template. No need to use .html files, when you got vBulletin template system
Reply With Quote
  #6  
Old 08-23-2002, 01:25 AM
DrkFusion's Avatar
DrkFusion DrkFusion is offline
 
Join Date: Nov 2001
Posts: 1,926
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well I might be using this later on not with vb
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 08:29 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.05775 seconds
  • Memory Usage 2,216KB
  • Queries Executed 13 (?)
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)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (3)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete