set_file('middlecontent','ads_list.html'); $foundads=array(); if (!empty($totalrows)) { $query="SELECT a.fk_user_id,a.subject,a.text,b.picture_name,c.gender FROM $from WHERE $where ORDER BY ad_id DESC LIMIT $offset,$results"; if (!($res=@mysql_query($query))) {trigger_error(mysql_error(),E_USER_ERROR);} $i=0; while ($rsrow=mysql_fetch_row($res)) { list($fk_user_id,$subject,$text,$picture_name,$gender)=$rsrow; $foundads[$i]['user_id']=$fk_user_id; $foundads[$i]['subject']=$subject; $foundads[$i]['text']=wordwrap(htmlentities(stripslashes($text)),80,'
',1); if (!empty($picture_name) && file_exists(_THUMBSPATH_."/$picture_name")) { $foundads[$i]['picture']=$picture_name; } elseif (file_exists(_THUMBSPATH_."/no-pict$gender.gif")) { $foundads[$i]['picture']="no-pict$gender.gif"; } else { $foundads[$i]['picture']="no-pict.gif"; } $foundads[$i]['picture']=_THUMBSURL_.'/'.$foundads[$i]['picture']; $i++; } $_SESSION['link_back']="ads_list.php"; $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_ads_found',$_messages['core'][164]); } $tpl->set_var('totalrows',$totalrows); $tpl->set_loop('foundads',$foundads); $middle_content=$tpl->process('','middlecontent',TPL_FINISH | TPL_LOOP); $title=$_messages['core'][284]; include('content_left.php'); include('content_right.php'); include('content_frame.php'); ?>