GeorgeofCS
10-23-2002, 08:26 PM
Ok I'm attempting to alter a pice of code I rewrote for other purposes. The only problem is that I need the script to show say 10 per page. Can anyone help?
Here's the bit of code.
if ($action=="") {
include("./global.php");
//check usergroup of user to see if they can use Profile
if ($bbuserinfo[userid]==0) {
show_nopermission();
}
$sponsors=$DB_site->query("SELECT id,name,sponban,sponlink,sponpoint,sponexp,sponhit s FROM sponsors WHERE (sponexp<=sponhits OR sponhits=0) ORDER BY id DESC");
$c = 0;
while ($sponsor=$DB_site->fetch_array($sponsors)) {
$sponsorbody .= "<br><a href=\"sponsor.php?s=$session[sessionhash]&action=sponsee&sponid=$sponsor[id]\" target=\"_blank\"><img src=\"$sponsor[sponban]\" border=\"0\"></a><br>Visiting $sponsor[name] is worth $sponsor[sponpoint] points.<br>";
$c = $c + 1;
}
if ($c==0) {
$sponsorbody .= "No Sponsors found";
}
$sponsorbody .= "";
eval("dooutput(\"".gettemplate("sponsor_main")."\");");
}
Here's the bit of code.
if ($action=="") {
include("./global.php");
//check usergroup of user to see if they can use Profile
if ($bbuserinfo[userid]==0) {
show_nopermission();
}
$sponsors=$DB_site->query("SELECT id,name,sponban,sponlink,sponpoint,sponexp,sponhit s FROM sponsors WHERE (sponexp<=sponhits OR sponhits=0) ORDER BY id DESC");
$c = 0;
while ($sponsor=$DB_site->fetch_array($sponsors)) {
$sponsorbody .= "<br><a href=\"sponsor.php?s=$session[sessionhash]&action=sponsee&sponid=$sponsor[id]\" target=\"_blank\"><img src=\"$sponsor[sponban]\" border=\"0\"></a><br>Visiting $sponsor[name] is worth $sponsor[sponpoint] points.<br>";
$c = $c + 1;
}
if ($c==0) {
$sponsorbody .= "No Sponsors found";
}
$sponsorbody .= "";
eval("dooutput(\"".gettemplate("sponsor_main")."\");");
}