📄 panel.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. ////////////////////////////////////////////////////////////////////////////////////error_reporting(7);//Prep variablesif(PHP_VERSION < '4.1.0') { $_GET = &$HTTP_GET_VARS; $_POST = &$HTTP_POST_VARS; $_COOKIE = &$HTTP_COOKIE_VARS; $_SERVER = &$HTTP_SERVER_VARS; $_ENV = &$HTTP_ENV_VARS; $_FILES = &$HTTP_POST_FILES; $_REQUEST = array_merge($_GET, $_POST, $_COOKIE); }$isMagic = get_magic_quotes_gpc();$typesToRegister = array($_POST,$_GET,$_COOKIE);foreach($typesToRegister as $varType) { if(is_array($varType)) { while(list($key,$value) = @each($varType)) { if ($isMagic) { if(!is_array($value)) { $value = stripslashes($value); } } ${$key} = $value; } } }set_magic_quotes_runtime(0);switch($rotate) { case "true": //Connect to database & get functions loaded include("connect.php"); include("functions.php"); //Set globals global $SystemOptions,$cat_id; $result = query("SELECT * FROM {$class_prefix}system",$class_link); $SystemOptions = mysql_fetch_array($result); //Set language include("{$insPath}languages/{$SystemOptions['language']}.php"); //Load ad types $panelAdTypes = array(); $result = query("SELECT type_id,type_title FROM {$class_prefix}ad_types",$class_link); while(list($typeID,$typeTitle) = mysql_fetch_row($result)) { $panelAdTypes[$typeID] = stripslashes($typeTitle); } echo<<<ENDPRINT <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html {$Languages['global']['dir']}> <head> <link href="{$insUrl}styles/{$SystemOptions['css']}" rel="stylesheet" type="text/css"> </head> <body class="body"> <META HTTP-EQUIV="refresh" CONTENT=5;URL="panel.php?paneltype=$paneltype&cat_id=$cat_id&rotate=true">ENDPRINT; if($paneltype == "featured") { $featured_counter = 0; if($cat_id != 0) { $featured_cat = "AND ad_category=$cat_id"; } $result = query("SELECT ad_id,ad_title,ad_image1,ad_type FROM {$class_prefix}ads WHERE ad_status=1 $featured_cat AND (ad_options & 1 != 0) ORDER BY RAND() LIMIT 4",$class_link); while(list($ad_id,$ad_title,$ad_image1,$ad_type) = mysql_fetch_row($result)) { $ad_title = strip_tags(stripslashes($ad_title)); if($ad_image1 != "") { $ad_image1 = getThumb($ad_image1); if($SystemOptions['spider'] == 1) { $imgs[$featured_counter] = "<a href=\"{$insUrl}classified.php/listing/$ad_id\" target=\"_parent\"><img src=\"{$insUrl}images/listings/{$ad_image1}\" border=\"0\" class=\"ad_thumb\"></a>"; } else { $imgs[$featured_counter] = "<a href=\"{$insUrl}classified.php?listing=$ad_id\" target=\"_parent\"><img src=\"{$insUrl}images/listings/{$ad_image1}\" border=\"0\" class=\"ad_thumb\"></a>"; } } $type = $panelAdTypes[$ad_type]; if($SystemOptions['spider'] == 1) { $featured_ads[$featured_counter] = "<span class=\"ad_text\">{$type}<br><a target=\"_parent\" href=\"{$insUrl}classified.php/listing/$ad_id\" class=\"ad_link\">$ad_title</a></span>"; } else { $featured_ads[$featured_counter] = "<span class=\"ad_text\">{$type}<br><a target=\"_parent\" href=\"{$insUrl}classified.php?listing=$ad_id\" class=\"ad_link\">$ad_title</a></span>"; } $featured_counter++; } if($featured_counter != 0) { $width = 100/$featured_counter; echo<<<ENDPRINT <br> <div id="menu"> <table width="100%" border="0" cellspacing="1" cellpadding="3"> <tr> <td>{$Languages['index']['featuredads']}</td> </tr> </table> </div> <div id="listings"> <table width="100%" border="0" cellspacing="1" cellpadding="3"> <tr>ENDPRINT; for($i=0; $i<=$featured_counter-1; $i++) { echo "<td align=\"center\" width=\"$width%\">{$imgs[$i]}<br>{$featured_ads[$i]}</td>"; } echo<<<ENDPRINT </tr> </table> </div>ENDPRINT; } } else { $new_counter = 0; if($cat_id != 0) { $new_cat = "AND ad_category=$cat_id"; } $result = query("SELECT ad_id,ad_title,ad_image1,ad_type FROM {$class_prefix}ads WHERE ad_status=1 $new_cat ORDER BY ad_date_begin DESC LIMIT 10",$class_link); $numResults = mysql_num_rows($result); while(list($ad_id,$ad_title,$ad_image1,$ad_type) = mysql_fetch_row($result)) { $ad_title = strip_tags(stripslashes($ad_title)); if($ad_image1 != "") { $ad_image1 = getThumb($ad_image1); if($SystemOptions['spider'] == 1) { $imgs[$new_counter] = "<a href=\"{$insUrl}classified.php/listing/$ad_id\" target=\"_parent\"><img src=\"{$insUrl}images/listings/{$ad_image1}\" border=\"0\" class=\"ad_thumb\"></a>"; } else { $imgs[$new_counter] = "<a href=\"{$insUrl}classified.php?listing=$ad_id\" target=\"_parent\"><img src=\"{$insUrl}images/listings/{$ad_image1}\" border=\"0\" class=\"ad_thumb\"></a>"; } } $type = $adTypes['$ad_type']; if($SystemOptions['spider'] == 1) { $new_ads[$new_counter] = "<span class=\"ad_text\">{$type}<br><a target=\"_parent\" href=\"{$insUrl}classified.php/listing/$ad_id\" class=\"ad_link\">$ad_title</a></span>"; } else { $new_ads[$new_counter] = "<span class=\"ad_text\">{$type}<br><a target=\"_parent\" href=\"{$insUrl}classified.php?listing=$ad_id\" class=\"ad_link\">$ad_title</a></span>"; } $new_counter++; } srand ((float) microtime() * 10000000); if($new_counter != 0) { $width = 100/$new_counter; echo<<<ENDPRINT <br> <div id="menu"> <table width="100%" border="0" cellspacing="1" cellpadding="3"> <tr> <td>{$Languages['index']['newads']}</td> </tr> </table> </div> <div id="listings"> <table width="100%" border="0" cellspacing="1" cellpadding="3"> <tr>ENDPRINT; $adUsed = array(); if($numResults > 3) { $numResults = 4; } for($i=0; $i<=$numResults - 1; $i++) { $rand = array_rand($new_ads,1); if(!in_array($rand,$adUsed)) { echo "<td align=\"center\" width=\"$width%\">{$imgs[$rand]}<br>{$new_ads[$rand]}</td>"; array_push($adUsed,$rand); } else { $i = $i - 1; } } echo<<<ENDPRINT </tr> </table> </div>ENDPRINT; } } echo<<<ENDPRINT </body> </html>ENDPRINT; break; default: if($paneltype == "featured") { $featured_counter = 0; if($cat_id != 0) { $featured_cat = "AND ad_category=$cat_id"; } $result = query("SELECT ad_id,ad_title,ad_image1,ad_type FROM {$class_prefix}ads WHERE ad_status=1 $featured_cat AND (ad_options & 1 != 0) ORDER BY RAND() LIMIT 4",$class_link); while(list($ad_id,$ad_title,$ad_image1,$ad_type) = mysql_fetch_row($result)) { $ad_title = strip_tags(stripslashes($ad_title)); if($ad_image1 != "") { $ad_image1 = getThumb($ad_image1); if($SystemOptions['spider'] == 1) { $imgs[$featured_counter] = "<a href=\"{$insUrl}classified.php/listing/$ad_id\" target=\"_parent\"><img src=\"{$insUrl}images/listings/{$ad_image1}\" border=\"0\" class=\"ad_thumb\"></a>"; } else { $imgs[$featured_counter] = "<a href=\"{$insUrl}classified.php?listing=$ad_id\" target=\"_parent\"><img src=\"{$insUrl}images/listings/{$ad_image1}\" border=\"0\" class=\"ad_thumb\"></a>"; } } $type = $adTypes[$ad_type]; if($SystemOptions['spider'] == 1) { $featured_ads[$featured_counter] = "<span class=\"ad_text\">{$type}<br><a href=\"{$insUrl}classified.php/listing/$ad_id\" class=\"ad_link\">$ad_title</a></span>"; } else { $featured_ads[$featured_counter] = "<span class=\"ad_text\">{$type}<br><a href=\"{$insUrl}classified.php?listing=$ad_id\" class=\"ad_link\">$ad_title</a></span>"; } $featured_counter++; } if($featured_counter != 0) { $width = 100/$featured_counter; echo<<<ENDPRINT <br> <div id="menu"> <table width="{$SystemOptions['page_width']}" border="0" cellspacing="1" cellpadding="3"> <tr> <td>{$Languages['index']['featuredads']}</td> </tr> </table> </div> <div id="listings"> <table width="{$SystemOptions['page_width']}" border="0" cellspacing="1" cellpadding="3"> <tr>ENDPRINT; for($i=0; $i<=$featured_counter-1; $i++) { echo "<td align=\"center\" width=\"$width%\">{$imgs[$i]}<br>{$featured_ads[$i]}</td>"; } echo<<<ENDPRINT </tr> </table> </div>ENDPRINT; } } else { $new_counter = 0; if($cat_id != 0) { $new_cat = "AND ad_category=$cat_id"; } $result = query("SELECT ad_id,ad_title,ad_image1,ad_type FROM {$class_prefix}ads WHERE ad_status=1 $new_cat ORDER BY ad_date_begin DESC LIMIT 10",$class_link); $numResults = mysql_num_rows($result); while(list($ad_id,$ad_title,$ad_image1,$ad_type) = mysql_fetch_row($result)) { $ad_title = strip_tags(stripslashes($ad_title)); if($ad_image1 != "") { $ad_image1 = getThumb($ad_image1); if($SystemOptions['spider'] == 1) { $imgs[$new_counter] = "<a href=\"{$insUrl}classified.php/listing/$ad_id\" target=\"_parent\"><img src=\"{$insUrl}images/listings/{$ad_image1}\" border=\"0\" class=\"ad_thumb\"></a>"; } else { $imgs[$new_counter] = "<a href=\"{$insUrl}classified.php?listing=$ad_id\" target=\"_parent\"><img src=\"{$insUrl}images/listings/{$ad_image1}\" border=\"0\" class=\"ad_thumb\"></a>"; } } $type = $adTypes[$ad_type]; if($SystemOptions['spider'] == 1) { $new_ads[$new_counter] = "<span class=\"ad_text\">{$type}<br><a href=\"{$insUrl}classified.php/listing/$ad_id\" class=\"ad_link\">$ad_title</a></span>"; } else { $new_ads[$new_counter] = "<span class=\"ad_text\">{$type}<br><a href=\"{$insUrl}classified.php?listing=$ad_id\" class=\"ad_link\">$ad_title</a></span>"; } $new_counter++; } srand ((float) microtime() * 10000000); if($new_counter != 0) { $width = 100/$new_counter; echo<<<ENDPRINT <br> <div id="menu"> <table width="{$SystemOptions['page_width']}" border="0" cellspacing="1" cellpadding="3"> <tr> <td>{$Languages['index']['newads']}</td> </tr> </table> </div> <div id="listings"> <table width="{$SystemOptions['page_width']}" border="0" cellspacing="1" cellpadding="3"> <tr>ENDPRINT; $adUsed = array(); if($numResults > 3) { $numResults = 4; } for($i=0; $i<=$numResults - 1; $i++) { $rand = array_rand($new_ads,1); if(!in_array($rand,$adUsed)) { echo "<td align=\"center\" width=\"$width%\">{$imgs[$rand]}<br>{$new_ads[$rand]}</td>"; array_push($adUsed,$rand); } else { $i = $i - 1; } } echo<<<ENDPRINT </tr> </table> </div>ENDPRINT; } } break; }?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -