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 01-07-2009, 11:07 PM
MarkFoster MarkFoster is offline
 
Join Date: Jun 2008
Posts: 305
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Creating Page Within Page?

How do I create a page within a page for example: www.example.com/example.php?do=news
Or something like: www.example.com/example.php?action=news

I really need this soon so any help appreciated.
Reply With Quote
  #2  
Old 01-07-2009, 11:15 PM
Bellardia Bellardia is offline
 
Join Date: Jul 2007
Location: Hamilton, Ontario
Posts: 378
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Use php $_GET['do'] and $_GET['action'] to get the query string.
Use an if condition...if ($_GET['do'] == 'something') { DO THIS } else { DO THIS } etc

Of course, this would be done in php.
Reply With Quote
  #3  
Old 01-07-2009, 11:28 PM
MarkFoster MarkFoster is offline
 
Join Date: Jun 2008
Posts: 305
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Bellardia View Post
Use php $_GET['do'] and $_GET['action'] to get the query string.
Use an if condition...if ($_GET['do'] == 'something') { DO THIS } else { DO THIS } etc

Of course, this would be done in php.
Could you make it in a quote what I should add?

I tried this many times without anything at all working
Quote:
if ($_REQUEST['do'] == 'xxx')
{
eval('print_output("' . fetch_template('TEMPLATE_XXX') . '");');
}
Reply With Quote
  #4  
Old 01-07-2009, 11:53 PM
Bellardia Bellardia is offline
 
Join Date: Jul 2007
Location: Hamilton, Ontario
Posts: 378
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

$_REQUEST is a very different function than $_GET.

Not sure what exactly you want to do with the code, so I won't tell you want to evaluate inside or anything...but to do something based on the query string use the code

PHP Code:
if ($_GET['do'] == 'Something')
{
   
//do something

Reply With Quote
  #5  
Old 01-08-2009, 12:47 AM
MarkFoster MarkFoster is offline
 
Join Date: Jun 2008
Posts: 305
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Bellardia View Post
$_REQUEST is a very different function than $_GET.

Not sure what exactly you want to do with the code, so I won't tell you want to evaluate inside or anything...but to do something based on the query string use the code

PHP Code:
if ($_GET['do'] == 'Something')
{
   
//do something

But if I do like this:
PHP Code:
if ($_GET['do'] == '?newsmain1')
{
[
B]   //do something[/B]

What will the command be to load a template and that template only, not the template that is on.com/name.php[S]?newsmain1[/S] ?
Reply With Quote
  #6  
Old 01-08-2009, 01:05 AM
Bellardia Bellardia is offline
 
Join Date: Jul 2007
Location: Hamilton, Ontario
Posts: 378
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You leave the '?' out of the $_GET command.

I advise you ask someone to do this for you, as you don't know PHP. You cant use bb code in php, nor html (directly).
Although a relatively simple task, would take awhile to explain from scratch, especially when unaware of your intentions. I would advise checking out some php tutorials.
Reply With Quote
  #7  
Old 01-08-2009, 01:06 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Don't put the question mark in the if statement ('newsmain1' only) Try your if statement with that correction.
Reply With Quote
  #8  
Old 01-08-2009, 01:13 AM
MarkFoster MarkFoster is offline
 
Join Date: Jun 2008
Posts: 305
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Bellardia View Post
You leave the '?' out of the $_GET command.

I advise you ask someone to do this for you, as you don't know PHP. You cant use bb code in php, nor html (directly).
Although a relatively simple task, would take awhile to explain from scratch, especially when unaware of your intentions. I would advise checking out some php tutorials.
All I really need is one PHP command which will let me add a page within a PHP file with my own template.
And that's about it so I'm pretty sure somebody has a code for that.
Reply With Quote
  #9  
Old 01-08-2009, 01:20 AM
Bellardia Bellardia is offline
 
Join Date: Jul 2007
Location: Hamilton, Ontario
Posts: 378
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
if ($_GET['do'] == 'Something')
{
   include(
'PAGENAME.HTML');

Change 'something' to what will be after do=, ie, if your page is www.mypage.com?do=run, then change it to 'something'. Change $_GET['do'] to what is before the equal sign...you could make it www.mypage.com?returnpage=first, then you would used $_GET['returnpage']. Use the include to fetch a html/php page from the same directory, or link it appropriately.

Or fetch a template instead.
Reply With Quote
  #10  
Old 01-08-2009, 01:37 AM
MarkFoster MarkFoster is offline
 
Join Date: Jun 2008
Posts: 305
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Bellardia View Post
PHP Code:
if ($_GET['do'] == 'Something')
{
   include(
'PAGENAME.HTML');

Change 'something' to what will be after do=, ie, if your page is www.mypage.com?do=run, then change it to 'something'. Change $_GET['do'] to what is before the equal sign...you could make it www.mypage.com?returnpage=first, then you would used $_GET['returnpage']. Use the include to fetch a html/php page from the same directory, or link it appropriately.

Or fetch a template instead.
I would rather fetch a template but this code wont work:
PHP Code:
if ($_GET['do'] == 'news1')
{
eval(
'print_output("' fetch_template('newsmain1') . '");'); 

Could you give me a exact fetch template line?
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 02:21 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.08078 seconds
  • Memory Usage 2,266KB
  • 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
  • (6)bbcode_php
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)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
  • (10)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_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