logged_with_bugmenot Posted June 13, 2006 Share Posted June 13, 2006 well if you see here [a href=\"http://www.eznom.net/s3/urbanmedia/urbanspace\" target=\"_blank\"]http://www.eznom.net/s3/urbanmedia/urbanspace[/a]I get a lot of erors and if anybody understands php, i would appreciate it if you would tell me whats wrong.here is the "functions.php" file which seems to be causing the problem[color=red]<?/**/$conn_id;$sql_res;$sql_res2;$sql_query;$HTTP_REFERER=$_SERVER["HTTP_REFERER"];$REQUEST_METHOD=$_SERVER["REQUEST_METHOD"];function sql_connect(){global $conn_id,$sql_host,$sql_user,$sql_pass,$sql_db;$conn_id=mysql_connect($sql_host,$sql_user,$sql_pass);mysql_select_db($sql_db);}function sql_execute($sql_query,$wtr){global $conn_id;$sql_res=mysql_query($sql_query,$conn_id);if($wtr=='get'){if(mysql_num_rows($sql_res)){return mysql_fetch_object($sql_res);}else {return '';}}elseif($wtr=='num'){return mysql_num_rows($sql_res);}elseif($wtr=='res'){return $sql_res;}}function sql_rows($id,$table){global $conn_id;$query="select $id from $table";$result=mysql_query($query,$conn_id);$number=mysql_num_rows($result);return $number;}function sql_close(){global $conn_id;mysql_close($conn_id);}function h_banners() {global $cookie_url,$main_url; $sql="select * from banners where b_blk='N' and b_typ='H' and b_exp='N'"; $res=mysql_query($sql); $dis=array(); $dis_id=array(); $num=mysql_num_rows($res); if(mysql_num_rows($res)) { while($row=mysql_fetch_object($res)) { $tmp=explode(".",$row->b_img); $tmp_count=count($tmp); $ext=strtolower($tmp[$tmp_count-1]); if($ext=="swf") { $img_s="<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='420' height='60'> <param name='movie' value='".$main_url."/".$row->b_img."'> <param name='quality' value='high'> <embed src='".$main_url."/".$row->b_img."' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='420' height='60'></embed></object>"; } else $img_s="<img src='".$main_url."/".$row->b_img."' border='0' width='420' height='60' alt='".stripslashes($row->b_desc)."' ismap>"; $dis[]="<A href='".$main_url."/banners/index.php?url=".$row->b_url."&seid=".$row->b_id."&sess=set' target='_blank'>".$img_s."</a>"; $dis_id[]=$row->b_id; } $tak=rand(0,$num); $sql_query="select * from banners where b_id='$dis_id[$tak]'"; $num=sql_execute($sql_query,'num'); if($num!=0) { $bann=sql_execute($sql_query,'get'); $d_f=date("d",$bann->b_f_day); $m_f=date("m",$bann->b_f_day); $y_f=date("Y",$bann->b_f_day); $d_t=date("d",$bann->b_t_day); $m_t=date("m",$bann->b_t_day); $y_t=date("Y",$bann->b_t_day);// $f_day=mktime(0,0,0,$m_f,$d_f,$y_f);// $t_day=mktime(0,0,0,$m_t,$d_t,$y_t); $f_day=mktime(0,0,0,$m_f,$d_f,$y_f); $t_day=mktime(0,0,0,$m_t,$d_t,$y_t); $today=mktime(0,0,0,date("m"),date("d"),date("Y")); if(($bann->b_dur=="D") and ($today>$t_day)) { delete_banner($dis_id[$tak]); } elseif($bann->b_dur=="C" and ($bann->b_ncl<=$bann->b_clks)) { delete_banner($dis_id[$tak]); } elseif($bann->b_dur=="I" and ($bann->b_noi<=$bann->b_see)) { delete_banner($dis_id[$tak]); } echo $dis[$tak]; for($i=0; $i<=$ip_co; $i++) { mysql_query("update banners set b_see=b_see+1 where b_id='$dis_id[$tak]'"); } } }}function f_banners() {global $cookie_url,$main_url; $sql="select * from banners where b_blk='N' and b_typ='F' and b_exp='N'"; $res=mysql_query($sql); $dis=array(); $dis_id=array(); $num=mysql_num_rows($res); if(mysql_num_rows($res)) { while($row=mysql_fetch_object($res)) { $tmp=explode(".",$row->b_img); $tmp_count=count($tmp); $ext=strtolower($tmp[$tmp_count-1]); if($ext=="swf") { $img_s="<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='720' height='60'> <param name='movie' value='".$main_url."/".$row->b_img."'> <param name='quality' value='high'> <param name='wmode' value='opaque'> <param name='loop' value='false'> <embed src='".$main_url."/".$row->b_img."' loop='false' wmode='opaque' quality='high' swLiveConnect='false' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='720' height='60'></embed></object>"; } else $img_s="<img src='".$main_url."/".$row->b_img."' border='0' width='720' height='60' alt='".stripslashes($row->b_desc)."' ismap>"; $dis[]="<A href='".$main_url."/banners/index.php?url=".$row->b_url."&seid=".$row->b_id."&sess=set' target='_blank'>".$img_s."</a>"; $dis_id[]=$row->b_id; } $tak=rand(0,$num); $sql_query="select * from banners where b_id='$dis_id[$tak]'"; $num=sql_execute($sql_query,'num'); if($num!=0) { $bann=sql_execute($sql_query,'get'); $d_f=date("d",$bann->b_f_day); $m_f=date("m",$bann->b_f_day); $y_f=date("Y",$bann->b_f_day); $d_t=date("d",$bann->b_t_day); $m_t=date("m",$bann->b_t_day); $y_t=date("Y",$bann->b_t_day);// $f_day=mktime(0,0,0,$m_f,$d_f,$y_f);// $t_day=mktime(0,0,0,$m_t,$d_t,$y_t);// $today=mktime(0,0,0,date("m"),date("d"),date("Y")); $f_day=mktime(0,0,0,$m_f,$d_f,$y_f); $t_day=mktime(0,0,0,$m_t,$d_t,$y_t); $today=mktime(0,0,0,date("m"),date("d"),date("Y")); if(($bann->b_dur=="D") and ($today>$t_day)) { delete_banner($dis_id[$tak]); } elseif($bann->b_dur=="C" and ($bann->b_ncl<=$bann->b_clks)) { delete_banner($dis_id[$tak]); } elseif($bann->b_dur=="I" and ($bann->b_noi<=$bann->b_see)) { delete_banner($dis_id[$tak]); } echo $dis[$tak]; for($i=0; $i<=$ip_co; $i++) { mysql_query("update banners set b_see=b_see+1 where b_id='$dis_id[$tak]'"); } } }}function mailing($to,$name,$from,$subj,$body) {global $SERVER_NAME;$subj=nl2br($subj);$body=nl2br($body);$recipient = $to;$headers = "From: " . "$name" . "<" . "$from" . ">\n";$headers .= "X-Sender: <" . "$to" . ">\n";$headers .= "Return-Path: <" . "$to" . ">\n";$headers .= "Error-To: <" . "$to" . ">\n";$headers .= "Content-Type: text/html\n";mail("$recipient","$subj","$body","$headers");}function form_get($value){global $HTTP_POST_VARS,$HTTP_GET_VARS,$_SERVER;$REQUEST_METHOD=$_SERVER["REQUEST_METHOD"];if($REQUEST_METHOD=='POST'){$get_value=$HTTP_POST_VARS["$value"];}elseif($REQUEST_METHOD=='GET'){$get_value=$HTTP_GET_VARS["$value"];}return $get_value;}function cookie_get($name){global $HTTP_COOKIE_VARS;return $HTTP_COOKIE_VARS[$name];}//require file, depending on modefunction check($mode){global $cookie_url,$main_url; if(isset($mode)){ $document=$mode.".php"; } else{ $document="main.php"; } require("$document");}//require admin file, depending on modefunction ad_check($mode){ if(isset($mode)){ $document=$mode.".php"; } else{ $document="main.php"; } require("admin/$document");}//require calendar file, depending on modefunction cal_check($mode){ if(isset($mode)){ $document=$mode.".php"; } else{ $document="calendar.php"; } require("calendar/$document");}//printing java code for listing categoriesfunction listing_cats_java($mod){$sql_query="select * from categories";$res=sql_execute($sql_query,'res');while($cat=mysql_fetch_object($res)){if($mod==1){echo "; listCategory.setDefaultOption('$cat->cat_id','$cat->cat_id'); listCategory.addOptions('$cat->cat_id','Select Subcategory','$cat->cat_id'";}elseif($mod==2){$nex=$cat->cat_id+1;echo "listmessage_categoryId.setDefaultOption('$cat->cat_id','$nex');listmessage_categoryId.addOptions('$cat->cat_id'";} $sql_query="select * from sub_categories where cat_id='$cat->cat_id'"; $res2=sql_execute($sql_query,'res'); while($sub=mysql_fetch_object($res2)){ echo ",'$sub->name','$sub->sub_cat_id'"; }//while echo ");";}//while}//function// Returnds the curent page number on a multipage displayfunction getpage(){ if(!isset($_GET['page'])) $page=1; else $page=$_GET['page']; return $page;}function getpages(){ if(!isset($_GET['page'])) $page=1; else $page=$_GET['page']; return $page;}//Displays the page numbersfunction show_page_nos($sql,$url,$lines,$page){ $tmp =explode("LIMIT",$sql); if(count($tmp)<1) $tmp =explode("limit",$sql); $pgsql =$tmp[0]; include 'show_pagenos.php';}//Formats The Datefunction format_date($date,$time=0){ $tmp =explode(" ",$date); $date2 =explode("-",$tmp[0]); $date =$date2[1]."-".$date2[2]."-".$date2[0]; if($time) return $date." ".$tmp[1]; else return $date;}//just printing listing cats listfunction listing_cats($sel){$sql_query="select * from categories";$res=sql_execute($sql_query,'res');while($cat=mysql_fetch_object($res)){ if($cat->cat_id=="$sel"){ echo "<option selected value='$cat->cat_id'>$cat->name"; } else{ echo "<option value='$cat->cat_id'>$cat->name"; }}//while}//function//just printing events cats listfunction events_cats($sel){$sql_query="select * from event_cat";$res=sql_execute($sql_query,'res');while($cat=mysql_fetch_object($res)){ if($cat->cat_id=="$sel"){ echo "<option selected value='$cat->event_id'>".stripslashes($cat->event_nam)."</option>"; } else{ echo "<option value='$cat->event_id'>".stripslashes($cat->event_nam)."</option>"; }}//while}//function//admin headerfunction show_ad_header($adsess){$mode=form_get("mode");$act=form_get("act");?><html><head><title>Site Administration</title><link href="styles/style.css" type="text/css" rel="stylesheet"><? if(($mode='listings_manager')&&($act=='edit')) {?><script language="Javascript" src="DynamicOptionList.js"></script><script LANGUAGE="JavaScript">var listCategory = new DynamicOptionList("Category","RootCategory");<?listing_cats_java(1);?> listCategory.addOptions('','Select Subcategory',''); listCategory.setDefaultOption('','');function init() { var theform = document.forms["searchListing"]; listCategory.init(theform); }</SCRIPT><body marginwidth="5" bgcolor="#ffffff" leftmargin ="5" topmargin="5" marginheight="5" onLoad="listCategory.init(document.forms['searchListing']);"><? } ?></head><body topmargin=2 leftmargin=2><table width="740"><tr><td width=100%><? require('templates/ad_header.php'); ?></td><tr><td width=100%><?}//function//showing headerfunction show_header(){?><html><head><title>Demo Site</title><link href="styles/style.css" type="text/css" rel="stylesheet"><?$mode=form_get("mode");$act=form_get("act");if($mode=="user"){ ?> <script language="JavaScript"> <!-- function formsubmit(type){ document.profile.redir.value=type; document.profile.submit(); } --> </script> <?}elseif(($mode=='listing')&&($act=='create')){?><script language="Javascript" src="DynamicOptionList.js"></script><script LANGUAGE="JavaScript">var listmessage_categoryId = new DynamicOptionList("message_categoryId","message_rootCategoryId");<? listing_cats_java(2); ?> listmessage_categoryId.addOptions('8000','computer','8001','creative','8002','erotic','8003','event','8004','household','8005','garden / labor / haul','8006','lessons','8007','looking for','8008','skilled trade','8009','sm biz ads','8010','therapeutic','8011');function init() { var theform = document.forms["manageListing"]; listmessage_categoryId.init(theform); }</SCRIPT><body marginwidth="5" bgcolor="#ffffff" leftmargin ="5" topmargin="5" marginheight="5" onLoad="listmessage_categoryId.init(document.forms['manageListing']);"><?}elseif((($mode=='listing')&&($act!='create')&&($act!='show')&&($act!='feedback'))||(($mode=='search')&&($act=='listing'))){?><script language="Javascript" src="DynamicOptionList.js"></script><script LANGUAGE="JavaScript">var listCategory = new DynamicOptionList("Category","RootCategory");<? listing_cats_java(1);?> listCategory.addOptions('','Select Subcategory',''); listCategory.setDefaultOption('','');function init() { var theform = document.forms["searchListing"]; listCategory.init(theform); }</SCRIPT><body marginwidth="5" bgcolor="#ffffff" leftmargin ="5" topmargin="5" marginheight="5" onLoad="listCategory.init(document.forms['searchListing']);"><?}//elseif?></head><body topmargin=2 leftmargin=2><table width="740"><tr><td width=100%><? require('templates/header.php'); ?></td><tr><td width=100%><?}//showing footerfunction show_footer(){?></td><tr><td width=100%><? require("templates/footer.php"); ?></td></body></html><?sql_close();}//redirectfunction show_screen($loc){Header("Location: $loc");exit;}//error reportsfunction error_screen($errid){$sql_query="select * from errors where err_id='$errid'";$err=sql_execute($sql_query,'get');$error_line=$err->error;$detailes_line=$err->detailes;show_header();require('error.php');show_footer();exit();}//complete pagesfunction complete_screen($comid){$sql_query="select * from complete where cmp_id='$comid'";$cmp=sql_execute($sql_query,'get');$header_line=$cmp->complete;$detailes_line=$cmp->detailes;show_header();require('complete.php');show_footer();exit();}//checkin user login infofunction login_test($mem_id,$mem_pass){$sql_query="select password,ban from members where mem_id='$mem_id'";$num=sql_execute($sql_query,'num');$mem=sql_execute($sql_query,'get');//if password incorrectif(($num==0)||($mem_pass!=$mem->password)){error_screen(0);}//if user bannedelseif($mem->ban=='y'){error_screen(12);}//updating db (setting user in online mode)$now=time();$was=$now-60*20;$sql_query="update members set current='$now' where mem_id='$mem_id'";sql_execute($sql_query,'');$sql_query="update members set online='off' where current < $was";sql_execute($sql_query,'');}//checkin admin session keyfunction admin_test($session){$time=time();$interval=$time-3600*24;$sql_query="delete from admin where started < $interval";sql_execute($sql_query,'');$sql_query="select * from admin where sess_id='$session'";$num=sql_execute($sql_query,'num');if($num==0){error_screen(24);}}//sending messages, depending on message idfunction messages($to,$mid,$data){global $system_mail,$site_name;if($mid==7){$subject=$data[0];$body=$data[1];$name=$data[2];$from_mail=$data[3];}//ifelse{$sql_query="select * from messages where mes_id='$mid'";$mes=sql_execute($sql_query,'get');$subject=$mes->subject;$body=$mes->body;//replacing templates$body=ereg_replace("\|email\|","$data[0]",$body);$body=ereg_replace("\|password\|","$data[1]",$body);$body=ereg_replace("\|link\|","$data",$body);$body=ereg_replace("\|subject\|","$data[0]",$body);$body=ereg_replace("\|message\|","$data[1]",$body);$body=ereg_replace("\|user\|","$data[0]",$body);$subject=ereg_replace("\|email\|","$data[0]",$subject);$subject=ereg_replace("\|password\|","$data[1]",$subject);$subject=ereg_replace("\|link\|","$data",$subject);$subject=ereg_replace("\|subject\|","$data[0]",$subject);$subject=ereg_replace("\|message\|","$data[1]",$subject);$subject=ereg_replace("\|user\|","$data[0]",$subject);$name=$site_name;$from_mail=$system_mail;}//else$subject=stripslashes($subject);$body=stripslashes($body);$sql_query="select notifications from members where email='$to'";$num=sql_execute($sql_query,'num');if($num>0){ $mem=sql_execute($sql_query,'get'); if($mem->notifications=='1'){ $stat=1; } else { $stat=0; }}else { $stat=1;}if(($stat==1)||($mid<4)){mailing($to,$name,$from_mail,$subject,$body);}}//deleting empty values of arrayfunction if_empty($data){$flag=0;if($data==''){ return '';}//ifelse{$result=array();foreach($data as $val){ if($val!=''){ $flag=1; array_push($result,$val); }//if}//foreachif($flag==0){ return '';}//elseifelse { return $result;}//else}//else}//function//showing country drop-down listfunction country_drop(){?> <OPTION VALUE="United States">United States</OPTION> <OPTION VALUE="Afghanistan">Afghanistan</OPTION> <OPTION VALUE="Albania">Albania</OPTION> <OPTION VALUE="Algeria">Algeria</OPTION> <OPTION VALUE="American Samoa">American Samoa</OPTION> <OPTION VALUE="Andorra">Andorra</OPTION> <OPTION VALUE="Angola">Angola</OPTION> <OPTION VALUE="Anguilla">Anguilla</OPTION> <OPTION VALUE="Antartica">Antartica</OPTION> <OPTION VALUE="Antigua and Barbuda">Antigua and Barbuda</OPTION> <OPTION VALUE="Argentina">Argentina</OPTION> <OPTION VALUE="Armenia">Armenia</OPTION> <OPTION VALUE="Aruba">Aruba</OPTION> <OPTION VALUE="Ascension Island">Ascension Island</OPTION> <OPTION VALUE="Australia">Australia</OPTION> <OPTION VALUE="Austria">Austria</OPTION> <OPTION VALUE="Azerbaijan">Azerbaijan</OPTION> <OPTION VALUE="Bahamas">Bahamas</OPTION> <OPTION VALUE="Bahrain">Bahrain</OPTION> <OPTION VALUE="Bangladesh">Bangladesh</OPTION> <OPTION VALUE="Barbados">Barbados</OPTION> <OPTION VALUE="Belarus">Belarus</OPTION> <OPTION VALUE="Belgium">Belgium</OPTION> <OPTION VALUE="Belize">Belize</OPTION> <OPTION VALUE="Benin">Benin</OPTION> <OPTION VALUE="Bermuda">Bermuda</OPTION> <OPTION VALUE="Bhutan">Bhutan</OPTION> <OPTION VALUE="Bolivia">Bolivia</OPTION> <OPTION VALUE="Botswana">Botswana</OPTION> <OPTION VALUE="Bouvet Island">Bouvet Island</OPTION> <OPTION VALUE="Brazil">Brazil</OPTION> <OPTION VALUE="Brunei Darussalam">Brunei Darussalam</OPTION> <OPTION VALUE="Bulgaria">Bulgaria</OPTION> <OPTION VALUE="Burkina Faso">Burkina Faso</OPTION> <OPTION VALUE="Burundi">Burundi</OPTION> <OPTION VALUE="Cambodia">Cambodia</OPTION> <OPTION VALUE="Cameroon">Cameroon</OPTION> <OPTION VALUE="Canada">Canada</OPTION> <OPTION VALUE="Cape Verde Islands">Cape Verde Islands</OPTION> <OPTION VALUE="Cayman Islands">Cayman Islands</OPTION> <OPTION VALUE="Chad">Chad</OPTION> <OPTION VALUE="Chile">Chile</OPTION> <OPTION VALUE="China">China</OPTION> <OPTION VALUE="Christmas Island">Christmas Island</OPTION> <OPTION VALUE="Colombia">Colombia</OPTION> <OPTION VALUE="Comoros">Comoros</OPTION> <OPTION VALUE="Congo, Republic of">Congo, Republic of</OPTION> <OPTION VALUE="Cook Islands">Cook Islands</OPTION> <OPTION VALUE="Costa Rica">Costa Rica</OPTION> <OPTION VALUE="Cote d Ivoire">Cote d'Ivoire</OPTION> <OPTION VALUE="Croatia/Hrvatska">Croatia/Hrvatska</OPTION> <OPTION VALUE="Cyprus">Cyprus</OPTION> <OPTION VALUE="Czech Republic">Czech Republic</OPTION> <OPTION VALUE="Denmark">Denmark</OPTION> <OPTION VALUE="Djibouti">Djibouti</OPTION> <OPTION VALUE="Dominica">Dominica</OPTION> <OPTION VALUE="Dominican Republic">Dominican Republic</OPTION> <OPTION VALUE="East Timor">East Timor</OPTION> <OPTION VALUE="Ecuador">Ecuador</OPTION> <OPTION VALUE="Egypt">Egypt</OPTION> <OPTION VALUE="El Salvador">El Salvador</OPTION> <OPTION VALUE="Equatorial Guinea">Equatorial Guinea</OPTION> <OPTION VALUE="Eritrea">Eritrea</OPTION> <OPTION VALUE="Estonia">Estonia</OPTION> <OPTION VALUE="Ethiopia">Ethiopia</OPTION> <OPTION VALUE="Falkland Islands">Falkland Islands</OPTION> <OPTION VALUE="Faroe Islands">Faroe Islands</OPTION> <OPTION VALUE="Fiji">Fiji</OPTION> <OPTION VALUE="Finland">Finland</OPTION> <OPTION VALUE="France">France</OPTION> <OPTION VALUE="French Guiana">French Guiana</OPTION> <OPTION VALUE="French Polynesia">French Polynesia</OPTION> <OPTION VALUE="Gabon">Gabon</OPTION> <OPTION VALUE="Gambia">Gambia</OPTION> <OPTION VALUE="Georgia">Georgia</OPTION> <OPTION VALUE="Germany">Germany</OPTION> <OPTION VALUE="Ghana">Ghana</OPTION> <OPTION VALUE="Gibraltar">Gibraltar</OPTION> <OPTION VALUE="Greece">Greece</OPTION> <OPTION VALUE="Greenland">Greenland</OPTION> <OPTION VALUE="Grenada">Grenada</OPTION> <OPTION VALUE="Guadeloupe">Guadeloupe</OPTION> <OPTION VALUE="Guam">Guam</OPTION> <OPTION VALUE="Guatemala">Guatemala</OPTION> <OPTION VALUE="Guernsey">Guernsey</OPTION> <OPTION VALUE="Guinea">Guinea</OPTION> <OPTION VALUE="Guinea-Bissau">Guinea-Bissau</OPTION> <OPTION VALUE="Guyana">Guyana</OPTION> <OPTION VALUE="Haiti">Haiti</OPTION> <OPTION VALUE="Honduras">Honduras</OPTION> <OPTION VALUE="Hong Kong">Hong Kong</OPTION> <OPTION VALUE="Hungary">Hungary</OPTION> <OPTION VALUE="Iceland">Iceland</OPTION> <OPTION VALUE="India">India</OPTION> <OPTION VALUE="Indonesia">Indonesia</OPTION> <OPTION VALUE="Iran">Iran</OPTION> <OPTION VALUE="Ireland">Ireland</OPTION> <OPTION VALUE="Isle of Man">Isle of Man</OPTION> <OPTION VALUE="Israel">Israel</OPTION> <OPTION VALUE="Italy">Italy</OPTION> <OPTION VALUE="Jamaica">Jamaica</OPTION> <OPTION VALUE="Japan">Japan</OPTION> <OPTION VALUE="Jersey">Jersey</OPTION> <OPTION VALUE="Jordan">Jordan</OPTION> <OPTION VALUE="Kazakhstan">Kazakhstan</OPTION> <OPTION VALUE="Kenya">Kenya</OPTION> <OPTION VALUE="Kiribati">Kiribati</OPTION> <OPTION VALUE="Korea, Republic of">Korea, Republic of</OPTION> <OPTION VALUE="Kuwait">Kuwait</OPTION> <OPTION VALUE="Kyrgyzstan">Kyrgyzstan</OPTION> <OPTION VALUE="Laos">Laos</OPTION> <OPTION VALUE="Latvia">Latvia</OPTION> <OPTION VALUE="Lebanon">Lebanon</OPTION> <OPTION VALUE="Lesotho">Lesotho</OPTION> <OPTION VALUE="Liberia">Liberia</OPTION> <OPTION VALUE="Libya">Libya</OPTION> <OPTION VALUE="Liechtenstein">Liechtenstein</OPTION> <OPTION VALUE="Lithuania">Lithuania</OPTION> <OPTION VALUE="Luxembourg">Luxembourg</OPTION> <OPTION VALUE="Macau">Macau</OPTION> <OPTION VALUE="Macedonia">Macedonia</OPTION> <OPTION VALUE="Madagascar">Madagascar</OPTION> <OPTION VALUE="Malawi">Malawi</OPTION> <OPTION VALUE="Malaysia">Malaysia</OPTION> <OPTION VALUE="Maldives">Maldives</OPTION> <OPTION VALUE="Mali">Mali</OPTION> <OPTION VALUE="Malta">Malta</OPTION> <OPTION VALUE="Marshall Islands">Marshall Islands</OPTION> <OPTION VALUE="Martinique">Martinique</OPTION> <OPTION VALUE="Mauritania">Mauritania</OPTION> <OPTION VALUE="Mauritius">Mauritius</OPTION> <OPTION VALUE="Mayotte Island">Mayotte Island</OPTION> <OPTION VALUE="Mexico">Mexico</OPTION> <OPTION VALUE="Micronesia">Micronesia</OPTION> <OPTION VALUE="Moldova">Moldova</OPTION> <OPTION VALUE="Monaco">Monaco</OPTION> <OPTION VALUE="Mongolia">Mongolia</OPTION> <OPTION VALUE="Montserrat">Montserrat</OPTION> <OPTION VALUE="Morocco">Morocco</OPTION> <OPTION VALUE="Mozambique">Mozambique</OPTION> <OPTION VALUE="Myanmar">Myanmar</OPTION> <OPTION VALUE="Namibia">Namibia</OPTION> <OPTION VALUE="Nauru">Nauru</OPTION> <OPTION VALUE="Nepal">Nepal</OPTION> <OPTION VALUE="Netherlands">Netherlands</OPTION> <OPTION VALUE="Netherlands Antilles">Netherlands Antilles</OPTION> <OPTION VALUE="New Caledonia">New Caledonia</OPTION> <OPTION VALUE="New Zealand">New Zealand</OPTION> <OPTION VALUE="Nicaragua">Nicaragua</OPTION> <OPTION VALUE="Niger">Niger</OPTION> <OPTION VALUE="Nigeria">Nigeria</OPTION> <OPTION VALUE="Niue">Niue</OPTION> <OPTION VALUE="Norfolk Island">Norfolk Island</OPTION> <OPTION VALUE="Norway">Norway</OPTION> <OPTION VALUE="Oman">Oman</OPTION> <OPTION VALUE="Pakistan">Pakistan</OPTION> <OPTION VALUE="Palau">Palau</OPTION> <OPTION VALUE="Panama">Panama</OPTION> <OPTION VALUE="Papua New Guinea">Papua New Guinea</OPTION> <OPTION VALUE="Paraguay">Paraguay</OPTION> <OPTION VALUE="Peru">Peru</OPTION> <OPTION VALUE="Philippines">Philippines</OPTION> <OPTION VALUE="Pitcairn Island">Pitcairn Island</OPTION> <OPTION VALUE="Poland">Poland</OPTION> <OPTION VALUE="Portugal">Portugal</OPTION> <OPTION VALUE="Puerto Rico">Puerto Rico</OPTION> <OPTION VALUE="Qatar">Qatar</OPTION> <OPTION VALUE="Reunion Island">Reunion Island</OPTION> <OPTION VALUE="Romania">Romania</OPTION> <OPTION VALUE="Russian Federation">Russian Federation</OPTION> <OPTION VALUE="Rwanda">Rwanda</OPTION> <OPTION VALUE="Saint Helena">Saint Helena</OPTION> <OPTION VALUE="Saint Lucia">Saint Lucia</OPTION> <OPTION VALUE="San Marino">San Marino</OPTION> <OPTION VALUE="Saudi Arabia">Saudi Arabia</OPTION> <OPTION VALUE="Senegal">Senegal</OPTION> <OPTION VALUE="Seychelles">Seychelles</OPTION> <OPTION VALUE="Sierra Leone">Sierra Leone</OPTION> <OPTION VALUE="Singapore">Singapore</OPTION> <OPTION VALUE="Slovak Republic">Slovak Republic</OPTION> <OPTION VALUE="Slovenia">Slovenia</OPTION> <OPTION VALUE="Solomon Islands">Solomon Islands</OPTION> <OPTION VALUE="Somalia">Somalia</OPTION> <OPTION VALUE="South Africa">South Africa</OPTION> <OPTION VALUE="South Georgia">South Georgia</OPTION> <OPTION VALUE="Spain">Spain</OPTION> <OPTION VALUE="Sri Lanka">Sri Lanka</OPTION> <OPTION VALUE="Suriname">Suriname</OPTION> <OPTION VALUE="Svalbard">Svalbard</OPTION> <OPTION VALUE="Swaziland">Swaziland</OPTION> <OPTION VALUE="Sweden">Sweden</OPTION> <OPTION VALUE="Switzerland">Switzerland</OPTION> <OPTION VALUE="Syria">Syria</OPTION> <OPTION VALUE="Taiwan">Taiwan</OPTION> <OPTION VALUE="Tajikistan">Tajikistan</OPTION> <OPTION VALUE="Tanzania">Tanzania</OPTION> <OPTION VALUE="Thailand">Thailand</OPTION> <OPTION VALUE="Togo">Togo</OPTION> <OPTION VALUE="Tokelau">Tokelau</OPTION> <OPTION VALUE="Tonga Islands">Tonga Islands</OPTION> <OPTION VALUE="Tunisia">Tunisia</OPTION> <OPTION VALUE="Turkey">Turkey</OPTION> <OPTION VALUE="Turkmenistan">Turkmenistan</OPTION> <OPTION VALUE="Tuvalu">Tuvalu</OPTION> <OPTION VALUE="Uganda">Uganda</OPTION> <OPTION VALUE="Ukraine">Ukraine</OPTION> <OPTION VALUE="United Kingdom">United Kingdom</OPTION> <OPTION VALUE="Uruguay">Uruguay</OPTION> <OPTION VALUE="Uzbekistan">Uzbekistan</OPTION> <OPTION VALUE="Vanuatu">Vanuatu</OPTION> <OPTION VALUE="Vatican City">Vatican City</OPTION> <OPTION VALUE="Venezuela">Venezuela</OPTION> <OPTION VALUE="Vietnam">Vietnam</OPTION> <OPTION VALUE="Western Sahara">Western Sahara</OPTION> <OPTION VALUE="Western Samoa">Western Samoa</OPTION> <OPTION VALUE="Yemen">Yemen</OPTION> <OPTION VALUE="Yugoslavia">Yugoslavia</OPTION> <OPTION VALUE="Zambia">Zambia</OPTION> <OPTION VALUE="Zimbabwe">Zimbabwe</OPTION><?}//days drop-down listfunction day_drop($sel){ for($i=1;$i<=31;$i++){ if($i==$sel){ echo "<option selected value='$i'>$i\n"; } else { echo "<option value='$i'>$i\n"; } }}//months drop-down listfunction month_drop($sel){ $month=array(1=>"Jan",2=>"Feb",3=>"Mar",4=>"Apr",5=>"May",6=>"Jun", 7=>"Jul",8=>"Aug",9=>"Sep",10=>"Oct",11=>"Nov",12=>"Dec"); for($i=1;$i<=12;$i++){ if($i==$sel){ echo "<option selected value='$i'>$month[$i]\n"; } else { echo "<option value='$i'>$month[$i]\n"; } }}//years drop-down listfunction year_drop($sel){if($sel=='now'){ $year=2010; $start=date("Y"); for($i=$start;$i<=$year;$i++){ echo "<option value='$i'>$i\n"; }//for}//ifelse{ $year=date("Y"); for($i=$year-50;$i<=$year;$i++){ if($i==$sel){ echo "<option selected value='$i'>$i\n"; } else { echo "<option value='$i'>$i\n"; } }}//else}//showing if user is online,offline or anonymousfunction show_online($m_id){$sql_query="select fname,lname,online from members where mem_id='$m_id'";$mem=sql_execute($sql_query,'get');if($mem->online=='on'){echo "<img src='images/icon_online.gif' alt='this user is online now'>";echo "  <span class='namelink-online'><a href='index.php?mode=people_card&p_id=$m_id'>$mem->fname</a></span>";}else{echo "<img src='images/icon_offline.gif' alt='this user is offline now'>";echo "  <span class='namelink-offline'><a href='index.php?mode=people_card&p_id=$m_id'>$mem->fname</a></span>";}}//showing user's namefunction show_memnam($m_id){$sql_query="select fname,lname from members where mem_id='$m_id'";$mem=sql_execute($sql_query,'get');echo "<span class='namelink-online'><a href='index.php?mode=people_card&p_id=$m_id'>$mem->fname</a></span>";}//showing user main photofunction show_photo($m_id){if($m_id=='anonim'){echo "<img src='images/unknownUser_th.jpg' border=0>";}//ifelse {$sql_query="select photo_thumb from members where mem_id='$m_id'";$mem=sql_execute($sql_query,'get');if($mem->photo_thumb=='no'){ $mem->photo_thumb="images/unknownUser_th.jpg";}echo "<a href='index.php?mode=people_card&p_id=$m_id'><img src='$mem->photo_thumb' border=0></a>";}}//calculating number of new messages in inboxfunction mes_num($m_id){$sql_query="select mes_id from messages_system where mem_id='$m_id'and folder='inbox' and type='message' and new='new'";$num=sql_execute($sql_query,'num');return $num;}//calculating number or creating array of user's friends, depending on degreefunction count_network($m_id,$deg,$mod){ //degree 1 if($deg==1){ $sql_query="select frd_id from network where mem_id='$m_id'"; $num=sql_execute($sql_query,'num'); if($num==0){ $friend=''; }//if else { $res=sql_execute($sql_query,'res'); $friend=array(); while($fr=mysql_fetch_object($res)){ array_push($friend,$fr->frd_id); }//while $friend=del_dup($friend); }//else }//deg1 //degree 2 elseif($deg==2){ $fr=array(); $fr=count_network($m_id,"1","ar"); if($fr==''){ $friend=''; $num=0; }//if else { $friend=array(); foreach($fr as $fid){ $sql_query="select frd_id from network where mem_id='$fid' and frd_id!='$m_id'"; $res=sql_execute($sql_query,'res'); while($fri=mysql_fetch_object($res)){ array_push($friend,$fri->frd_id); }//while }//foreach $friend=del_dup($friend); $friend=array_diff($friend,$fr); $num=count($friend); }//else }//deg2 //degree 3 elseif($deg==3){ $fr=array(); $fr1=count_network($m_id,"1","ar"); $fr=count_network($m_id,"2","ar"); if($fr==''){ $friend=''; $num=0; }//if else { $friend=array(); foreach($fr as $fid){ $sql_query="select frd_id from network where mem_id='$fid' and frd_id!='$m_id'"; $res=sql_execute($sql_query,'res'); while($fri=mysql_fetch_object($res)){ array_push($friend,$fri->frd_id); }//while }//foreach $friend=del_dup($friend); $friend=array_diff($friend,$fr); $friend=array_diff($friend,$fr1); $num=count($friend); }//else }//deg3 //degree 4 elseif($deg==4){ $fr=array(); $fr1=count_network($m_id,"1","ar"); $fr2=count_network($m_id,"2","ar"); $fr=count_network($m_id,"3","ar"); if($fr==''){ $friend=''; $num=0; }//if else { $friend=array(); foreach($fr as $fid){ $sql_query="select frd_id from network where mem_id='$fid' and frd_id!='$m_id'"; $res=sql_execute($sql_query,'res'); while($fri=mysql_fetch_object($res)){ array_push($friend,$fri->frd_id); }//while }//foreach $friend=del_dup($friend); $friend=array_diff($friend,$fr); $friend=array_diff($friend,$fr1); $friend=array_diff($friend,$fr2); $num=count($friend); }//else }//deg4 //degree all elseif($deg=='all'){ $num=count_network($m_id,"1","num")+count_network($m_id,"2","num")+ count_network($m_id,"3","num")+count_network($m_id,"4","num"); $friend=array_merge(count_network($m_id,"1","ar"),count_network($m_id,"2","ar"), count_network($m_id,"3","ar"),count_network($m_id,"4","ar")); }//degall //////////////////////////////////// //format output if ($mod=='num'){ return $num; } elseif ($mod=='ar'){ return $friend; } ////////////////////////////////////}//deleting duplicates from arrayfunction del_dup($data){$result=array();$result=array_unique($data);return $result;}//showing random tipfunction show_tip(){$num=sql_rows("tip_id","tips");$tid=rand(0,$num);$sql_query="select * from tips where tip_id='$tid'";$tip=sql_execute($sql_query,'get');echo "<span class='bold'>$tip->tip_header</span></br>$tip->tip";}//creating array of lister friendsfunction lister_degree($mem_id,$deg){$result=array();for($i=$deg;$i>=1;$i--){ $network=count_network($mem_id,"$i","ar"); $result=array_merge($result,$network);}$result=if_empty($result);if($result==''){ $result[]='';}return $result;}//function//showing listings, depending on modefunction show_listings($mode,$m_id,$page){$now=time();$sql_query="delete from listings where added+live<$now";sql_execute($sql_query,'');if($mode!='tribe'){//setting ignore list$sql_query="select ignore_list from members where mem_id='$m_id'";$mem1=sql_execute($sql_query,'get');$ignore=split("\|",$mem1->ignore_list);$ignore=if_empty($ignore);//setting filter$sql_query="select filter,zip from members where mem_id='$m_id'";$mem=sql_execute($sql_query,'get');$items=split("\|",$mem->filter);$distance=$items[0];$zip=$items[1];if($zip==''){ $zip=$mem->zip;}$degree=$items[2];//applying distance filter$zone=array();if($distance=='any'){$zonear='no result';}else{$zonear=inradius($zip,$distance);}if(($zonear=='not found')||($zonear=='no result')){ $sql_query="select lst_id from listings"; $res=sql_execute($sql_query,'res'); while($z=mysql_fetch_object($res)){ array_push($zone,$z->lst_id); }}else { $sql_query="select lst_id from listings where "; foreach($zonear as $zp){ $sql_query.="zip='$zp' or "; } $sql_query=rtrim($sql_query,' or '); $res=sql_execute($sql_query,'res'); while($z=mysql_fetch_object($res)){ array_push($zone,$z->lst_id); }}//applying degree filter$friends=array();$filter=array();if($degree=='any'){ $sql_query="select mem_id from members"; $res=sql_execute($sql_query,'res'); while($fr=mysql_fetch_object($res)){ array_push($friends,$fr->mem_id); }}else {for($i=$degree;$i>=1;$i--){$friends=array_merge($friends,count_network($m_id,$i,"ar"));}//for}//else$filter=$friends;}//if$zone=if_empty($zone);$filter=if_empty($filter);//recent listings if($mode=='recent'){ if(($filter!='')&&($zone!='')) { $sql_query="select * from listings where ("; if($filter!=''){ foreach($filter as $id){ $sql_query.="mem_id='$id' or "; }//foreach $sql_query=rtrim($sql_query,' or '); }//if if($zone!=''){ $sql_query.=") and ("; foreach($zone as $zon){ $sql_query.="lst_id='$zon' or "; }//foreach $sql_query=rtrim($sql_query,' or '); $sql_query.=")"; }//if if($ignore!=''){ //deleting from sql-query ignored users foreach($ignore as $ign){ $sql_query.=" and mem_id!='$ign'"; }//foreach }//if if($degree!='any'){ $sql_query.=" and anonim!='y'"; }//if $sql_query.=" and stat='a' order by added desc"; $res=sql_execute($sql_query,'res'); if(mysql_num_rows($res)){ $i=0; while($lst=mysql_fetch_object($res)){ if($lst->show_deg!='trb'){ if(($lst->show_deg!='any')&&($lst->mem_id!=$m_id)){ $lister_friends=lister_degree($lst->mem_id,$lst->show_deg); } else{ $lister_friends[]=$m_id; } //checkin if user is a friend of lister if((in_array($m_id,$lister_friends))||($lst->anonim=='y')){ $date=date("m/d/Y",$lst->added); $sql_query="select name from categories where cat_id='$lst->cat_id'"; $cat=sql_execute($sql_query,'get'); $sql_query="select name from sub_categories where sub_cat_id='$lst->sub_cat_id'"; $sub=sql_execute($sql_query,'get'); echo "<table>"; echo "<tr><td> <table class='table-photo'> <tr><td align=center width=70 height=75>"; if(($lst->privacy=='y')||($lst->anonim=='y')){ echo "<img src='images/unknownUser_th.jpg' border=0>"; }//if else { show_photo($lst->mem_id); }//else echo "</td> <tr><td align=center>"; if($lst->anonim!='y'){ show_online($lst->mem_id); } else{ echo "<small><small>anonymous</small></small>"; } echo "</td> </table> </td>"; echo "<td> <table width=100% class='body'> <tr><td class='form-comment'><a href='index.php?mode=listing&act=show&lst_id=$lst->lst_id'> <img src='images/icon_listing.gif' border=0> $lst->title</a></td> <tr><td>$date - $cat->name - $sub->name</td> <tr><td>$lst->descr_part <span class='action'><a href='index.php?mode=listing&act=show&lst_id=$lst->lst_id'>more</a></span></td> <tr><td>"; if($lst->anonim!='y'){ connections($m_id,$lst->mem_id); } echo "</td> </table> </td>"; echo "</table>"; if($i==5){ break; } $i++; }//if }//while }//if }//else }//if }//if //profile section listings from user and friends elseif($mode=='inprofile'){ $friends=array(); $friends=count_network($m_id,"1","ar"); $sql_query="select * from listings where (mem_id='$m_id'"; if($friends!=''){ foreach($friends as $fr){ $sql_query.=" or mem_id='$fr'"; }//foreach }//if $sql_query.=") and stat='a' order by added"; $num=sql_execute($sql_query,'num'); if($num==0){ echo "<p align=center>No listings available</p> "; }//if else { $res=sql_execute($sql_query,'res'); while($lst=mysql_fetch_object($res)){ $date=date("m/d",$lst->added); echo "$date <img src='images/icon_listing.gif'> <a href='index.php?mode=listing&act=show&lst_id=$lst->lst_id'>$lst->title</a>"; $c_name=get_cat_name($lst->cat_id); echo " (<a href='index.php?mode=listing&act=show_cat&cat_id=$lst->cat_id'>$c_name</a>) - "; show_online($lst->mem_id); echo "</br>"; }//while Link to comment Share on other sites More sharing options...
.josh Posted June 13, 2006 Share Posted June 13, 2006 yeah man. how about posting what your errors are, using some code tags, and posting the relavent code. walking into someplace, throwing your entire code down on the table in a big mess, with no explanation, and expecting people to jump all over it...not gonna happen. Link to comment Share on other sites More sharing options...
logged_with_bugmenot Posted August 8, 2006 Author Share Posted August 8, 2006 I didn't post this topic, but after seeing it, I would agree that the author needs to at least do some better indentation, and syntax highlight it. Way too much code though so forget it. Link to comment Share on other sites More sharing options...
wildteen88 Posted August 8, 2006 Share Posted August 8, 2006 Topic closed as this hasnt been replied to in 2months.logged_with_bugmenot if you want this thread reopened please post in the [url=http://www.phpfreaks.com/forums/index.php/board,11.0.html]PHPFreaks.com Questions, Comments, & Suggestions[/url] forum. Link to comment Share on other sites More sharing options...
Recommended Posts