i think i must use the return element. It gave me a t varible error and another t error as well. Let me show you the whole function. It's kind of long. Im sorry but im getting more and more confused. Im kinda new to php and trying to learn and keep up with what your telling me.
function _get_subpics($id, $album_id=0)
{
global $tb_users, $tb_albums, $tb_upload_image_details, $base_url, $HTTP_GET_VARS;
$img_src = $base_url."/images/notfound_image.gif";
if ($album_id == 0)
{
$album_result = mysql_query("SELECT * FROM $tb_upload_image_details WHERE main='n' AND user_id='$id'");
}
elseif ($album_id == -2)
{
$album_result = mysql_query("SELECT * FROM $tb_upload_image_details WHERE main='y' AND user_id='$id'");
}
else
{
$album_result = mysql_query("SELECT * FROM $tb_upload_image_details WHERE album_id='$album_id' AND user_id='$id'");
}
$sql = "select id,username,image,image_url,concat(id,'.',image_ext) as theimage,image_status,total_files from $tb_users where id = '$id'";
$query = mysql_query($sql);
$array = mysql_fetch_array($query);
if($array["image_status"] == "approved" || $array["image_status"] == "queued")
{
if ($array["total_files"] > 0)
{
if ($array["image"] == "here")
{
if (mysql_num_rows($album_result) != 0)
{
$return = '<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"><tr>';
$i = 1;
while ($a_row = mysql_fetch_array($album_result))
{
$img_src = $base_url."/image.php?id=" . $a_row["user_id"] . "&p=" . $a_row['total_file_count'];
$imgsrc = "id=" . $a_row["user_id"] . "&p=" . $a_row['total_file_count'];
$img_src1 = $base_url."/show_image.php?id=" . $a_row["user_id"] . "&p=" . $a_row['total_file_count'];
$delete_url = $base_url . "/delete_image.php?id=" . $a_row['total_file_count'] . "&user=" . $a_row['user_id'];
$return .= "<td width=\"33%\" align=\"center\"><a href=\"viewimage.php?$imgsrc\" target=\"_blank\"><img src=\"$img_src\" width=100 height=100 border=0 alt=\".: $array[username] :.\" title=\".: $array[username] :.\"></a>";
if ( (!isset($_GET['v'])) AND (!isset($_GET['i'])) AND (!isset($_GET['s'])) AND (!isset($_GET['z'])))
{
if (!isset($_GET['pid']) && $album_id != -2)
$return .= "<br><a class=link01 href='" . $delete_url . "'>x</a>";
}
$return .= "<td>";
((($i%4)==0) ? $return .= "</tr><tr><td colspan=3></td></tr><tr>" : '');
$i++;
}
$return .= '</tr></table>';
}
}
}
}
return $return;
}
That is the function that displays the user's subpic's as smaller images ( thumbnails) and onclick , loads them into viewimage.php
Sorry for my confusion , this is the most complicated issue ive ever delt with.
Thanks and Regards.