username,$req_user) == 0 || $session->isAdmin()) { } else if(strcmp($session->username,$req_user) == 0 || $session->isScreener()) { } else if(strcmp($session->username,$req_user) == 0 || $session->isMember()) { } else if($member_only_sees_thumbnails == 'yes') { echo(" $website_name : $page_title
"); include ("/home/users/web/b1176/pow.photoarchive/htdocs/includes/top_left.php"); echo(""); include ("/home/users/web/b1176/pow.photoarchive/htdocs/includes/top.php"); echo("


$members_only_text
"); exit(); } //************** CANT CONNECT TO DATABASE CODE ************** if (!(@mysql_select_db($db_name))) // If can't connect to database, error and exit(). { echo(" $website_name : $page_title
"); include ("/home/users/web/b1176/pow.photoarchive/htdocs/includes/top_left.php"); echo(""); include ("/home/users/web/b1176/pow.photoarchive/htdocs/includes/top.php"); echo("


The $website_name $page_title server appears to be down, please try again later, we apologise for this interruption.

"); exit(); } //************** SHUT DOWN WEBSITE CODE ************** if ($turn_website_on == 'no') // If can't connect to database, error and exit(). { echo(" $website_name : $page_title
"); include ("/home/users/web/b1176/pow.photoarchive/htdocs/includes/top_left.php"); echo(""); include ("/home/users/web/b1176/pow.photoarchive/htdocs/includes/top.php"); echo("


The $website_name $page_title server has been turned off to facilitate upgrade and maintenance work to be carried out.

The $website_name apologises for this interruption, service will be resumed ASAP.

"); exit(); } // ************************* Search script ************************* // Get the search variable from URL $var = @$_GET['q'] ; $query = trim($var); //trim whitespace from the stored variable $query = stripslashes($query); //strip slashes from variable if ($query != 'full_list') { $query = str_replace("_", " ", "$query"); } //echo $query; $var2 = @$_GET['fields'] ; $sort_var = @$_GET['sort'] ; $full_text_search = @$_GET['ft'] ; //**********Referrer********** $requested_page = "$PHP_SELF?q=$var&u=$var2&sort=$sort_var"; if ($query == '24hours' && $sort_var == 'most_popular') { $search_period = 1; $title = "Most Popular Pictures Of The Last 24 Hours"; $page_visit_link = "topday/"; } else if ($query == '7days' && $sort_var == 'most_popular') { $search_period = 7; $title = "Most Popular Pictures Of The Last 7 Days"; $page_visit_link = "top7days/"; } else if ($query == 'month' && $sort_var == 'most_popular') { $search_period = 30; $title = "Most Popular Pictures Of The Last Month"; $page_visit_link = "topmonth/"; } else if ($query == '6months' && $sort_var == 'most_popular') { $search_period = 180; $title = "Most Popular Picture Of The Last 6 Months"; $page_visit_link = "top6months/"; } else if ($query == 'year' && $sort_var == 'most_popular') { $search_period = 365; $title = "Most Popular Pictures Of The Last Year"; $page_visit_link = "topyear/"; } else if ($query == 'full_list' && $sort_var == 'most_popular') { $search_period = '%'; $title = "Most Popular Pictures Of All Time"; $page_visit_link = "topalltime/"; } else if ($query == 'edschoice') { $full_text_search = ''; $title = "Editor's Choice Pictures"; $page_visit_link = "edschoice/"; } else if ($query == '24hours') { $search_period = 1; $title = "Pictures Added In The Last 24 Hours"; $page_visit_link = "24hours/"; } else if ($query == '7days') { $search_period = 7; $title = "Pictures Added In The Last 7 Days"; $page_visit_link = "7days/"; } else if ($query == 'month') { $search_period = 30; $title = "Pictures Added In The Last Month"; $page_visit_link = "month/"; } else if ($query == '6months') { $search_period = 180; $title = "Pictures Added In The Last 6 Months"; $page_visit_link = "6months/"; } else if ($query == 'year') { $search_period = 365; $title = "Pictures Added In The Last Year"; $page_visit_link = "year/"; } else if ($query == 'full_list') { $search_period = '%'; $title = "Full List Of Pictures"; $page_visit_link = "full_list/"; } else if ($query == 'latestukhome') { $search_period = '%'; $title = "Latest UK Homebuilt Addition"; $page_visit_link = "latestukhome/"; } else if ($query == 'latestukptf') { $search_period = '%'; $title = "Latest UK Homebuilt Permit To Fly Addition"; $page_visit_link = "latestukptf/"; } else { $query = $query; $title = $query; } if ($var2 == 'picture_category') { $title = "$query Pictures"; } if ($var2 == '' || $var2 == 'all' || $var2 == 'email') { $query2 = ("type,type_search,generic,generic_search,reg,reg_search,cn,cn_search,PFATYPENO,PFATYPENO_search,PFASERNO,PFASERNO_search,PLANNUMBER,constructor,photographer,photographer_search,location,location_search,country,country_search,event,event_search,date,date_search,information"); } else if ($var2 == 'reg') { $query2 = ("reg,reg_search"); } else if ($var2 == 'model' || $var2 == 'type') { $query2 = ("type,type_search,generic,generic_search"); } else if ($var2 == 'photographer') { $query2 = ("photographer,photographer_search"); } else if ($var2 == 'location') { $query2 = ("location,location_search"); } else if ($var2 == 'country') { $query2 = ("country,country_search"); } else if ($var2 == 'laatypeno') { $query2 = ("PFATYPENO,PFATYPENO_search"); } else if ($var2 == 'laaserno') { $query2 = ("PFASERNO,PFASERNO_search"); } else if ($var2 == 'plannumber') { $query2 = ("PLANNUMBER,PLANNUMBER_Search"); } else if ($var2 == 'constructor') { $query2 = ("constructor"); } else if ($var2 == 'cn') { $query2 = ("cn,cn_search"); } else if ($var2 == 'event') { $query2 = ("event,event_search"); } else if ($var2 == 'date') { $query2 = ("date,date_search"); } else { $query2 = ("$var2"); } // ************************* End Search script ************************* $var_00 = $var; $var_00 = str_replace (" and ", " ", $var_00); $var11 = str_replace (".", " ", $var_00); $var22 = str_replace ("-", " ", $var11); $sort_var3 = str_replace ("+", " ", $var22); $var44 = preg_replace('/[^a-z 0-9]/i', '', $sort_var3); $var55 = ereg_replace(" +", " ", $var44); $ExplodeIt = explode(" ","$var55"); // Lets get a Count Of the total Values in the array. $Count = count($ExplodeIt); // Lets get a Count Of the total Values in the array. if ($Count == 0) { $ExplodeIt = $var; } // Create a Loop to Output the Information. Make sure $i starts off at 0, this is where the first value is returned for ($i=0; $i < $Count; $i++) { if (strlen($ExplodeIt[$i]) == 3) { $extra_chars_3 = "_"; $ExplodeIt[$i] = "+$ExplodeIt[$i]$extra_chars_3 "; } else if (strlen($ExplodeIt[$i]) == 2) { $extra_chars_2 = "__"; $ExplodeIt[$i] = "+$ExplodeIt[$i]$extra_chars_2 "; } else if (strlen($ExplodeIt[$i]) == 1) { $extra_chars_1 = "___"; $ExplodeIt[$i] = "+$ExplodeIt[$i]$extra_chars_1 "; } else { $ExplodeIt[$i] = "+$ExplodeIt[$i] "; } } // Output the Information. Remember, It is looping so as many items that are in the array will do this loop that many times. $query_exploded = "$ExplodeIt[0]$ExplodeIt[1]$ExplodeIt[2]$ExplodeIt[3]$ExplodeIt[4]$ExplodeIt[5]$ExplodeIt[6]$ExplodeIt[7]$ExplodeIt[8]$ExplodeIt[9]$ExplodeIt[10]$ExplodeIt[11]$ExplodeIt[12]$ExplodeIt[13]$ExplodeIt[14]$ExplodeIt[15]$ExplodeIt[16]$ExplodeIt[17]$ExplodeIt[18]$ExplodeIt[19]"; //echo $query_exploded; // ************************* Sort script ************************* if ($sort_var == '' || $sort_var == 'latest') { $sort_var = "latest"; $query3 = " ORDER BY added DESC"; } else if ($sort_var == 'oldest') { $query3 = " ORDER BY added ASC"; } else if ($sort_var == 'most_popular') { $query3 = (" ORDER BY views DESC"); } else if ($sort_var == 'photographer_a_z') { $query3 = (" ORDER BY photographer ASC"); } else if ($sort_var == 'photographer_z_a') { $query3 = (" ORDER BY photographer DESC"); } else if ($sort_var == 'location_a_z') { $query3 = (" ORDER BY location ASC"); } else if ($sort_var == 'location_z_a') { $query3 = (" ORDER BY location DESC"); } else if ($sort_var == 'country_a_z') { $query3 = (" ORDER BY country ASC"); } else if ($sort_var == 'country_z_a') { $query3 = (" ORDER BY country DESC"); } else if ($sort_var == 'reg_a_z') { $query3 = (" ORDER BY reg ASC"); } else if ($sort_var == 'reg_z_a') { $query3 = (" ORDER BY reg DESC"); } else if ($sort_var == 'model_a_z') { $query3 = (" ORDER BY type ASC"); } else if ($sort_var == 'model_z_a') { $query3 = (" ORDER BY model DESC"); } else if ($sort_var == 'cn_a_z') { $query3 = (" ORDER BY cn ASC"); } else if ($sort_var == 'cn_z_a') { $query3 = (" ORDER BY cn DESC"); } else if ($sort_var == 'laatypeno_0_9') { $query3 = (" ORDER BY PFATYPENO ASC"); } else if ($sort_var == 'laatypeno_9_0') { $query3 = (" ORDER BY PFATYPENO DESC"); } else if ($sort_var == 'laaserno_0_9') { $query3 = (" ORDER BY PFASERNO ASC"); } else if ($sort_var == 'laaserno_9_0') { $query3 = (" ORDER BY PFASERNO DESC"); } else if ($sort_var == 'plannumber_0_9') { $query3 = (" ORDER BY PFASERNO ASC"); } else if ($sort_var == 'plannumber_9_0') { $query3 = (" ORDER BY PFASERNO DESC"); } else if ($sort_var == 'constructor_a_z') { $query3 = (" ORDER BY constructor ASC"); } else if ($sort_var == 'constructor_z_a') { $query3 = (" ORDER BY constructor DESC"); } //Picture Limit************************************ $limit = @$_GET['limit'] ; //if ((!($limit)) || ($limit != 5) || ($limit != 10) || ($limit != 20) || ($limit != 50)) if ($limit == 5 || $limit == 10 || $limit == 20 || $limit == 50) { $limit = $limit; // Default results per-page. } else { $limit = $database_search_limit; // Default results per-page. } if (!($page)) { $page = 0; } // Default page value. // Pager Script. include("pagination/pager_class.php"); $pager = new pager; if ($full_text_search != 'yes' && ($query == '24hours' || $query == '7days' || $query == 'month' || $query == '6months' || $query == 'year')) { $pager->sql = "SELECT * FROM $pictures_table WHERE display_picture='yes' and TO_DAYS(NOW()) - TO_DAYS(added) <= $search_period $query3 $sort_query"; } else if ($full_text_search != 'yes' && ($query == 'edschoice')) { $pager->sql = "SELECT * FROM $pictures_table WHERE display_picture='yes' and edschoice like 'yes%' $query3 $sort_query"; } else if ($full_text_search != 'yes' && $query == 'full_list') { $pager->sql = "SELECT * FROM $pictures_table WHERE display_picture='yes' $query3 $sort_query"; } else if ($full_text_search != 'yes' && $var2 == 'picture_category') { $pager->sql = "SELECT * FROM $pictures_table WHERE display_picture='yes' and subtype2='$query' or display_picture='yes' and picture_category='$query' $query3 $sort_query"; } else if ($full_text_search != 'yes' && $var2 == 'location') { $pager->sql = "SELECT * FROM $pictures_table WHERE display_picture='yes' and location='$query' or display_picture='yes' and location_search='$query' $query3 $sort_query"; } else if ($full_text_search != 'yes' && $var2 == 'country') { $pager->sql = "SELECT * FROM $pictures_table WHERE display_picture='yes' and country='$query' or display_picture='yes' and country_search='$query' $query3 $sort_query"; } else if ($full_text_search != 'yes' && $var2 == 'model') { $pager->sql = "SELECT * FROM $pictures_table WHERE display_picture='yes' and type='$query' or display_picture='yes' and type_search='$query' $query3 $sort_query"; } else if ($full_text_search != 'yes' && $var2 == 'laaserno') { $pager->sql = "SELECT * FROM $pictures_table WHERE display_picture='yes' and PFASERNO='$query' or display_picture='yes' and PFASERNO_search='$query' $query3 $sort_query"; } else if ($full_text_search != 'yes' && $var2 == 'laatypeno') { $pager->sql = "SELECT * FROM $pictures_table WHERE display_picture='yes' and PFATYPENO='$query' or display_picture='yes' and PFATYPENO_search='$query' $query3 $sort_query"; } else if ($full_text_search != 'yes' && $var2 == 'plannumber') { $pager->sql = "SELECT * FROM $pictures_table WHERE display_picture='yes' and PLANNUMBER='$query' or display_picture='yes' and PLANNUMBER_search='$query' $query3 $sort_query"; } else if ($full_text_search != 'yes' && $var2 == 'constructor') { $pager->sql = "SELECT * FROM $pictures_table WHERE display_picture='yes' and constructor='$query' or display_picture='yes' and constructor_search='$query' $query3 $sort_query"; } else if ($full_text_search != 'yes' && $query == 'latestukhome') { //$pager->sql = "SELECT * FROM $pictures_table WHERE display_picture='yes' and PFASERNO != '-' or display_picture='yes' and PFASERNO != ' ' or display_picture='yes' and PFASERNO != '' or display_picture='yes' and PFASERNO != 'unknown' $query3 $sort_query"; $pager->sql = "SELECT * FROM $pictures_table WHERE display_picture='yes' and subtype2 = 'UK Homebuilt' or display_picture='yes' and picture_category = 'UK Homebuilt' or display_picture='yes' and subtype2 = 'UK Homebuilt under construction' or display_picture='yes' and picture_category = 'UK Homebuilt under construction' $query3 $sort_query"; } else if ($full_text_search != 'yes' && $query == 'latestukptf') { //$pager->sql = "SELECT * FROM $pictures_table WHERE display_picture='yes' and PFATYPENO != '-' and PFASERNO = '' or display_picture='yes' and PFATYPENO != '-' and PFASERNO = '-' or display_picture='yes' and PFATYPENO != ' ' and PFASERNO = '-' or display_picture='yes' and PFATYPENO != '' and PFASERNO = '-' or display_picture='yes' and PFATYPENO != 'Unknown' and PFASERNO = '-' or display_picture='yes' and subtype2 = 'Non homebuilt on Permit to Fly' or display_picture='yes' and picture_category = 'Non homebuilt on Permit to Fly' $query3 $sort_query"; $pager->sql = "SELECT * FROM $pictures_table WHERE display_picture='yes' and subtype2 = 'Non homebuilt on Permit to Fly' or display_picture='yes' and picture_category = 'Non homebuilt on Permit to Fly' $query3 $sort_query"; } else if ($full_text_search != 'yes') { $pager->sql = "SELECT * FROM $pictures_table WHERE display_picture='yes' and $var2 = '$query' $query3 $sort_query"; } else if ($full_text_search == 'yes') { $pager->sql = "SELECT * FROM $pictures_table WHERE display_picture='yes' and MATCH($query2) AGAINST ('$query_exploded' IN BOOLEAN MODE) $query3 $sort_query"; } $result = $pager->get_page_result(); // result set $numrows = $pager->get_page_num_rows(); // number of records in result set $nav_links = $pager->navigation(" ", "currentStyle"); // the navigation links (define a CSS class selector for the current link) $nav_info = $pager->page_info("to"); // information about the number of records on page ("to" is the text between the number) $simple_nav_links = $pager->back_forward_link(false); // the navigation with only the back and forward links, use true to use images $total_recs = $pager->get_total_rows(); // the total number of records $page_info = $pager->page_info(); $curr_pages = $pager->navigation(); if ($numrows == 0){ echo(" $website_name : $page_title
"); include ("/home/users/web/b1176/pow.photoarchive/htdocs/includes/top_left.php"); echo(""); include ("/home/users/web/b1176/pow.photoarchive/htdocs/includes/top.php"); echo("


No results were found for your search.


Click here to search for pictures. ]

"); // bah, modify the "Not Found" error for your needs. exit(); } //**********Page Title Script********** $location=@mysql_result($result,$i,"location"); $type=@mysql_result($result,$i,"type"); if ($var2 == 'location' && $full_text_search != 'yes') { $title = $location; } if ($var2 == 'model' && $full_text_search != 'yes') { $title = $type; } ?> <? echo "$website_name : $title"; ?>
 


Displaying
 

Home   -   New Search
 

Home   -   New Search