Exemple #1
0
 * @package		ArthurXF
 * @subpackage	Personality_customization
 */
require_once '../config/config.inc.php';
require_once "../class/Personality_customization.class.php";
require_once '../../useradmin/checklogin.php';
$objWebInit = new Personality_customization();
//数据库连接参数
$objWebInit->setDBG($arrGPdoDB);
//smarty参数
$objWebInit->arrGSmarty = $arrGSmarty;
//翻页参数
$objWebInit->arrGPage = $arrGPage;
//图片上传参数
$objWebInit->arrGPic = $arrGPic;
$objWebInit->db();
$arrWhere = array();
$arrLink = array();
if (isset($_GET['action'])) {
    if ($_GET['action'] == 'search') {
        // 构造搜索条件和翻页参数
        $arrLink[] = 'action=search';
        if (!empty($_GET['title'])) {
            $strKeywords = strval(urldecode($_GET['title']));
            if ($strKeywords[0] == '/') {
                //精确查询ID
                $strKeywords = substr($strKeywords, 1);
                if (is_numeric($strKeywords)) {
                    $arrWhere[] = "id = '" . $strKeywords . "'";
                }
            } else {
 * @author		Arthur(ArthurXF@gmail.com)
 * @copyright	(c) 2006 by bizeway.com
 * @version		$Id$
 * @package		ArthurXF
 * @subpackage	Personality_customization
 */
if (is_object($objWebInit)) {
    if (!isset($objPersonality_customization)) {
        include_once __WEB_ROOT . "/Personality_customization/class/Personality_customization.class.php";
        include_once __WEB_ROOT . "/Personality_customization/config/var.inc.php";
        $objPersonality_customization = new Personality_customization();
        $objPersonality_customization->setDBG($arrGPdoDB);
        if (is_object($objWebInit->db)) {
            $objPersonality_customization->db = $objWebInit->db;
        } else {
            $objPersonality_customization->db();
        }
    }
    $arrCommendPersonality_customization = array();
    $intMax = $objPersonality_customization->getRecordsG($objPersonality_customization->tablename2, 'where pass=1 and recommendflag = 1');
    if ($intMax < 1) {
        $intMax = $objPersonality_customization->getRecordsG($objPersonality_customization->tablename2, 'where pass=1 and recommendflag = 0');
        if ($intMax > 10) {
            $intMax -= 10;
        }
        $arrCommendPersonality_customization = $objPersonality_customization->getInfoList('where pass=1 and recommendflag = 0', ' order by submit_date desc', rand(0, $intMax), 10);
    } else {
        if ($intMax > 10) {
            $intMax -= 10;
        }
        $arrCommendPersonality_customization = $objPersonality_customization->getInfoList('where pass=1 and recommendflag = 1', ' order by submit_date desc', rand(0, $intMax), 10);