按品牌找车:
新车资讯
= 5 && $page = 4; $in_ajax = isset($in_ajax) ? intval($in_ajax) : 0; define('CACHE_TIME',3600); $cache_path = 'weibo_article'; $cache_file = 'list_' . $typeid . '_' .$page . '.htm'; $C = new Cache($cache_path,$cache_file); $data = ''; if($C->check(CACHE_TIME)) { $data = $C->read(''); } else { require_once(DEDEINC.'/arc.archives.class.php'); $max_page = 5; //读取栏目信息 $limit = 15; $offset = $page * $limit; $sql = 'SELECT COUNT(arc.`id`) AS `count` FROM `#@__archives` arc LEFT JOIN `#@__arctype` tp ON arc.`typeid`=tp.`id`'; // $sql .= " WHERE (arc.typeid={$typeid} OR tp.reid={$typeid}) AND FIND_IN_SET('p',arc.`flag`) AND arc.`arcrank`=0 AND arc.`weibo_id`!=''"; $sql .= " WHERE (arc.typeid={$typeid} OR tp.reid={$typeid}) AND FIND_IN_SET('p',arc.`flag`) AND arc.`arcrank`=0 "; $sql .= " LIMIT 1"; $row = $dsql->GetOne($sql); $total = $row['count']; if($total > 0) { $total_page = ceil($total/$limit); $total_page > $max_page && $total_page = $max_page; $sql = 'SELECT arc.*,tp.typedir,tp.typename,tp.isdefault,tp.reid,tp.topid,arc.money,'; $sql .= ' tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath'; $sql .= ' FROM `#@__archives` arc LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id'; //$sql .= " WHERE (arc.typeid={$typeid} OR tp.reid={$typeid}) AND FIND_IN_SET('p',arc.`flag`) AND arc.`arcrank`=0 AND arc.`weibo_id`!=''"; $sql .= " WHERE (arc.typeid={$typeid} OR tp.reid={$typeid}) AND FIND_IN_SET('p',arc.`flag`) AND arc.`arcrank`=0 "; $sql .= " ORDER BY arc.`pubdate` DESC LIMIT {$offset},{$limit}"; $dsql->SetQuery($sql); $dsql->Execute(); while($row = $dsql->GetArray()) { $row1 = $dsql->GetOne('SELECT COUNT(`id`) AS `count` FROM `#@__feedback` WHERE `aid`='.$row['id']); $row['count'] = $row1['count']; $row["arcurl"] = GetFileUrl($row["id"],$row["typeid"],$row["senddate"],$row["title"],$row["ismake"],$row["arcrank"],$row["namerule"],$row["typedir"],$row["money"],$row['filename'],$row["moresite"],$row["siteurl"],$row["sitepath"]); //$row['litpic'] = $row['litpic'] ? 'http://img.qi-che.com' . $row['litpic'] : 'http://img1.qi-che.com/imgs/images/defaultpic.gif'; if(empty($row['litpic'])) { $row['litpic'] = 'http://img1.qi-che.com/imgs/images/defaultpic.gif'; } else { if (strpos($row['litpic'], "http://") === false) $row['litpic'] = 'http://img.qi-che.com' . $row['litpic']; } if(strLength($row['description'])>200){ $row['description'] = cn_substr($row['description'],200)."..."; } $data .= '
  • '.$row['title'].'

    '.$row['title'].'

    来自:'.$row['source'].' '.$row['writer'].' 发布于 '.date("Y-m-d",$row['pubdate']).'

    评论('.$row['count'].')腾讯微博新浪微博

    '.$row['description'].'

  • '; } } else { $total_page = $max_page; $typeid = 5; $sql = 'SELECT arc.*,tp.typedir,tp.typename,tp.isdefault,tp.reid,tp.topid,arc.money,'; $sql .= ' tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath'; $sql .= ' FROM `#@__archives` arc LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id'; //$sql .= " WHERE (arc.typeid={$typeid} OR tp.reid={$typeid}) AND FIND_IN_SET('p',arc.`flag`) AND arc.`arcrank`=0 AND arc.`weibo_id`!=''"; $sql .= " WHERE (arc.typeid={$typeid} OR tp.reid={$typeid}) AND FIND_IN_SET('p',arc.`flag`) AND arc.`arcrank`=0 "; $sql .= " ORDER BY arc.`pubdate` DESC LIMIT {$offset},{$limit}"; $dsql->SetQuery($sql); $dsql->Execute(); while($row = $dsql->GetArray()) { $row1 = $dsql->GetOne('SELECT COUNT(`id`) AS `count` FROM `#@__feedback` WHERE `aid`='.$row['id']); $row['count'] = $row1['count']; $row["arcurl"] = GetFileUrl($row["id"],$row["typeid"],$row["senddate"],$row["title"],$row["ismake"],$row["arcrank"],$row["namerule"],$row["typedir"],$row["money"],$row['filename'],$row["moresite"],$row["siteurl"],$row["sitepath"]); //$row['litpic'] = $row['litpic'] ? 'http://img.qi-che.com' . $row['litpic'] : 'http://img1.qi-che.com/imgs/images/defaultpic.gif'; if(empty($row['litpic'])) { $row['litpic'] = 'http://img1.qi-che.com/imgs/images/defaultpic.gif'; } else { if (strpos($row['litpic'], "http://") === false) $row['litpic'] = 'http://img.qi-che.com' . $row['litpic']; } if(strLength($row['description'])>200){ $row['description'] = cn_substr($row['description'],200)."..."; } $data .= '
  • '.$row['title'].'

    '.$row['title'].'

    来自:'.$row['source'].' '.$row['writer'].' 发布于 '.date("Y-m-d",$row['pubdate']).'

    评论('.$row['count'].')腾讯微博新浪微博

    '.$row['description'].'

  • '; } } if(!empty($data)) { $data = '
      ' . $data . '
    '; $data .= multi($page,$total_page); $C->write($data,''); } } if($in_ajax) { $res['data'] = iconv('gbk','utf-8//ignore',$data); $json = json_encode($res); header('Content-Type:application/json; Charset=UTF-8'); echo "{$callback}({$json})";die; } else { echo $data;die; } /** * 分页 * @return string */ function multi($page,$total_page) { if($total_page <= 1) return ''; $data = '
      '; if($page > 0) { $prev_page = $page - 1; $data .= "
    • < 上一页
    • "; //$data .= "
    • < 上一页
    • "; } for($i = 0; $i < $total_page; $i++) { $cur_page = $i + 1; if($i === $page) { $data .= "
    • {$cur_page}
    • "; } else { $data .= "
    • {$cur_page}
    • "; //$data .= "
    • {$cur_page}
    • "; } } if($page < $total_page - 1) { $next_page = $page + 1; $data .= "
    • 下一页 >
    • "; //$data .= "
    • 下一页 >
    • "; } $data .= '
    '; return $data; } // $list3 =getfenyelist('105,1345,1344,106','15','p','0'); // $res['content']='
      '; // if(is_array($list3['data']) && !empty($list3['data'])){ // foreach($list3['data'] as $ls){ // $res['content'].='
    • '.$ls['title'].'

      来自:'.$ls['source'].' '.$ls['writer'].' 发布于 '.strftime("%Y-%m-%d",$ls['pubdate']).'

      评论('.$ls['count'].')腾讯微博新浪微博

      '.$ls['description'].'

    • '; // } // } // $res['content'].='
    '; // $res['content'].='
    // //
    '; // if($_GET["action"]=="gethtml"){ // echo $res['content'];die; // }else{ // $res['content']=iconv('GB2312', 'UTF-8//ignore',$res['content']); // echo ShowAjaxMsg($res['content']);die; // } // //读取内容(含分页) // function getfenyelist($typeid,$row,$flags,$limit) // { // global $dsql; // $dsql->safeCheck = false; // if(isset($_GET["page"])) // { // @$page = max(1, intval($_GET["page"])); // //echo $row; // $pagesize=$row; // $startindex=($page-1)*$pagesize+$limit; // $sql="Select arc.*,tp.typedir,tp.typename,tp.isdefault,tp.reid,tp.topid,arc.money, // tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath // from `#@__archives` arc left join `#@__arctype` tp on arc.typeid=tp.id where (arc.typeid in(".$typeid.") or tp.reid in(".$typeid.") or tp.topid in(".$typeid."))"; // if($flags!='') // { // $flags = explode(',',$flags); // if(!empty($flags) && is_array($flags)) // { // foreach($flags as $flag) // { // isset($flag) && $sql .= " AND FIND_IN_SET('{$flag}',flag)>0"; // } // } // } // $sql .=" and arc.arcrank=0 and (Select count(`id`) From `#@__feedback` where aid=arc.id) > 0 order by arc.pubdate desc limit ".$startindex.",".$pagesize; // // echo $sql; // $dsql->SetQuery($sql); // $dsql->Execute(); // while($row = $dsql->GetArray()) // { // $row1 = $dsql->GetOne("Select count(`id`) as count From `#@__feedback` where aid=".$row["id"]); // $row['count'] = $row1['count']; // $row["arcurl"] = GetFileUrl($row["id"],$row["typeid"],$row["senddate"],$row["title"],$row["ismake"],$row["arcrank"],$row["namerule"],$row["typedir"],$row["money"],$row['filename'],$row["moresite"],$row["siteurl"],$row["sitepath"]); // $row['litpic'] = $row['litpic'] ? $row['litpic'] : 'http://img1.qi-che.com/imgs/images/defaultpic.gif'; // if(strLength($row['description'])>200){ // $row['description'] = cn_substr($row['description'],200)."..."; // } // $list['data'][] = $row; // } // $num=12; // $pagenum=@ceil($num/$pagesize); // if ($num > 1) // { // if ($page == 1) // { // $str .= "
  • < 上一页
  • \n "; // } else // { // $up_page = $page -1; // $str .= "
  • < 上一页
  • \n "; // } // if ($num > 10) // { // if ($page <= 5) { // $loop1_start = 1; // $loop1_end = $page +5; // for ($i = $loop1_start; $i <= $loop1_end; $i++) { // if ($i == $page) // $str .= "
  • ".$i."
  • \n"; // else // $str .= "
  • ".$i."
  • \n"; // } // //$str .= "...".$num."\n"; // } // elseif ($page >= $num -5) { // $str .= "
  • 1
  • \n"; // $loop2_start = $page -5; // $loop2_end = $num; // for ($i = $loop2_start; $i <= $loop2_end; $i++) { // if ($i == $page) // $str .= "
  • ".$i."
  • \n"; // else // $str .= "
  • ".$i."
  • \n"; // } // } else { // $str .= "
  • 1
  • \n"; // for ($i = $page -4; $i <= $page +4; $i++) { // if ($i == $page) // $str .= "
  • ".$i."
  • \n"; // else // $str .= "
  • ".$i."
  • \n"; // } // } // $middle = $page; // } // else // { // for ($i = 1; $i <= $num; $i++) { // if ($i == $page) // $str .= "
  • ".$i."
  • \n"; // else // $str .= "
  • ".$i."
  • \n"; // } // } // if ($page < $num) // { // $next_page = $page +1; // $str .= "
  • 下一页 >
  • \n "; // } // else // { // $str .= "
  • 下一页 >
  • \n "; // } // } // else // { // $str .= " "; // } // $list['page']=$str; // } // else // { // die(); // } // return $list; // } /** * 返回jsonp格式数据 */ function ShowAjaxMsg($res) { $res = json_encode($res); global $callback; echo "$callback($res)"; //exit; } ?>
    口碑推荐

    嘉年华

    打分人数:58

    平均总分:3

    我要打分
    汽车试驾
    更多推荐经销商
    更多资讯推荐
    合作媒体
    凤凰汽车 车讯网 中华网汽车 卡车之家论坛

    (交换链接PR值和BR值大于6,符合要求请加相关人员QQ:1388461 )