$v) { if($allAskList[$k]['IP'] == '127.0.0.1'||$allAskList[$k]['IP'] == '') { $allAskList[$k]['author'] = '汽车美高梅友'; } else { $allAskList[$k]['author'] = CvIp($allAskList[$k]['IP']); } } } if(is_array($waitAskList)) { foreach($waitAskList as $k=>$v) { if($waitAskList[$k]['IP'] == '127.0.0.1'||$waitAskList[$k]['IP'] == '') { $waitAskList[$k]['author'] = '汽车美高梅友'; } else { $waitAskList[$k]['author'] = CvIp($waitAskList[$k]['IP']); } } } if(is_array($alreadyAskList)) { foreach($alreadyAskList as $k=>$v) { if($alreadyAskList[$k]['eip'] == '127.0.0.1'||$alreadyAskList[$k]['eip'] == '') { $alreadyAskList[$k]['author'] = '汽车美高梅友'; } else { $alreadyAskList[$k]['author'] = CvIp($alreadyAskList[$k]['eip']); } } } if(is_array($expertList)) { foreach($expertList as $k=>$v) { if($expertList[$k]['eip'] == '127.0.0.1'||$expertList[$k]['eip'] == '') { $expertList[$k]['author'] = '汽车美高梅友'; } else { $expertList[$k]['author'] = CvIp($expertList[$k]['eip']); } } } if(is_array($curMonActive)) { foreach($curMonActive as $k=>$v) { if($curMonActive[$k]['IP'] == '127.0.0.1'||$curMonActive[$k]['IP'] == '127.0.0.1') { $curMonActive[$k]['author'] = '汽车美高梅友'; } else { $curMonActive[$k]['author'] = CvIp($curMonActive[$k]['IP']); } } } if(is_array($totalActive)) { foreach($totalActive as $k=>$v) { if($totalActive[$k]['IP'] == '127.0.0.1'||$totalActive[$k]['IP'] == '') { $totalActive[$k]['author'] = '汽车美高梅友'; } else { $totalActive[$k]['author'] = CvIp($totalActive[$k]['IP']); } } } $category = getCategory(); if(is_array($category)) { foreach($category as $v=>$k) { $it = $k['ID']; $category[$v]['child'] = getCategory($it); } } $db->sql_close(); $db = ConnectDatabase($DB_CONFIG_TAG_READ, false); //品牌 $prebrand = getPreBrand(30); $db->sql_close(); $db = ConnectDatabase($DB_CONFIG_DEDE_READ, false); if(is_array($prebrand)) { foreach($prebrand as $v=>$k) { $it = $k['BrandID']; $tmp = getBrandCount($it); $prebrand[$v]['num'] = $tmp['c']; } usort($prebrand, "cmp"); } //print_r($prebrand);die; $db->sql_close(); $smarty->assign("count1", $count1); //获得待解决问题数量 $smarty->assign("count2", $count2); //获得已解决问题数量 $smarty->assign("category", $category); //获得分类列表 $smarty->assign("prebrand", $prebrand); //获得品牌列表 $smarty->assign("allAskList", $allAskList); //所有问题 $smarty->assign("waitAskList", $waitAskList); //待解决问题 $smarty->assign("alreadyAskList", $alreadyAskList); //已解决问题 $smarty->assign("recList", $recList); //获得精彩推列表 $smarty->assign("expertList", $expertList); //获得专家精彩推列表 $smarty->assign("curMonActive", $curMonActive); //当月活跃网友 $smarty->assign("totalActive", $totalActive); //总活跃网友 $smarty->display('ask/index.tpl'); exit (); ?>