本文整理匯總了PHP中IPSCookie類的典型用法代碼示例。如果您正苦於以下問題:PHP IPSCookie類的具體用法?PHP IPSCookie怎麽用?PHP IPSCookie使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了IPSCookie類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _toggleSidePanel
/**
* Toggle side panel on/off without JS
*
* @access public
* @return void
* @see The Dark Knight (it was an awesome movie)
*/
public function _toggleSidePanel()
{
$current = IPSCookie::get('hide_sidebar');
$new = $current ? 0 : 1;
IPSCookie::set('hide_sidebar', $new);
$this->registry->getClass('output')->silentRedirect($this->settings['base_url']);
}
示例2: boardIndexTemplate
function boardIndexTemplate($lastvisit = "", $stats = array(), $calendar_events = FALSE, $birthdays = FALSE, $chat_html = '', $news_data = array(), $cat_data = array(), $show_side_blocks = true, $side_blocks = array())
{
$IPBHTML = "";
$this->templateVars['sidebar_enabled'] = "{$show_side_blocks}";
$this->__default__templateVars['sidebar_enabled'] = "{$show_side_blocks}";
$IPBHTML .= "" . $this->registry->getClass('output')->addJSModule("board", "0") . "\n" . $this->registry->getClass('output')->addJSModule("hooks", "0") . "<script type='text/javascript'>\n//<![CDATA[\n\tipb.global.boardMarkers = {$H}({\n\t\t'f_cat_unread': \"" . $this->registry->getClass('output')->getReplacement("f_cat_read") . "\",\n\t\t'f_unread': \"" . $this->registry->getClass('output')->getReplacement("f_read") . "\",\n\t\t'f_pass_unread': \"" . $this->registry->getClass('output')->getReplacement("f_pass_read") . "\"\n\t});\n\tvar markerURL = \"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=forums&module=ajax§ion=markasread&secure_key={$this->member->form_hash}&i=1&forumid=", 'public', ''), "", "") . "\"; // Ajax URL so don't use &\n//]]>\n</script>\n" . ($this->templateVars['sidebar_enabled'] ? "<a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=forums&module=extras&section=toggle", 'public', ''), "", "") . "' id='close_sidebar' class='sidebar_toggle rounded' " . (IPSCookie::get('hide_sidebar') != '1' ? "style='display: none'" : "") . "><img src='{$this->settings['img_url']}/sidebar_close.png' alt='{$this->lang->words['sidebar_close']}' /></a>\n\t<a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=forums&module=extras&section=toggle", 'public', ''), "", "") . "' id='open_sidebar' class='sidebar_toggle rounded' " . (IPSCookie::get('hide_sidebar') == '1' ? "style='display: none'" : "") . "><img src='{$this->settings['img_url']}/sidebar_open.png' alt='{$this->lang->words['sidebar_open']}' /></a>" : "") . "\n<h2 class='hide'>{$this->lang->words['board_index_title']}</h2>\n<div id='board_index' class='clearfix'>\n\t" . ($this->templateVars['sidebar_enabled'] ? "<div id='index_stats' class='right clearfix' " . (IPSCookie::get('hide_sidebar') == '1' ? "style='display: none'" : "") . ">\n\t\t\t" . $this->__f__ff88473eff708eb9314ce7282dac4715($lastvisit, $stats, $calendar_events, $birthdays, $chat_html, $news_data, $cat_data, $show_side_blocks, $side_blocks) . "\t\t</div>" : "") . "\n\t\n\t\n\t<div id='categories' class='" . (IPSCookie::get('hide_sidebar') == '1' || !$this->templateVars['sidebar_enabled'] ? "no_sidebar" : "") . " clearfix'>\n\t\t" . ((is_array($news_data) and count($news_data)) ? "\n\t\t\t<div id='latest_news' class='row2'><strong>{$this->lang->words['newslink']}</strong> <a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("showtopic={$news_data['id']}", 'public', ''), "{$news_data['seo_title']}", "showtopic") . "' title='{$this->lang->words['newslink']}'>{$news_data['title']}</a></div>\n\t\t" : "") . "\n\t<!-- CATS AND FORUMS -->\n\t\t" . ((is_array($cat_data) and count($cat_data)) ? "\n\t\t\t" . $this->__f__055700bb587a2b33772bc541b89a163e($lastvisit, $stats, $calendar_events, $birthdays, $chat_html, $news_data, $cat_data, $show_side_blocks, $side_blocks) . "\t\t" : "") . "\n\t</div>\n</div>\n<ul id='stat_links' class='filter_bar rounded'>\n\t<li><a href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=core&module=search&do=active", 'public', ''), "", "") . "\" title=\"{$this->lang->words['today_active_cont']}\">{$this->lang->words['new_active_cont']}</a></li>\n\t<li><a href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=forums&module=extras&section=stats&do=leaders", 'public', ''), "", "") . "\" title=\"{$this->lang->words['sm_forum_leaders_title']}\">{$this->lang->words['sm_forum_leaders']}</a></li>\n\t<li><a href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=forums&module=extras&section=stats", 'public', ''), "", "") . "\" title=\"{$this->lang->words['sm_all_posters_title']}\">{$this->lang->words['sm_today_posters']}</a></li>\n\t<li><a href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=members&section=view&module=list&max_results=20&sort_key=posts&sort_order=desc&filter=ALL", 'public', ''), "", "") . "\" title=\"{$this->lang->words['sm_overall_posters_title']}\">{$this->lang->words['sm_overall_posters']}</a></li>\n</ul>\n<div id='board_statistics' class='statistics general_box clearfix'>\n\t" . ($this->settings['show_totals'] ? "\n\t\t<div id='stats'>\n\t\t\t<h2>{$this->lang->words['board_stats']}</h2>\n\t\t\t<dl>\n\t\t\t\t<dt>{$this->lang->words['total_posts']}</dt>\n\t\t\t\t<dd>{$stats['info']['total_posts']}</dd>\n\t\t\t\t<dt>{$this->lang->words['total_members']}</dt>\n\t\t\t\t<dd>{$stats['info']['mem_count']}</dd>\n\t\t\t\t<dt>{$this->lang->words['newest_member']}</dt>\n\t\t\t\t<dd><a href='{$stats['info']['last_mem_link']}' title='{$this->lang->words['view_profile']}'>{$stats['info']['last_mem_name']}</a>" . $this->registry->getClass('output')->getTemplate('global')->user_popup($stats['info']['last_mem_id'], $stats['info']['last_mem_seo']) . " </dd>\n\t\t\t\t<dt>{$this->lang->words['online_at_once']}</dt>\n\t\t\t\t<dd>{$stats['info']['most_online']}<br /><span class='extra'>{$this->lang->words['on']} {$stats['info']['most_time']}</span></dd>\n\t\t\t</dl>\n\t\t</div>\n\t" : "") . "\n\t" . ($this->settings['show_active'] ? "<div id='active_users' class='stats_list'>\n\t\t\t<h2>\n\t\t\t\t{$stats['TOTAL']} {$this->lang->words['active_users_text']} <span>{$this->lang->words['active_users']}</span><br />\n\t\t\t\t<span class='desc'>{$stats['MEMBERS']} {$this->lang->words['members']}, {$stats['GUESTS']} {$this->lang->words['guests']}, {$stats['ANON']} {$this->lang->words['anon_users']} | {$this->lang->words['show_by']}: <a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=members&module=online&sort_order=desc", 'public', ''), "", "") . "'>{$this->lang->words['oul_click']}</a> {$this->lang->words['or']} <a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=members&module=online&sort_key=name&sort_order=asc&show_mem=reg", 'public', ''), "", "") . "'>{$this->lang->words['oul_name']}</a></span>\n\t\t\t</h2>\n\t\t\t" . (count($stats['NAMES']) ? "\n\t\t\t\t<p>\n\t\t\t\t\t<span class='name'>" . implode(",</span> <span class='name'>", $stats['NAMES']) . "</span>\t\t\t\t\t\n\t\t\t\t</p>\n\t\t\t" : "") . "\n\t\t</div>" : "") . "\n\t" . ($calendar_events ? "<div id='cal_events' class='stats_list'>\n\t\t<h2>{$this->lang->words['upcoming_events']}</h2>\n\t\t" . (is_array($calendar_events) ? "\n\t\t\t<p>\n\t\t\t\t<span class='name'>" . implode(",</span> <span class='name'>", $calendar_events) . "</span>\n\t\t\t</p>\n\t\t" : "\n\t\t\t<p>{$calendar_events}</p>\n\t\t") . "\n\t</div>" : "") . "\n\t\n\t" . (($birthdays !== FALSE and is_array($birthdays['users']) and count($birthdays['users'])) ? "\n\t\t<div id='cal_bdays' class='stats_list'>\n\t\t\t<h2>{$birthdays['count']} {$this->lang->words['birthdays_today']}</h2>\n\t\t\t<p>\n\t\t\t\t<span class='name'>" . implode(",</span> <span class='name'>", $birthdays['users']) . "</span>\t\t\t\t\t\n\t\t\t</p>\n\t\t</div>\n\t" : "" . (($this->settings['show_birthdays'] and !$this->settings['autohide_bday']) ? "\n\t\t\t<div id='cal_bdays' class='stats_list'>\n\t\t\t\t<h2>0 {$this->lang->words['birthdays_today']}</h2>\n\t\t\t\t<p>{$this->lang->words['no_birth_users']}</p>\n\t\t\t</div>\n\t\t" : "") . "") . "\n\t\n</div>\n" . (($this->memberData['members_auto_dst'] == 1 and $this->settings['time_dst_auto_correction']) ? "\n<script type='text/javascript'>\n\tipb.vars['dst_on']\t= parseInt(\"{$this->memberData['dst_in_use']}\");\n\t\n\tipb.board.checkDST();\n</script>\n" : "") . "";
return $IPBHTML;
}
示例3: _toggleSidePanel
/**
* Toggle side panel on/off without JS
*
* @return @e void
* @see The Dark Knight (it was an awesome movie)
*/
public function _toggleSidePanel()
{
/* Security Check */
if ($this->request['secure_key'] != $this->member->form_hash) {
$this->registry->output->showError('usercp_forums_bad_key', 102998, null, null, 403);
}
$current = IPSCookie::get('hide_sidebar');
$new = $current ? 0 : 1;
IPSCookie::set('hide_sidebar', $new);
$this->registry->getClass('output')->silentRedirect($this->settings['base_url'] . 'act=idx', 'false');
}
示例4: chatRoom
function chatRoom($options = array(), $chatters = array())
{
$IPBHTML = "";
if (IPSLib::locationHasHooks('skin_ipchat', $this->_funcHooks['chatRoom'])) {
$count_fc473221c0d8519b3b35e078488c45d5 = is_array($this->functionData['chatRoom']) ? count($this->functionData['chatRoom']) : 0;
$this->functionData['chatRoom'][$count_fc473221c0d8519b3b35e078488c45d5]['options'] = $options;
$this->functionData['chatRoom'][$count_fc473221c0d8519b3b35e078488c45d5]['chatters'] = $chatters;
}
$IPBHTML .= "" . $this->registry->getClass('output')->addJSModule("chat", "0") . "\n" . $this->registry->getClass('output')->addToDocumentHead('importcss', "{$this->settings['css_base_url']}style_css/{$this->registry->output->skin['_csscacheid']}/ipb_editor.css") . "\n<script type='text/javascript'>\n\t// Basic variables\n\tvar roomId\t\t= {$options['roomId']};\n\tvar userId\t\t= {$options['userId']};\n\tvar userName\t= '" . ($this->memberData['member_id'] ? "{$this->memberData['members_display_name']}" : "{$this->memberData['members_display_name']}_{$options['userId']}") . "';\n\tvar accessKey\t= '{$options['accessKey']}';\n\tvar serverHost\t= '{$options['serverHost']}';\n\tvar serverPath\t= '{$options['serverPath']}';\n\tvar ourUrl\t\t= '{$options['ourUrl']}';\n\tUSE_RTE\t\t\t= 0;\n\tvar isMobile\t= 0;\n\t// Chat settings\t\n\tipb.chat.condenseTime\t\t= parseInt({$this->settings['ipchat_limit_time']});\n\tipb.chat.maxMessages\t\t= parseInt({$this->settings['ipchat_max_messages']});\n\tipb.chat.moderator\t\t\t= parseInt({$options['moderator']});\n\tipb.chat.private\t\t\t= parseInt({$options['private']});\n\tipb.chat.hideEnterExit\t\t= parseInt({$this->settings['ipchat_hide_usermessage']});\n\tipb.chat.noBuffer\t\t\t= parseInt('{$this->settings['ipchat_no_buffer']}');\n\tipb.chat.inactiveKick\t\t= parseInt('{$this->settings['ipchat_inactive_minutes']}');\n\tipb.chat.user24hour \t\t= parseInt('{$this->settings['ipchat_24hour']}');\n\t\n\t// Set up templates\n\tipb.chat.templates['msg-1']\t\t\t\t= new Template( \"<li class='post chat-message #{ownclass}'>#{photo} <label>#{username}</label> <div>#{message}</div></li>\" );\n\tipb.chat.templates['msg-1-compound']\t= new Template( \"<li class='post chat-message #{ownclass}'><div class='hider'> </div><div>#{message}</div></li>\" );\n\tipb.chat.templates['msg-2']\t\t\t\t= new Template( \"<li class='post chat-notice'>#{photo} <label>#{username}</label> <div>#{action}</div></li>\" );\n\tipb.chat.templates['msg-3']\t\t\t\t= new Template( \"<li class='post chat-me'>#{photo} <label>#{username}</label> <div>**#{message}**</div></li>\" );\n\tipb.chat.templates['msg-4']\t\t\t\t= new Template( \"<li class='post chat-system'>{$this->lang->words['sys_message_pre']} #{message}</li>\" );\n\tipb.chat.templates['msg-5']\t\t\t\t= new Template( \"<li class='post chat-moderator'><label class='fluid'>#{username}</label> <div>{$this->lang->words['_kicked']} #{extra}</div></li>\" );\n\tipb.chat.templates['msg-K']\t\t\t\t= new Template( \"<li class='post chat-moderator'><div>{$this->lang->words['youve_been_kicked']}</div></li>\" );\n\tipb.chat.templates['send_private']\t\t= new Template( \"<div id='priv_#{id}_wrap'><h3 class='bar'>{$this->lang->words['sendprivatechat']}</h3><div class='chat-private-message'><textarea name='message_content' id='priv_chat_text_#{id}' cols='25' rows='2'></textarea> <input type='submit' value='{$this->lang->words['sendprivatebutton']}' class='input_submit add_folder' id='#{id}_submit' onclick='return ipb.chat.sendPrivateChat( #{id} );' /></div></div>\" );\n\tipb.chat.templates['new-tab']\t\t\t= new Template( \"<a href='#tab-#{id}' rel='#{id}'>#{name} <img src='{$this->settings['img_url']}/cross.png' alt='x' class='right' id='close-chat-tab-#{id}' /></a>\" );\n\tipb.chat.templates['count-title']\t\t= new Template( \"" . str_replace('%s', '#{count}', $this->lang->words['chattab_count']) . "\" );\n\t\n\t// Set some language vars\n\tipb.lang['time_am']\t\t\t\t= \"{$this->lang->words['time_am']}\";\n\tipb.lang['time_pm']\t\t\t\t= \"{$this->lang->words['time_pm']}\";\n\tipb.lang['entered_room']\t\t= \" {$this->lang->words['entered_room']}\";\n\tipb.lang['left_room']\t\t\t= \" {$this->lang->words['left_room']}\";\n\tipb.lang['chat_kick_user']\t\t= \"{$this->lang->words['chat_kick_user']}\";\n\tipb.lang['chat_ban_user']\t\t= \"{$this->lang->words['chat_ban_user']}\";\n\tipb.lang['chat_priv_user']\t\t= \"{$this->lang->words['chat_priv_user']}\";\n\tipb.lang['cant_kick_self']\t\t= \"{$this->lang->words['cant_kick_self']}\";\n\tipb.lang['youve_been_kicked']\t= \"{$this->lang->words['youve_been_kicked']}\";\n\tipb.lang['block_priv_user']\t\t= \"{$this->lang->words['block_priv_user']}\";\n\tipb.lang['unblock_priv_user']\t= \"{$this->lang->words['unblock_priv_user']}\";\n\tipb.lang['cant_block_user']\t\t= \"{$this->lang->words['cant_block_user']}\";\n\tipb.lang['noprivate_withignored'] = \"{$this->lang->words['noprivate_withignored']}\";\n\tipb.lang['ban_user_confirm']\t= \"{$this->lang->words['banconfirmpopup']}\";\n\t\n\t// Emoticons\n\tipb.chat.emoticons\t\t\t= \$H({ " . IPSLib::fetchEmoticonsAsJson($this->registry->output->skin['set_emo_dir'], true) . " });\n\tipb.vars['emoticon_url']\t= \"{$this->settings['emoticons_url']}\";\n\tipb.vars['img_url']\t\t\t= '{$this->settings['img_url']}';\n\t\n\t// Sound\n\tipb.chat.soundEnabled\t\t= " . (IPSCookie::get('chat_sounds') == 'off' ? "0" : "1") . ";\n\tipb.chat.soundOnImg\t\t\t= \"{$this->settings['img_url']}/bell.png\";\n\tipb.chat.soundOffImg\t\t= \"{$this->settings['img_url']}/bell_off.png\";\n\t\n\t// Chatters name formatting\n\t" . $this->__f__776f6e2cf0409238d7f8b06df58633b5($options, $chatters) . "\t// Ignore private chats from..\n\t" . $this->__f__5cb7dc707613b708061e35c39c0315de($options, $chatters) . "\t" . ((isset($this->memberData['_ignoredUsers']) and count($this->memberData['_ignoredUsers'])) ? "\n\t\t" . $this->__f__912a9882eb2468aa711103e006f1db77($options, $chatters) . "\t" : "") . "\n\t\n\t// Badwords\n\t" . ((is_array($this->caches['badwords']) and count($this->caches['badwords'])) ? "\n\t\t" . $this->__f__a322b0264fb42d72e2ed89b6f99a822a($options, $chatters) . "\t" : "") . "\n\t\n\t// Groups\n\t" . $this->__f__2a73ab0bb6c4c786423dde2785d55fd9($options, $chatters) . "</script>\n<script type='text/javascript' src='{$this->settings['public_dir']}js/ips.editor.js'></script>\n" . (!$this->request['_popup'] ? "\n\t<h1 class='ipsType_pagetitle'>" . IPSLib::getAppTitle('ipchat') . "</h1>\n\t<br /><br />\n" : "") . "\n<div class='ipsBox ipsLayout ipsLayout_withright ipsPostForm clearfix'>\n\t<div class='ipsBox_container ipsLayout_right ipsPostForm_sidebar'>\n\t\t<div id='chat-room-list' style='display:none'>\n\t\t\t<h3 class='bar'>{$this->lang->words['chats']}</h3>\n\t\t\t<div class='ipsPad ipsSideMenu'>\n\t\t\t\t<ul id='chat-tab-holder'>\n\t\t\t\t\t<li class='active' id='tab-chatroom'><a href='#tab-chatroom' rel='chatroom'>{$this->lang->words['chat_tab_home']}</a></li>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t</div>\t\n\t\t<h3 class='bar'><span id='online-chat-count'>" . (($_count = count($chatters)) ? "{$_count}" : "0") . "</span> {$this->lang->words['whos_chatting_ttl']}</h3>\n\t\t<div class='ipsPad' id='chatters-online-wrap'>\n\t\t\t<ul id='chatters-online'>\n\t\t\t\t" . $this->__f__85f7a2a7de7bd273e202a92898fb0067($options, $chatters) . "\t\t\t</ul>\n\t\t</div>\n\t\t<div class='ipsPad right'>\n\t\t\t<ul class='ipsList_inline'>\n\t\t\t\t<li>\n\t\t\t\t\t<a class='ipsButton_secondary' href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("module=ipschat&section=chat&do=leave&room={$options['roomId']}&user={$options['userId']}&access_key={$options['accessKey']}&secure_key={$this->member->form_hash}" . ($this->request['_popup'] ? "&popup=1" : "") . "", "publicWithApp", ''), "", "") . "' title='{$this->lang->words['leave_room']}' id='leave_room'><img src='{$this->settings['img_url']}/cross.png' alt='{$this->lang->words['leave_room']}' /> {$this->lang->words['leave_room']}</a>\n\t\t\t\t</li>\n\t\t\t\t<li>\n\t\t\t\t\t<a class='ipsButton_secondary' href='#' title='{$this->lang->words['toggle_sound']}' id='sound_toggle'> <img id='sound_toggle_img' src='{$this->settings['img_url']}/" . (IPSCookie::get('chat_sounds') == 'off' ? "bell_off.png" : "bell.png") . "' alt='{$this->lang->words['toggle_sound']}' /> </a>\n\t\t\t\t</li>\n\t\t\t\t" . (!$this->request['_popup'] ? "\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<a class='ipsButton_secondary' href='#' title='{$this->lang->words['chat_new_window']}' id='chat_new_window'><img src='{$this->settings['img_url']}/chat/window_open.png' alt='{$this->lang->words['chat_new_window']}' /></a>\n\t\t\t\t\t</li>\n\t\t\t\t" : "") . "\n\t\t\t</ul>\n\t\t</div>\n\t</div>\n\t<div class='ipsBox_container ipsLayout_content'>\n\t\t<div id='scrollbar_container'>\n\t\t\t<div id='messages-display'><span id='initial_message'>{$this->lang->words['please_wait_chats']}</span></div>\n\t\t</div>\n\t\t<form id='chat-form' action='#' method='post'>\n\t\t\t<input type='hidden' name='1_wysiwyg_used' id='1_wysiwyg_used' value='0' />\n\t\t\t<input type='hidden' name='editor_ids[]' value='1' />\n\t\t\t<div class='ips_editor' id='editor_message'>\n\t\t\t\t<div id='message_controls' class='controls'>\n\t\t\t\t\t<ul id='message_toolbar_2' class='toolbar' style='display: none'>\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<span id='message_cmd_bold' class='rte_control rte_button' title='{$this->lang->words['js_tt_bold']}'><img src='{$this->settings['img_url']}/rte_icons/bold.png' alt='{$this->lang->words['js_tt_bold']}' /></span>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<span id='message_cmd_italic' class='rte_control rte_button' title='{$this->lang->words['js_tt_italic']}'><img src='{$this->settings['img_url']}/rte_icons/italic.png' alt='{$this->lang->words['js_tt_italic']}' /></span>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<span id='message_cmd_underline' class='rte_control rte_button' title='{$this->lang->words['js_tt_underline']}'><img src='{$this->settings['img_url']}/rte_icons/underline.png' alt='{$this->lang->words['js_tt_underline']}' /></span>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<span id='emoticons_custom_menu' class='ipbmenu rte_control rte_button' title='{$this->lang->words['js_tt_emoticons']}'><img src='{$this->settings['img_url']}/rte_icons/emoticons.png' alt='{$this->lang->words['js_tt_emoticons']}' /></span>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<span id='message_cmd_link' class='rte_control rte_palette' title='{$this->lang->words['js_tt_link']}'><img src='{$this->settings['img_url']}/rte_icons/link.png' alt='{$this->lang->words['js_tt_link']}' /></span>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t\t<div id='message_wrap' class='editor'>\n\t\t\t\t\t<textarea name=\"message\" class=\"input_rte\" id=\"message_textarea\" rows=\"3\" cols=\"50\" tabindex=\"0\" maxlength=\"450\"></textarea>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<input type='submit' id='chat-submit' class='input_submit' value='{$this->lang->words['chat_post_button']}' />\n\t\t</form>\n\t</div>\n</div>\n<div id='mod-menu-container'>\n\t" . $this->__f__b9925e475553743bdec6c74675fb1a60($options, $chatters) . "</div>\n<div id='emoticons_custom_menu_menucontent'></div>\n<script type='text/javascript'>\n\tif( \$( 'message_toolbar_2' ) ){ \$( 'message_toolbar_2' ).show(); }\n\tipb.editor_values.get('templates')['link'] = new Template(\"<label for='#{id}_url'>{$this->lang->words['js_template_url']}</label><input type='text' class='input_text' id='#{id}_url' value='http://' tabindex='10' /><label for='#{id}_urltext'>{$this->lang->words['js_template_link']}</label><input type='text' class='input_text _select' id='#{id}_urltext' value='{$this->lang->words['js_template_default']}' tabindex='11' /><input type='submit' value='{$this->lang->words['js_template_insert_link']}' tabindex='12' />\");\n\tipb.editor_values.get('templates')['emoticons_showall'] = new Template(\"<input class='input_submit emoticons' type='button' id='#{id}_all_emoticons' value='{$this->lang->words['show_all_emoticons']}' />\");\n\tipb.editor_values.get('templates')['emoticon_wrapper'] = new Template(\"<h4><span>{$this->lang->words['emoticons_template_title']}</span></h4><div id='#{id}_emoticon_holder' class='emoticon_holder'></div>\");\n\tipb.editor_values.set( 'show_emoticon_link', false );\n\tipb.editor_values.set( 'emoticons', ipb.chat.emoticons );\n\tipb.editor_values.set( 'bbcodes', \$H(" . IPSLib::fetchBbcodeAsJson() . ") );\n\tipb.editors[ 'message' ] = new ipb.editor( 'message', 0 );\n\t/* Load emoticons on the fly ... */\n\tvar _emoticonsLoaded\t= false;\n\t\$('emoticons_custom_menu').observe( 'click', function( e ){ \n\t\tif( !_emoticonsLoaded )\n\t\t{\n\t\t\tnew Ajax.Request( \n\t\t\t\t\t\t\t\tipb.vars['base_url'] + \"&app=ipchat&module=ajax§ion=getemoticons&md5check=\" + ipb.vars['secure_hash'], \n\t\t\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t\t\tmethod: 'get',\n\t\t\t\t\t\t\t\t\tonSuccess: function(t)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\$('emoticons_custom_menu_menucontent').update( t.responseText );\n\t\t\t\t\t\t\t\t\t\t_emoticonsLoaded\t= true;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t}\n\t});\n\tfunction addEmoImage(elem){\n\t\tvar code = elem.up('tr').down('a').innerHTML;\n\t\tvar title = elem.up('tr').down('img').readAttribute('title');\n\t\tipb.editors[ 'message' ].insert_emoticon('', title, code,'');\n\t}\n</script>\n\t\t\t\n<!--Iframes used for cross-domain \"AJAX\"-->\n<div id='iframeContainer'>\n<div id='storage_container_chatroom' class='storage-container'><ul id='storage_chatroom'></ul></div>\n</div>";
return $IPBHTML;
}
示例5: _change
/**
* Changes the skin ID choice for the member
*
* @return @e void
*/
protected function _change()
{
$skinId = $this->request['skinId'];
if ($this->request['skinId'] != 'setAsMobile' && $this->request['k'] != $this->member->form_hash) {
$this->registry->output->showError('no_permission', 10122243, FALSE, '', 403);
}
if (is_numeric($skinId)) {
/* Rudimentaty check */
if ($this->registry->output->allSkins[$skinId]['_youCanUse'] and $this->registry->output->allSkins[$skinId]['_gatewayExclude'] !== TRUE) {
if ($this->memberData['member_id']) {
/* Update... */
IPSMember::save($this->memberData['member_id'], array('core' => array('skin' => $skinId)));
} else {
IPSCookie::set('guestSkinChoice', $skinId);
}
/* Make sure mobile skin is removed */
IPSCookie::set("mobileApp", 'false', -1);
IPSCookie::set("mobileBrowser", 0, -1);
/* remove user agent bypass */
IPSCookie::set("uagent_bypass", 0, -1);
/* Update member row */
$this->memberData['skin'] = $skinId;
}
} else {
if ($skinId == 'fullVersion') {
/* Set cookie */
IPSCookie::set("uagent_bypass", 1, -1);
IPSCookie::set("mobileBrowser", 0, -1);
} else {
if ($skinId == 'unlockUserAgent') {
$this->member->updateMySession(array('uagent_bypass' => 1));
/* Set cookie */
IPSCookie::set("uagent_bypass", 1, -1);
IPSCookie::set("mobileBrowser", 0, -1);
} else {
if ($skinId == 'setAsMobile') {
$this->member->updateMySession(array('uagent_bypass' => 0));
/* Set cookie */
IPSCookie::set("uagent_bypass", 0, -1);
IPSCookie::set("mobileBrowser", 1, -1);
}
}
}
}
/* Redirect */
if ($this->settings['query_string_real']) {
$url = preg_replace('#&k=(?:\\S+?)($|&)#', '\\1', str_replace('&', '&', $this->settings['query_string_real']));
$url = preg_replace('#&settingNewSkin=(?:\\S+?)($|&)#', '\\1', $url);
$url = preg_replace('#&setAsMobile=(?:\\S+?)($|&)#', '\\1', $url);
$this->registry->getClass('output')->silentRedirect($this->settings['board_url'] . '?' . $url, '', true);
}
$this->registry->getClass('output')->silentRedirect($this->settings['board_url'], '', true);
}
示例6: boardIndexTemplate
function boardIndexTemplate($lastvisit = "", $stats = array(), $cat_data = array(), $show_side_blocks = true, $side_blocks = array())
{
$IPBHTML = "";
if (IPSLib::locationHasHooks('skin_boards', $this->_funcHooks['boardIndexTemplate'])) {
$count_d79a4680f047b95f9c696f93b859d2a2 = is_array($this->functionData['boardIndexTemplate']) ? count($this->functionData['boardIndexTemplate']) : 0;
$this->functionData['boardIndexTemplate'][$count_d79a4680f047b95f9c696f93b859d2a2]['lastvisit'] = $lastvisit;
$this->functionData['boardIndexTemplate'][$count_d79a4680f047b95f9c696f93b859d2a2]['stats'] = $stats;
$this->functionData['boardIndexTemplate'][$count_d79a4680f047b95f9c696f93b859d2a2]['cat_data'] = $cat_data;
$this->functionData['boardIndexTemplate'][$count_d79a4680f047b95f9c696f93b859d2a2]['show_side_blocks'] = $show_side_blocks;
$this->functionData['boardIndexTemplate'][$count_d79a4680f047b95f9c696f93b859d2a2]['side_blocks'] = $side_blocks;
}
$this->templateVars['sidebar_enabled'] = "{$show_side_blocks}";
$this->__default__templateVars['sidebar_enabled'] = "{$show_side_blocks}";
$IPBHTML .= "" . $this->registry->getClass('output')->addJSModule("board", "0") . "" . (true ? "" : "") . "\r\n<div id='board_index' class='ipsLayout " . ($this->templateVars['sidebar_enabled'] ? "ipsLayout_withright" : "") . " ipsLayout_largeright clearfix " . (IPSCookie::get('hide_sidebar') == '1' ? "no_sidebar" : "") . "'>\t\r\n\t<div id='categories' class='ipsLayout_content clearfix'>\r\n\t<!-- CATS AND FORUMS -->\r\n\t\t" . ((is_array($cat_data) and count($cat_data)) ? "\r\n\t\t\t" . $this->__f__f3046b4671aec0807f8ac620415036a8($lastvisit, $stats, $cat_data, $show_side_blocks, $side_blocks) . "\t\t" : "") . "\r\n\t</div>\r\n\t" . ($this->templateVars['sidebar_enabled'] ? "<div id='index_stats' class='ipsLayout_right clearfix' " . (IPSCookie::get('hide_sidebar') == '1' ? "style='display: none'" : "") . ">\r\n\t\t\t" . $this->__f__89030e7582e797890a67a50f095f2544($lastvisit, $stats, $cat_data, $show_side_blocks, $side_blocks) . "\t\t</div>\r\n\t\t<a href='#' id='toggle_sidebar' title='{$this->lang->words['toggle_sidebar']}' data-closed=\"{$this->lang->words['_laquo']}\" data-open=\"×\"> </a>" : "") . "\r\n</div>\r\n<script type='text/javascript'>\r\n//<![CDATA[\r\n\tvar markerURL = ipb.vars['base_url'] + \"app=forums&module=ajax§ion=markasread&i=1\"; // Ajax URL so don't use &\r\n\tvar unreadIcon = \"<img src='{$this->settings['img_url']}/f_icon_read.png' />\";\r\n\t\r\n\t" . ((is_array($cat_data) and count($cat_data)) ? "\r\n\t\t" . $this->__f__2d7df5c3f0ad6083957d5ca77bafc27f($lastvisit, $stats, $cat_data, $show_side_blocks, $side_blocks) . "\t" : "") . "\r\n//]]>\r\n</script>\r\n" . ($this->settings['show_totals'] ? "\r\n\t<div id='board_stats'>\t\t\r\n\t\t<ul class='ipsType_small ipsList_inline'>\r\n\t\t\t<li class='clear'>\r\n\t\t\t\t<span class='value'>{$stats['info']['total_posts']}</span>\r\n\t\t\t\t{$this->lang->words['total_posts']}\r\n\t\t\t</li>\r\n\t\t\t<li class='clear'>\r\n\t\t\t\t<span class='value'>{$stats['info']['mem_count']}</span>\r\n\t\t\t\t{$this->lang->words['total_members']}\r\n\t\t\t</li>\r\n\t\t\t<li class='clear'>\r\n\t\t\t\t" . IPSMember::makeProfileLink($stats['info']['last_mem_name'], $stats['info']['last_mem_id'], $stats['info']['last_mem_seo'], 'value') . "\r\n\t\t\t\t{$this->lang->words['newest_member']}\r\n\t\t\t</li>\r\n\t\t\t<li class='clear' data-tooltip=\"{$stats['info']['most_time']}\">\r\n\t\t\t\t<span class='value'>{$stats['info']['most_online']}</span>\r\n\t\t\t\t{$this->lang->words['online_at_once']}\r\n\t\t\t</li>\r\n\t\t</ul>\r\n\t</div>\r\n" : "") . "\r\n<div id='board_statistics' class='statistics clearfix'>\r\n\t<ul id='stat_links' class='ipsList_inline right ipsType_small'>\r\n\t\t" . (1 == 1 ? "<!-- Hook point -->\r\n\t\t\t<li><a href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=forums&module=extras&section=stats&do=leaders", "public", ''), "", "") . "\" title=\"{$this->lang->words['sm_forum_leaders_title']}\">{$this->lang->words['sm_forum_leaders']}</a></li>\r\n\t\t\t<li><a href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=forums&module=extras&section=stats", "public", ''), "", "") . "\" title=\"{$this->lang->words['sm_all_posters_title']}\">{$this->lang->words['sm_today_posters']}</a></li>\r\n\t\t\t<li><a href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=members&module=list&max_results=20&sort_key=posts&sort_order=desc&filter=ALL", "public", ''), "false", "") . "\" title=\"{$this->lang->words['sm_overall_posters_title']}\">{$this->lang->words['sm_overall_posters']}</a></li>\r\n\t\t\t" . ($this->settings['reputation_enabled'] ? "<li>\r\n\t\t\t\t\t<a href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=members&module=reputation&section=most", "public", ''), "most_liked", "most_liked") . "\" title=\"" . ($this->settings['reputation_point_types'] == 'like' ? "{$this->lang->words['most_rep_likes']}" : "{$this->lang->words['most_rep_rep']}") . "\">\r\n\t\t\t\t\t\t" . ($this->settings['reputation_point_types'] == 'like' ? "\r\n\t\t\t\t\t\t\t{$this->lang->words['most_rep_likes']}\r\n\t\t\t\t\t\t" : "\r\n\t\t\t\t\t\t\t{$this->lang->words['most_rep_rep']}\r\n\t\t\t\t\t\t") . "\r\n\t\t\t\t\t</a>\r\n\t\t\t\t</li>" : "") . "" : "") . "\r\n\t</ul>\r\n\t\r\n\t" . ($this->settings['show_active'] && $this->memberData['gbw_view_online_lists'] ? "<h4 class='statistics_head'>" . sprintf($this->lang->words['online_right_now'], $stats['TOTAL']) . " {$this->lang->words['active_users']}</h4>\r\n\t\t<p class='statistics_brief desc'>\r\n\t\t\t" . sprintf($this->lang->words['active_users_detail'], $stats['MEMBERS'], $stats['GUESTS'], $stats['ANON']) . "\r\n\t\t\t" . ($this->settings['allow_online_list'] ? " <a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=members&module=online&sort_order=desc", "public", ''), "", "") . "' title='{$this->lang->words['online_link']}'>({$this->lang->words['online_link']})</a>" : "") . "\r\n\t\t</p>" : "") . "\r\n\t" . (count($stats['NAMES']) && $this->settings['show_active'] ? "\r\n\t\t<br />\r\n\t\t<p>\r\n\t\t\t<span class='name'>" . implode(",</span> <span class='name'>", $stats['NAMES']) . "</span>\r\n\t\t</p>\r\n\t" : "") . "\r\n</div>";
return $IPBHTML;
}
示例7: boardIndexTemplate
function boardIndexTemplate($lastvisit = "", $stats = array(), $cat_data = array(), $show_side_blocks = true, $side_blocks = array())
{
$IPBHTML = "";
if (IPSLib::locationHasHooks('skin_boards', $this->_funcHooks['boardIndexTemplate'])) {
$count_3caeb9bb43000ee1df74d49ffc12eae7 = is_array($this->functionData['boardIndexTemplate']) ? count($this->functionData['boardIndexTemplate']) : 0;
$this->functionData['boardIndexTemplate'][$count_3caeb9bb43000ee1df74d49ffc12eae7]['lastvisit'] = $lastvisit;
$this->functionData['boardIndexTemplate'][$count_3caeb9bb43000ee1df74d49ffc12eae7]['stats'] = $stats;
$this->functionData['boardIndexTemplate'][$count_3caeb9bb43000ee1df74d49ffc12eae7]['cat_data'] = $cat_data;
$this->functionData['boardIndexTemplate'][$count_3caeb9bb43000ee1df74d49ffc12eae7]['show_side_blocks'] = $show_side_blocks;
$this->functionData['boardIndexTemplate'][$count_3caeb9bb43000ee1df74d49ffc12eae7]['side_blocks'] = $side_blocks;
}
$this->templateVars['sidebar_enabled'] = "{$show_side_blocks}";
$this->__default__templateVars['sidebar_enabled'] = "{$show_side_blocks}";
$IPBHTML .= "" . (($this->settings['hoverDescriptions'] = 'no') ? "" : "") . "\n" . (($this->settings['removeStatsColumn'] = 'no') ? "" : "") . "\n" . (($this->settings['customForumIcons'] = 'no') ? "" : "") . "\n" . (($this->settings['clickableRows'] = 'yes') ? "" : "") . "" . $this->registry->getClass('output')->addJSModule("board", "0") . "" . (true ? "" : "") . "\n<div id='board_index' class='ipsLayout " . ($this->templateVars['sidebar_enabled'] ? "ipsLayout_withleft" : "") . " ipsLayout_largeleft clearfix " . (IPSCookie::get('hide_sidebar') == '1' ? "no_sidebar" : "") . "'>\n\t" . ($this->templateVars['sidebar_enabled'] ? "<div id='index_stats' class='ipsLayout_left clearfix' " . (IPSCookie::get('hide_sidebar') == '1' ? "style='display: none'" : "") . ">\n" . ($this->settings['show_totals'] ? "\n <div class='ipsSideBlock clearfix'>\n <h3><span class='icon icon-span-text icon-block'></span>Статистика форума</h3>\n <div class='_sbcollapsable'>\n <ul class='ipsList_data csoStatistics clearfix'>\n <li class='clearfix'>\n <span class='value right'>" . $this->registry->getClass('class_localization')->formatNumber($this->caches['stats']['total_topics']) . "</span>\n <span class='label left'><i class=\"fa fa-comment\"></i> Всего тем</span>\n </li>\n <li class='clearfix'>\n <span class='value right'>{$stats['info']['total_posts']}</span>\n <span class='label left'><i class=\"fa fa-pencil-square-o\"></i> {$this->lang->words['total_posts']}</span>\n </li>\n <li class='clearfix'>\n <span class='value right'>{$stats['info']['mem_count']}</span>\n <span class='label left'><i class=\"fa fa-users\"></i> {$this->lang->words['total_members']}</span>\n </li>\n <li class='clearfix'>\n <span class='value right '>" . IPSMember::makeProfileLink($stats['info']['last_mem_name'], $stats['info']['last_mem_id'], $stats['info']['last_mem_seo'], 'value') . "</span>\n <span class='label left'><i class=\"fa fa-user\"></i> {$this->lang->words['newest_member']}</span>\n </li>\n <li class='clearfix' data-tooltip='{$stats['info']['most_time']}'>\n <span class='value right'>{$stats['info']['most_online']}</span>\n <span class='label left'><i class=\"fa fa-signal\"></i> {$this->lang->words['online_at_once']}</span>\n </li> \n </ul>\n </div>\n </div>\n" : "") . "\n\t\t\t" . $this->__f__b29a9c9cce830e12603033197489dc70($lastvisit, $stats, $cat_data, $show_side_blocks, $side_blocks) . "\t\t</div>\n\t\t<a href='#' id='toggle_sidebar' title='{$this->lang->words['toggle_sidebar']}' data-closed=\"{$this->lang->words['_laquo']}\" data-open=\"×\"> </a>" : "") . "\n\t<div id='categories' class='ipsLayout_content clearfix'>\n\t<!-- CATS AND FORUMS -->\n\t\t" . ((is_array($cat_data) and count($cat_data)) ? "\n\t\t\t" . $this->__f__5147475eaba97cbcedc3e8701382c4a7($lastvisit, $stats, $cat_data, $show_side_blocks, $side_blocks) . "\t\t" : "") . "\n\t</div>\n</div>\n<script type='text/javascript'>\n//<![CDATA[\n\tvar markerURL = ipb.vars['base_url'] + \"app=forums&module=ajax§ion=markasread&i=1\"; // Ajax URL so don't use &\n\tvar unreadIcon = \"<img src='{$this->settings['img_url']}/f_icon_read.png' />\";\n\t\n\t" . ((is_array($cat_data) and count($cat_data)) ? "\n\t\t" . $this->__f__a75b64ad1448186d22b780ae5692d94a($lastvisit, $stats, $cat_data, $show_side_blocks, $side_blocks) . "\t" : "") . "\n//]]>\n</script>\n<div id='board_statistics' class='statistics clearfix'>\n\t<h4 class='statistics_head clearfix'><ul id='stat_links' class='ipsList_inline right ipsType_small'>\n\t\t" . (1 == 1 ? "<!-- Hook point -->\n\t\t\t<li><a href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=forums&module=extras&section=stats&do=leaders", "public", ''), "", "") . "\" title=\"{$this->lang->words['sm_forum_leaders_title']}\">{$this->lang->words['sm_forum_leaders']}</a></li>\n\t\t\t<li><a href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=forums&module=extras&section=stats", "public", ''), "", "") . "\" title=\"{$this->lang->words['sm_all_posters_title']}\">{$this->lang->words['sm_today_posters']}</a></li>\n\t\t\t<li><a href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=members&module=list&max_results=20&sort_key=posts&sort_order=desc&filter=ALL", "public", ''), "false", "") . "\" title=\"{$this->lang->words['sm_overall_posters_title']}\">{$this->lang->words['sm_overall_posters']}</a></li>\n " . ($this->settings['reputation_enabled'] ? "<li>\n <a href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=members&module=reputation&section=most", "public", ''), "most_liked", "most_liked") . "\" title=\"" . ($this->settings['reputation_point_types'] == 'like' ? "{$this->lang->words['most_rep_likes']}" : "{$this->lang->words['most_rep_rep']}") . "\">\n " . ($this->settings['reputation_point_types'] == 'like' ? "\n {$this->lang->words['most_rep_likes']}\n " : "\n {$this->lang->words['most_rep_rep']}\n ") . "\n </a>\n </li>" : "") . "" : "") . "\n\t</ul>\n" . ($this->settings['show_active'] && $this->memberData['gbw_view_online_lists'] ? "" . sprintf($this->lang->words['online_right_now'], $stats['TOTAL']) . " {$this->lang->words['active_users']}" : "") . "</h4>\n\t" . ($this->settings['show_active'] ? "<p class='statistics_brief desc'>\n\t\t" . sprintf($this->lang->words['active_users_detail'], $stats['MEMBERS'], $stats['GUESTS'], $stats['ANON']) . "\n\t\t" . ($this->settings['allow_online_list'] ? " <a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=members&module=online&sort_order=desc", "public", ''), "", "") . "' title='{$this->lang->words['online_link']}'>({$this->lang->words['online_link']})</a>" : "") . "\n\t</p>" : "") . "\n\t\n\t" . (count($stats['NAMES']) && $this->settings['show_active'] ? "\n\t\t<br />\n\t\t<p>\n\t\t\t<span class='name'>" . implode(",</span> <span class='name'>", $stats['NAMES']) . "</span>\t\t\t\t\t\n\t\t</p>\n\t" : "") . "\n</div>";
return $IPBHTML;
}
示例8: dispatch
/**
* Figure out what api is being called
*
* @return @e void
*/
public function dispatch()
{
/* Force a cookie to identify as a mobile app */
if (!$this->request['dontSetCookie']) {
IPSCookie::set("mobileApp", 'true', -1);
}
/* Figure out the action */
switch ($this->request['api']) {
case 'getNotifications':
$this->_handleGetNotifications();
break;
case 'toggleNotifications':
$this->_handleToggleNotifications();
break;
case 'toggleNotificationKey':
$this->_hanldeToggleNotificaionKey();
break;
case 'notificationTypes':
$this->_handleNotificationTypes();
break;
case 'login':
$this->_handleLogin();
break;
case 'postImage':
$this->_handlePostImage();
break;
case 'postStatus':
$this->_handlePostStatus();
break;
case 'postTopic':
$this->_handlePostTopic();
break;
case 'postReply':
$this->_handlePostReply();
break;
case 'getStyle':
$this->_handleGetStyle();
break;
case 'getApns':
$this->_getApns();
break;
default:
$this->_invalidApi();
break;
}
}
示例9: verifyLogin
//.........這裏部分代碼省略.........
} else {
return array(null, null, 'validating_remote', "<a href='{$this->revalidate_url}' target='_blank'>" . ipsRegistry::getClass('class_localization')->words['resend_val'] . "</a>");
}
} else {
return array(null, null, 'wrong_auth');
}
}
}
}
}
//-----------------------------------------
// Is this a partial member?
// Not completed their sign in?
//-----------------------------------------
if ($member['members_created_remote'] and isset($member['full']) and !$member['full']) {
return array($this->registry->getClass('class_localization')->words['partial_login'], $this->settings['base_url'] . 'app=core&module=global&section=register&do=complete_login&mid=' . $member['member_id'] . '&key=' . $member['timenow']);
}
//-----------------------------------------
// Generate a new log in key
//-----------------------------------------
$_ok = 1;
$_time = $this->settings['login_key_expire'] ? time() + intval($this->settings['login_key_expire']) * 86400 : 0;
$_sticky = $_time ? 0 : 1;
$_days = $_time ? $this->settings['login_key_expire'] : 365;
if (!$member['member_login_key'] or $this->settings['login_key_expire'] and time() > $member['member_login_key_expire']) {
$member['member_login_key'] = IPSMember::generateAutoLoginKey();
$core['member_login_key'] = $member['member_login_key'];
$core['member_login_key_expire'] = $_time;
}
//-----------------------------------------
// Cookie me softly?
//-----------------------------------------
if ($this->request['rememberMe']) {
IPSCookie::set("member_id", $member['member_id'], 1, 0, FALSE, TRUE);
IPSCookie::set("pass_hash", $member['member_login_key'], $_sticky, $_days, FALSE, TRUE);
IPSCookie::set("ipsconnect_" . md5($this->settings['board_url'] . '/interface/ipsconnect/ipsconnect.php'), '1', $_sticky, $_days, FALSE, FALSE);
} else {
// Ticket 824266
// IPSCookie::set( "member_id" , $member['member_id'], 0 );
// IPSCookie::set( "pass_hash" , $member['member_login_key'], 0 );
IPSCookie::set("ipsconnect_" . md5($this->settings['board_url'] . '/interface/ipsconnect/ipsconnect.php'), '1', 0, 0, FALSE, FALSE);
}
//-----------------------------------------
// Remove any COPPA cookies previously set
//-----------------------------------------
IPSCookie::set("coppa", '0', 0);
//-----------------------------------------
// Update profile if IP addr missing
//-----------------------------------------
if ($member['ip_address'] == "" or $member['ip_address'] == '127.0.0.1') {
$core['ip_address'] = $this->registry->member()->ip_address;
}
//-----------------------------------------
// Create / Update session
//-----------------------------------------
$privacy = $member['g_hide_online_list'] || empty($this->settings['disable_anonymous']) && !empty($this->request['anonymous']) ? 1 : 0;
$session_id = $this->registry->member()->sessionClass()->convertGuestToMember(array('member_name' => $member['members_display_name'], 'member_id' => $member['member_id'], 'member_group' => $member['member_group_id'], 'login_type' => $privacy));
if (!empty($this->request['referer']) and $this->request['section'] != 'register') {
if (stripos($this->request['referer'], 'section=register') or stripos($this->request['referer'], 'section=login') or stripos($this->request['referer'], 'section=lostpass') or stripos($this->request['referer'], CP_DIRECTORY . '/')) {
$url = $this->settings['base_url'];
} else {
$url = str_replace('&', '&', $this->request['referer']);
if ($this->registry->member()->session_type == 'cookie') {
$url = preg_replace('#s=(\\w){32}#', "", $url);
}
}
示例10: _saveCookie
/**
* Save cookie
*
* @access protected
* @param string Key name (leave blank to save out all cookies)
* @return @e void
*/
protected function _saveCookie($key = '')
{
if (!$this->_useCookies) {
return;
}
if ($key and is_array($this->_cookie[$key])) {
IPSCookie::set($key, $this->_cookie[$key], 1);
} else {
foreach ($this->_cookie as $k => $v) {
if (is_array($v) and !count($v)) {
/* Do we have a cookie? */
$test = IPSCookie::get($k);
if ($test) {
/* set a blank, non sticky cookie */
IPSCookie::set($k, '-', 0, -1);
} else {
continue;
}
} else {
IPSDebug::addMessage('Cookie SAVED: ' . $k . ' - ' . $this->_compressCookie($v));
IPSCookie::set($k, $this->_compressCookie($v), 1);
}
}
}
}
示例11: registerForm
function registerForm($general_errors = array(), $data = array(), $inline_errors = array(), $time_select = array(), $custom_fields = array(), $nexusFields = array(), $nexusStates = array())
{
$IPBHTML = "";
if (IPSLib::locationHasHooks('skin_register', $this->_funcHooks['registerForm'])) {
$count_cddbc826bab17032ea84f409e00836ae = is_array($this->functionData['registerForm']) ? count($this->functionData['registerForm']) : 0;
$this->functionData['registerForm'][$count_cddbc826bab17032ea84f409e00836ae]['general_errors'] = $general_errors;
$this->functionData['registerForm'][$count_cddbc826bab17032ea84f409e00836ae]['data'] = $data;
$this->functionData['registerForm'][$count_cddbc826bab17032ea84f409e00836ae]['inline_errors'] = $inline_errors;
$this->functionData['registerForm'][$count_cddbc826bab17032ea84f409e00836ae]['time_select'] = $time_select;
$this->functionData['registerForm'][$count_cddbc826bab17032ea84f409e00836ae]['custom_fields'] = $custom_fields;
$this->functionData['registerForm'][$count_cddbc826bab17032ea84f409e00836ae]['nexusFields'] = $nexusFields;
$this->functionData['registerForm'][$count_cddbc826bab17032ea84f409e00836ae]['nexusStates'] = $nexusStates;
}
$IPBHTML .= "" . ($this->settings['use_coppa'] && (!$this->request['coppa'] && !IPSCookie::get('coppa')) ? "\n\t" . (method_exists($this->registry->getClass('output')->getTemplate('register'), 'registerCoppaStart') ? $this->registry->getClass('output')->getTemplate('register')->registerCoppaStart() : '') . "\n" : "" . (!$this->request['agree_tos'] ? "\n\t\t<div class='master_list'>\n\t\t\t<h2>{$this->lang->words['reg_terms_popup_title']}</h2>\n\t\t\t<div class='row post line_spacing'>\n\t\t\t\t{$this->settings['_termsAndConditions']}\n\t\t\t</div>\n\t\t\t<div class='submit'>\n\t\t\t\t<a class='button secondary' href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=core&module=global&section=register&agree_tos=1", "public", ''), "", "") . "'>{$this->lang->words['mobile_agree_to_tos']}</a>\n\t\t\t</div>\n\t\t</div>\n\t" : "<div class='master_list'>\n\t\t\t<h2>{$this->lang->words['register']}</h2>\n\t\t\t" . (is_array($general_errors) && count($general_errors) ? "\n\t\t\t\t<div class='message error'>\n\t\t\t\t\t<strong>{$this->lang->words['following_errors']}</strong><br />\n\t\t\t\t\t" . $this->__f__19d06e799ceca51592bbfcc7cc259515($general_errors, $data, $inline_errors, $time_select, $custom_fields, $nexusFields, $nexusStates) . "\t\t\t\t</div>\n\t\t\t" : "") . "\n\t\n\t\t\t<form class='ipsForm_vertical' action=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=core&module=global&section=register", "public", ''), "", "") . "\" method=\"post\" name=\"REG\" id='register'>\n\t\t\t\t<input type=\"hidden\" name=\"termsread\" value=\"1\" />\n\t\t\t\t<input type=\"hidden\" name=\"agree_to_terms\" value=\"1\" />\n\t\t\t\t<input type=\"hidden\" name=\"agree_tos\" value=\"1\" />\n\t\t\t\t<input type=\"hidden\" name=\"do\" value=\"process_form\" />\n\t\t\t\t<input type=\"hidden\" name=\"coppa_user\" value=\"{$data['coppa_user']}\" />\n\t\t\t\t<input type='hidden' name='nexus_pass' value='1' />\n\t\t\n\t\t\t\t<h3>{$this->lang->words['reg_step1']}</h3>\n\t\t\t\t<div class='ipsField'>\n\t\t\t\t\t<label for='display_name' class='ipsField_title'>{$this->lang->words['reg_choose_dname']}</label>\n\t\t\t\t\t<input type='text' class='input_text " . ($inline_errors['dname'] ? "error" : "") . "' id='display_name' size='30' maxlength='{$this->settings['max_user_name_length']}' value='{$this->request['members_display_name']}' name='members_display_name' /><br />\n\t\t\t\t\t<span class='desc'>" . ($inline_errors['dname'] ? "<span class='error'>{$inline_errors['dname']}<br /></span>" : "") . "" . sprintf($this->lang->words['dname_desc'], $this->settings['max_user_name_length']) . "</span>\n\t\t\t\t</div>\n\t\t\n\t\t\t\t<div class='ipsField'>\n\t\t\t\t\t<label for='email_1' class='ipsField_title'>{$this->lang->words['reg_enter_email']}</label>\n\t\t\t\t\t<input type='text' id='email_1' class='input_text email " . ($inline_errors['email'] ? "error" : "") . "' size='30' maxlength='150' name='EmailAddress' value='{$this->request['EmailAddress']}' /><br />\n\t\t\t\t\t<span class='desc'>" . ($inline_errors['email'] ? "<span class='error'>{$inline_errors['email']}<br /></span>" : "") . "{$this->lang->words['reg_enter_email_desc']}</span>\n\t\t\t\t</div>\n\t\n\t\t\n\t\t\t\t<div class='ipsField'>\n\t\t\t\t\t<label for='password_1' class='ipsField_title'>{$this->lang->words['reg_choose_password']}</label>\n\t\t\t\t\t<input type='password' id='password_1' class='input_text password " . ($inline_errors['password'] ? "error" : "") . "' size='30' maxlength='32' value='{$this->request['PassWord']}' name='PassWord' /><br />\n\t\t\t\t\t<span class='desc'>" . ($inline_errors['password'] ? "<span class='error'>{$inline_errors['password']}<br /></span>" : "") . "{$this->lang->words['reg_choose_password_desc']}</span>\n\t\t\t\t</div>\n\t\t\n\t\t\t\t<div class='ipsField'>\n\t\t\t\t\t<label for='password_2' class='ipsField_title'>{$this->lang->words['reg_reenter_password']}</label>\n\t\t\t\t\t<input type='password' id='password_2' class='input_text password' size='30' maxlength='32' value='{$this->request['PassWord_Check']}' name='PassWord_Check' />\n\t\t\t\t</div>\n\t\t\n\t\t\t\t" . (is_array($custom_fields['required']) && count($custom_fields['required']) || is_array($custom_fields['optional']) && count($custom_fields['optional']) ? "<div class='row line_spacing'>\n\t\t\t\t\t\t" . (is_array($custom_fields['required']) && count($custom_fields['required']) ? "\n\t\t\t\t\t\t\t" . $this->__f__b992a2c8c4e8170e08721054c6f36ab3($general_errors, $data, $inline_errors, $time_select, $custom_fields, $nexusFields, $nexusStates) . "\t\t\t\t\t\t" : "") . "\n\t\t\t\t\n\t\t\t\t\t\t" . (is_array($custom_fields['optional']) && count($custom_fields['optional']) ? "\n\t\t\t\t\t\t\t" . $this->__f__c270991a3640ceae9340642786f02629($general_errors, $data, $inline_errors, $time_select, $custom_fields, $nexusFields, $nexusStates) . "\t\t\t\t\t\t" : "") . "\n\t\t\t\t\t\t<!--IBF.MODULES.EXTRA-->\n\t\t\t\t\t</div>" : "") . "\n\t\t\n\t\t\t\t" . ($data['captchaHTML'] || $data['qandaHTML'] ? "\n\t\t\t\t\t<h3>{$this->lang->words['reg_step3_spam']}</h3>\n\t\t\t\t\t{$data['qandaHTML']}\n\t\t\t\t\t{$data['captchaHTML']}\n\t\t\t\t" : "") . "\n\t\t\t\n\t\t\t\t<div class='ipsField ipsField_checkbox'>\n\t\t\t\t\t<input type=\"checkbox\" name=\"allow_admin_mail\" id=\"allow_admin_mail\" value=\"1\" class=\"input_check\" " . ($this->request['allow_admin_mail'] || !isset($this->request['allow_admin_mail']) ? "checked='checked'" : "") . " />\n\t\t\t\t\t<p class='ipsField_content'>{$this->lang->words['receive_admin_emails']}</p>\n\t\t\t\t</div>\n\t\t\t\t<div class='submit'>\n\t\t\t\t\t<input type='submit' class='button' value='{$this->lang->words['register']}' />\n\t\t\t\t</div>\n\t\t\t</form>\n\t\n\t\t</div>") . "") . "";
return $IPBHTML;
}
示例12: registerProcessForm
//.........這裏部分代碼省略.........
/* Flag for admin approval */
/* Flag for admin approval */
case 2:
$member['member_group_id'] = $this->settings['auth_group'];
$this->settings['reg_auth_type'] = 'admin';
break;
/* Approve the account, but ban it */
/* Approve the account, but ban it */
case 3:
$member['member_banned'] = 1;
$member['member_group_id'] = $this->settings['banned_group'];
$this->settings['reg_auth_type'] = '';
break;
}
}
//-----------------------------------------
// Create the account
//-----------------------------------------
$member = IPSMember::create(array('members' => $member, 'pfields_content' => $this->request));
//-----------------------------------------
// Login handler create account callback
//-----------------------------------------
$this->han_login->createAccount(array('email' => $member['email'], 'joined' => $member['joined'], 'password' => $in_password, 'ip_address' => $this->member->ip_address, 'username' => $member['members_display_name']));
//-----------------------------------------
// We'll just ignore if this fails - it shouldn't hold up IPB anyways
//-----------------------------------------
/*if ( $han_login->return_code AND ( $han_login->return_code != 'METHOD_NOT_DEFINED' AND $han_login->return_code != 'SUCCESS' ) )
{
$this->registry->output->showError( 'han_login_create_failed', 2017, true );
}*/
//-----------------------------------------
// Validation
//-----------------------------------------
$validate_key = md5(IPSLib::makePassword() . time());
$time = time();
if ($coppa != 1) {
if ($this->settings['reg_auth_type'] == 'user' or $this->settings['reg_auth_type'] == 'admin' or $this->settings['reg_auth_type'] == 'admin_user') {
//-----------------------------------------
// We want to validate all reg's via email,
// after email verificiation has taken place,
// we restore their previous group and remove the validate_key
//-----------------------------------------
$this->DB->insert('validating', array('vid' => $validate_key, 'member_id' => $member['member_id'], 'real_group' => $this->settings['member_group'], 'temp_group' => $this->settings['auth_group'], 'entry_date' => $time, 'coppa_user' => $coppa, 'new_reg' => 1, 'ip_address' => $member['ip_address']));
if ($this->settings['reg_auth_type'] == 'user' or $this->settings['reg_auth_type'] == 'admin_user') {
IPSText::getTextClass('email')->getTemplate("reg_validate");
IPSText::getTextClass('email')->buildMessage(array('THE_LINK' => $this->settings['base_url'] . "app=core&module=global§ion=register&do=auto_validate&uid=" . urlencode($member['member_id']) . "&aid=" . urlencode($validate_key), 'NAME' => $member['members_display_name'], 'MAN_LINK' => $this->settings['base_url'] . "app=core&module=global§ion=register&do=05", 'EMAIL' => $member['email'], 'ID' => $member['member_id'], 'CODE' => $validate_key));
IPSText::getTextClass('email')->subject = $this->lang->words['new_registration_email'] . $this->settings['board_name'];
IPSText::getTextClass('email')->to = $member['email'];
IPSText::getTextClass('email')->sendMail();
$this->output = $this->registry->output->getTemplate('register')->showAuthorize($member);
} else {
if ($this->settings['reg_auth_type'] == 'admin') {
$this->output = $this->registry->output->getTemplate('register')->showPreview($member);
}
}
if ($this->settings['new_reg_notify']) {
$date = $this->registry->class_localization->getDate(time(), 'LONG', 1);
IPSText::getTextClass('email')->getTemplate('admin_newuser');
IPSText::getTextClass('email')->buildMessage(array('DATE' => $date, 'MEMBER_NAME' => $member['members_display_name']));
IPSText::getTextClass('email')->subject = $this->lang->words['new_registration_email1'] . $this->settings['board_name'];
IPSText::getTextClass('email')->to = $this->settings['email_in'];
IPSText::getTextClass('email')->sendMail();
}
$this->registry->output->setTitle($this->lang->words['reg_success']);
$this->registry->output->addNavigation($this->lang->words['nav_reg'], '');
} else {
/* We don't want to preview, or get them to validate via email. */
$stat_cache = $this->caches['stats'];
if ($member['members_display_name'] and $member['member_id']) {
$stat_cache['last_mem_name'] = $member['members_display_name'];
$stat_cache['last_mem_id'] = $member['member_id'];
}
$stat_cache['mem_count'] += 1;
$this->cache->setCache('stats', $stat_cache, array('array' => 1, 'deletefirst' => 0));
if ($this->settings['new_reg_notify']) {
$date = $this->registry->class_localization->getDate(time(), 'LONG', 1);
IPSText::getTextClass('email')->getTemplate('admin_newuser');
IPSText::getTextClass('email')->buildMessage(array('DATE' => $date, 'MEMBER_NAME' => $member['members_display_name']));
IPSText::getTextClass('email')->subject = $this->lang->words['new_registration_email1'] . $this->settings['board_name'];
IPSText::getTextClass('email')->to = $this->settings['email_in'];
IPSText::getTextClass('email')->sendMail();
}
IPSCookie::set('pass_hash', $member['member_login_key'], 1);
IPSCookie::set('member_id', $member['member_id'], 1);
//-----------------------------------------
// Fix up session
//-----------------------------------------
$privacy = $this->request['Privacy'] ? 1 : 0;
if ($member['g_hide_online_list']) {
$privacy = 1;
}
$this->member->sessionClass()->convertGuestToMember(array('member_name' => $member['members_display_name'], 'member_id' => $member['member_id'], 'member_group' => $member['member_group_id'], 'login_type' => $privacy));
$this->registry->output->silentRedirect($this->settings['base_url'] . '&app=core&module=global§ion=login&do=autologin&fromreg=1');
}
} else {
/* This is a COPPA user, so lets tell them they registered OK and redirect to the form. */
$this->DB->insert('validating', array('vid' => $validate_key, 'member_id' => $member['member_id'], 'real_group' => $this->settings['member_group'], 'temp_group' => $this->settings['auth_group'], 'entry_date' => $time, 'coppa_user' => $coppa, 'new_reg' => 1, 'ip_address' => $member['ip_address']));
$this->registry->output->redirectScreen($this->lang->words['cp_success'], $this->settings['base_url'] . 'app=core&module=global&section=register&do=12');
}
}
示例13: define
* Set to 0 to not match with IP address
*/
define('CVG_IP_MATCH', 1);
require_once '../../initdata.php';
//===========================================================================
// MAIN PROGRAM
//===========================================================================
define('IPS_CLASS_PATH', IPS_ROOT_PATH . 'sources/classes/');
require_once IPS_ROOT_PATH . 'sources/base/ipsRegistry.php';
require_once IPS_ROOT_PATH . 'sources/base/ipsController.php';
//-----------------------------------------
// Set up cookie stuff
//-----------------------------------------
$registry = ipsRegistry::instance();
$registry->init();
IPSCookie::$sensitive_cookies = array('session_id', 'ipb_admin_session_id', 'member_id', 'pass_hash');
//--------------------------------
// Set up our vars
//--------------------------------
$registry->DB()->obj['use_shutdown'] = 0;
//--------------------------------
// Set debug mode
//--------------------------------
$registry->DB()->setDebugMode(ipsRegistry::$settings['sql_debug'] == 1 ? intval($_GET['debug']) : 0);
//===========================================================================
// Create the XML-RPC Server
//===========================================================================
require_once IPS_KERNEL_PATH . 'classApiServer.php';
$server = new classApiServer();
$api = $server->decodeRequest();
//===========================================================================
示例14: doLogout
/**
* Log a user out
*
* @param integer Flag to check md5 key
* @return mixed Error message or array [0=immediate|redirect, 1=words to show, 2=URL to send to]
*/
public function doLogout($check_key = true)
{
//-----------------------------------------
// INIT
//-----------------------------------------
if ($check_key) {
$key = $this->request['k'];
# Check for funny business
if ($key != $this->member->form_hash) {
$this->registry->getClass('output')->showError('bad_logout_key', 2012);
}
}
//-----------------------------------------
// Set some cookies
//-----------------------------------------
IPSCookie::set("member_id", "0", 1, 0, FALSE, TRUE);
IPSCookie::set("pass_hash", "0", 1, 0, FALSE, TRUE);
if (IPSCookie::get("ipsconnect_" . md5($this->settings['board_url'] . '/interface/ipsconnect/ipsconnect.php'))) {
IPSCookie::set("ipsconnect_" . md5($this->settings['board_url'] . '/interface/ipsconnect/ipsconnect.php'), '0', 1, 0, FALSE, FALSE);
}
//-----------------------------------------
// IPS Connect
//-----------------------------------------
foreach ($this->caches['login_methods'] as $k => $data) {
if ($data['login_folder_name'] == 'ipsconnect' and $data['login_enabled']) {
$ipsConnectSettings = unserialize($data['login_custom_config']);
IPSCookie::set("ipsconnect_" . md5($ipsConnectSettings['master_url']), '0', 1, 0, FALSE, FALSE);
}
}
if (is_array($_COOKIE)) {
foreach ($_COOKIE as $cookie => $value) {
if (stripos($cookie, $this->settings['cookie_id'] . 'ipbforumpass') !== false and !strstr($value, 'mobileApp')) {
IPSCookie::set(str_replace($this->settings['cookie_id'], "", $cookie), '-', -1);
}
}
}
//-----------------------------------------
// Do it..
//-----------------------------------------
$this->member->sessionClass()->convertMemberToGuest();
$privacy = intval(IPSMember::isLoggedInAnon($this->memberData));
IPSMember::save($this->memberData['member_id'], array('core' => array('login_anonymous' => "{$privacy}&0", 'last_activity' => IPS_UNIX_TIME_NOW)));
//-----------------------------------------
// Logout callbacks...
//-----------------------------------------
IPSLib::runMemberSync('onLogOut', $this->memberData);
$this->han_login->logoutCallback($this->memberData);
//-----------------------------------------
// Return..
//-----------------------------------------
$url = "";
if ($this->request['return'] and $this->request['return'] != "") {
$return = urldecode($this->request['return']);
if (strpos($return, "http://") === 0) {
return array('immediate', '', $return);
}
}
return array('redirect', $this->lang->words['thanks_for_logout'], $this->settings['board_url']);
}
示例15: parseTopicData
/**
* Parase Topic Data
*
* @access public
* @param array $topic Topic data
* @param bool $last_time_default Use default "last read time"
* @return array
**/
public function parseTopicData($topic, $last_time_default = true)
{
//-----------------------------------------
// INIT
//-----------------------------------------
$topic['real_tid'] = $topic['tid'];
$topic['_last_post'] = $topic['last_post'];
//-----------------------------------------
// Do we have an SEO title?
//-----------------------------------------
$_hasSEOTitle = false;
if ($topic['title_seo']) {
$_hasSEOTitle = true;
}
$topic['title_seo'] = $topic['title_seo'] ? $topic['title_seo'] : IPSText::makeSeoTitle($topic['title']);
/**
* Here we'll take the one query hit to update in order to speed it up in the future
*/
if (!$_hasSEOTitle and $this->settings['use_friendly_urls']) {
$this->DB->update('topics', array('title_seo' => $topic['title_seo'] ? $topic['title_seo'] : '-'), 'tid=' . $topic['tid']);
}
//-----------------------------------------
// Need to update this topic?
//-----------------------------------------
if ($topic['state'] == 'open') {
if (!$topic['topic_open_time'] or $topic['topic_open_time'] < $topic['topic_close_time']) {
if ($topic['topic_close_time'] and ($topic['topic_close_time'] <= time() and (time() >= $topic['topic_open_time'] or !$topic['topic_open_time']))) {
$topic['state'] = 'closed';
$this->update_topics_close[] = $topic['real_tid'];
}
} else {
if ($topic['topic_open_time'] or $topic['topic_open_time'] > $topic['topic_close_time']) {
if ($topic['topic_close_time'] and ($topic['topic_close_time'] <= time() and time() <= $topic['topic_open_time'])) {
$topic['state'] = 'closed';
$this->update_topics_close[] = $topic['real_tid'];
}
}
}
} else {
if ($topic['state'] == 'closed') {
if (!$topic['topic_close_time'] or $topic['topic_close_time'] < $topic['topic_open_time']) {
if ($topic['topic_open_time'] and ($topic['topic_open_time'] <= time() and (time() >= $topic['topic_close_time'] or !$topic['topic_close_time']))) {
$topic['state'] = 'open';
$this->update_topics_open[] = $topic['real_tid'];
}
} else {
if ($topic['topic_close_time'] or $topic['topic_close_time'] > $topic['topic_open_time']) {
if ($topic['topic_open_time'] and ($topic['topic_open_time'] <= time() and time() <= $topic['topic_close_time'])) {
$topic['state'] = 'open';
$this->update_topics_open[] = $topic['real_tid'];
}
}
}
}
}
//-----------------------------------------
// For polls we check last vote instead
// @todo [Future] Show a diff icon for new vote + new reply, new vote + no new reply, etc.
// Bug 16598: Need separate checks for icon vs getnewpost link
//-----------------------------------------
if ($topic['poll_state'] and $topic['last_vote'] > $topic['last_post']) {
$is_read = $this->registry->classItemMarking->isRead(array('forumID' => $topic['forum_id'], 'itemID' => $topic['tid'], 'itemLastUpdate' => $topic['last_vote']), 'forums');
$gotonewpost = $this->registry->classItemMarking->isRead(array('forumID' => $topic['forum_id'], 'itemID' => $topic['tid'], 'itemLastUpdate' => $topic['last_post']), 'forums');
} else {
$is_read = $this->registry->classItemMarking->isRead(array('forumID' => $topic['forum_id'], 'itemID' => $topic['tid'], 'itemLastUpdate' => $topic['last_post']), 'forums');
$gotonewpost = $is_read;
}
//-----------------------------------------
// Yawn
//-----------------------------------------
$topic['last_poster'] = $topic['last_poster_id'] ? IPSLib::makeProfileLink($topic['last_poster_name'], $topic['last_poster_id'], $topic['seo_last_name']) : $this->settings['guest_name_pre'] . $topic['last_poster_name'] . $this->settings['guest_name_suf'];
$topic['starter'] = $topic['starter_id'] ? IPSLib::makeProfileLink($topic['starter_name'], $topic['starter_id'], $topic['seo_first_name']) : $this->settings['guest_name_pre'] . $topic['starter_name'] . $this->settings['guest_name_suf'];
$topic['prefix'] = $topic['poll_state'] ? $this->registry->getClass('output')->getTemplate('forum')->topicPrefixWrap($this->settings['pre_polls']) : '';
$show_dots = "";
if ($this->memberData['member_id'] and (isset($topic['author_id']) and $topic['author_id'])) {
$show_dots = 1;
}
$topic['folder_img'] = $this->registry->getClass('class_forums')->fetchTopicFolderIcon($topic, $show_dots, $is_read);
/* SKINNOTE: Change these so that the link is built in the skin, not here */
$topic['topic_icon'] = $topic['icon_id'] ? '<img src="' . $this->settings['mime_img'] . '/style_extra/post_icons/icon' . $topic['icon_id'] . '.gif" border="0" alt="" />' : ' ';
$topic['topic_icon'] = $topic['pinned'] ? '<{B_PIN}>' : $topic['topic_icon'];
$topic['start_date'] = $this->registry->getClass('class_localization')->getDate($topic['start_date'], 'LONG');
//-----------------------------------------
// Pages 'n' posts
//-----------------------------------------
$pages = 1;
$topic['PAGES'] = "";
if ($this->memberData['is_mod']) {
$topic['posts'] += intval($topic['topic_queuedposts']);
}
if ($topic['posts']) {
$mode = IPSCookie::get('topicmode');
//.........這裏部分代碼省略.........