Stuif's Adventures

Update your comment
              

\n"; exit; } $query="SELECT id, album_name,content, counter FROM albums WHERE album_nr='$album_nr' AND owner='$owner'"; $result=mysql_query($query); $num=mysql_num_rows($result); list($id,$album_name,$content,$counter)=mysql_fetch_row($result); $pp='webpage'.$id; if (!$$pp) { $counter++; $query="UPDATE albums SET counter='$counter' WHERE id='$id' "; $result=mysql_query($query); setcookie("$pp",$counter); } // generation of the page $content=explode("",$content); $splitcount=count($content); for ($i=1;$i<$splitcount;$i++) { $partcont=explode("",$content[$i]); $nrsplit=$partcont[0]; $comm[$nrsplit]="$partcont[1]


"; } echo"
All albums

$album_name
$content[0]
\n"; $query="SELECT pic_name, caption, pic_nr FROM images WHERE album_nr='$album_nr' AND owner='$owner' ORDER BY pic_nr "; $result=mysql_query($query); $totalwidth=0; $nrow=0; while (list($pic_name,$caption,$pic_nr)=mysql_fetch_row($result)) { $npic=$npic+1; $query="SELECT * FROM comments WHERE album_nr='$album_nr' AND owner='$owner' AND pic_name='$pic_name' "; $result1=mysql_query($query); $numcomm=mysql_num_rows($result1); if (!$numcomm) {$numcomm=" ";} elseif ($numcomm==1) {$numcomm="1 comment";} else {$numcomm="$numcomm comments";} $image="./images/$owner/$album_nr/tn/$pic_name"; $size=getimagesize($image);$width=$size[0]; $totalwidth=$totalwidth+$width; if ($totalwidth>835) {$nrow=$nrow+1;echo"
$comm[$nrow]
\n"; $totalwidth=$width;} echo "\n"; } echo"

$caption
$numcomm

"; // now the comments, if any $query="SELECT id,pic_name, commenter, comment, quote,date FROM comments WHERE album_nr='$album_nr' AND owner='$owner' ORDER BY date, pic_name"; $result=mysql_query($query); $oldpic=""; while (list($id,$pic_name,$commenter,$comment,$quote, $date)=mysql_fetch_row($result)) { if ($pic_name&&($pic_name==$oldpic)) {$width="98%";}else {$width="100%";} $oldpic=$pic_name; $query="SELECT avatar,url,realname FROM contacts WHERE name='$commenter' "; $result1=mysql_query($query); if ($commenter==$multiply_username) {$deledit="edit/delete";}else {$deledit="";} list($avatar,$url,$realname)=mysql_fetch_row($result1); $src_avatar=""; if ($url) {$avatarlink="$src_avatar";} else {$avatarlink="$src_avatar";} if ($pic_name) { $image="./images/$owner/$album_nr/tn/$pic_name"; $im=""; } else {$im='';} $date=date("M j, Y",$date); echo "
$avatarlink $realname wrote on $date:
$comment
$im
$deledit

\n"; } if ($multiply_username) { $query="SELECT avatar FROM contacts WHERE name='$multiply_username' "; $result=mysql_query($query); list($avatar)= mysql_fetch_row($result); echo"

Add a Comment
"; } else {echo"
You are welcome to comment, but you must register and/or login first.
"; } ?>