Log in

View Full Version : Dont understand this thing about creating subpages


The-Ensemble
07-29-2006, 08:53 PM
Creating "Subpages"

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


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.

// 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
// 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') . '");');
}