vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Dont understand this thing about creating subpages (https://vborg.vbsupport.ru/showthread.php?t=122506)

The-Ensemble 07-29-2006 08:53 PM

Dont understand this thing about creating subpages
 
Quote:

Creating "Subpages"

If you want to create "subpages" within your custom page, simply wrap blocks of code with the following structure:


PHP Code:

if ($_REQUEST['do'] == 'test'

    
// Block of code #1
}

if (
$_REQUEST['do'] == 'test2'

    
// Block of code #2



Ok.
I get some of this but not the "wrap blocks of code" part.
what code?

BTW this is a question about this hack/mod: https://vborg.vbsupport.ru/showthread.php?t=98009

The-Ensemble 08-01-2006 05:13 AM

bump

Kirk Y 08-01-2006 07:16 AM

The blocks of code are whatever you want displayed in the even that request is issued.

For example, I made a Rules page that contains my site's Legal Policy, Privacy Policy, and the Forum Rules.

Code:

// Grab template for legal information
if ($_REQUEST['do'] == 'legal')
{
    eval('print_output("' . fetch_template('rules_legal') . '");');
}

// Or grab template for privacy
elseif ($_REQUEST['do'] == 'privacy')
{
    eval('print_output("' . fetch_template('rules_privacy') . '");');
}

// Template for main rules page if no 'do' statement
else
{
        eval('print_output("' . fetch_template('rules_siterules') . '");');
}

So if someone typed in mysite.com/rules.php, they'd be shown the plain 'ol forum rules, but if they type in mysite.com/rules.php?do=legal, they'd be shown my site's Legal Policy, and the same for mysite.com/rules.php?do=privacy -- they'd be shown our Privacy Policy.

Hope that helps.

The-Ensemble 08-01-2006 02:59 PM

Thanks!
Is there a way that you can view the page name?
example:
First custom page : Rules
A sub page in rules: Copyright Policy

could you make it so somone could type in yoursite.net/copyright.php rather than the
rules.php?do=copyright ?

Thanks for your help.

Kirk Y 08-01-2006 08:39 PM

Just make a custom page called copyright.php like is done in the Custom Page Tutorial.

The-Ensemble 08-02-2006 12:00 AM

I ment as a sub page.

Kirk Y 08-02-2006 12:09 AM

Code:

// Grab template for legal information
if ($_REQUEST['do'] == 'copyright')
{
    eval('print_output("' . fetch_template('copyright_template') . '");');
}

// Template for main rules page if no 'do' statement
else
{
        eval('print_output("' . fetch_template('rules_template') . '");');
}



All times are GMT. The time now is 05:11 PM.

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.01213 seconds
  • Memory Usage 1,726KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete