Quote:
Originally Posted by kh99
If I remember correctly your function cotw_sotw_print_nom() calls "echo($id)" at the end, when I think what you want is to use return $id;
The reason it comes out at the top is because the vbulletin code works by gathering up all the output in a big string, which is then echoed at the end of the script. So if anything you do before that causes output (like calling echo() ), then it comes out before any other output (and so is at the top of the page).
|
Ahh that's why it's been printing out this function like that. This is the function:
PHP Code:
function cotw_sotw_print_nom($dummy)
{
global $vbulletin;
$result = $vbulletin->db->query_read("SELECT * FROM cotw_sotw_nominations");
if (mysql_num_rows($result) > 0) {
// yes
// print them one after another
echo "<center><table style=margin-top:5px;>";
while($row = mysql_fetch_row($result)) {
echo "<tr>";
echo "<td><center>".$row[0].".) Nominated By: <b style=color:#3B81B7;><a href=http://development.aniworlds.net/member.php?".$row[6]."-".$row[4].">".$row[4]." </a></b></center>";
echo "<center>Added: ".date("F j, Y g:i a", strtotime($row[3]))."</center>";
echo "<center>Created By: ".$row[5]."</center></td>";
echo "<td><center><img class=oftw_img_nom src =".$row[1]." style=margin-bottom:10px;></center></td>";
echo "</tr>";
}
echo "</table></center>"; }
else {
// no
// print status message
echo "No Nominations Have Been Submitted!";
}
}
Since it is all being echo'ed then it prints it out first, now I understand. Would it be as easy as replacing echo with return in this case??