PDA

View Full Version : Template Help!


Neo
03-10-2002, 04:24 PM
Ok, I have a template I am using as my base template, then I have sub templates.. there are put into the base template with variables like $tplink.. but when I put them in it shows under the $footer... how would I get it to show correctly?

the link I use is something like this

$tplink = eval("dooutput(\"".gettemplate("temp_under_2")."\");");

I am lost and need help :smoke:

Lesane
03-10-2002, 04:34 PM
Did u tried this?

eval("\$tplink .= \"".gettemplate("temp_under_2")."\";");

Neo
03-10-2002, 04:59 PM
Yes, and nothing showed up at all.

Neo
03-10-2002, 09:40 PM
COme on FireFly.. you do pro, can ya give me a hand ;)

TECK
03-10-2002, 11:35 PM
give me more details neo. i should be able to give you a straight answer. ;)
what exacly you try to do?

btw, you cannot use the function dooutput(), because it calls the headers twice on the same page. that's a no no.. :)

Neo
03-10-2002, 11:40 PM
well in a template I have...

example:
<html>
$headrer
$tplink
$footer
</html>

I want the $tplink to be another template.. but when I try and make it a variable.. it only puts it at the bottom and the coe that Lesane posted doesnt show anything at all... how can I get it to work G funk

TECK
03-11-2002, 12:08 AM
forum/global.php
1. find this code:$templatesused.=',pagenav,pagenav_curpage,pag enav_firstlink,pagenav_lastlink,pagenav_nextlink,p agenav_pagelink,pagenav_prevlink';replace it with:$templatesused.=',pagenav,pagenav_curpage,pag enav_firstlink,pagenav_lastlink,pagenav_nextlink,p agenav_pagelink,pagenav_prevlink,$tplink';2. find this code:$header='';
$footer='';replace it with:$header='';
$tplink='';
$footer='';3. find this code:eval("\$header .= \"".gettemplate('header')."\";");
eval("\$footer .= \"".gettemplate('footer')."\";");replace it with:eval("\$header .= \"".gettemplate('header')."\";");
eval("\$tplink .= \"".gettemplate('neo_got_insane')."\";");
eval("\$footer .= \"".gettemplate('footer')."\";");now create a custom template called neo_got_insane and place your html code in there.
all you have to do now is place your $tplink variable, wherever you want (except header and footer). bam.. you are done.. (did you liked that bam thing?) ;)

Neo
03-11-2002, 01:27 AM
YOU THE MAN!!!! :D Thanks

TECK
03-11-2002, 01:44 AM
ur more then welcome neo.. :)

Neo
03-11-2002, 04:55 PM
OK I am having the same problem.. here is the code I am using...

So where is my question and what I am trying to do in short

This is in members.php
---
if ($action=="custom") {
$templatesused = "customize_1,customize_2,customize_3";
include("./global.php");

eval("dooutput(\"".gettemplate("customize_1")."\");");

if ($bbuserinfo[cpbenabled]!=0) {
eval("\$cpjoin .= \"".gettemplate("customize_2")."\";");
} else {
eval("\$cpjoin .= \"".gettemplate("customize_3")."\";");
}

}
---
Now I want to put $cpjoin in customize_1 template, so the if cpbenabled statment will have two different out comes and show two different things. But when I use this code it shows nothing either way.. do you know where my problem is?

Thanks for your time
- Neo

TECK
03-11-2002, 07:14 PM
// ############################### start customized templates ###############################
if ($action=="custom") {
include("./global.php");
if ($bbuserinfo[cpbenabled]!=0 and $bbuserinfo[userid]!=-1) {
eval("\$tplink = \"".gettemplate("custom_template1")."\";");
} elseif ($bbuserinfo[cpbenabled]!=0 and $someid!=somevalue) {
eval("\$tplink = \"".gettemplate("custom_template2")."\";");
} else {
eval("\$tplink = \"".gettemplate("custom_template3")."\";");
}
}If you want to use the dooutput() function, do this:// ############################### start customized templates ###############################
if ($action=="custom") {
include("./global.php");
if ($bbuserinfo[cpbenabled]!=0 and $bbuserinfo[userid]!=-1) {
eval("dooutput(\"".gettemplate("custom_template1")."\");");
} elseif ($bbuserinfo[cpbenabled]!=0 and $someid!=somevalue) {
eval("dooutput(\"".gettemplate("custom_template2")."\");");
} else {
eval("dooutput(\"".gettemplate("custom_template3")."\");");
}
}

In the dooutput() case, your custom_template should look like this:{ htmldoctype }
<html>
<head>
<title>$bbtitle - bla bla</title>
$headinclude
</head>
<body>
$header
<!-- your html code here -->
$footer
</body>
</html>

Neo
03-12-2002, 05:44 AM
Ahhh... I am begining to see. Thanks once again.