📄 recent.php
字号:
<?php//////////////////////////// COPYRIGHT NOTICE ////////////////////////////////////// This script is part of BosClassifieds, a software application by BosDev, Inc //// Use of any kind of part or all of this script or modification of this //// script requires a license from BosDev, Inc. Use or modification of //// this script without a license constitutes Software Piracy and will //// result in legal action from BosDev, Inc. All rights reserved. //// http://www.bosdev.com sales@bosdev.com //// //// BosClassifieds Copyright 2004, BosDev, Inc. //////////////////////////////////////////////////////////////////////////////////////Connect to database & get functions loadedinclude("connect.php");include("functions.php");//Set globalsglobal $SystemOptions,$cat_id;$result = query("SELECT * FROM {$class_prefix}system",$class_link);$SystemOptions = mysql_fetch_array($result);//Set languageinclude("{$insPath}languages/{$SystemOptions['language']}.php");//Include integration fileinclude("{$insPath}integration/{$SystemOptions['integration']}.php");//Include the header$from = "recent";$title_extra = "{$Languages['recent']['fromtitle']} | ";include("header.php");//Add viewer to statisticsrecordUser("v");//Load ad types$adTypes = array();$result = query("SELECT type_id,type_title FROM {$class_prefix}ad_types",$class_link);while(list($typeID,$typeTitle) = mysql_fetch_row($result)) { $typeTitle = stripslashes($typeTitle); $adTypes[$typeID] = $typeTitle; $dispType = sprintf($Languages['recent']['showtype'],$typeTitle); if($typeID == $recentType) { $selected = "selected"; } else { $selected = ""; } $adTypeOptions .= "<option value=\"$typeID\" $selected>$dispType</option>"; }if(isset($recentType) && $recentType != "") { $recentType = intval(protect($recentType)); $typeQuery = "AND ad_type=$recentType"; }//List recent classifieds$ads_counter = 0;$imgs = array();$ads = array();$result = query("SELECT ad_id,ad_date_begin,ad_date_end,ad_type,ad_title,ad_description,ad_image1,ad_options,ad_price FROM {$class_prefix}ads WHERE ad_status=1 {$typeQuery} ORDER BY ad_date_begin DESC,ad_id DESC LIMIT 10",$class_link);while(list($ad_id,$ad_date_begin,$ad_date_end,$ad_type,$ad_title,$ad_description,$ad_image1,$ad_options,$ad_price) = mysql_fetch_row($result)) { $ad_title = strip_tags(stripslashes($ad_title)); $ad_description = strip_tags(stripslashes($ad_description)); if(strlen($ad_description) >= 100) { $ad_description = substr($ad_description,0,100 + strpos(substr($ad_description,100)," "))."..."; } if($ad_image1 != "") { $ad_image1 = getThumb($ad_image1); if($SystemOptions['spider'] == 1) { $imgs[$ads_counter] = "<a href=\"{$insUrl}classified.php/listing/$ad_id\"><img src=\"{$insUrl}images/listings/{$ad_image1}\" border=\"0\" class=\"ad_thumb\" align=\"left\"></a>"; } else { $imgs[$ads_counter] = "<a href=\"{$insUrl}classified.php?listing=$ad_id\"><img src=\"{$insUrl}images/listings/{$ad_image1}\" border=\"0\" class=\"ad_thumb\" align=\"left\"></a>"; } } $type = $adTypes[$ad_type]; $date = formatDate($ad_date_begin); if($SystemOptions['spider'] == 1) { $ads[$ads_counter] = "{$type} <a href=\"{$insUrl}classified.php/listing/$ad_id\" class=\"ad_link\">$ad_title</a><br>$ad_description<br>{$ad_price}"; } else { $ads[$ads_counter] = "{$type}: <a href=\"{$insUrl}classified.php?listing=$ad_id\" class=\"ad_link\">$ad_title</a><br>$ad_description<br>{$ad_price}"; } if($ad_options >= 1) { $back = ""; $back_e = ""; $bold = ""; $italic = ""; if(($ad_options & 8) != 0) { $back = "<div class=\"background_1\">"; $back_e = "</div>"; } if(($ad_options & 16) != 0) { $back = "<div class=\"background_2\">"; $back_e = "</div>"; } if(($ad_options & 32) != 0) { $back = "<div class=\"background_3\">"; $back_e = "</div>"; } if(($ad_options & 64) != 0) { $back = "<div class=\"background_4\">"; $back_e = "</div>"; } if(($ad_options & 2) != 0) { $bold = "font-weight:bold;"; } if(($ad_options & 4) != 0) { $italic = "font-style:italic;"; } $ads[$ads_counter] = "{$back}<div style=\"$bold $italic\">{$imgs[$ads_counter]}{$ads[$ads_counter]}</div>{$back_e}"; } else { $ads[$ads_counter] = "{$imgs[$ads_counter]}{$ads[$ads_counter]}"; } $ads_counter++; }if($ads_counter != 0) { echo<<<ENDPRINT <br> <div id="menu"> <table width="{$SystemOptions['page_width']}" border="0" cellspacing="1" cellpadding="3"> <form method="post" action="recent.php"> <tr> <td width="50%">{$Languages['recent']['results']}</td> <td width="50%" align="right"><select name="recentType" onChange="submit()"><option value="">{$Languages['recent']['showall']}</option>$adTypeOptions</select></td> </tr> </form> </table> </div> <div id="listings"> <table width="{$SystemOptions['page_width']}" border="0" cellspacing="1" cellpadding="3">ENDPRINT; if(substr($SystemOptions['page_width'],-1) == "%") { $colWidth = floor($SystemOptions['page_width'] / $SystemOptions['list_columns']) . "%"; } else { $colWidth = floor($SystemOptions['page_width'] / $SystemOptions['list_columns']); } for($i=0; $i<=9; $i++) { if($ads[$i] == "") { continue; } echo "<tr>"; for($ii=0; $ii<=$SystemOptions['list_columns']-1; $ii++) { $j = $i + $ii; echo "<td width=\"$colWidth\" valign=\"top\">$ads[$j]</td>"; } echo "</tr>"; $i = $i + $SystemOptions['list_columns'] - 1; } echo "</table></div>"; }if($ads_counter == 0) { echo<<<ENDPRINT <br> <div id="menu"> <table width="{$SystemOptions['page_width']}" border="0" cellspacing="0" cellpadding="3"> <form method="post" action="recent.php"> <tr> <td width="50%">{$Languages['recent']['results']}</td> <td width="50%" align="right"><select name="recentType" onChange="submit()"><option value="">{$Languages['recent']['showall']}</option>$adTypeOptions</select></td> </tr> </form> </table> </div> <div id="listings"> <table width="{$SystemOptions['page_width']}" border="0" cellspacing="1" cellpadding="3"> <tr> <td align="center"><br>{$Languages['recent']['noads']}</td> </tr> </table> </div>ENDPRINT; }include("footer.php");?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -