set_file('menu1file',$menu1file); $tpl->set_var('relative_path', $relative_path); $menu1file=$tpl->process('out','menu1file',0,1); $tpl->set_file('menu2file','menu_newestmodels.html'); $tpl->set_var('relative_path', $relative_path); $tpl->set_var('latestmembers',latestmembers_bit()); $tpl->set_var('most_viewed',mostviewed_bit()); $menu2file=$tpl->process('out','menu2file',0,1); $tpl->set_file('menu3file','menu_mostviewed.html'); $tpl->set_var('relative_path', $relative_path); $tpl->set_var('latestmembers',latestmembers_bit()); $tpl->set_var('most_viewed',mostviewed_bit()); $menu3file=$tpl->process('out','menu3file',0,1); if (get_site_option('use_ratings')) { $tpl->set_file('menu4file','menu_toprated.html'); $tpl->set_var('relative_path', $relative_path); $menu4file=$tpl->process('out','menu4file',0,1); } $tpl->set_file('menu5file','menu_lookupmodel.html'); $tpl->set_var('relative_path', $relative_path); $menu5file=$tpl->process('out','menu5file',0,1); if(!isset($myuser_id) || empty ($myuser_id)){ $tpl->set_file('menu_home_join','menu_home_join.html'); $menu_home_join=$tpl->process('out','menu_home_join',0,1);} else{$menu_home_join="";} if(!isset($myuser_id) || empty ($myuser_id)){ $tpl->set_file('menu_login','menu_login.html'); $menu_login=$tpl->process('out','menu_login',0,1);} else{$tpl->set_file('menu_login','menu_logout.html'); $menu_login=$tpl->process('out','menu_login',0,1);} $tpl->set_file('leftcontent','browse_left.html'); $tpl->set_var('relative_path', $relative_path); $tpl->set_var('menu_home_join',$menu_home_join); $tpl->set_var('menu1file',$menu1file); $tpl->set_var('menu2file',$menu2file); $tpl->set_var('menu3file',$menu3file); if (get_site_option('use_ratings')) { $tpl->set_var('menu4file',$menu4file);} $tpl->set_var('menu5file',$menu5file); $tpl->set_var('menulogin',$menu_login); $tpl->set_var('most_viewed',mostviewed_bit()); $left_content=$tpl->process('out','leftcontent',0,1); // start search processing content $topass=array(); $message=""; $_SESSION['foundmembers']=''; if (isset($_REQUEST['searchtype']) && !empty($_REQUEST['searchtype'])) { $searchtype=addslashes_mq($_REQUEST['searchtype'],true); $from="users a"; $where="a.status="._STATUSACTIVE_; if ($searchtype=='name') { $access_level=$access_matrix['namesearch'][0]; check_login_member(); if (isset($_REQUEST['screenname'])) { $name=addslashes_mq($_REQUEST['screenname']); } else { $error=true; $message="No search string specified
"; $topass['message']=$message; redirect2page("basicsearch.php",$topass); } if (strlen($name)<3) { $error=true; $message='You are not allowed to search for names less than 3 chars long'; $topass['message']=$message; redirect2page("basicsearch.php",$topass); } if (strstr($name,'?') || strstr($name,'\'') || strstr($name,'"')) { $error=true; $message='Invalid characters in search string. Please use only letters, digits and the percent char (%).'; $topass['message']=$message; redirect2page("basicsearch.php",$topass); } if (isset($name) && !empty($name) &&!$error) { $where.=" AND a.name LIKE '%$name%'"; } } elseif ($searchtype=='quicker') { $access_level=$access_matrix['quicksearch'][0]; check_login_member(); $gender=addslashes_mq($_REQUEST['gender']); if (($gender!=_ANY_) && ($gender!=_NDISCLOSED_)) { $where.=" AND (a.gender='$gender' OR a.gender='"._ANY_."' OR a.gender='"._NDISCLOSED_."')"; } $agemin=addslashes_mq($_REQUEST['agemin']); $agemax=addslashes_mq($_REQUEST['agemax']); $where.=" AND a.birthdate between (now()-INTERVAL $agemax YEAR) AND (now()-INTERVAL $agemin YEAR)"; $ethnicity=addslashes_mq($_REQUEST['ethnicity']); if (($ethnicity!=_ANY_) && ($ethnicity!=_NDISCLOSED_)) { $where.=" AND a.ethnic<>'' AND ((MOD(a.ethnic>>$ethnicity,2)=1) OR a.ethnic='"._NDISCLOSED_."')"; } if(isset($_REQUEST['profession']) && (!empty($_REQUEST['profession']))){ $profession=addslashes_mq($_REQUEST['profession']);} else { $profession = 1;} if (($profession!=_ANY_) && ($profession!=_NDISCLOSED_)) { $where.=" AND a.profession='$profession'"; } if (isset($_REQUEST['have_photo']) && !empty($_REQUEST['have_photo'])) { $where.=" AND a.user_id=b.fk_user_id"; $from.=",user_album2 b"; } }elseif ($searchtype=='state') { $access_level=$access_matrix['basicsearch'][0]; check_login_member(); $state=addslashes_mq($_REQUEST['whichstate']); $where.=" AND a.us_state='$state' AND a.profession='1'"; }elseif ($searchtype=='browsegender') { $access_level=$access_matrix['browse'][0]; check_login_member(); $gender=addslashes_mq($_REQUEST['browsegender']); $where.=" AND a.gender='$gender' AND a.profession='1'"; }elseif ($searchtype=='photographer') { $access_level=$access_matrix['browse'][0]; check_login_member(); $where.=" AND a.profession='2'"; }elseif ($searchtype=='bymodels') { $access_level=$access_matrix['browse'][0]; check_login_member(); $where.=" AND a.profession='1'"; } elseif ($searchtype=='advanced') { $access_level=$access_matrix['advancedsearch'][0]; check_login_member(); global $relative_path; $topass['$backto']="Advanced Search"; $gender=addslashes_mq($_REQUEST['gender']); if (($gender!=_ANY_) && ($gender!=_NDISCLOSED_)) { $where.=" AND a.gender='$gender'"; } $country=addslashes_mq($_REQUEST['country']); if (($country!=_ANY_) && ($country!=_NDISCLOSED_)) { $where.=" AND a.country='$country'"; } $us_state=addslashes_mq($_REQUEST['us_state']); if (($country==1) && ($us_state!=_ANY_) && ($us_state!=_NDISCLOSED_)) { $where.=" AND a.us_state='$us_state'"; } if (isset($_REQUEST['city']) && !empty($_REQUEST['city'])) { $city=addslashes_mq($_REQUEST['city'],true); $where.=" AND a.city='$city'"; } $agemin=addslashes_mq($_REQUEST['agemin']); $agemax=addslashes_mq($_REQUEST['agemax']); $where.=" AND a.birthdate>=(now()-INTERVAL $agemax YEAR) AND a.birthdate<=(now()-INTERVAL $agemin YEAR)"; $heightmin=addslashes_mq($_REQUEST['heightmin']); $heightmax=addslashes_mq($_REQUEST['heightmax']); if ($heightmin!=_ANY_) { $where.=" AND a.height>='$heightmin' AND a.height<='$heightmax'"; } $weightmin=addslashes_mq($_REQUEST['weightmin']); $weightmax=addslashes_mq($_REQUEST['weightmax']); if ($weightmin!=_ANY_) { $where.=" AND a.weight>='$weightmin' AND a.weight<='$weightmax'"; } $ethnic=addslashes_mq($_REQUEST['ethnicity']); if (($ethnic!=_ANY_) && ($ethnic!=_NDISCLOSED_)) { $where.=" AND a.ethnic='$ethnic'"; } $profession=addslashes_mq($_REQUEST['profession']); if (($profession!=_ANY_) && ($profession!=_NDISCLOSED_)) { $where.=" AND a.profession='$profession'"; } $body=addslashes_mq($_REQUEST['body']); if (($body!=_ANY_) && ($body!=_NDISCLOSED_)) { $where.=" AND a.bodytype='$body'"; } $haircolor=addslashes_mq($_REQUEST['haircolor']); if (($haircolor!=_ANY_) && ($haircolor!=_NDISCLOSED_)) { $where.=" AND a.haircolor='$haircolor'"; } $hairlength=addslashes_mq($_REQUEST['hairlength']); if (($hairlength!=_ANY_) && ($hairlength!=_NDISCLOSED_)) { $where.=" AND a.hairlength='$hairlength'"; } $hairtype=addslashes_mq($_REQUEST['hairtype']); if (($hairtype!=_ANY_) && ($hairtype!=_NDISCLOSED_)) { $where.=" AND a.hairtype='$hairtype'"; } $hairpiece=addslashes_mq($_REQUEST['hairpiece']); if (($hairpiece!=_ANY_) && ($hairpiece!=_NDISCLOSED_)) { $where.=" AND a.hairtype='$hairpiece'"; } $eyecolor=addslashes_mq($_REQUEST['eyecolor']); if (($eyecolor!=_ANY_) && ($eyecolor!=_NDISCLOSED_)) { $where.=" AND a.eyecolor='$eyecolor'"; } $eyeshape=addslashes_mq($_REQUEST['eyeshape']); if (($eyeshape!=_ANY_) && ($eyeshape!=_NDISCLOSED_)) { $where.=" AND a.eyeshape='$eyeshape'"; } $eyebrows=addslashes_mq($_REQUEST['eyebrows']); if (($eyebrows!=_ANY_) && ($eyebrows!=_NDISCLOSED_)) { $where.=" AND a.eyebrows='$eyebrows'"; } $eyelashes=addslashes_mq($_REQUEST['eyelashes']); if (($eyelashes!=_ANY_) && ($eyelashes!=_NDISCLOSED_)) { $where.=" AND a.eyelashes='$eyelashes'"; } $eyewear=addslashes_mq($_REQUEST['eyewear']); if (($eyewear!=_ANY_) && ($eyewear!=_NDISCLOSED_)) { $where.=" AND a.eyewear='$eyewear'"; } $faceshape=addslashes_mq($_REQUEST['faceshape']); if (($faceshape!=_ANY_) && ($faceshape!=_NDISCLOSED_)) { $where.=" AND a.faceshape='$faceshape'"; } $waist=addslashes_mq($_REQUEST['waist']); if (($waist!=_ANY_) && ($waist!=_NDISCLOSED_)) { $where.=" AND a.waist='$waist'"; } $chest=addslashes_mq($_REQUEST['chest']); if (($chest!=_ANY_) && ($chest!=_NDISCLOSED_)) { $where.=" AND a.chest='$chest'"; } $dress_shirt=addslashes_mq($_REQUEST['dress_shirt']); if (($dress_shirt!=_ANY_) && ($dress_shirt!=_NDISCLOSED_)) { $where.=" AND a.dress_shirt='$dress_shirt'"; } $hips_inseam=addslashes_mq($_REQUEST['hips_inseam']); if (($hips_inseam!=_ANY_) && ($hips_inseam!=_NDISCLOSED_)) { $where.=" AND a.hips_inseam='$hips_inseam'"; } $shoes=addslashes_mq($_REQUEST['shoes']); if (($shoes!=_ANY_) && ($shoes!=_NDISCLOSED_)) { $where.=" AND a.shoes='$shoes'"; } if (isset($_REQUEST['have_photo']) && !empty($_REQUEST['have_photo'])) { $where.=" AND a.user_id=b.fk_user_id"; $from.=",user_album2 b"; } } if (isset($_REQUEST['have_photo']) && !empty($_REQUEST['have_photo'])) { $where.=" GROUP BY a.user_id"; } // start processing the query $offset=(isset($_REQUEST['offset'])) ? (addslashes_mq($_REQUEST['offset'])) : ($offset=0); $results=(isset($_REQUEST['results']) && !empty($_REQUEST['results'])) ? addslashes_mq($_REQUEST['results']) : ($results=_RESULTS_); $guestlimit=0; $users=array(); if ((!isset($_SESSION['user_id']) || empty($_SESSION['user_id']))) { $guestlimit=_GUESTLIMIT_; if (!empty($guestlimit)) { $query="SELECT a.user_id FROM $from WHERE $where ORDER BY a.last_visit DESC"; //die($query); if (!($res=@mysql_query($query))) {trigger_error(mysql_error(),E_USER_ERROR);} for ($i=0;$iset_file('middlecontent','member_list.html'); $foundmembers=array(); if (!empty($totalrows)) { $foundmembers=userlist_tpl_array($users); $tpl->set_var('relative_path',$relative_path); $tpl->set_var('imagesurl',_THUMBSURL_); $tpl->set_var('pager1',create_pager($from,$where,$offset,$results)); $tpl->set_var('pager2',create_pager($from,$where,$offset,$results)); } else { $tpl->set_var('no_members_found',"No portfolio found"); } $blinkstable=""; $table_cols=5; $blinkstable=""; $i=1; unset($accepted_genders[_ANY_],$accepted_genders[_NDISCLOSED_]); while (list($k,$v)=each($accepted_genders)) { if (($i%$table_cols)==1) {$blinkstable.="\n";} $blinkstable.="\t\n"; if ($i%$table_cols==0) {$blinkstable.="\n";} $i++; } $rest=($i-1)%$table_cols; if ($rest!=0) { $colspan=$table_cols-$rest; $blinkstable.="\t \n\n"; } $blinkstable.="
\n"; $blinkstable.="Browse $v portfolios"; $blinkstable.="\t
\n"; $tpl->set_loop('foundmembers',$foundmembers); $tpl->set_var('totalrows',$totalrows); $tpl->set_var('list_title',"Search Results"); $tpl->set_var('blinkstable',$blinkstable); $tpl->set_var('message',$message); $middle_content=$tpl->process('out','middlecontent',1); $title="Search Results"; include('block_main_frame.php'); } ?>