Ejemplo n.º 1
0
 static function readfeed($loadcount, $type = '', $uid = '', $objid = '', $templatename = "", $cachename = "", $cachetime = 300)
 {
     global $kekezu, $_lang;
     $tag_arr = $kekezu->_tag;
     $tag_info = $tag_arr[$templatename];
     $feed_arr = $cachename ? $kekezu->_cache_obj->get("feed_" . $cachename . "_cache") : null;
     if (!$feed_arr) {
         $feed_obj = new Keke_witkey_feed_class();
         $limit = $loadcount ? "limit 0,{$loadcount}" : "";
         $where = "1=1 ";
         $where .= $type ? "and feedtype='{$type}' " : "";
         $where .= $uid ? "and uid='{$uid}' " : "";
         $where .= $objid ? "and obj_id='{$objid}' " : "";
         $where .= " order by feed_time desc ";
         $feed_obj->setWhere($where . $limit);
         $feed_arr = $feed_obj->query_keke_witkey_feed();
         $temp_arr = array();
         if (is_array($feed_arr)) {
             foreach ($feed_arr as $v) {
                 $v['on_time'] = kekezu::get_gmdate($v['feed_time']);
                 $temp_arr[] = $v;
             }
         }
         $feed_arr = $temp_arr;
         $cachename ? $kekezu->_cache_obj->set("feed_" . $cachename . "_cache", $feed_arr, $cachetime) : null;
     }
     $datalist = $feed_arr;
     require keke_tpl_class::parse_code(htmlspecialchars_decode($tag_info[tag_code]), $tag_info[tag_id]);
 }
Ejemplo n.º 2
0
    $where = " 1 = 1 ";
    $txt_feed_id and $where .= " and feed_id={$txt_feed_id} ";
    $txt_title and $where .= " and title like '%" . $txt_title . "%' ";
} elseif ($type === 'manage') {
    $where = " 1=1 and tag_type=8 ";
    $txt_tag_id and $where .= " and tag_id = {$txt_tag_id} ";
    $tpl_type or $tpl_type = $_K[template];
    $tpl_type == 1 or $where .= " and tpl_type like '%" . $tpl_type . "%' ";
}
if ($ord[1]) {
    $where .= " order by {$ord['0']} {$ord['1']} ";
} else {
    $where .= " order by feed_time desc";
}
if ($type == 'data' || !isset($type)) {
    $feed_obj->setWhere($where);
    $count = $feed_obj->count_keke_witkey_feed();
}
if ($type == 'manage') {
    $tag_obj->setWhere($where);
    $count = $tag_obj->count_keke_witkey_tag();
}
if ($type === 'manage') {
    $url = "index.php?do={$do}&view={$view}&slt_page_size={$slt_page_size}&page={$page}&feedtype={$feedtype}&tpl_type={$tpl_type}&txt_title={$txt_title}&txt_tag_id={$txt_tag_id}&type={$type}&ord[]={$ord['0']}&ord[]={$ord['1']}";
} else {
    $url = "index.php?do={$do}&view={$view}&slt_page_size={$slt_page_size}&page={$page}&feedtype={$feedtype}&tpl_type={$tpl_type}&txt_title={$txt_title}&txt_feed_id={$txt_feed_id}&type={$type}&ord[]={$ord['0']}&ord[]={$ord['1']}";
}
$limit = $slt_page_size;
$kekezu->_page_obj->setAjax(1);
$kekezu->_page_obj->setAjaxDom("ajax_dom");
$pages = $kekezu->_page_obj->getPages($count, $limit, $page, $url);