View Full Version : How would I do this?
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
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
Try
Find:
eval("\$pagenav = \"".gettemplate("showthread_numpages")."\";");
Replace with:
if ($totalpages==1) {
eval("\$pagenav = \"".gettemplate ("showthread_numpages2")."\";");
} else {
eval("\$pagenav = \"".gettemplate("showthread_numpages")."\";");
}
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
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
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.