Esempio 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]);
 }