Transparent

Transparent


\n"; $sql_search1 = "SELECT *, UNIX_TIMESTAMP(time) as time FROM photo WHERE title like '%$search%' ORDER BY time DESC"; $result_search1 = mysql_query($sql_search1); $row_search1 = mysql_fetch_array($result_search1); if ($row_search1 = mysql_fetch_array($result_search1)) { echo "Results in Photos:
\n"; echo "
    \n"; do { $pht_id = $row_search1["pht_id"]; $sql_thumbnail = "SELECT * FROM photo_thumbnail WHERE pht_id = $pht_id"; $result_thumbnail = mysql_query($sql_thumbnail); $row_thumbnail = mysql_fetch_array($result_thumbnail); echo "
  • Photo: " . $row_search1["title"] . "

    \n"; echo "" . $row_search1["title"] . "

    \n"; } while ($row_search1 = mysql_fetch_array($result_search1)); echo "
\n"; } else { echo "No results found in Photos.

\n"; } $sql_search2 = "SELECT * FROM photo_series WHERE serie like '%$search%'"; $result_search2 = mysql_query($sql_search2); $row_search2 = mysql_fetch_array($result_search2); if ($row_search2 = mysql_fetch_array($result_search2)) { echo "
Results in Series:
\n"; echo "\n"; } else { echo "No results found in Series.

\n"; } $sql_search3 = "SELECT * FROM photo_region WHERE description_ext like '%$search%' OR description like '%$search%'"; $result_search3 = mysql_query($sql_search3); $row_search3 = mysql_fetch_array($result_search3); if ($row_search3 = mysql_fetch_array($result_search3)) { echo "
Results in Regions:
\n"; echo "\n"; } else { echo "No results found in Regions.

\n"; } $sql_add_view = "UPDATE site_stats SET count = count + 1 WHERE st_stts_id = '1'"; $result_add_view2 = mysql_query($sql_add_view); echo "
\n"; echo "
New search:
\n"; echo "

\n"; echo "\n"; echo "\n"; echo "
\n"; } elseif (isset($submit) AND $action == "searchnonfree") { $i = 0; if ($cmr_tp_id != 0) { $sql_where = " WHERE cmr_tp_id = " . $cmr_tp_id; $i = 1; // Searched for $sql_camtype = "SELECT * FROM camera_type WHERE cmr_tp_id = '$cmr_tp_id'"; $result_camtype = mysql_query($sql_camtype); $row_camtype = mysql_fetch_array($result_camtype); $search_items .= "> Camera: " . $row_camtype["camera"] . "
"; } if ($lns_tp_id != 0) { if ($i == 1) { $sql_where .= " AND lns_tp_id = " . $lns_tp_id; } else { $sql_where .= " WHERE lns_tp_id = " . $lns_tp_id; } $i = 1; } if ($focal_length_01 != 0 AND $focal_length_02 != 0) { if ($i == 1) { $sql_where .= " AND focal_length BETWEEN " . $focal_length_01 . " AND " . $focal_length_02; } else { $sql_where .= " WHERE focal_length BETWEEN " . $focal_length_01 . " AND " . $focal_length_02; } $i = 1; } if ($focal_length_01 != 0 AND $focal_length_02 == "") { if ($i == 1) { $sql_where .= " AND focal_length = " . $focal_length_01; } else { $sql_where .= " WHERE focal_length = " . $focal_length_01; } $i = 1; } if ($aperture != 0) { $search_aperture = "f " . $aperture; if ($i == 1) { $sql_where .= " AND aperture = \"" . $search_aperture . "\""; } else { $sql_where .= " WHERE aperture = \"" . $search_aperture . "\""; } $i = 1; } if ($exposure != 0) { if ($exposure == "1/15 sec") { if ($i == 1) { $sql_where .= " AND exposure =< \"" . $exposure . "\" AND "; } else { $sql_where .= " WHERE exposure =< \"" . $exposure . "\""; } } else { if ($i == 1) { $sql_where .= " AND exposure = \"" . $exposure . "\""; } else { $sql_where .= " WHERE exposure = \"" . $exposure . "\""; } } $i = 1; } if ($iso != 0) { if ($i == 1) { $sql_where .= " AND iso = " . $iso; } else { $sql_where .= " WHERE iso = " . $iso; } $i = 1; } if ($time != 0) { if ($i == 1) { $sql_where .= " AND time like '" . $time . "'"; } else { $sql_where .= " WHERE time like '" . $time . "'"; } $i = 1; } if ($time_month != 0) { if ($i == 1) { $sql_where .= " AND MONTH(time) = '" . $time_month . "'"; } else { $sql_where .= " WHERE MONTH(time) = '" . $time_month . "'"; } $i = 1; } if ($pht_rg_prvnc_id != 0) { $sql_search_region = "SELECT * FROM photo_region WHERE pht_rg_prvnc_id = $pht_rg_prvnc_id"; $result_search_region = mysql_query($sql_search_region); if ($row_search_region = mysql_fetch_array($result_search_region)) { do { $pht_rg_id = $row_search_region["pht_rg_id"]; if ($i == 1) { $sql_where .= " OR pht_rg_id = '" . $pht_rg_id . "'"; } else { $sql_where .= " WHERE pht_rg_id = '" . $pht_rg_id . "'"; } $i = 1; } while ($row_search_region = mysql_fetch_array($result_search_region)); } } if ($pht_tg_id != 0) { foreach ($pht_tg_id as $tag_id) { $sql_search_tag = "SELECT * FROM photo_photo_tag WHERE pht_tg_id = $tag_id"; // echo $sql_search_tag . "

"; $result_search_tag = mysql_query($sql_search_tag); // Searched for $sql_tag = "SELECT * FROM photo_tag WHERE pht_tg_id = '$tag_id'"; $result_tag = mysql_query($sql_tag); $row_tag = mysql_fetch_array($result_tag); $search_items .= "> Tag: " . $row_tag["tag"] . "
"; if ($row_search_tag = mysql_fetch_array($result_search_tag)) { if ($i == 1) { $sql_where .= " AND ("; } do { // echo "last_tag_id: " . $last_tag_id . "
"; // echo "tag_id: " . $tag_id . "

"; $pht_id = $row_search_tag["pht_id"]; if ($i == 1) { $sql_where .= "pht_id = '" . $pht_id . "' OR "; } else { $sql_where .= " WHERE (pht_id = '" . $pht_id . "' OR "; } $i = 1; } while ($row_search_tag = mysql_fetch_array($result_search_tag)); $sql_where = substr($sql_where, 0, -4);; $sql_where .= ")"; } } } $sql_search1 = "SELECT *, UNIX_TIMESTAMP(time) as time FROM photo $sql_where ORDER BY time DESC LIMIT 0,100"; // echo $sql_search_region . "

"; // echo $sql_search1 . "

"; $result_search1 = mysql_query($sql_search1); if ($row_search1 = mysql_fetch_array($result_search1)) { echo "Result(s):

\n"; echo "Searched for:
" . $search_items . "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; do { $current_pht_id = $row_search1["pht_id"]; $sql_thumbnail = "SELECT * FROM photo_thumbnail WHERE pht_id = $current_pht_id"; // echo $sql_thumbnail; $result_thumbnail = mysql_query($sql_thumbnail); $row_thumbnail = mysql_fetch_array($result_thumbnail); $photo_month2 = strftime("%m", $row_search1["time"]); $photo_day = strftime("%d", $row_search1["time"]); $photo_year = strftime("%Y", $row_search1["time"]); $photo_hour = strftime("%H", $row_search1["time"]); $photo_minute = strftime("%M", $row_search1["time"]); $photo_second = strftime(" %SM", $row_search1["time"]); echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; } while ($row_search1 = mysql_fetch_array($result_search1)); echo "
ThumbnailDateFocal lengthApertureExposureISOViews
\n"; echo "

\n"; echo "
\n"; echo "" . $photo_day . "-" . $photo_month2 . "-" . $photo_year . "\n"; echo "\n"; echo "" . $row_search1["focal_length"] . "\n"; echo "\n"; echo "" . $row_search1["aperture"] . "\n"; echo "\n"; echo "" . $row_search1["exposure"] . "\n"; echo "\n"; echo "" . $row_search1["iso"] . "\n"; echo "\n"; echo "" . $row_search1["views"] . "\n"; echo "
\n"; } else { echo "No results found in Photos.

\n"; } $sql_add_view = "UPDATE site_stats SET count = count + 1 WHERE st_stts_id = '1'"; $result_add_view2 = mysql_query($sql_add_view); } else { echo "
\n"; echo "Search for:

\n"; echo "

\n"; echo "\n"; echo "\n"; echo "
\n"; echo "
\n"; echo "or\n"; echo "


\n"; echo "
\n"; echo "Search by:

\n"; // Camera query $sql_camtype = "SELECT * FROM camera_type ORDER BY camera ASC"; $result_camtype = mysql_query($sql_camtype); $row_camtype = mysql_fetch_array($result_camtype); echo "Camera used:
\n"; echo "

\n"; // Lens query $sql_lens = "SELECT * FROM lens_type ORDER BY lens ASC"; $result_lens = mysql_query($sql_lens); $row_lens = mysql_fetch_array($result_lens); echo "Lens used:
\n"; echo "

\n"; // Focal length echo "Focal length:
\n"; echo " mm (to\n"; echo " mm) \n"; echo "

\n"; // Aperture echo "Aperture used:
\n"; echo "

\n"; // Shutter speed echo "Shutter speed used:
\n"; echo "

\n"; // ISO echo "Iso used:
\n"; echo "

\n"; // Year echo "Year:
\n"; echo "

\n"; // Month echo "Month:
\n"; echo "

\n"; // Province echo "Province (only the Netherlands):
\n"; echo "

\n"; // Tags query $sql_tags = "SELECT * FROM photo_tag ORDER BY tag ASC"; $result_tags = mysql_query($sql_tags); $row_tags = mysql_fetch_array($result_tags); echo "Tags (use ctrl to select more than one):
\n"; echo "

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