PHP Code:
unset($upload_bits); //clears the variable
$showpic = $DB_site->query("SELECT uploadname FROM user WHERE userid = '".$bbuserinfo['userid']."' ORDER BY uploadname DESC"); //sets the query, and only shows uploads from user viewing page.
if ($DB_site->num_rows($showpic) == 0){ //check for number of rows, if none, then display error page
eval("standarderror(\"".gettemplate("upload_none")."\");"); //provides an error page with redirect
} else { //or else display downloads page
while($picname = $DB_site->fetch_array($showpic)); //loop until last row in table
$picname = $picname['uploadname']; //You will have to call this variable ($picname) in the template 'upload_isthere' for it to show up in the template
eval ("\$upload_bits .= \"".gettemplate("upload_isthere")."\";"); //setup the variable to display the template
} // close the while statement
eval("dooutput(\"".gettemplate('upload_index')."\");"); //change upload_index to the template for the actual display of the page this page would need to use the variable $upload_bits
} //close the if statement
Hope that helps, follow the comments and you should see the steps.