\n"; echo "\n"; $server="localhost"; $user="calumsco_CAS01"; $pw="lotuselanK1!"; $cn = mysql_connect ($server,$user,$pw) or die('Database unavailable. Please try again later.'); mysql_select_db("csdb"); $gal = $_REQUEST['gal']; $pic = $_REQUEST['pic']; $sqlq = "select * from gal_pics where gpic_fname = '".$pic."' and gpic_gall_name = '".$gal."'"; $rs = mysql_query($sqlq); $NumRows = mysql_num_rows($rs); if ($NumRows != 0) { $k = mysql_fetch_row($rs); if ($k[3] != '') { $title = $k[3]; $def_title = 'n'; } else { $fp = fopen("galleries/galleries.txt","r"); while ($data = fgetcsv ($fp, 1000, ",")) { if ($data[0] == $gal) { $title = "Picture from Gallery: \"".$data[1]."\""; $copyyear = $data[4]; $copyname = $data[5]; } } $def_title = 'y'; } } else { $fp = fopen("galleries/galleries.txt","r"); while ($data = fgetcsv ($fp, 1000, ",")) { if ($data[0] == $gal) { $title = "Picture from Gallery: \"".$data[1]."\""; $copyyear = $data[4]; $copyname = $data[5]; } } $def_title = 'y'; } $fp = fopen("galleries/galleries.txt","r"); while ($data = fgetcsv ($fp, 1000, ",")) { if ($data[0] == $gal) { $copyyear = $data[4]; $copyname = $data[5]; } } echo "".$title."\n"; echo "\n"; ?> \n"; include("styles.php"); echo "\n"; echo "\n"; echo "\n"; echo "

[Home] [Back] [Search]

\n"; echo "

".$title."

\n"; echo "

 

\n"; echo "

This picture is Copyright (c) ".$copyname." ".$copyyear.", all rights reserved and may not be stored in a retrieval system, transmitted or reproduced in any way including but not limited to photocopy, photograph, magnetic or other record without the prior written consent of ".$copyname.".

\n"; echo "

"; echo "

Keywords: ".$k[2]."

\n"; echo "

 

\n"; echo "

Comments on this photo...

\n"; if ($NumRows != 0) { $sqlq = "select * from gal_comments where gcom_pic_id = ".$k[0]." order by gcom_tstamp"; $rs = mysql_query($sqlq); $NumRows = mysql_num_rows($rs); if ($NumRows != 0) { echo "

\n"; echo "\n"; echo ""; for ($i=1;$i<=$NumRows;$i++) { $k = mysql_fetch_row($rs); echo "\n"; echo "\n"; echo "\n"; } echo "
CommentBy...
".$k[3]."".$k[2]."
\n"; echo "

\n"; echo "

Add Comments

\n"; } else { echo "

Add Comments

\n"; } } else { echo "

Add Comments

\n"; } echo "

 

\n"; echo "

[Title][Keywords][Comments]

\n"; echo "\n"; echo "\n"; ?>