Gallerij
ffffffff

'); if (str_replace(' ','',$en['user']) == '') header($loc); //stop if name is blank //remove http:// from homepage URL $en[www] = str_replace("http://", "", strtolower($en[www])); // fix DOS newlines $en[comment] = str_replace("\r\n", "\n", $en[comment]); // fix Mac newlines $en[comment] = str_replace("\r", "\n", $en[comment]); // replace newlines with
's $en[comment] = str_replace("\n","
",$en[comment]); foreach($en as $key => $value) { if ($key == comment) continue; $en[$key] = strip_tags($value); } //$gal_id = substr($en['galsid'],0,strpos($en['galid'],'_')); $query = "INSERT INTO $commtable VALUES ('{$en['galid']}','{$en['user']}','{$en['email']}','{$en['www']}','{$en['comment']}','$ip','$time','$date')"; $result = mysql_query($query, $link) or die("Query failed: ".mysql_error()); header($loc); //redirect back to picture page } //page head echo ""; echo "
".constant('site_name')."
"; //drop down list to choose galleries ?> Beschikbare albums ($gcount): "; if ($gcount == 0) {die ("Geen albums beschikbaar");} //page contents if ($galreq=='view') { //VIEW GALLERY $query = "SELECT * FROM $picstable WHERE galleryID=$galid"; $result = mysql_query($query, $link) or die("Query failed: ".mysql_error()); $picc = mysql_num_rows($result); $pc = 0; while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { $pc++; $pics[$pc] = $line; } echo "Huidige album: ".$gal[$galid][name]."
Aantal foto's: $picc

"; echo "
"; $perpage = constant('max_thumbnail_rows') * constant('max_thumbs_per_row'); $pages = round($picc / $perpage); $pg = 0; for ($k=1;$k<=$pages+1;$k++) { $n1 = ($k-1)*$perpage+1; $n2 = ($k)*$perpage; if ($n2 > $picc) $n2 = $picc; if ($galoffs == $n1) {$lnk = ''; $lnk_c = '';} else {$lnk = ""; $lnk_c = '';} if ($n1<=$picc) {$href .= ' '.$lnk.$n1.'-'.$n2.$lnk_c; $pg++;} } $href = "$pg pagina(s) ... $href"; echo $href; $p = $galoffs-1; for ($y=1;$y<=constant('max_thumbnail_rows');$y++) { echo ""; for ($x=1;$x<=constant('max_thumbs_per_row');$x++) { $p++; $query = "SELECT * FROM $commtable WHERE picID='{$pics[$p][picID]}'"; $res = mysql_query($query, $link) or die("Query failed: ".mysql_error()); $commc = mysql_num_rows($res); echo ""; if ($p >= $picc) break; } echo ""; if ($p >= $picc) break; } echo "

{$pics[$p][file_name]}
{$pics[$p][short_descr]}
"; echo $href; echo "

{$gal[$galid][descr]}
"; } if ($galreq=='pic') { //VIEW PICTURE //increase view count for the picture $query = "UPDATE $picstable SET times_viewed=times_viewed+1 WHERE picID='$galid'"; $result = mysql_query($query, $link) or die("Query failed: ".mysql_error()); //get picture info $query = "SELECT * FROM $picstable WHERE picID='$galid'"; $result = mysql_query($query, $link) or die("Query failed: ".mysql_error()); $pic = mysql_fetch_array($result, MYSQL_ASSOC); $gal_n = substr($galid,0,strpos($galid,'_')); //gallery number $pic_n = substr($galid,strpos($galid,'_')+1,strlen($galid)); //picture number $perpage = constant('max_thumbnail_rows') * constant('max_thumbs_per_row'); //check whether next/previous images are available $nn = $pic_n+1; $pn = $pic_n-1; $query = "SELECT * FROM $picstable WHERE galleryID=$gal_n"; $result = mysql_query($query, $link) or die("Query failed: ".mysql_error()); $c = 0; while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { $c++; $tmp[$c] = $line; if ($line[picID] == $galid) $nm = $c; //$nm - picture index in gallery } $isnext = ($nm < mysql_num_rows($result)); $nextp = $tmp[$nm+1]; $isprev = ($nm > 1); $prevp = $tmp[$nm-1]; $pn = floor(($nm-1)/$perpage); //get page number in gallery $offs = ($pn*$perpage)+1; //page offset //get gallery data $query = "SELECT * FROM $galstable WHERE ID=$gal_n"; $result = mysql_query($query, $link) or die("Query failed: ".mysql_error()); $gal = mysql_fetch_array($result, MYSQL_ASSOC); $href = '
'. ($isprev ? " :: " : ''). "$gal[name]". ($isnext ? " :: " : ''). '
'; //display the pic... echo "
$gal[name] > $pic[short_descr]
"; echo "$href
".($isnext ? "" : '')."
".($isnext ? "
" : '')."

$href"; if ($pic[long_descr]!='') echo "
Omschrijving: $pic[long_descr]
"; if ($commc > 0) { while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { echo "
".($line[email] == '' ? $line[name] : "$line[name]")." ".($line[www]==''?'':"[www]")." @ $line[date], $line[time]
"; } } ?> "; include("/var/www/www.lughnalynn.com/public_html/bottom.php"); ?>