The Arcive of vBulletin Modifications Site. |
|
Details »»
|
|||||||||||||||||||||||||
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 Show Your Support
|
|||||||||||||||||||||||||
| Comments |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
Try
Find: Code:
eval("\$pagenav = \"".gettemplate("showthread_numpages")."\";");
Code:
if ($totalpages==1) {
eval("\$pagenav = \"".gettemplate ("showthread_numpages2")."\";");
} else {
eval("\$pagenav = \"".gettemplate("showthread_numpages")."\";");
}
Quote:
|
|
#4
|
|||
|
|||
|
Moonwolf:
Thanks Parker |
|
#5
|
|||
|
|||
|
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 |
![]() |
|
|