config = $config;
$this->helper = $helper;
$this->db = $db;
$this->cache = $cache;
$this->user = $user;
$this->auth = $auth;
$this->content_visibility = $content_visibility;
$this->phpEx = $phpEx;
$this->set_keys();
// Allow num_items to be string
if (is_string($this->num_items))
{
$this->num_items = (int) $this->config[$this->num_items];
// A precaution
if (!$this->num_items)
{
$this->num_items = 10;
}
}
}
/**
* Set keys.
*/
function set_keys()
{
}
/**
* Open feed
*/
function open()
{
}
/**
* Close feed
*/
function close()
{
if (!empty($this->result))
{
$this->db->sql_freeresult($this->result);
}
}
/**
* Set key
*/
function set($key, $value)
{
$this->keys[$key] = $value;
}
/**
* Get key
*/
function get($key)
{
return (isset($this->keys[$key])) ? $this->keys[$key] : null;
}
function get_readable_forums()
{
static $forum_ids;
if (!isset($forum_ids))
{
$forum_ids = array_keys($this->auth->acl_getf('f_read', true));
}
return $forum_ids;
}
function get_moderator_approve_forums()
{
static $forum_ids;
if (!isset($forum_ids))
{
$forum_ids = array_keys($this->auth->acl_getf('m_approve', true));
}
return $forum_ids;
}
function is_moderator_approve_forum($forum_id)
{
static $forum_ids;
if (!isset($forum_ids))
{
$forum_ids = array_flip($this->get_moderator_approve_forums());
}
return (isset($forum_ids[$forum_id])) ? true : false;
}
function get_excluded_forums()
{
static $forum_ids;
// Matches acp/acp_board.php
$cache_name = 'feed_excluded_forum_ids';
if (!isset($forum_ids) && ($forum_ids = $this->cache->get('_' . $cache_name)) === false)
{
$sql = 'SELECT forum_id
FROM ' . FORUMS_TABLE . '
WHERE ' . $this->db->sql_bit_and('forum_options', FORUM_OPTION_FEED_EXCLUDE, '<> 0');
$result = $this->db->sql_query($sql);
$forum_ids = array();
while ($forum_id = (int) $this->db->sql_fetchfield('forum_id'))
{
$forum_ids[$forum_id] = $forum_id;
}
$this->db->sql_freeresult($result);
$this->cache->put('_' . $cache_name, $forum_ids);
}
return $forum_ids;
}
function is_excluded_forum($forum_id)
{
$forum_ids = $this->get_excluded_forums();
return isset($forum_ids[$forum_id]) ? true : false;
}
function get_passworded_forums()
{
return $this->user->get_passworded_forums();
}
function get_item()
{
static $result;
if (!isset($result))
{
if (!$this->get_sql())
{
return false;
}
// Query database
$sql = $this->db->sql_build_query('SELECT', $this->sql);
$result = $this->db->sql_query_limit($sql, $this->num_items);
}
return $this->db->sql_fetchrow($result);
}
function user_viewprofile($row)
{
$author_id = (int) $row[$this->get('author_id')];
if ($author_id == ANONYMOUS)
{
// Since we cannot link to a profile, we just return GUEST
// instead of $row['username']
return $this->user->lang['GUEST'];
}
return '' . $row[$this->get('creator')] . '';
}
}
-5JLJ Ow)1_LHiTHP\ؽ8>ƽg:In='ƽ^AWKq7U+|V
U(l{JJ.fOavS}M{!ٵ{#+aWr=ǽ+p;G<=/9\J: -t?T
3؛EL㯩К֕
(!id
Cn_tOF6{oBqԦLKlsKdchKH3+fZK%S}~Cԃe!*?49o|>[
B
哋R{
ϰBEcѐdQiZ (]rI ;5+GMs{$:))\CQ6u!3uӁ^}"^&qx<@>Vep?4ڿ6h"]Zw1_v pܓ y.GjoT0.T*[_XF ~Ѧo;s1z\2L\}>VuALłWKN}7q,lvpγ>P5 : UӯS1+v+U6svz^RCL-~B{ǘnyU
|Rk(C̉kxٹ5o?(^p씶ɏ}b ݸ7oP.ֹpV|xE.<`d!wSa jL'^5l^
H)EvЂAB-QK)xrj<{xN,'HD+VSE rl>(VW1w-=ޑQ 3A6|.LeCC$jEn[ɏn&^ $dže-]f/RSs9v3Ec>CQYe.P9Pg@v{vtӨt
r$̛!J*uq
!j"ۀG0ܐw8cEdb.UZa_xB'eX"||NxF9Qޑ KVŲ$>bZ"&ީ?:ØeRMDʙZrq5}( -r