PDA


View Full Version : Extra Pages problem


tomshawk
06-13-2005, 03:06 AM
Hello Brian,

I have setup many extra pages, and I am trying to do something you might think is a little wierd, but I've seen it done on other sites,
www.thekryptonian.com for example
so I thougt i'd ask.

Maybe he is using another package, but because he has his navigator and everything it looks like the CMPS

Anyway
I take the normal index.php file and add a page, so now I get this
http://www.tech-unity.com/index.php?page=Legal
or this
http://www.tech-unity.com/index.php?page=guestmap

Now, i've created some extra pages, but they are all related, so I'd like to take a copy of index.php and rename it to something else, say certs.php for example

When I do that and add in the code

define('VBA_PORTAL', true);
define('VBA_PAGE', 'req');for the template I want it to start with

http://www.tech-unity.com/certs.php

It works, but, if I add the ?page=LPI1 behind it, like this

http://www.tech-unity.com/certs.php?page=LPI1
It does not work

but If I do the regular
http://www.tech-unity.com/index.php?page=LPI1 it works fine

and if I dont add in the original code from up top

define('VBA_PORTAL', true);
define('VBA_PAGE', 'req');
and do this
http://www.tech-unity.com/certs2.php?page=LPI1
it works but this
http://www.tech-unity.com/certs2.php
just shows the normal index.

I hope I explained that right

Any help would be greatly appriciated, please!

Brian
06-13-2005, 10:35 AM
If you define the page at the top of the file then that's going to be the only page that file can pull. You may want to try something like this instead:

if (!$_REQUEST['page'])
{
define('VBA_PAGE', 'req');
}

tomshawk
06-13-2005, 11:11 AM
Works perfectly, thank you Brian ;)

tomshawk
06-13-2005, 04:46 PM
If you define the page at the top of the file then that's going to be the only page that file can pull. You may want to try something like this instead:

if (!$_REQUEST['page'])
{
define('VBA_PAGE', 'req');
}

Hello Brian, this worked but, for some reason, I assume the templates are the problem, but adding these pages slowed my site down to a crawl.
(Like I said, I think it was what was in the templates, they were rather large.)

Could that explain it, once I removed the templates the site sped back up.

Are these templates loaded into memory or something, even when they are not called (i.e. checked as active on a paticular page)

Brian
06-13-2005, 05:00 PM
Yup, they are loaded into memory. I'm not sure if it would make a difference, but you may want to try the HTML page option for some of them (just throw the contents of the template into an HTML file and then inlcude that file) and see if that helps.

tomshawk
06-13-2005, 07:14 PM
Yup, they are loaded into memory. I'm not sure if it would make a difference, but you may want to try the HTML page option for some of them (just throw the contents of the template into an HTML file and then inlcude that file) and see if that helps.

ROFLMAO

Well, that explains a heck of alot :p

Thanks Brian, I'll check out the HTML file option and let you know ;)