PDA

View Full Version : How can I get this to work?


11 Jul 2000, 18:22
In the showthread.php file you have

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

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

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

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

To get it to say "This thread is XX pages long", etc.

I created a new template for saying "This thread is one page long"

and change the above to:

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_numpage")."\";");
}else{
eval("\$pagenav = \"".gettemplate("showthread_numpages")."\";");
}


I have not been able to get this to display on single pages. I know the template is working because if I change the showthread_numpages to numpage it will say it is One page long.

So any ideas? Obviously it is not counting anything and just jumping to the second in line in the if else line.

Thanks,

Parker

11 Jul 2000, 18:52
Try changing:


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



To:


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



$totalpages only gets set if ($threadinfo[posts]>$perpage), which won't happen if there's only one page.

11 Jul 2000, 20:00
Ed:

No good. It is still not seeing the value of 1.

Hmm...

Parker

[Edited by Parker Clack on 07-11-2000 at 04:01 PM]

11 Jul 2000, 20:16
how about



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



[Edited by rangersfan on 07-11-2000 at 04:16 PM]

11 Jul 2000, 23:41
Well, I looked at my code real quick, and we all missed one thing - one VERY important thing.



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

is inside the


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

code block :)

So, scroll down and find:


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



Under the } else { line, add:


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



/me crosses fingers...

12 Jul 2000, 02:26
Ed:

Simply solution to something that I was pulling my hair out about. And I don't have that much hair left to pull out anymore. :)

Thanks,

Parker