Please choose an avatar!"; } //else { $avatarstatus="Edit Headshot"; } if ($extra=='hidden') { $extra=" and status='Inactive'"; } else { $extra=" and status!='Inactive'"; } /* if ($job==0) { $profile=$homepage . "/" . "portfolio.html"; } else if ($job==1) { $profile=$homepage . "/" . "portfolio-photographer.html"; } else if ($job==2) { $profile=$homepage . "/" . "portfolio-designer.html"; } else if ($job==4) { $profile=$homepage . "/" . "mypicture.html"; } */ $profile="$homepage/portfolio.html?id=$fid&pid=$job"; /* delete photo */ if ($did!='') { $pqry="select filename,status from $phototable[$job] where id='$did' and pid='$fid'"; $prec=SelectQry($pqry); print "$pqry
"; $aqry="select avatar from $table[$job] where avatar like '%".$prec[0]['filename']."%' and $myid='$fid'"; if ($admin) print "$aqry
"; $arec=SelectQry($aqry); if ($arec[0]['avatar']!='') { $updatestatus="update $table[$job] set avatar='' where $myid='$fid'"; if ($admin) print "$updatestatus
"; $updatestatusrec = mysql_query("$updatestatus"); } $frame=$jobdir[$job] . $rec[0]['PageName'] . "/frame_" . $prec[0]['filename']; $thumb=$jobdir[$job] . $rec[0]['PageName'] . "/thumb_" . $prec[0]['filename']; $large=$jobdir[$job] . $rec[0]['PageName'] . "/large_" . $prec[0]['filename']; $file=$jobdir[$job] . $rec[0]['PageName'] . "/" . $prec[0]['filename']; if (is_dir($bad_dir)) { $msg.="copying bad photos into bad dir ($bad_dir)
"; } else { $msg="folder to copy bad photo does not exist! ($bad_dir)
"; } if (is_file($frame)) { copy("$frame", "$bad_dir"); unlink($frame); } if (is_file($thumb)) { copy("$thumb", "$bad_dir"); unlink($thumb); } if (is_file($large)) { copy("$large", "$bad_dir"); unlink($large); } if (is_file($file)) { copy("$file", "$bad_dir"); unlink($file); } $delete="delete from $phototable[$job] where id='$did' and pid='$fid'"; $updaterec = mysql_query("$delete") or $msg="Unable to remove photo, contact admin.
"; if ($debug!='') { print "$delete
$file
$frame
$thumb
"; } } $pqry="select id,filename,filesize,filedate,status from $phototable[$job] where filename!='' and pid='$fid' $extra order by filedate desc"; $prec=SelectQry($pqry); } $ilimit=10000; $totalimg=0; $peralbum=$ilimit; $dir=$jobdir[$job] . $rec[0]['PageName']; $url=$oldhomepage . "/" . $jobpath[$job] . "/" . $rec[0]['PageName']; $thumbarr=array(); $framearr=array(); $filearr=array(); $iarr=array(); $myavatar=array(); $totalimg=0; /* IF image exist in database */ if (count($prec)>0) { for($f=0;$f"; $avatarfile="avatar_" . $prec[$f]['filename']; if ($avatarfile=="$avatar") { // print "main: $avatarfile ($f)

"; $myavatar[$f]=" Avatar"; //if ($prec[$f]['status']=='Inactive') $avatarstatus="Edit Headshot"; } if ($prec[$f]['status']=='main') { $myavatar[$f]=" Main"; } array_push($thumbarr,$thumb); array_push($framearr,$frame); array_push($filearr,$prec[$f]['filename']); array_push($iarr,$prec[$f]['id']); $totalimg++; } } /* ELSE read image directly from local directory */ } else if ($handle = opendir("$dir")) { while (false !== ($file = readdir($handle))) { $forExt = explode('.',$file); $dirpath=$dir . "/" . $file; if (($totalimg<=$ilimit) && (eregi("frame_",$file))) { $thumbfile=ereg_replace("frame_","thumb_",$file); $thumb=$url . "/" . $thumbfile; $framefile=$file; $frame=$url . "/" . $framefile; array_push($thumbarr,$thumb); array_push($framearr,$frame); array_push($filearr,$file); $totalimg++; } } closedir($handle); } $numofalbum=ceil($totalimg/$peralbum); //print "$dir
total pic: $totalimg
pic per album: $peralbum
number of album: $numofalbum"; $numofalbum=1; ?> Back to Album "; exit; } if ($msg) { print "$msg
"; } ?>

Edit your portfolio   View My Portfolio Page   

Pic per album: $peralbum
Number of album: $numofalbum"; ?>
"; for($i=$start;$i<$peralbum;$i++) { if (($thumbarr[$i]!='') && ($row<6)) { print " "; $row++; } else if ($thumbarr[$i]!='') { print " "; $row=1; } $imagecount++; } ?>
img
Edit   Delete   $imagecount   $myavatar[$i]
img
Edit   Delete   $imagecount   $myavatar[$i]