本文整理匯總了PHP中IPSText::getTextClass方法的典型用法代碼示例。如果您正苦於以下問題:PHP IPSText::getTextClass方法的具體用法?PHP IPSText::getTextClass怎麽用?PHP IPSText::getTextClass使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類IPSText
的用法示例。
在下文中一共展示了IPSText::getTextClass方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: doExecute
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen]
*/
public function doExecute(ipsRegistry $registry)
{
//-----------------------------------------
// INIT
//-----------------------------------------
$info = array();
$id = intval($this->memberData['member_id']);
//-----------------------------------------
// Get HTML and skin
//-----------------------------------------
$this->registry->class_localization->loadLanguageFile(array('public_profile'), 'members');
//-----------------------------------------
// Can we access?
//-----------------------------------------
if (!$this->memberData['g_mem_info'] or $this->memberData['gbw_no_status_update']) {
$this->returnJsonError($this->lang->words['status_off']);
}
if (!$id) {
$this->returnJsonError($this->lang->words['status_off']);
}
$newStatus = trim(IPSText::getTextClass('bbcode')->stripBadWords(IPSText::parseCleanValue($_POST['new_status'])));
IPSMember::save($id, array('extendedProfile' => array('pp_status' => $newStatus, 'pp_status_update' => time())));
$this->returnJsonArray(array('status' => 'success', 'new_status' => $newStatus));
exit;
}
示例2: doExecute
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen]
*/
public function doExecute(ipsRegistry $registry)
{
//-----------------------------------------
// Security check
//-----------------------------------------
if ($this->request['k'] != $this->member->form_hash) {
$this->registry->getClass('output')->showError('no_permission', 20314);
}
//-----------------------------------------
// INIT
//-----------------------------------------
$info = array();
$id = intval($this->memberData['member_id']);
//-----------------------------------------
// Get HTML and skin
//-----------------------------------------
$this->registry->class_localization->loadLanguageFile(array('public_profile'), 'members');
//-----------------------------------------
// Can we access?
//-----------------------------------------
if (!$this->memberData['g_mem_info']) {
$this->registry->output->showError('status_off', 10268);
}
if (!$id) {
$this->registry->output->showError('status_off', 10269);
}
$newStatus = trim(IPSText::getTextClass('bbcode')->stripBadWords($this->request['new_status']));
IPSMember::save($id, array('extendedProfile' => array('pp_status' => $newStatus, 'pp_status_update' => time())));
$this->registry->output->redirectScreen($this->lang->words['status_was_changed'], $this->settings['base_url'] . 'showuser=' . $id, $this->memberData['members_seo_name']);
}
示例3: doExecute
/**
* Main function executed automatically by the controller
*
* @param object $registry Registry object
* @return @e void
*/
public function doExecute(ipsRegistry $registry)
{
/* Set up */
$inapp = trim($this->request['inapp']);
$do = !empty($this->request['do']) ? $this->request['do'] : 'all';
/* Load navigation stuff */
$classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/classes/navigation/build.php', 'classes_navigation_build');
$navigation = new $classToLoad($inapp);
/* Show warning if offline */
if ($this->settings['board_offline'] and !$this->memberData['g_access_offline']) {
$row = $this->DB->buildAndFetch(array('select' => '*', 'from' => 'core_sys_conf_settings', 'where' => "conf_key='offline_msg'"));
IPSText::getTextClass('bbcode')->parse_bbcode = 1;
IPSText::getTextClass('bbcode')->parse_html = 1;
IPSText::getTextClass('bbcode')->parse_emoticons = 1;
IPSText::getTextClass('bbcode')->parse_nl2br = 1;
IPSText::getTextClass('bbcode')->parsing_section = 'global';
$row['conf_value'] = IPSText::getTextClass('bbcode')->preDisplayParse(IPSText::getTextClass('bbcode')->preDbParse($row['conf_value']));
return $this->returnHtml($this->registry->output->getTemplate('global_other')->quickNavigationOffline($row['conf_value']));
}
/* Return */
if ($do == 'all') {
return $this->returnHtml($this->registry->output->getTemplate('global_other')->quickNavigationWrapper($navigation->loadApplicationTabs(), $navigation->loadNavigationData(), $navigation->getApp()));
} else {
return $this->returnHtml($this->registry->output->getTemplate('global_other')->quickNavigationPanel($navigation->loadNavigationData(), $navigation->getApp()));
}
}
示例4: return_html_block
/**
* return HTML block
*
* @access public
* @param array Member information
* @return string HTML block
*/
public function return_html_block($member = array())
{
/* Get blog API */
require_once IPS_ROOT_PATH . 'api/api_core.php';
require_once IPS_ROOT_PATH . 'api/blog/api_blog.php';
/* Create API Object */
$blog_api = new apiBlog();
/* Language */
$this->lang->loadLanguageFile(array('public_portal'), 'blog');
$content = '';
$blog_url = $blog_api->getBlogUrl($blog_api->getBlogID($member['member_id']));
$this->lang->words['visit_blog'] = "<a href=\"{$blog_url}\">{$this->lang->words['visit_blog']}</a>";
$entry_content = '';
$entries = $blog_api->lastXEntries('member', $member['member_id'], 5);
if (is_array($entries) && count($entries)) {
$attachments = 0;
$entry_ids = array();
foreach ($entries as $row) {
$row['_post_date'] = ipsRegistry::getClass('class_localization')->getDate($row['entry_date'], 'SHORT');
$row['_date_array'] = IPSTime::date_getgmdate($row['entry_date'] + ipsRegistry::getClass('class_localization')->getTimeOffset());
$entry_ids[$row['entry_id']] = $row['entry_id'];
IPSText::getTextClass('bbcode')->parse_html = $row['entry_html_state'] ? 1 : 0;
IPSText::getTextClass('bbcode')->parse_nl2br = $row['entry_html_state'] == 2 ? 1 : 0;
IPSText::getTextClass('bbcode')->parse_bbcode = 1;
IPSText::getTextClass('bbcode')->parsing_section = 'blog';
$row['post'] = IPSText::getTextClass('bbcode')->preDisplayParse($row['entry']);
$row['post'] = IPSText::getTextClass('bbcode')->memberViewImages($row['post']);
if ($row['entry_has_attach']) {
$parseAttachments = true;
}
$entry_content .= $this->registry->output->getTemplate('profile')->tabSingleColumn($row, $this->lang->words['readentry'], $row['entry_url'], $row['entry_name']);
}
//-----------------------------------------
// Attachments (but only if necessary)
//-----------------------------------------
if ($parseAttachments and !is_object($this->class_attach)) {
require_once IPSLib::getAppDir('core') . '/sources/classes/attach/class_attach.php';
$this->class_attach = new class_attach($this->registry);
$this->class_attach->type = 'blogentry';
$this->class_attach->init();
$entry_content = $this->class_attach->renderAttachments($entry_content, $entry_ids, 'blog_show');
$entry_content = $entry_content[0]['html'];
}
$content = $this->registry->output->getTemplate('blog_portal')->profileTabWrap($this->lang->words['visit_blog'], $entry_content);
} else {
$content .= $this->registry->output->getTemplate('profile')->tabNoContent('noblogentries');
}
//-----------------------------------------
// Return content..
//-----------------------------------------
return $content;
}
示例5: doExecute
/**
* Class entry point
*
* @param object Registry reference
* @return @e void [Outputs to screen/redirects]
*/
public function doExecute(ipsRegistry $registry)
{
/* Get board rule (not cached) */
$row = $this->DB->buildAndFetch(array('select' => '*', 'from' => 'core_sys_conf_settings', 'where' => "conf_key='gl_guidelines'"));
IPSText::getTextClass('bbcode')->parse_smilies = 1;
IPSText::getTextClass('bbcode')->parse_html = 1;
IPSText::getTextClass('bbcode')->parse_nl2br = 1;
IPSText::getTextClass('bbcode')->parse_bbcode = 1;
$row['conf_value'] = IPSText::getTextClass('bbcode')->preDisplayParse($row['conf_value'] ? $row['conf_value'] : $row['conf_default']);
$this->registry->output->addNavigation($this->settings['gl_title'], '');
$this->registry->output->setTitle($this->settings['gl_title'] . ' - ' . ipsRegistry::$settings['board_name']);
$this->registry->output->addContent($this->registry->output->getTemplate('emails')->boardRules($this->settings['gl_title'], IPSText::getTextClass('bbcode')->preDisplayParse($row['conf_value'])));
$this->registry->output->sendOutput();
}
示例6: _formatMessageForDisplay
/**
* Function to format the actual message (applies BBcode, etc)
*
* @param string Raw text
* @param array PM data
* @return string Processed text
*/
private function _formatMessageForDisplay($msgContent, $data = array())
{
IPSText::resetTextClass('bbcode');
$this->settings['max_emos'] = 0;
IPSText::getTextClass('bbcode')->parse_smilies = 1;
IPSText::getTextClass('bbcode')->parse_nl2br = 1;
IPSText::getTextClass('bbcode')->parse_html = 0;
IPSText::getTextClass('bbcode')->parse_bbcode = 1;
IPSText::getTextClass('bbcode')->parsing_section = 'pms';
IPSText::getTextClass('bbcode')->parsing_mgroup = $data['member_group_id'];
IPSText::getTextClass('bbcode')->parsing_mgroup_others = $data['mgroup_others'];
$msgContent = IPSText::getTextClass('bbcode')->preDisplayParse($msgContent);
return $msgContent;
}
示例7: doExecute
/**
* Class entry point
*
* @param object Registry reference
* @return @e void [Outputs to screen/redirects]
*/
public function doExecute(ipsRegistry $registry)
{
$raw = $this->DB->buildAndFetch(array('select' => '*', 'from' => 'core_sys_conf_settings', 'where' => 'conf_key=\'priv_body\''));
if ($this->settings['priv_title']) {
IPSText::getTextClass('bbcode')->parse_smilies = 1;
IPSText::getTextClass('bbcode')->parse_html = 1;
IPSText::getTextClass('bbcode')->parse_nl2br = 1;
IPSText::getTextClass('bbcode')->parse_bbcode = 1;
IPSText::getTextClass('bbcode')->parsing_section = 'rules';
$policy = IPSText::getTextClass('bbcode')->preDisplayParse($raw['conf_value'] ? $raw['conf_value'] : $raw['conf_default']);
$this->output .= $this->registry->getClass('output')->getTemplate('global_other')->privacyPolicy($this->settings['priv_title'], $policy);
$this->registry->output->setTitle($this->settings['priv_title'] . ' - ' . ipsRegistry::$settings['board_name']);
$this->registry->output->addContent($this->output);
$this->registry->output->sendOutput();
} else {
$this->registry->getClass('output')->showError('page_doesnt_exist', 10335, null, null, 404);
}
}
示例8: return_html_block
/**
* Feturn HTML block
*
* @access public
* @param array Member information
* @return string HTML block
*/
public function return_html_block($member = array())
{
//-----------------------------------------
// Got a member?
//-----------------------------------------
if (!is_array($member) or !count($member)) {
return $this->registry->getClass('output')->getTemplate('profile')->tabNoContent('err_no_aboutme_to_show');
}
//-----------------------------------------
// Format signature
//-----------------------------------------
if ($member['signature']) {
IPSText::getTextClass('bbcode')->parse_bbcode = $this->settings['msg_allow_code'];
IPSText::getTextClass('bbcode')->parse_smilies = 1;
IPSText::getTextClass('bbcode')->parse_html = $this->settings['msg_allow_html'];
IPSText::getTextClass('bbcode')->parse_nl2br = 1;
IPSText::getTextClass('bbcode')->parsing_section = 'signatures';
IPSText::getTextClass('bbcode')->parsing_mgroup = $member['member_group_id'];
IPSText::getTextClass('bbcode')->parsing_mgroup_others = $member['mgroup_others'];
$member['signature'] = IPSText::getTextClass('bbcode')->preDisplayParse($member['signature']);
$member['signature'] = $this->registry->getClass('output')->getTemplate('global')->signature_separator($member['signature']);
}
//-----------------------------------------
// Format 'About me'
//-----------------------------------------
IPSText::getTextClass('bbcode')->parse_html = intval($this->settings['aboutme_html']);
IPSText::getTextClass('bbcode')->parse_nl2br = 1;
IPSText::getTextClass('bbcode')->parse_smilies = $this->settings['aboutme_emoticons'];
IPSText::getTextClass('bbcode')->parse_bbcode = $this->settings['aboutme_bbcode'];
IPSText::getTextClass('bbcode')->parsing_section = 'aboutme';
IPSText::getTextClass('bbcode')->parsing_mgroup = $member['member_group_id'];
IPSText::getTextClass('bbcode')->parsing_mgroup_others = $member['mgroup_others'];
$member['pp_about_me'] = IPSText::getTextClass('bbcode')->preDisplayParse($member['pp_about_me']);
$content = $this->registry->getClass('output')->getTemplate('profile')->tabAboutMe($member);
//-----------------------------------------
// Macros...
//-----------------------------------------
$content = $this->registry->output->replaceMacros($content);
//-----------------------------------------
// Return content..
//-----------------------------------------
return $content ? $content : $this->registry->getClass('output')->getTemplate('profile')->tabNoContent('err_no_aboutme_to_show');
}
示例9: doExecute
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen/redirects]
*/
public function doExecute(ipsRegistry $registry)
{
/* Get board rule (not cached) */
$row = $this->DB->buildAndFetch(array('select' => '*', 'from' => 'core_sys_conf_settings', 'where' => "conf_key='gl_guidelines'"));
IPSText::getTextClass('bbcode')->parse_bbcode = 1;
IPSText::getTextClass('bbcode')->parse_html = 1;
IPSText::getTextClass('bbcode')->parse_nl2br = 1;
IPSText::getTextClass('bbcode')->parse_emoticons = 1;
IPSText::getTextClass('bbcode')->parsing_section = 'global';
$row['conf_value'] = IPSText::getTextClass('bbcode')->preDbParse($row['conf_value']);
$row['conf_value'] = IPSText::getTextClass('bbcode')->preDisplayParse($row['conf_value']);
/* Hacky fix for bug #15632 */
//$row['conf_value'] = str_replace( '<ul><br />' , '<ul>', $row['conf_value'] );
//$row['conf_value'] = str_replace( '<ul' , '<ul class="bbc"', $row['conf_value'] );
//$row['conf_value'] = str_replace( '</li><br />' , '</li>', $row['conf_value'] );
//$row['conf_value'] = str_replace( '</ul><br />' , '</ul>', $row['conf_value'] );
//$row['conf_value'] = preg_replace( '#<li([^\n]*)<br />#', '<li$1', $row['conf_value'] );
$this->registry->output->addNavigation($this->settings['gl_title'], '');
$this->registry->output->setTitle($this->settings['gl_title']);
$this->registry->output->addContent($this->registry->output->getTemplate('emails')->boardRules($this->settings['gl_title'], $row['conf_value']));
$this->registry->output->sendOutput();
}
示例10: __construct
/**
* Constructor
*
* @access public
* @param object ipsRegistry reference
* @return @e void
*/
public function __construct(ipsRegistry $registry)
{
/* Make object */
$this->registry = $registry;
$this->DB = $this->registry->DB();
$this->settings =& $this->registry->fetchSettings();
$this->request =& $this->registry->fetchRequest();
$this->lang = $this->registry->getClass('class_localization');
$this->member = $this->registry->member();
$this->memberData =& $this->registry->member()->fetchMemberData();
$this->generated_acp_hash = $this->generateSecureHash();
$this->_admin_auth_key = $this->getSecurityKey();
$this->registry->output->global_template = $this->registry->output->loadRootTemplate('cp_skin_global');
//------------------------------------------
// Message in a bottle?
//------------------------------------------
if (!empty($this->request['messageinabottleacp'])) {
$this->request['messageinabottleacp'] = IPSText::getTextClass('bbcode')->xssHtmlClean(IPSText::UNhtmlspecialchars(urldecode($this->request['messageinabottleacp'])));
$this->registry->output->global_message = $this->request['messageinabottleacp'];
$this->registry->output->persistent_message = intval($this->request['messagepersistent']);
}
}
示例11: _bbcodeTest
/**
* Test a bbcode
*
* @return @e void [Outputs to screen]
* @todo [Future] Also show the resulting HTML alongside the formatted content
*/
protected function _bbcodeTest()
{
$t = IPSText::stripslashes(htmlspecialchars($_POST['bbtest']));
//-----------------------------------------
// Run through libraries
//-----------------------------------------
IPSText::getTextClass('bbcode')->parse_bbcode = 1;
IPSText::getTextClass('bbcode')->parse_smilies = 0;
IPSText::getTextClass('bbcode')->parsing_section = 'global';
//-----------------------------------------
// Store the url/fix base url
//-----------------------------------------
$_current = $this->settings['base_url'];
$this->settings['base_url'] = $this->settings['board_url'] . '/index.php?';
//-----------------------------------------
// Parse
//-----------------------------------------
$t = IPSText::getTextClass('bbcode')->preDbParse($t);
$t = IPSText::getTextClass('bbcode')->preDisplayParse($t);
//-----------------------------------------
// Restore base url
//-----------------------------------------
$this->settings['base_url'] = $_current;
$this->registry->output->setMessage($this->lang->words['bbcode_test'] . $t, true);
$this->_bbcodeStart();
}
示例12: _multiTopicMmod
/**
* Topic multi-moderation
*
* @return @e void [Outputs to screen]
*/
protected function _multiTopicMmod()
{
//-----------------------------------------
// It's tea time
//-----------------------------------------
if (!strstr($this->request['tact'], 't_') or !count($this->tids)) {
$this->_showError('mod_stupid_beggar', 103114);
}
$mm_id = intval(str_replace('t_', '', $this->request['tact']));
//-----------------------------------------
// Init modfunc module
//-----------------------------------------
$this->modLibrary->init($this->forum, "", $this->moderator);
//-----------------------------------------
// Do we have permission?
//-----------------------------------------
if ($this->modLibrary->mmAuthorize() != TRUE) {
$this->_showError('mod_no_multimod', 103115);
}
$mm_data = $this->caches['multimod'][$mm_id];
if (!$mm_data) {
$this->_showError('mod_no_mm_id', 103116, 404);
}
//-----------------------------------------
// Does this forum have this mm_id
//-----------------------------------------
if ($this->modLibrary->mmCheckIdInForum($this->forum['id'], $mm_data) != TRUE) {
$this->_showError('mod_no_multimod', 103117, 404);
}
//-----------------------------------------
// Still here? We're damn good to go sir!
//-----------------------------------------
$this->modLibrary->stmInit();
//-----------------------------------------
// Open close?
//-----------------------------------------
if ($mm_data['topic_state'] != 'leave') {
if ($mm_data['topic_state'] == 'close') {
$this->modLibrary->stmAddClose();
} else {
if ($mm_data['topic_state'] == 'open') {
$this->modLibrary->stmAddOpen();
}
}
}
//-----------------------------------------
// pin no-pin?
//-----------------------------------------
if ($mm_data['topic_pin'] != 'leave') {
if ($mm_data['topic_pin'] == 'pin') {
$this->modLibrary->stmAddPin();
} else {
if ($mm_data['topic_pin'] == 'unpin') {
$this->modLibrary->stmAddUnpin();
}
}
}
//-----------------------------------------
// Approve / Unapprove
//-----------------------------------------
if ($mm_data['topic_approve']) {
if ($mm_data['topic_approve'] == 1) {
$this->modLibrary->stmAddApprove();
} else {
if ($mm_data['topic_approve'] == 2) {
$this->modLibrary->stmAddUnapprove();
}
}
}
//-----------------------------------------
// Update what we have so far...
//-----------------------------------------
$this->modLibrary->stmExec($this->tids);
//-----------------------------------------
// Topic title (1337 - I am!)
//-----------------------------------------
if ($mm_data['topic_title_st'] or $mm_data['topic_title_end']) {
$this->DB->update('topics', 'title=' . $this->DB->buildConcat(array(array($mm_data['topic_title_st'], 'string'), array('title'), array($mm_data['topic_title_end'], 'string'))), "tid IN(" . implode(',', $this->tids) . ")", false, true);
//-----------------------------------------
// Rebuild topic for SEO title
//-----------------------------------------
foreach ($this->tids as $tid) {
$this->modLibrary->rebuildTopic($tid);
}
}
//-----------------------------------------
// Add reply?
//-----------------------------------------
if ($mm_data['topic_reply'] and $mm_data['topic_reply_content']) {
$move_ids = array();
foreach ($this->tids as $tid) {
$move_ids[] = array($tid, $this->forum['id']);
}
IPSText::getTextClass('bbcode')->parse_smilies = 1;
IPSText::getTextClass('bbcode')->parse_bbcode = 1;
//.........這裏部分代碼省略.........
示例13: calendarShowEvent
//.........這裏部分代碼省略.........
if (!IPSMember::isInGroup($this->memberData, $permissionGroups)) {
$this->registry->output->showError('calendar_event_not_found', 10432, null, null, 404);
}
}
//-----------------------------------------
// Are we RSVPing?
//-----------------------------------------
if ($this->request['_rsvp'] and $event['event_rsvp']) {
if ($this->registry->permissions->check('rsvp', $this->calendar) and $this->memberData['member_id']) {
//-----------------------------------------
// Make sure we aren't already RSVPed
//-----------------------------------------
$_check = $this->DB->buildAndFetch(array('select' => 'rsvp_id', 'from' => 'cal_event_rsvp', 'where' => 'rsvp_event_id=' . $event['event_id'] . ' AND rsvp_member_id=' . $this->memberData['member_id']));
if (!$_check['rsvp_id']) {
$_insert = array('rsvp_event_id' => $event['event_id'], 'rsvp_member_id' => $this->memberData['member_id'], 'rsvp_date' => time());
$this->DB->insert('cal_event_rsvp', $_insert);
$this->registry->output->redirectScreen($this->lang->words['rsvp_saved_im'], $this->settings['base_url'] . "app=calendar&module=calendar&section=view&do=showevent&event_id=" . $event['event_id'], $event['event_title_seo'], 'cal_event');
}
}
}
//-----------------------------------------
// Comments class
//-----------------------------------------
require_once IPS_ROOT_PATH . 'sources/classes/comments/bootstrap.php';
/*noLibHook*/
$this->_comments = classes_comments_bootstrap::controller('calendar-events');
$comments = array('html' => $this->_comments->fetchFormatted($event, array('offset' => intval($this->request['st']))), 'count' => $this->_comments->count($event));
//-----------------------------------------
// Highlight...
//-----------------------------------------
if ($this->request['hl']) {
$event['event_content'] = IPSText::searchHighlight($event['event_content'], $this->request['hl']);
$event['event_title'] = IPSText::searchHighlight($event['event_title'], $this->request['hl']);
}
//-----------------------------------------
// Can we report?
//-----------------------------------------
$classToLoad = IPSLib::loadLibrary(IPSLib::getAppDir('core') . '/sources/classes/reportLibrary.php', 'reportLibrary', 'core');
$reports = new $classToLoad($this->registry);
$event['_canReport'] = $reports->canReport('calendar');
//-----------------------------------------
// Output
//-----------------------------------------
$member = IPSMember::load($event['event_member_id'], 'all');
$this->registry->output->addNavigation($this->calendar['cal_title'], "app=calendar&module=calendar&section=view&cal_id={$this->calendar['cal_id']}", $this->calendar['cal_title_seo'], 'cal_calendar');
//-----------------------------------------
// Try to match out and improve navigation
//-----------------------------------------
$_referrer = $_SERVER['HTTP_REFERER'];
if ($_referrer) {
//-----------------------------------------
// Came from add form?
//-----------------------------------------
if (preg_match("#/add\$#", $_referrer)) {
$_data = $this->calendarMakeEventHTML($event, true);
$_dateBits = explode('-', gmstrftime('%Y-%m-%d-%B', $_data['event']['_start_time']));
$this->registry->output->addNavigation($_dateBits[3] . ' ' . $_dateBits[0], "app=calendar&module=calendar&section=view&cal_id={$this->calendar['cal_id']}&m={$_dateBits[1]}&y={$_dateBits[0]}", $this->calendar['cal_title_seo'], 'cal_month');
$this->registry->output->addNavigation($_dateBits[3] . ' ' . $_dateBits[2] . ', ' . $_dateBits[0], "app=calendar&module=calendar&section=view&cal_id={$this->calendar['cal_id']}&do=showday&y={$_dateBits[0]}&m={$_dateBits[1]}&d={$_dateBits[2]}", $this->calendar['cal_title_seo'], 'cal_day');
} else {
if (preg_match("#/day\\-(\\d{4})\\-(\\d{1,2})\\-(\\d{1,2})\$#i", $_referrer, $matches)) {
$_dateBits = explode('-', gmstrftime('%Y-%m-%d-%B', gmmktime(0, 0, 0, $matches[2], $matches[3], $matches[1])));
$this->registry->output->addNavigation($_dateBits[3] . ' ' . $_dateBits[0], "app=calendar&module=calendar&section=view&cal_id={$this->calendar['cal_id']}&m={$_dateBits[1]}&y={$_dateBits[0]}", $this->calendar['cal_title_seo'], 'cal_month');
$this->registry->output->addNavigation($_dateBits[3] . ' ' . $_dateBits[2] . ', ' . $_dateBits[0], "app=calendar&module=calendar&section=view&cal_id={$this->calendar['cal_id']}&do=showday&y={$_dateBits[0]}&m={$_dateBits[1]}&d={$_dateBits[2]}", $this->calendar['cal_title_seo'], 'cal_day');
} else {
if (preg_match("#/week\\-(\\d+?)\$#i", $_referrer, $matches)) {
$_dateBits = explode('-', gmstrftime('%Y-%m-%d-%B', $matches[1]));
$this->registry->output->addNavigation($_dateBits[3] . ' ' . $_dateBits[0], "app=calendar&module=calendar&section=view&cal_id={$this->calendar['cal_id']}&m={$_dateBits[1]}&y={$_dateBits[0]}", $this->calendar['cal_title_seo'], 'cal_month');
$this->registry->output->addNavigation("{$this->lang->words['week_beginning']} " . gmstrftime('%B %d, %Y', $matches[1]), "app=calendar&module=calendar&section=view&cal_id={$this->calendar['cal_id']}&do=showweek&week={$matches[1]}", $this->calendar['cal_title_seo'], 'cal_week');
} else {
if (preg_match("#/(\\d{1,2})\\-(\\d{4})\$#i", $_referrer, $matches)) {
$_dateBits = explode('-', gmstrftime('%Y-%m-%d-%B', gmmktime(0, 0, 0, $matches[1], 15, $matches[2])));
$this->registry->output->addNavigation($_dateBits[3] . " " . $_dateBits[0], "app=calendar&module=calendar&section=view&cal_id={$this->calendar['cal_id']}&m={$_dateBits[1]}&y={$_dateBits[0]}", $this->calendar['cal_title_seo'], 'cal_month');
} else {
if (preg_match("#/(\\d+?)\\-(.+?)\$#i", $_referrer, $matches)) {
$_data = $this->calendarMakeEventHTML($event, true);
$_dateBits = explode('-', gmstrftime('%Y-%m-%d-%B', $_data['event']['_start_time']));
$this->registry->output->addNavigation($_dateBits[3] . " " . $_dateBits[0], "app=calendar&module=calendar&section=view&cal_id={$this->calendar['cal_id']}&m={$_dateBits[1]}&y={$_dateBits[0]}", $this->calendar['cal_title_seo'], 'cal_month');
} else {
$_data = $this->calendarMakeEventHTML($event, true);
$_dateBits = explode('-', gmstrftime('%Y-%m-%d-%B', $_data['event']['_start_time']));
$this->registry->output->addNavigation($_dateBits[3] . ' ' . $_dateBits[0], "app=calendar&module=calendar&section=view&cal_id={$this->calendar['cal_id']}&m={$_dateBits[1]}&y={$_dateBits[0]}", $this->calendar['cal_title_seo'], 'cal_month');
$this->registry->output->addNavigation($_dateBits[3] . ' ' . $_dateBits[2] . ', ' . $_dateBits[0], "app=calendar&module=calendar&section=view&cal_id={$this->calendar['cal_id']}&do=showday&y={$_dateBits[0]}&m={$_dateBits[1]}&d={$_dateBits[2]}", $this->calendar['cal_title_seo'], 'cal_day');
}
}
}
}
}
}
//-----------------------------------------
// Finish output
//-----------------------------------------
$this->registry->output->addNavigation($event['event_title']);
$this->registry->output->addMetaTag('keywords', $this->chosen_date['month_name'] . ' ' . $_dateBits[2] . ' events event calendar ' . $event['event_title'] . ' ' . IPSText::getTextClass('bbcode')->stripAllTags($event['event_content']), TRUE);
$this->registry->output->addMetaTag('description', str_replace("\n", " ", str_replace("\r", "", IPSText::getTextClass('bbcode')->stripAllTags($event['event_content']))), FALSE, 155);
$this->registry->output->addToDocumentHead('raw', "<link rel='up' href='" . $this->registry->output->buildSEOUrl('app=calendar&module=calendar&section=view&cal_id=' . $event['event_calendar_id'], 'publicNoSession', $this->calendar['cal_title_seo'], 'cal_calendar') . "' />");
$this->registry->output->addToDocumentHead('raw', "<link rel='author' href='" . $this->registry->output->buildSEOUrl('showuser=' . $event['event_member_id'], 'publicNoSession', $member['members_seo_name'], 'showuser') . "' />");
$this->registry->getClass('output')->addCanonicalTag('app=calendar&module=calendar&section=view&do=showevent&event_id=' . $event['event_id'], $event['event_title_seo'], 'cal_event');
$this->page_title = $event['event_title'];
$this->output .= $this->registry->output->getTemplate('calendar')->calendarShowEvent($this->calendarMakeEventHTML($event), $comments);
}
示例14: _moderation
//.........這裏部分代碼省略.........
if (!is_array($friend_ids) or !count($friend_ids)) {
$this->registry->output->silentRedirect($this->settings['base_url'] . '&app=members§ion=friends&module=profile&do=list&___msg=error&tab=pending');
}
//-----------------------------------------
// Load friends...
//-----------------------------------------
$friends = IPSMember::load($friend_member_ids);
//-----------------------------------------
// Check...
//-----------------------------------------
if (!is_array($friends) or !count($friends) or !$this->memberData['member_id']) {
$this->registry->output->silentRedirect($this->settings['base_url'] . '&app=members§ion=friends&module=profile&do=list&___msg=error&tab=pending');
}
//-----------------------------------------
// What to do?
//-----------------------------------------
if ($pp_option == 'delete') {
//-----------------------------------------
// Delete friends records
//-----------------------------------------
foreach ($friend_member_ids as $friend_id) {
$this->friend_lib->removeFriend($this->memberData['member_id'], $friend_id);
$this->friend_lib->removeFriend($friend_id, $this->memberData['member_id']);
}
$msg = 'pp_friend_removed';
} else {
//-----------------------------------------
// Ok.. approve them in the DB.
//-----------------------------------------
$this->DB->update('profile_friends', array('friends_approved' => 1), 'friends_id IN(' . implode(',', $friend_ids) . ')');
//-----------------------------------------
// And make sure they're added in reverse
//-----------------------------------------
foreach ($friend_member_ids as $friend_id) {
$this->friend_lib->addFriend($friend_id, $this->memberData['member_id'], true, false);
}
//-----------------------------------------
// Catch all (should find any missing friends)
//-----------------------------------------
if ($pp_option == 'add') {
//-----------------------------------------
// Find out who isn't already on your list...
//-----------------------------------------
$this->DB->build(array('select' => '*', 'from' => 'profile_friends', 'where' => 'friends_friend_id=' . $this->memberData['member_id'] . ' AND friends_approved=1 AND friends_member_id IN (' . implode(',', $_friend_ids) . ')'));
$this->DB->execute();
while ($row = $this->DB->fetch()) {
$friends_already[$row['friends_member_id']] = $row['friends_member_id'];
}
//-----------------------------------------
// Check which aren't already members...
//-----------------------------------------
foreach ($friend_member_ids as $id => $_id) {
if (in_array($id, $friends_already)) {
continue;
}
$friends_update[$id] = $id;
}
//-----------------------------------------
// Gonna do it?
//-----------------------------------------
if (is_array($friends_update) and count($friends_update)) {
foreach ($friends_update as $id) {
$this->DB->insert('profile_friends', array('friends_member_id' => $id, 'friends_friend_id' => $this->memberData['member_id'], 'friends_approved' => 1, 'friends_added' => time()));
}
}
}
//-----------------------------------------
// Send out message...
//-----------------------------------------
foreach ($friends as $friend) {
//-----------------------------------------
// Notifications library
//-----------------------------------------
$classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . '/sources/classes/member/notifications.php', 'notifications');
$notifyLibrary = new $classToLoad($this->registry);
IPSText::getTextClass('email')->getTemplate("new_friend_approved");
IPSText::getTextClass('email')->buildMessage(array('MEMBERS_DISPLAY_NAME' => $friend['members_display_name'], 'FRIEND_NAME' => $this->memberData['members_display_name'], 'LINK' => $this->settings['board_url'] . '/index.' . $this->settings['php_ext'] . '?app=members&module=profile&section=friends&do=list'));
IPSText::getTextClass('email')->subject = sprintf(IPSText::getTextClass('email')->subject, $this->registry->output->buildSEOUrl('showuser=' . $this->memberData['member_id'], 'public', $this->memberData['members_seo_name'], 'showuser'), $this->memberData['members_display_name']);
$notifyLibrary->setMember($friend);
$notifyLibrary->setFrom($this->memberData);
$notifyLibrary->setNotificationKey('friend_request_approve');
$notifyLibrary->setNotificationUrl($this->registry->output->buildSEOUrl('showuser=' . $this->memberData['member_id'], 'public', $this->memberData['members_seo_name'], 'showuser'));
$notifyLibrary->setNotificationText(IPSText::getTextClass('email')->message);
$notifyLibrary->setNotificationTitle(IPSText::getTextClass('email')->subject);
try {
$notifyLibrary->sendNotification();
} catch (Exception $e) {
}
}
$this->friend_lib->recacheFriends($friend);
}
//-----------------------------------------
// Recache..
//-----------------------------------------
$this->friend_lib->recacheFriends($this->memberData);
//-----------------------------------------
// Return
//-----------------------------------------
$this->registry->output->silentRedirect($this->settings['base_url'] . '&app=members§ion=friends&module=profile&do=list&___msg=' . $msg . '&tab=pending');
}
示例15: helpShowSection
/**
* Displays a help file
*
* @return @e void
*/
public function helpShowSection()
{
/* Check ID */
$id = $this->request['HID'] ? intval($this->request['HID']) : 0;
if (!$id) {
$this->helpShowTitles();
return;
}
/* Query the hel topic */
$topic = $this->DB->buildAndFetch(array('select' => 'id, title, text', 'from' => 'faq', 'where' => 'id=' . $id));
if (!$topic['id']) {
$this->registry->output->showError('help_no_id', 10128);
}
/* Parse out board URL */
$topic['text'] = str_replace('{board_url}', $this->settings['base_url'], $topic['text']);
IPSText::getTextClass('bbcode')->parse_smilies = 1;
IPSText::getTextClass('bbcode')->parse_html = 1;
IPSText::getTextClass('bbcode')->parse_nl2br = 1;
IPSText::getTextClass('bbcode')->parse_bbcode = 1;
IPSText::getTextClass('bbcode')->parsing_section = 'global';
$topic['text'] = IPSText::getTextClass('bbcode')->preDisplayParse($topic['text']);
if ($this->request['hl']) {
$topic['text'] = IPSText::searchHighlight($topic['text'], $this->request['hl']);
$topic['title'] = IPSText::searchHighlight($topic['title'], $this->request['hl']);
}
/* Output */
$this->output .= $this->registry->output->getTemplate('help')->helpShowSection($this->lang->words['help_topic'], $this->lang->words['topic_text'], $topic['title'], $topic['text']);
/* Navigation */
$this->registry->output->setTitle($this->lang->words['help_topic'] . ': ' . $topic['title'] . ' - ' . ipsRegistry::$settings['board_name']);
$this->registry->output->addNavigation($this->lang->words['help_topics'], "app=core&module=help");
$this->registry->output->addNavigation($this->lang->words['help_topic'], '');
if ($this->request['xml'] == 1) {
$classToLoad = IPSLib::loadLibrary(IPS_KERNEL_PATH . 'classAjax.php', 'classAjax');
$classAjax = new $classToLoad();
$classAjax->returnHtml($this->output);
}
}