本文整理汇总了PHP中IPSLib::getAppdir方法的典型用法代码示例。如果您正苦于以下问题:PHP IPSLib::getAppdir方法的具体用法?PHP IPSLib::getAppdir怎么用?PHP IPSLib::getAppdir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPSLib
的用法示例。
在下文中一共展示了IPSLib::getAppdir方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _buildRSSFeed
/**
* Build a private RSS feed for the member to monitor reports
*
* @access private
* @return void
*/
private function _buildRSSFeed($data = array(), $report_data)
{
$ids = array();
$this->registry->getClass('class_localization')->loadLanguageFile(array('public_reports'), 'core');
if (is_array($data) and count($data)) {
foreach ($data as $user) {
$ids[] = $user['member_id'];
}
}
if (count($ids) == 0) {
return;
}
require_once IPS_KERNEL_PATH . 'classRss.php';
$status = array();
$this->DB->build(array('select' => 'status, is_new, is_complete', 'from' => 'rc_status', 'where' => "is_new=1 OR is_complete=1"));
$this->DB->execute();
while ($row = $this->DB->fetch()) {
if ($row['is_new'] == 1) {
$status['new'] = $row['status'];
} elseif ($row['is_complete'] == 1) {
$status['complete'] = $row['status'];
}
}
//-----------------------------------------
// Now, we loop over each of the member ids
//-----------------------------------------
foreach ($ids as $id) {
//-----------------------------------------
// Clear out for new RSS doc and add channel
//-----------------------------------------
$rss = new classRss();
$channel_id = $rss->createNewChannel(array('title' => $this->lang->words['rss_feed_title'], 'link' => $this->settings['board_url'], 'description' => $this->lang->words['reports_rss_desc'], 'pubDate' => $rss->formatDate(time())));
//-----------------------------------------
// Now we need to find all open reports for
// this member
//-----------------------------------------
$this->DB->build(array('select' => 'i.*', 'from' => array('rc_reports_index' => 'i'), 'where' => 's.is_active=1', 'add_join' => array(array('from' => array('rc_status' => 's'), 'where' => 's.status=i.status', 'type' => 'left'), array('select' => 'c.my_class, c.mod_group_perm', 'from' => array('rc_classes' => 'c'), 'where' => 'c.com_id=i.rc_class', 'type' => 'left'))));
$outer = $this->DB->execute();
while ($r = $this->DB->fetch($outer)) {
//-----------------------------------------
// Fix stuff....this is hackish :(
//-----------------------------------------
if ($r['my_class'] == 'post') {
$r['FORUM_ID'] = $r['exdat1'];
}
//-----------------------------------------
// Found all open reports, can we access?
//-----------------------------------------
require_once IPSLib::getAppdir('core') . '/sources/reportPlugins/' . $r['my_class'] . '.php';
$class = $r['my_class'] . '_plugin';
$object = new $class($this->registry);
$notify = $object->getNotificationList(IPSText::cleanPermString($r['mod_group_perm']), $r);
$pass = false;
if (is_array($notify['RSS']) and count($notify['RSS'])) {
foreach ($notify['RSS'] as $memberAccount) {
if ($memberAccount['mem_id'] == $id) {
$pass = true;
break;
}
}
}
if ($pass) {
$url = $this->registry->getClass('reportLibrary')->processUrl(str_replace('&', '&', $r['url']));
$rss->addItemToChannel($channel_id, array('title' => $url, 'link' => $url, 'description' => $r['title'], 'content' => $r['title'], 'pubDate' => $rss->formatDate($r['date_updated'])));
}
}
$rss->createRssDocument();
$this->DB->update('rc_modpref', array('rss_cache' => $rss->rss_document), "mem_id=" . $id);
}
}