The Arcive of vBulletin Modifications Site. |
|
Details »»
|
|||||||||||||||||||||||||
first of all my 'beginning' code might be a bit different, my board is really hacked up. anyways,...
to get a 'Next Page >' button in your multi-page threads, so people dont need to remember what page they're on: in showthread.php replace Code:
while ($curpage++<$totalpages) {
if (($curpage<$pagenumber-$pagenavpages or $curpage>$pagenumber+$pagenavpages) and $pagenavpages!=0) {
if ($curpage==1) {
$pagenav.=" <a href=\"showthread.php?threadid=$threadid&pagenumber=$curpage".iif($perpage==$maxposts,"","&perpage=$perpage")."\"><font color=\"#afa3c5\" class=thtcolor><< First Page</font></a> ... ";
}
if ($curpage==$totalpages) {
$pagenav.=" ... <a href=\"showthread.php?threadid=$threadid&pagenumber=$curpage".iif($perpage==$maxposts,"","&perpage=$perpage")."\"><font color=\"#afa3c5\" class=thtcolor>Last Page >></font></a> ";
}
} else {
if ($curpage==$pagenumber) {
$pagenav.=" <font color=\"#afa3c5\" class=thtcolor>$curpage</font> ";
} else {
$pagenav.=" <a href=\"showthread.php?threadid=$threadid&pagenumber=$curpage".iif($perpage==$maxposts,"","&perpage=$perpage")."\"><font color=\"#afa3c5\" class=thtcolor>$curpage</font></a> ";
}
}
}
} else {
Code:
while ($curpage++<$totalpages) {
if (($curpage<$pagenumber-$pagenavpages or $curpage>$pagenumber+$pagenavpages) and $pagenavpages!=0) {
if ($curpage==1) {
$pagenav.=" <a href=\"showthread.php?threadid=$threadid&pagenumber=$curpage".iif($perpage==$maxposts,"","&perpage=$perpage")."\"><font color=\"#afa3c5\" class=thtcolor><< First Page</font></a> ... ";
}
if ($curpage==$totalpages) {
$twrat_nextpage = ($pagenumber)+1;
$pagenav.=" ... <a href=\"showthread.php?threadid=$threadid&pagenumber=$twrat_nextpage".iif($perpage==$maxposts,"","&perpage=$perpage")."\"><font color=\"#afa3c5\" class=thtcolor>Next Page ></font></a> <a href=\"showthread.php?threadid=$threadid&pagenumber=$curpage".iif($perpage==$maxposts,"","&perpage=$perpage")."\"><font color=\"#afa3c5\" class=thtcolor>Last Page >></font></a> ";
}
} else {
if ($curpage==$pagenumber) {
$pagenav.=" <font color=\"#afa3c5\" class=thtcolor>$curpage</font> ";
} else {
$pagenav.=" <a href=\"showthread.php?threadid=$threadid&pagenumber=$curpage".iif($perpage==$maxposts,"","&perpage=$perpage")."\"><font color=\"#afa3c5\" class=thtcolor>$curpage</font></a> ";
}
}
}
$twrat_nextpage = ($pagenumber)+1;
$pagenav.=" <a href=\"showthread.php?threadid=$threadid&pagenumber=$twrat_nextpage".iif($perpage==$maxposts,"","&perpage=$perpage")."\"><font color=\"#afa3c5\" class=thtcolor>Next Page ></font></a> ";
} else {
![]() to make your template.php create instantly useable templates from the form (instead of having to go into global.php and register them) open /admin/template.php and find Code:
$DB_site->query("INSERT INTO template (templateid,title,template) VALUES (NULL,'".addslashes("$title")."','".addslashes("$template")."')");
Code:
# added template code
# echo "title is $title <br>"; # debugging
$filename = "rattemp.php";
$str = '<?php eval("\$';
$str .= $title;
$str .= ' = \"".gettemplate("';
$str .= $title;
$str .= '")."\";"); ?>';
$fp=fopen($filename, 'a+');
fwrite($fp,"$str \n");
fclose($fp);
# end
Code:
eval("\$fivelinks = \"".gettemplate("fivelinks")."\";");
Code:
require ("admin/rattemp.php");
![]() anyways, thats all stuff ive been meaning to do for 3 months and never got around to it, so i figured maybe i'd share it ![]() also im not really a mega-php programmer, my bag is perl, so if you find my code is weird (or just plain bad) thats why ![]() [Edited by Ratorasniki on 01-01-2001 at 07:45 PM] Show Your Support
|
|||||||||||||||||||||||||
| Comments |
|
#2
|
|||
|
|||
|
my bad, old ver. to get the next button replace it with
Code:
while ($curpage++<$totalpages) {
if (($curpage<$pagenumber-$pagenavpages or $curpage>$pagenumber+$pagenavpages) and $pagenavpages!=0) {
if ($curpage==1) {
$pagenav.=" <a href=\"showthread.php?threadid=$threadid&pagenumber=$curpage".iif($perpage==$maxposts,"","&perpage=$perpage")."\"><font color=\"#afa3c5\" class=thtcolor><< First Page</font></a> ... ";
}
if ($curpage==$totalpages) {
$pagenav.=" ... <a href=\"showthread.php?threadid=$threadid&pagenumber=$curpage".iif($perpage==$maxposts,"","&perpage=$perpage")."\"><font color=\"#afa3c5\" class=thtcolor>Last Page >></font></a> ";
}
} else {
if ($curpage==$pagenumber) {
$pagenav.=" <font color=\"#afa3c5\" class=thtcolor>$curpage</font> ";
} else {
$pagenav.=" <a href=\"showthread.php?threadid=$threadid&pagenumber=$curpage".iif($perpage==$maxposts,"","&perpage=$perpage")."\"><font color=\"#afa3c5\" class=thtcolor>$curpage</font></a> ";
}
}
}
$twrat_nextpage = ($pagenumber)+1;
if ($pagenumber != $totalpages) {
$pagenav.=" <a href=\"showthread.php?threadid=$threadid&pagenumber=$twrat_nextpage".iif($perpage==$maxposts,"","&perpage=$perpage")."\"><font color=\"#afa3c5\" class=thtcolor>Next Page ></font></a> "; }
} else {
|
|
#3
|
|||
|
|||
|
thanks for the code, it workes perfectly, but can you add previous page to the hack?
|
|
#4
|
|||
|
|||
|
Quote:
Code:
$twrat_prevpage = ($pagenumber)-1;
$twrat_nextpage = ($pagenumber)+1;
if ($pagenumber != $totalpages) {
$pagenav="<a href=\"showthread.php?threadid=$threadid&pagenumber=$twrat_prevpage".iif($perpage==$maxposts,"","&perpage=$perpage")."\"><font color=\"#afa3c5\" class=thtcolor>Next Page ></font></a> ".$pagenav;
$pagenav.=" <a href=\"showthread.php?threadid=$threadid&pagenumber=$twrat_nextpage".iif($perpage==$maxposts,"","&perpage=$perpage")."\"><font color=\"#afa3c5\" class=thtcolor>Next Page ></font></a> ";
}
|
|
#5
|
|||
|
|||
|
not exactly,
first of all you didnt change it to perivous page (so both of them are "next page", and second, the previos text shows before "This thread is X pages long:". please fix that. |
|
#6
|
|||
|
|||
|
Code:
$twrat_prevpage = ($pagenumber)-1;
$twrat_nextpage = ($pagenumber)+1;
if ($pagenumber != 1) {
$pagenav.="<a href=\"showthread.php?threadid=$threadid&pagenumber=$twrat_prevpage".iif($perpage==$maxposts,"","&perpage=$perpage")."\"><font color=\"#afa3c5\" class=thtcolor>Previous Page ></font></a> ";
}
if ($pagenumber != $totalpages) {
$pagenav.=" <a href=\"showthread.php?threadid=$threadid&pagenumber=$twrat_nextpage".iif($perpage==$maxposts,"","&perpage=$perpage")."\"><font color=\"#afa3c5\" class=thtcolor>Next Page ></font></a> ";
}
|
|
#7
|
|||
|
|||
|
that is not what i wanted, what I want is something like this:
< Previous Page 1 2 3 Next Page > now it is: 1 2 3 Previous Page > Next Page > |
|
#8
|
|||
|
|||
|
Why don't you look at the code a little and fix it.
Sorry but while I try to help, I am not at your beck and call and my time is precious. The next time you need help, why don't you ask a little more kindly and without the demanding tone? |
|
#9
|
|||
|
|||
|
sorry if i didnt ask kindly, I really aprreciate your work.
I know nothing about php but ill try. thanks anyway. well maybe just one more thing, can you tell me how to use this "<" char? [Edited by Scaramanga_gold on 01-02-2001 at 02:57 PM] |
|
#10
|
|||
|
|||
|
If you look at the source of this page you will see that you need to use "<"
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|