title; $title_font = $row->title_font; $page_description = $row->description; $keywords = $row->keywords; $bgcolor = $row->bgcolor; $sidebgcolor = $row->sidebgcolor; $topbanner = $row->topbanner; $copyright_name = $row->copyright_name; $content_font = $row->content_font; $image_path = $row->image_path; } if(empty($bgcolor)) $bgcolor = 'ffffff'; if(empty($sidebgcolor)) $sidebgcolor = 'ccccff'; if($action == 'REMOVE'){ // validate user and password $go = "no"; $query_string = "SELECT customer_id FROM customer WHERE customer_id = '$customer_id' AND password = '$password' "; $result = mysql_db_query("$dbName",$query_string); while($row = mysql_fetch_object($result)) { $go = "yes"; } if($go == 'yes'){ $query = "DELETE FROM diygallery WHERE customer_id = '$customer_id' AND unique_id = '$unique_id' "; $result = mysql_db_query("$dbName",$query); $action_message = "Image Removed from Collection Image is still uploaded however
"; } else { $action_message = "Error: Username or Password not recognized. Image NOT modified
"; } } // end action is REMOVE if($action == 'MODIFY'){ // validate user and password $go = "no"; $query_string = "SELECT customer_id FROM customer WHERE customer_id = '$customer_id' AND password = '$password' "; $result = mysql_db_query("$dbName",$query_string); while($row = mysql_fetch_object($result)) { $go = "yes"; } if($go == 'yes'){ if(!empty($collection_alt)) $collection = $collection_alt; if(empty($collection)) $collection = date("m-d-Y"); $caption = str_replace('\'', '', $caption); $caption = str_replace('\"', '', $caption); $collection = str_replace('\'', '', $collection); $collection = str_replace('\"', '', $collection); $collection = str_replace('\&', ' ', $collection); $technical_details = str_replace('\'', '', $technical_details); $technical_details = str_replace('\"', '', $technical_details); $technical_details = str_replace('\&', ' ', $technical_details); $photographer = str_replace('\'', '', $photographer); $photographer = str_replace('\"', '', $photographer); $photographer = str_replace('\&', ' ', $photographer); $description = str_replace('\'', '', $description); $description = str_replace('\"', '', $description); $description = str_replace('\&', ' ', $description); //$ip = getenv("REMOTE_HOST"); // should creation and ip be updated? used as last modified $query = "UPDATE diygallery SET collection = '$collection', caption = '$caption', description = '$description', technical_details = '$technical_details', photographer = '$photographer', date = '$date' WHERE customer_id = '$customer_id' AND unique_id = '$unique_id' "; $result = mysql_db_query("$dbName",$query); $action_message = "Image modified
"; } else { $action_message = "Error: Username or Password not recognized. Image NOT modified
"; } } // end action is MODIFY PRINT " ".$title." "; /* for now the topbanner is just used as a main image on the homepage if($topbanner != ''){ PRINT " "; } */ PRINT "
"; if($customer_id != '' AND $password != ''){ PRINT " (".$customer_id." Logged In) Manage Gallery Logout"; if(empty($action_message)) $action_message = $customer_id." you can modify picture details below."; } else { PRINT "Login / Manage Gallery"; } PRINT "
".ucfirst($customer_id)." IMAGE GALLERY

Available Collections

"; $query_string = "SELECT distinct collection, count(collection) as count FROM diygallery WHERE customer_id = '$customer_id' AND collection != '' GROUP BY collection"; $result = mysql_db_query("$dbName",$query_string); while($row = mysql_fetch_object($result)) { $collection_space = str_replace(' ', '+', $row->collection); if($customer_id != '' AND $password != ''){ PRINT "

  • ".$row->collection." (".$row->count.")

    "; } else { PRINT "

  • ".$row->collection." (".$row->count.")

    "; } } PRINT "

    "; if($customer_id != '' AND $password != ''){ PRINT "".$customer_id." Homepage

    "; PRINT "ALL GALLERIES"; } else { PRINT "".$customer_id." Homepage

    "; PRINT "ALL GALLERIES"; } PRINT "

  •  ".$title."
    "; if($customer_id != '' AND $password != ''){ $query_string = "SELECT collection FROM diygallery WHERE customer_id = '$customer_id' ORDER BY collection"; $result = mysql_db_query("$dbName",$query_string); while($row = mysql_fetch_object($result)) { $collection_count[$row->collection]++; $collections_exist = "yes"; } if(!empty($collections_exist)){ $select_collection = "
    OR
    "; } } PRINT "

    ".$action_message." "; $query_string = "SELECT * FROM diygallery WHERE customer_id = '$customer_id' AND image = '$image' "; $result = mysql_db_query("$dbName",$query_string); while($row = mysql_fetch_object($result)) { if($customer_id != '' AND $password != ''){ PRINT " "; } else { PRINT " "; } } $base_dir = '/usr/www/users/autobv3k/lab/'; $testimage = $base_dir.$image_path."/".$image; $full_size = filesize($testimage)."K"; $full_dim = getimagesize ($testimage); PRINT "
    Caption
    Event / Collection ".$select_collection."
    Description
    Technical Details
    Photographer
    Date Taken
    IMPORTANT! You MUST click the Modify button
    or your changes will not take effect.
    Click to eliminate this picture
    Caption".$row->caption."
    Event / Collection".$row->collection."
    Description".$row->description."
    Technical Details".$row->technical_details."
    Photographer".$row->photographer."
    Date Taken".$row->date."
    ".$image."
    ".$full_size." ".$full_dim[3]."
    "; $copyright_year = date("Y"); PRINT "

    Copyright © ".$copyright_year." ".$copyright_name."
    All Rights Reserved
    "; ?>