The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Actions for includes in php
hi there,
i was wondering if there was any way i could simply use one page for includes, instead of having to save the normal way. Normally youd alter the includes code to the specific page eg index.php's includes would be indexinc.php,navigation.php,extras.php news includes would be newsinc.php, navigation.php,extras.php Basically what i want to do is for every inc page of my site create an action from the main template that would display the unique included page to each eg index.php?action=news would include newsinc.php and the navigation and extras files index.php?action=freebies would include freeinc.php and the navigation and extras files anyway i can do this? im a total newbie to php |
#2
|
||||
|
||||
not sure if i understand you the right way...
try this code: PHP Code:
|
#3
|
||||
|
||||
Xenon, Lets have an affair, your an asset
So i would simply create a full compliment of links and type in their function? using if ifelse if else if else if else? it works tops, Im such a newb By the way Xenon, could you tell me a good resource OTHER than php.net for tutorials btw sorry for the triple post |
#4
|
||||
|
||||
Hmm nope, having problems now, can you tell me whats up with this code?
<? if(isset($action) and trim($action)!="home") { include($action."main.php"); } if else(isset($action) and trim($action)!="legal") { include($action."legal.php"); } ?> |
#5
|
||||
|
||||
It's elseif not if else and I would just do...
PHP Code:
|
#6
|
||||
|
||||
Doh! Shows my talent in the php area then :P
|
#7
|
||||
|
||||
by the way, i know the if and elseif statements and the include function, but can people explain actions to me please? and is it possible to set the include main action as the default
|
#8
|
||||
|
||||
what do u mean actions? you could try www.php.net, but i dunno what you mean by actions.
|
#9
|
||||
|
||||
Thanks for the update, its running more efficently now,
|
#10
|
||||
|
||||
what i meab by actions is like
index.php?action=forums or is that simply a user defined function? |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|