Log in

View Full Version : $pagenav - Help, i thought that this would be easy!


trafix
05-14-2003, 03:10 PM
Ok i thought that adding pages to a hack would be easy ... i cant seem to work it out from existing coding :( could someone explaine how to add this to a hack. A tut would be great:)

Thanks in advance

Dean C
05-14-2003, 03:36 PM
Same here - pagination is so much harder than it looks :(

- miSt

colicab-d
05-14-2003, 05:22 PM
pagination would be handy... maybe someone could write a good tutorial and post it in the hacking hints and tips..

please :D lol

N!ck
05-14-2003, 11:52 PM
It's pretty easy with that pagenav() function. You just feed it your result.

Boofo
05-15-2003, 12:27 AM
Can you post an example or something?

trafix
05-15-2003, 04:03 AM
OK, here is the piece of coding that i require pagenav on. It comes from vbtrader.php and the primary db column is itemid,

please use this as the example ... :)

ooops wrong piece ... see next post

trafix
05-15-2003, 04:06 AM
sorry this is the right bit of code

// ###################### Start Get Listings #######################
if ($action=="getlist") {

eval("\$navbar .= \"".gettemplate("trader_navbar")."\";");

$getinfo2 = $DB_site->query_first("SELECT * FROM traderclasssublist WHERE subid=$subid");
$catmain=$getinfo2[parentname];
$catmainid=$getinfo2[parentid];
$catsub=$getinfo2[subname];

$getinfo3 = $DB_site->query_first("SELECT * FROM traderclassmainlist WHERE id=$catmainid");

$getlist = $DB_site->query("SELECT * FROM traderlisting WHERE itemsubcatid=$subid and active=1 ORDER BY datelisted DESC");
while ($list4 = mysql_fetch_array($getlist)) {
$list4[finish]=vbdate($dateformat,$list4[dateexpire]);

$newlist="";
if ($list4[datelisted] > $bbuserinfo[lastvisit]) {
$newlist="color=red";
}

if (($counter++ % 2) != 0) {
$backcolor="{firstaltcolor}";
$bgclass="alt1";
} else {
$backcolor = "{secondaltcolor}";
$bgclass="alt2";
}


eval("\$itemlist .= \"".gettemplate("trader_itemlist_bit")."\";");
}

eval("dooutput(\"".gettemplate("trader_item_list")."\");");

}