PDA

View Full Version : How would I do this?


07 Jun 2000, 01:51
In showthread.php you have the variable.

eval("\$pagenav = \"".gettemplate"
showthread_numpages")."\";");

So it will show the number of pages a thread is long.

I have set up another template called showthread_numpages2
and I want it to call on this template when the number of pages is one.

How would I set up an if else statement here to either pull up showthread-numpages2 if the page count is 1 or showthread-numpages if it is greater than 1?

Thanks,
Parker

08 Jun 2000, 10:27
Ok,

This is what I have written and it doesn't work.

if ($pagenav==1) {
eval("\$pagenav = \"".gettemplate("showthread_numpages2")."\";");
} else {
eval("\$pagenav = \"".gettemplate("showthread_numpages")."\";");
}

showthread_numpages2 is a second template that I have written that says.

This thread is 1 page long.

So now no matter how many pages long it is it goes to this variable instead of showthread_numpages.

Any ideas?

Parker

08 Jun 2000, 10:52
Try

Find:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



Replace with:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


Originally posted by Parker Clack
Ok,

This is what I have written and it doesn't work.

if ($pagenav==1) {
eval("\$pagenav = \"".gettemplate("showthread_numpages2")."\";");
} else {
eval("\$pagenav = \"".gettemplate("showthread_numpages")."\";");
}

showthread_numpages2 is a second template that I have written that says.

This thread is 1 page long.

So now no matter how many pages long it is it goes to this variable instead of showthread_numpages.

Any ideas?

Parker

08 Jun 2000, 15:35
Moonwolf:

Thanks

Parker

09 Jun 2000, 14:22
Moonwolf:

I tried that and it didn't work. This is what I have.

if ($threadinfo[posts]>$perpage) {

$totalpages=$threadinfo[posts]/$perpage;
if ($totalpages!=intval($totalpages)) {
$totalpages=intval($totalpages)+1;
}

if ($pagenumber=="lastpage") {
$pagenumber=$totalpages;
}

if ($totalpages==1) {
eval("\$pagenav = \"".gettemplate("showthread_numpages2")."\";");
} else {
eval("\$pagenav = \"".gettemplate("showthread_numpages")."\";");
}


It still does not dispaly the template showthread_numpages2
when there is only one page.

Parker