Page 1 of 1

Help with pre-made site

Posted: Tue Apr 28, 2015 9:48 am
by majrdim
Hi there,
I bought a pre-made site and I have this stupid code that I can't seem to make it work, it gives me the same warnings and I believe it is also getting the info from a httt request, so it should be solved by your very professional answers.
The problem is that i'm new to PHP and don't seem to be able to do it. :(
Do you think you can help me?
Here's the code I'm saying:
I've highlighted the bit where I think the problem is.

Code: Select all

<?php
require_once("includes/main.inc.php");
require_once(SITE_FS_PATH."/front-functions.php");
$link_curr=get_config_setting(15);
$link_details=get_config_setting(17);
$tmpClsID = (isset($_REQUEST[clsId]) && $_REQUEST[clsId]!="") ? intval($_REQUEST[clsId]) : 0;
/**************** Display records ***************/
if(!empty($tmpClsID)){	
	if(isset($_SESSION['memId']) && $_SESSION['memId']!=""){
	 $sql_clsi_show="select *,DATE_FORMAT(classified_post_date ,'%d- %m- %Y') as cli_post_date
	 from tbl_classified where classified_id=$tmpClsID and classified_status!='Delete' "; 
	}else{
	 $sql_clsi_show="select *,DATE_FORMAT(classified_post_date ,'%d- %m- %Y') as cli_post_date
	 from tbl_classified where classified_id=$tmpClsID and classified_status='Active' ";
	}
$sql_rs_set=db_query($sql_clsi_show);
$reccnt = mysql_num_rows($sql_rs_set);
$res=mysql_fetch_array($sql_rs_set);
$sql_img="select * from tbl_classified_image where clsd_id='$res[classified_id]' and img_status='Y'";
$sql_img_set=db_query($sql_img);

if($res[classified_poster_state]!="" && $res[classified_poster_state]!=0){				 
 $state=getResult('tbl_state',"WHERE state_id=$res[classified_poster_state]");				
 }
 if($res[classified_city_id]!="" && $res[classified_city_id]!=0){				
   $city=getResult('tbl_city',"WHERE city_id=$res[classified_city_id]"); 
 }

 if(mysql_num_rows($sql_img_set) > 0 ) {
  $km=0;  
   while($res1=mysql_fetch_array($sql_img_set)){        
   $file_sm=UP_FILES_WS_PATH."/classified_img/".$res1[cls_img_file];    
	 $autoID[]=$res1['clsd_img_id']; 
	   if($res1[cls_img_file]!=""){
	      $file_path_sm=show_thumb($file_sm,"135","135","width");
		  $file_path_big=show_thumb($file_sm,"2550","2550","width");
		      $sz=getimagesize($file_path_sm);
			  $sz_big=getimagesize($file_path_big);			 
			  $width=($sz[0]>=65) ?  '65' :  $sz[0];
			  $height=($sz[1]>=65) ? '65'  :   65 ;                     //$sz[1]
			  $width_big=($sz_big[0]>=400) ?   '300'  : $sz_big[0];
			  $height_big=($sz_big[1]>=200) ?  '200' : $sz_big[1];			  
			  $dis=($km==0) ? 'display:block;' : 'display:none;'; 			  
			  			  			  		  
			  $im_small='<a href="javascript:void(0);" onmouseover="show_gall('.$km.',7);">
		<img src="'.$file_path_sm.'" alt="" width="'.$width.'" height="'.$height.'" border="0" class="border-img" />
			  </a>';			  
			  $im_big='<img src="'.$file_path_big.'" alt="" width="'.$width_big.'" height="'.$height_big.'" border="0" class="border-img" style="'.$dis.'" id="gallery_1_'.$km.'" />';		  
			  	
	 $im_arr_small[]= $im_small;			 
	 $joom_link[]= '<a href="'.$file_path_big.'" title="" class="link" id="gallzoom_1_'.$km.'" style="'.$dis.'" rel="lightbox[me]"><img src=" '.$theem_img.'/zoom.gif" width="15" height="15" border="0" alt="" class="absm" /><br> Clique para Ampliar<br></a>';
	       $im_arr_big[]= $im_big;	  
            $km++;
		}
     }
   }
}
The site is very slow this way, and warning messages like the one stated are showing.
Hope you guys can help me,
Thanks in advance.
Marco

Re: Help with pre-made site

Posted: Tue Apr 28, 2015 10:09 am
by Celauran
Split this off from a thread from way back in 2012.