コード例 #1
0
 function globalTemplate($html, $documentHeadItems, $css, $jsModules, $metaTags, $header_items = array(), $items = array(), $footer_items = array(), $stats = array())
 {
     $IPBHTML = "";
     $this->templateVars['forumActive'] = "";
     $this->__default__templateVars['forumActive'] = "";
     if (IPS_APP_COMPONENT == 'forums') {
         $this->templateVars['forumActive'] = "active";
     } else {
         $this->templateVars['forumActive'] = $this->__default__templateVars['forumActive'];
     }
     $this->templateVars['membersActive'] = "";
     $this->__default__templateVars['membersActive'] = "";
     if (IPS_APP_COMPONENT == 'members') {
         $this->templateVars['membersActive'] = "active";
     } else {
         $this->templateVars['membersActive'] = $this->__default__templateVars['membersActive'];
     }
     $this->templateVars['helpActive'] = "";
     $this->__default__templateVars['helpActive'] = "";
     if (IPS_APP_COMPONENT == 'core' and $this->request['module'] == 'help') {
         $this->templateVars['helpActive'] = "active";
     } else {
         $this->templateVars['helpActive'] = $this->__default__templateVars['helpActive'];
     }
     $this->did_first = 0;
     $IPBHTML .= "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n\t<html xml:lang=\"en\" lang=\"en\" xmlns=\"http://www.w3.org/1999/xhtml\"" . (IPSLib::fbc_enabled() === TRUE ? " xmlns:fb=\"http://www.facebook.com/2008/fbml\"" : "") . ">\n\t<head>\n\t\t<meta http-equiv=\"content-type\" content=\"text/html; charset={$this->settings['gb_char_set']}\" />\n\t\t<title>{$header_items['title']}" . ($header_items['page'] ? " {$this->lang->words['page_title_page']} {$header_items['page']}" : "") . "</title>\n\t\t<link rel=\"shortcut icon\" href='" . ($this->registry->output->isHTTPS ? "{$this->settings['board_url_https']}" : "{$this->settings['board_url']}") . "/favicon.ico' />\n\t\t<script type='text/javascript'>\n\t\t\tjsDebug = " . intval($this->settings['_jsDebug']) . "; /* Must come before JS includes */\n\t\t\tUSE_RTE = " . ($this->memberData['members_editor_choice'] == 'rte' && $this->memberData['_canUseRTE'] === TRUE ? "1" : "0") . ";\n\t\t\tinACP   = false;\n\t\t</script>\n\t\t" . $this->registry->getClass('output')->getTemplate('global')->includeCSS($css) . "\n\t\t<!--<meta http-equiv=\"X-UA-Compatible\" content=\"IE=7\" />-->\n\t\t" . $this->registry->getClass('output')->getTemplate('global')->includeMeta($metaTags) . "" . $this->registry->getClass('output')->getTemplate('global')->includeJS($jsModules) . "" . $this->registry->getClass('output')->getTemplate('global')->includeFeeds($documentHeadItems) . "" . $this->registry->getClass('output')->getTemplate('global')->includeRTL() . "\t\t\n\t\t" . $this->registry->getClass('output')->getTemplate('global')->includeVars() . "\n\t\t<script type='text/javascript'>\n\t\t\tLoader.boot();\n\t\t</script>\n\t</head>\n\t<body id='ipboard_body'>\n\t\t<div id='ipbwrapper'>\n\t\t\t<h1>{$this->settings['board_name']}: {$header_items['title']}</h1>\n\t\t\t<p id='content_jump'><a id='top'></a><a href='#j_content' title='{$this->lang->words['jump_to_content']}' accesskey='m'>{$this->lang->words['jump_to_content']}</a></p>\n\t\t\n\t\t\t" . (($this->memberData['g_is_supmod'] == 1 or isset($this->memberData['access_report_center']) and $this->memberData['access_report_center']) ? "<div id='admin_bar'>\n\t\t\t\t\t" . (($this->memberData['g_access_cp'] == 1 and $this->settings['security_remove_acp_link'] == 0) ? "\n\t\t\t\t\t<p class='right'>\n\t\t\t\t\t\t<a href=\"{$this->settings['_admin_link']}\" title='{$this->lang->words['admin_cp']}'>{$this->lang->words['login_to_acp']} &gt;</a>\n\t\t\t\t\t</p>\n\t\t\t\t\t" : "") . "\n\t\t\t\t\t<strong>{$this->lang->words['mod_tools']}</strong> \n\t\t\t\t\t<ul id='mod_tools'>\n\t\t\t\t\t\t" . ($this->memberData['g_is_supmod'] == 1 ? "\n\t\t\t\t\t\t\t<li><a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=core&amp;module=usercp&amp;tab=members&amp;area=mod_ipaddress", 'public', ''), "", "") . "' title='{$this->lang->words['ip_lookup']}'>{$this->lang->words['ip_lookup']}</a></li>\n\t\t\t\t\t\t\t<li><a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=core&amp;module=usercp&amp;tab=forums&amp;area=modAddAnnouncement&amp;do=add", 'public', ''), "", "") . "' title='{$this->lang->words['post_announcement']}'>{$this->lang->words['post_announcement']}</a></li>\n\t\t\t\t\t\t" : "") . "\n\t\t\t\t\t\t" . ($this->memberData['access_report_center'] ? "<li " . ($this->memberData['_cache']['report_num'] > 0 ? "class='active'" : "") . "><a href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=core&amp;module=reports&amp;do=index", 'public', ''), "", "") . "\" title='{$this->lang->words['view_reports']}'>{$this->memberData['_cache']['report_num']} {$this->lang->words['report_member_bar']}</a></li>" : "") . "\n\t\t\t\t\t</ul>\n\t\t\t\t</div>" : "") . "\n\t\t\t<div id='header'>\n\t\t\t\t<div id='branding'>\n\t\t\t\t\t" . (method_exists($this->registry->output->getTemplate($this->registry->getCurrentApplication() . '_global'), 'overwriteHeader') ? "\n\t\t\t\t\t\t" . $this->registry->getClass('output')->getTemplate('' . $this->registry->getCurrentApplication() . '_global')->overwriteHeader() . "\n\t\t\t\t\t" : "\n\t\t\t\t\t\t" . $this->registry->getClass('output')->getTemplate('global')->defaultHeader() . "\n\t\t\t\t\t") . "\n\t\t\t\t</div>\n\t\t\t\t\t\t\n\t\t\t\t" . ($this->memberData['member_id'] ? "<div id='user_navigation' class='logged_in'>\n\t\t\t\t\t\t<img src='{$this->memberData['pp_thumb_photo']}' alt=\"{$this->memberData['members_display_name']}{$this->lang->words['users_photo']}\" width='{$this->memberData['pp_thumb_width']}' height='{$this->memberData['pp_thumb_height']}' class='photo' />\n\t\t\t\t\t\t<div id='user_info'>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<span class='hide'>{$this->lang->words['logged_in_as']} </span>\nLogged in as\n\t\t\t\t\t\t\t\t<a id='user_link' class='ipbmenu' href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("showuser={$this->memberData['member_id']}", 'public', ''), "{$this->memberData['members_seo_name']}", "showuser") . "\"  title='{$this->lang->words['your_profile']}'>{$this->memberData['members_display_name']} <img src='{$this->settings['img_url']}/opts_arrow.png' alt='&gt;' /></a>" . ($this->memberData['msg_count_new'] != 0 ? "<a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=members&amp;module=messaging", 'public', ''), "", "") . "' id='new_msg_count' title='{$this->memberData['msg_count_new']} {$this->lang->words['msg_new']}'>{$this->memberData['msg_count_new']}<span class='hide'> {$this->lang->words['msg_new']}</span></a>" : "") . "\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<ul id='user_link_menucontent'>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<ul id='user_other'>\n\t\t\t\t\t\t\t\t<li><a href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=core&amp;module=global&amp;section=login&amp;do=logout&amp;k={$this->member->form_hash}", 'public', ''), "", "") . "\">{$this->lang->words['log_out']}</a></li>\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t" . ($this->memberData['member_group_id'] == $this->settings['auth_group'] ? "\n\t\t\t\t\t\t\t\t\t<li><strong><a href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=core&amp;module=global&amp;section=register&amp;do=reval", 'public', ''), "", "") . "\" title='{$this->lang->words['resend_val']}'>{$this->lang->words['resend_val']}</a></strong></li>\n\t\t\t\t\t\t\t\t" : "") . "\n\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\t\t\t\tif( \$('user_link_menucontent') ){\n\t\t\t\t\t\t\t\t\t\$('user_link_menucontent').hide();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t</script>\n\t\t\t\t\t\t\t" . $this->registry->getClass('output')->addJSModule("friends", "0") . "\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>" : "\n\t\t\t\t\t<div id='user_navigation' class='not_logged_in'>\n\t\t\t\t\t\t<a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=core&amp;module=global&amp;section=login", 'public', ''), "", "") . "' title='{$this->lang->words['sign_in']}'>" . $this->registry->getClass('output')->getReplacement("signin_icon") . " {$this->lang->words['sign_in']}</a>\n\t\t\t\t\t\t<a href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=core&amp;module=global&amp;section=register", 'public', ''), "", "") . "\" title='{$this->lang->words['register']}'>" . $this->registry->getClass('output')->getReplacement("register_icon") . " {$this->lang->words['register']}</a>\n\t\t\t\t\t\t<a href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=core&amp;module=help", 'public', ''), "", "") . "\" title='{$this->lang->words['view_help']}' rel=\"help\" accesskey='6'>" . $this->registry->getClass('output')->getReplacement("help_icon") . " {$this->lang->words['sj_help']}</a>\n\t\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t") . "\n\t\t\t\n\t\t\t\t<div id='primary_nav'>\n\t\t\t\t\t<div id='search'>\n\t\t\t\t\t\t" . (!in_array($this->settings['search_method'], array('traditional', 'sphinx')) ? "\n\t\t\t\t\t\t<form action=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=core&amp;module=search&amp;do=quick_search&amp;search_filter_app[all]=1", 'public', ''), "", "") . "\" method=\"post\" id='search-box' >\n\t\t\t\t\t\t" : "<form action=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=core&amp;module=search&amp;do=quick_search&amp;search_filter_app[" . (!empty($this->request['search_app']) ? "{$this->request['search_app']}" : "" . (IPSSearchIndex::appIsSearchable($this->registry->getCurrentApplication()) ? "{$this->registry->getCurrentApplication()}" : "forums") . "") . "]=1", 'public', ''), "", "") . "\" method=\"post\" id='search-box' >") . "\n\t\t\t\t\t\t\t<fieldset>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<label for='main_search' class='hide'>{$this->lang->words['sj_search']}</label>\n\t\t\t\t\t\t\t\t<input type='text' id='main_search' name='search_term' class='text_input' size='17' tabindex='6' />\n\t\t\t\t\t\t\t\t<input type='submit' class='submit_input' value='{$this->lang->words['sj_search']}' />\n\t\t\t\t\t\t\t\t<a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=core&amp;module=search", 'public', ''), "", "") . "' title='{$this->lang->words['advanced_search']}' accesskey='4' rel=\"search\" id='adv_search'>{$this->lang->words['advanced']}</a>\n\t\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</div>\n\t\t\t\t\t<ul>\n\t\t\t\t\t" . ($this->settings['home_url'] ? "\n\t\t\t\t\t\t\t<li id='nav_home' class='left'><a href='{$this->settings['home_url']}' title='{$this->lang->words['homepage_title']}' rel=\"home\">{$this->settings['home_name']}</a></li>\n\t\t\t\t\t\t" : "") . " \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t" . ((is_array($header_items['applications']) and count($header_items['applications'])) ? "\n\t\t\t\t\t\t\t" . $this->__f__f3ef81aefc61e1ddbb3a00ce02d56217($html, $documentHeadItems, $css, $jsModules, $metaTags, $header_items, $items, $footer_items, $stats) . "\t\t\t\t\t\t" : "") . "\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t\t" . (is_array($items['pmData']) ? "<div id='pm_notification'>\n\t\t\t\t\t\t<div id='pm_wrap'>\n\t\t\t\t\t\t\t<img src='{$items['pmData']['authorData']['pp_thumb_photo']}' alt=\"{$items['pmData']['authorData']['members_display_name']}{$this->lang->words['users_photo']}\" width='{$items['pmData']['authorData']['pp_thumb_width']}' height='{$items['pmData']['authorData']['pp_thumb_height']}' class='photo' />\n\t\t\t\t\t\t\t<h2>{$items['pmData']['authorData']['members_display_name']} " . ($items['pmData']['_type'] == 'new' ? "{$this->lang->words['sent_new_convo']}" : "{$this->lang->words['replied_convo']}") . "</h2>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<strong>{$this->lang->words['pc_subject']}</strong> {$items['pmData']['mt_title']}<br />\n\t\t\t\t\t\t\t\t<strong>{$this->lang->words['pc_replies']}</strong> " . intval($items['pmData']['mt_replies']) . "<br />\n\t\t\t\t\t\t\t\t<strong>{$this->lang->words['pc_sent']}</strong> " . $this->registry->getClass('class_localization')->getDate($items['pmData']['msg_date'], "short", 0) . "\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<p class='excerpt'>\n\t\t\t\t\t\t\t\t" . IPSText::truncate($items['pmData']['msg_post'], 500) . "\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t<ul class='topic_buttons ok_thanks'>\n\t\t\t\t\t\t\t\t<li><a href='#j_content' id='close_pm_notification'><img src='{$this->settings['img_url']}/cross.png' alt='{$this->lang->words['icon']}' /> {$this->lang->words['ignore_conversation']}</a></li>\n\t\t\t\t\t\t\t\t<li><a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=members&amp;module=messaging&amp;section=view&amp;do=findMessage&amp;topicID={$items['pmData']['mt_id']}&amp;msgID=__firstUnread__", 'public', ''), "", "") . "'><img src='{$this->settings['img_url']}/email.png' alt='{$this->lang->words['icon']}' /> {$this->lang->words['global_pm_read']}</a></li>\n\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\t\t\$('pm_notification').hide();\n\t\t\t\t\t</script>" : "") . "\n\t\t\t\n\t\t\t<!-- NAVIGATION TOP LEFT\t<div id='secondary_nav'>\n\t\t\t\t\t<ul id='breadcrumb' class='left'>\n\t\t\t\t\t\t\t\t\t\t\t\t" . ((!$this->settings['remove_forums_nav'] or ipsRegistry::$current_application == 'forums') ? "<li class='first'><a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("act=idx", 'public', ''), "false", "") . "'>{$this->settings['board_name']}</a></li>\n\t\t\t\t\t\t\t" . (($this->did_first = 1) ? "" : "") . "" : "") . " \n\t\t\t\t\t\t" . $this->__f__ce9338f8ac36f63d75adce3df1cb47a3($html, $documentHeadItems, $css, $jsModules, $metaTags, $header_items, $items, $footer_items, $stats) . "\t\t\t\t\t</ul>\n\t\t\t\t\t<ul id='section_links' class='right'>\n\t\t\t\t\t\t" . (($this->settings['gl_show'] and $this->settings['gl_title']) ? "<li><a href='" . ($this->settings['gl_link'] ? "{$this->settings['gl_link']}" : "" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=forums&amp;module=extras&amp;section=boardrules", 'public', ''), "", "") . "") . "'>" . ($this->settings['gl_title'] ? "{$this->settings['gl_title']}" : "{$this->lang->words['board_rules']}") . "</a></li>" : "") . "\n\t\t\t\t\t\t<li><a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=core&amp;module=search&amp;do=new_posts&amp;search_filter_app[" . (($this->registry->getCurrentApplication() != 'core' and IPSSearchIndex::appIsSearchable($this->registry->getCurrentApplication())) ? "{$this->registry->getCurrentApplication()}" : "forums") . "]=1", 'public', ''), "", "") . "' accesskey='2'>{$this->lang->words['view_new_posts']}</a></li>\n\t\t\t\t\t\t<li><img src='{$this->settings['img_url']}/feed.png' alt='{$this->lang->words['rss_feed']}' id='rss_feed' class='clickable' /></li> \n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t</div>  -->\n\t\t\t<div id='content' class='clear'>\n\t\t\t\t<a id='j_content'></a>\n\t\t\t\t" . ($html ? "{$html}" : "") . "\n\t\t\t\t<br class='clear' />\n\t\t\t</div>\n\t\t\t<div id='footer_utilities' class='clearfix clear rounded'>\n\t\t\t\t<h2 class='hide'>{$this->lang->words['skin_and_lang']}</h2>\n\t\t\t\t" . (($this->settings['allow_skins'] and $footer_items['skin_chooser']) ? "" . (($this->memberData['userAgentLocked'] and !$this->memberData['userAgentBypass']) ? "\n\t\t\t\t\t\t<p id='useragent_msg'>\n\t\t\t\t\t\t\t{$this->lang->words['skin_browser_set']} <a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("{$this->settings['query_string_formatted']}&amp;unlockUserAgent=1", 'public', ''), "", "") . "'>{$this->lang->words['override_browser_theme']}</a>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t" : "\n\t\t\t\t\t\t<form action=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("{$this->settings['query_string_formatted']}", 'public', ''), "", "") . "\" method=\"post\" class='left'>\n\t\t\t\t\t\t\t<fieldset>\n\t\t\t\t\t\t\t\t<input type='hidden' name='k' value='{$this->member->form_hash}' />\n\t\t\t\t\t\t\t\t<label for='newSkin' class='hide'>{$this->lang->words['theme_prefix']}</label>\n\t\t\t\t\t\t\t\t<select name=\"settingNewSkin\" id='newSkin'>\n\t\t\t\t\t\t\t\t\t{$footer_items['skin_chooser']}\n\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t<input type='submit' value='{$this->lang->words['jmp_go']}' class='input_submit alt' id='newSkinSubmit' />\n\t\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t") . "" : "") . "\n\t\t\t\t<form action=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("{$this->settings['query_string_formatted']}", 'public', ''), "", "") . "\" method=\"post\" class='left'>\n\t\t\t\t\t<fieldset>\n\t\t\t\t\t\t<input type='hidden' name='k' value='{$this->member->form_hash}' />\n\t\t\t\t\t\t<input type='hidden' name='setlanguage' value='1' />\n\t\t\t\t\t\t<input type=\"hidden\" name=\"langurlbits\" value=\"{$this->settings['query_string_safe']}&amp;cal_id={$this->request['cal_id']}\" />\n\t\t\t\t\t\t<label for='newLang' class='hide'>{$this->lang->words['language_prefix']}</label>\n\t\t\t\t\t\t<select name=\"langid\" id='newLang'>\n\t\t\t\t\t\t\t\t{$footer_items['lang_chooser']}\n\t\t\t\t\t\t</select>\n\t\t\t\t\t\t<input type='submit' class='input_submit alt' value='{$this->lang->words['jmp_go']}' id='newLangSubmit' />\n\t\t\t\t\t</fieldset>\n\t\t\t\t</form>\n\t\t\t\t<h2 class='hide'>{$this->lang->words['exec_stats']}</h2>\n\t\t\t\t<ul class='right'>\n\t\t\t\t\t<li>{$this->lang->words['time_now']} {$footer_items['time']}\n\t\t\t\t\t\t" . (($this->memberData['member_id'] and $this->memberData['last_visit']) ? "<p>{$this->lang->words['you_last_visit']} " . $this->registry->getClass('class_localization')->getDate($this->memberData['last_visit'], "short", 0) . "</p>" : "") . "\n\t\t\t\t\t</li>\n\t\t\t\t\t" . (($this->memberData['member_id'] and $this->settings['debug_level']) ? "<li><img src='{$this->settings['img_url']}/stats_time.png' alt='{$this->lang->words['icon']}' /> {$stats['ex_time']} {$this->lang->words['stats_sec']}</li>\n\t\t\t\t\t\t<li><img src='{$this->settings['img_url']}/stats_server.png' alt='{$this->lang->words['icon']}' /> {$stats['server_load']}</li>\n\t\t\t\t\t\t<li><img src='{$this->settings['img_url']}/stats_database.png' alt='{$this->lang->words['icon']}' /> {$stats['queries']} " . (IPS_SQL_DEBUG_MODE ? "<a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("{$this->settings['query_string_safe']}&amp;debug=1", 'public', ''), "", "") . "'>" : "") . "{$this->lang->words['stats_queries']}" . (IPS_SQL_DEBUG_MODE ? "</a>" : "") . "</li>\n\t\t\t\t\t\t<li><img src='{$this->settings['img_url']}/stats_compression.png' alt='{$this->lang->words['icon']}' /> {$stats['gzip_status']}</li>" : "") . "\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t\t<!-- __FOOTER__ -->\n\t\t\t<!-- /__FOOTER__ -->\n\t\t\t<!--DEBUG_STATS-->\n\t\t\t<div id='board_footer'>\n\t\t\t\t<ul id='utility_links' class='left'>\n\t\t\t\t\t<li><a href='#top' title='{$this->lang->words['go_to_top']}'>{$this->lang->words['back_to_top']}</a></li>\n\t\t\t\t\t<li><a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("", 'public', ''), "", "") . "' title='{$this->lang->words['sj_home']}'>Home</a></li>\n\t\t\t\t\t<li><a href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=core&amp;module=global&amp;section=login&amp;do=deleteCookies&amp;k={$this->member->form_hash}", 'public', ''), "", "") . "\" title='{$this->lang->words['delete_all_cookies_title']}'>{$this->lang->words['delete_my_cookies']}</a></li>\n\t\t\t\t</ul>\n\t\t\t\t{$footer_items['copyright']}\n\t\t\t</div>\n\t\t\t{$stats['task']}\n\t\t\t" . ($this->settings['do_include_lightbox_real'] ? "" . $this->registry->getClass('output')->getTemplate('global')->include_lightbox_real() . "" : "") . "\n\t\t</div>\n\t</body>\n</html>";
     return $IPBHTML;
 }
コード例 #2
0
ファイル: skin_calendar.php プロジェクト: mover5/imobackup
 function bbCodeEvent($event = array(), $type = '', $ends = '')
 {
     $IPBHTML = "";
     if (IPSLib::locationHasHooks('skin_calendar', $this->_funcHooks['bbCodeEvent'])) {
         $count_9d2c4a6233c711353aa8df4a9626a07a = is_array($this->functionData['bbCodeEvent']) ? count($this->functionData['bbCodeEvent']) : 0;
         $this->functionData['bbCodeEvent'][$count_9d2c4a6233c711353aa8df4a9626a07a]['event'] = $event;
         $this->functionData['bbCodeEvent'][$count_9d2c4a6233c711353aa8df4a9626a07a]['type'] = $type;
         $this->functionData['bbCodeEvent'][$count_9d2c4a6233c711353aa8df4a9626a07a]['ends'] = $ends;
     }
     $IPBHTML .= "<div class='_sharedMediaBbcode'>\n\t<div class='bbcode_mediaWrap clearfix'>\n\t\t<a href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=calendar&amp;module=calendar&amp;section=view&amp;do=showevent&amp;event_id={$event['event_id']}", "public", ''), "{$event['event_title_seo']}", "cal_event") . "\"><img src='{$this->settings['img_url']}/sharedmedia/events.png' alt='{$this->lang->words['event_img_alt']}' class='sharedmedia_screenshot' /></a>\n\t\t<div class='details'>\n\t\t\t<h5><a href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=calendar&amp;module=calendar&amp;section=view&amp;do=showevent&amp;event_id={$event['event_id']}", "public", ''), "{$event['event_title_seo']}", "cal_event") . "\">" . IPSText::truncate($event['event_title'], 60) . "</a></h5>\n\t\t\t<div><a href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=calendar&amp;module=calendar&amp;section=view&amp;cal_id={$event['cal_id']}", "public", ''), "{$event['cal_title_seo']}", "cal_calendar") . "\">{$this->lang->words['event_calendar']} {$event['cal_title']}</a></div>\n\t\t\t<div>{$event['_start_date']} \n\t\t\t\t" . (!$ends ? "{$event['_event_time']}" : "") . " \n\t\t\t\t" . ($ends ? "{$ends} " : "") . " \n\t\t\t\t" . (($ends and $event['_event_time']) ? "{$event['_event_time']} " . ($event['_event_etime'] ? "- {$event['_event_etime']}" : "") . "" : "") . "\n\t\t\t\t" . (($event['_event_etime'] and !$ends) ? "- {$event['_event_etime']}" : "") . "\n\t\t\t\t({$type})</div>\n\t\t</div>\n\t</div>\n</div>\n<br />";
     return $IPBHTML;
 }
コード例 #3
0
ファイル: skin_forum.php プロジェクト: mover5/imobackup
 function forumIndexTemplate($forum_data, $announce_data, $topic_data, $other_data, $multi_mod_data, $sub_forum_data, $footer_filter, $active_user_data, $mod_data, $inforum = 1)
 {
     $IPBHTML = "";
     if (IPSLib::locationHasHooks('skin_forum', $this->_funcHooks['forumIndexTemplate'])) {
         $count_a249c0aecf82d8bd8ed21846ebf07357 = is_array($this->functionData['forumIndexTemplate']) ? count($this->functionData['forumIndexTemplate']) : 0;
         $this->functionData['forumIndexTemplate'][$count_a249c0aecf82d8bd8ed21846ebf07357]['forum_data'] = $forum_data;
         $this->functionData['forumIndexTemplate'][$count_a249c0aecf82d8bd8ed21846ebf07357]['announce_data'] = $announce_data;
         $this->functionData['forumIndexTemplate'][$count_a249c0aecf82d8bd8ed21846ebf07357]['topic_data'] = $topic_data;
         $this->functionData['forumIndexTemplate'][$count_a249c0aecf82d8bd8ed21846ebf07357]['other_data'] = $other_data;
         $this->functionData['forumIndexTemplate'][$count_a249c0aecf82d8bd8ed21846ebf07357]['multi_mod_data'] = $multi_mod_data;
         $this->functionData['forumIndexTemplate'][$count_a249c0aecf82d8bd8ed21846ebf07357]['sub_forum_data'] = $sub_forum_data;
         $this->functionData['forumIndexTemplate'][$count_a249c0aecf82d8bd8ed21846ebf07357]['footer_filter'] = $footer_filter;
         $this->functionData['forumIndexTemplate'][$count_a249c0aecf82d8bd8ed21846ebf07357]['active_user_data'] = $active_user_data;
         $this->functionData['forumIndexTemplate'][$count_a249c0aecf82d8bd8ed21846ebf07357]['mod_data'] = $mod_data;
         $this->functionData['forumIndexTemplate'][$count_a249c0aecf82d8bd8ed21846ebf07357]['inforum'] = $inforum;
     }
     $IPBHTML .= "<h2>" . IPSText::truncate($forum_data['name']) . "</h2>\n" . ((is_array($sub_forum_data) and count($sub_forum_data)) ? "\n\t<div class='master_list' id='board_index'>\n\t\t" . $this->__f__e5abccb8d9df641b5917cb4cf33bad9e($forum_data, $announce_data, $topic_data, $other_data, $multi_mod_data, $sub_forum_data, $footer_filter, $active_user_data, $mod_data, $inforum) . "\t</div>\n" : "") . "\n<div class='master_list'>\n\t" . ($forum_data['sub_can_post'] ? "<!--<h2>{$forum_data['name']}</h2>-->\n\t\t<div class='controls'>\n\t\t\t<div class='buttons'>\n\t\t\t\t" . ($forum_data['_user_can_post'] ? "\n\t\t\t\t\t<a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("module=post&amp;section=post&amp;do=new_post&amp;f={$forum_data['id']}", "publicWithApp", ''), "", "") . "' title='{$this->lang->words['topic_start']}' accesskey='s' class='button'>{$this->lang->words['topic_start']}</a>\n\t\t\t\t" : "") . "\n\t\t\t\t{$forum_data['SHOW_PAGES']}\n\t\t\t</div>\n\t\t</div>\n\t\t\n\t\t" . ((is_array($announce_data) and count($announce_data)) ? "\n\t\t\t" . $this->__f__f4abb4bd3e08583c176554ce47ba5aed($forum_data, $announce_data, $topic_data, $other_data, $multi_mod_data, $sub_forum_data, $footer_filter, $active_user_data, $mod_data, $inforum) . "\t\t" : "") . "\n\t\t\n\t\t" . ((is_array($topic_data) and count($topic_data)) ? "\n\t\t\t<h3>{$this->lang->words['forum_topic_list']}</h3>\n\t\t\t" . $this->__f__483cf29b8e814e500f0244d2155831c0($forum_data, $announce_data, $topic_data, $other_data, $multi_mod_data, $sub_forum_data, $footer_filter, $active_user_data, $mod_data, $inforum) . "\t\t" : "\n\t\t\t<div class='row no_messages'>\n\t\t\t\t{$this->lang->words['no_topics']}\n\t\t\t</div>\n\t\t") . "\n\t\t<div class='controls'>\n\t\t\t<div class='buttons'>\n\t\t\t\t" . ($forum_data['_user_can_post'] ? "\n\t\t\t\t\t<a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("module=post&amp;section=post&amp;do=new_post&amp;f={$forum_data['id']}", "publicWithApp", ''), "", "") . "' title='{$this->lang->words['topic_start']}' accesskey='s' class='button'>{$this->lang->words['topic_start']}</a>\n\t\t\t\t" : "") . "\n\t\t\t\t{$forum_data['SHOW_PAGES']}\n\t\t\t</div>\n\t\t</div>" : "") . "\t\n</div>";
     return $IPBHTML;
 }
コード例 #4
0
 function forumIndexTemplate($forum_data, $announce_data, $topic_data, $other_data, $multi_mod_data, $sub_forum_data, $footer_filter, $active_user_data, $mod_data, $inforum = 1)
 {
     $IPBHTML = "";
     if (IPSLib::locationHasHooks('skin_forum', $this->_funcHooks['forumIndexTemplate'])) {
         $count_67ce811bd382cf82cfdfbb680caeba94 = is_array($this->functionData['forumIndexTemplate']) ? count($this->functionData['forumIndexTemplate']) : 0;
         $this->functionData['forumIndexTemplate'][$count_67ce811bd382cf82cfdfbb680caeba94]['forum_data'] = $forum_data;
         $this->functionData['forumIndexTemplate'][$count_67ce811bd382cf82cfdfbb680caeba94]['announce_data'] = $announce_data;
         $this->functionData['forumIndexTemplate'][$count_67ce811bd382cf82cfdfbb680caeba94]['topic_data'] = $topic_data;
         $this->functionData['forumIndexTemplate'][$count_67ce811bd382cf82cfdfbb680caeba94]['other_data'] = $other_data;
         $this->functionData['forumIndexTemplate'][$count_67ce811bd382cf82cfdfbb680caeba94]['multi_mod_data'] = $multi_mod_data;
         $this->functionData['forumIndexTemplate'][$count_67ce811bd382cf82cfdfbb680caeba94]['sub_forum_data'] = $sub_forum_data;
         $this->functionData['forumIndexTemplate'][$count_67ce811bd382cf82cfdfbb680caeba94]['footer_filter'] = $footer_filter;
         $this->functionData['forumIndexTemplate'][$count_67ce811bd382cf82cfdfbb680caeba94]['active_user_data'] = $active_user_data;
         $this->functionData['forumIndexTemplate'][$count_67ce811bd382cf82cfdfbb680caeba94]['mod_data'] = $mod_data;
         $this->functionData['forumIndexTemplate'][$count_67ce811bd382cf82cfdfbb680caeba94]['inforum'] = $inforum;
     }
     $IPBHTML .= "<h2>" . IPSText::truncate($forum_data['name']) . "</h2>\n" . ((is_array($sub_forum_data) and count($sub_forum_data)) ? "\n\t<div class='master_list' id='board_index'>\n\t\t" . $this->__f__04dc268cba1692f1c8246bcd4bb0185e($forum_data, $announce_data, $topic_data, $other_data, $multi_mod_data, $sub_forum_data, $footer_filter, $active_user_data, $mod_data, $inforum) . "\t</div>\n" : "") . "\n<div class='master_list'>\n\t" . ($forum_data['sub_can_post'] ? "<!--<h2>{$forum_data['name']}</h2>-->\n\t\t<div class='controls'>\n\t\t\t<div class='buttons'>\n\t\t\t\t" . ($forum_data['_user_can_post'] ? "\n\t\t\t\t\t<a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("module=post&amp;section=post&amp;do=new_post&amp;f={$forum_data['id']}", "publicWithApp", ''), "", "") . "' title='{$this->lang->words['topic_start']}' accesskey='s' class='button'>{$this->lang->words['topic_start']}</a>\n\t\t\t\t" : "") . "\n\t\t\t\t{$forum_data['SHOW_PAGES']}\n\t\t\t</div>\n\t\t</div>\n\t\t\n\t\t" . ((is_array($announce_data) and count($announce_data)) ? "\n\t\t\t" . $this->__f__062f9f3b211ecceff0d0d46789b6b494($forum_data, $announce_data, $topic_data, $other_data, $multi_mod_data, $sub_forum_data, $footer_filter, $active_user_data, $mod_data, $inforum) . "\t\t" : "") . "\n\t\t\n\t\t" . ((is_array($topic_data) and count($topic_data)) ? "\n\t\t\t<h3>{$this->lang->words['forum_topic_list']}</h3>\n\t\t\t" . $this->__f__c71a1045be627115405724f888f32a3c($forum_data, $announce_data, $topic_data, $other_data, $multi_mod_data, $sub_forum_data, $footer_filter, $active_user_data, $mod_data, $inforum) . "\t\t" : "\n\t\t\t<div class='row no_messages'>\n\t\t\t\t{$this->lang->words['no_topics']}\n\t\t\t</div>\n\t\t") . "\n\t\t<div class='controls'>\n\t\t\t<div class='buttons'>\n\t\t\t\t" . ($forum_data['_user_can_post'] ? "\n\t\t\t\t\t<a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("module=post&amp;section=post&amp;do=new_post&amp;f={$forum_data['id']}", "publicWithApp", ''), "", "") . "' title='{$this->lang->words['topic_start']}' accesskey='s' class='button'>{$this->lang->words['topic_start']}</a>\n\t\t\t\t" : "") . "\n\t\t\t\t{$forum_data['SHOW_PAGES']}\n\t\t\t</div>\n\t\t</div>" : "") . "\t\n</div>";
     return $IPBHTML;
 }
コード例 #5
0
 function forumIndexTemplate($forum_data, $announce_data, $topic_data, $other_data, $multi_mod_data, $sub_forum_data, $footer_filter, $active_user_data, $mod_data, $inforum = 1)
 {
     $IPBHTML = "";
     if (IPSLib::locationHasHooks('skin_forum', $this->_funcHooks['forumIndexTemplate'])) {
         $count_1c0d88849d33c13a953f8d516e9dfae1 = is_array($this->functionData['forumIndexTemplate']) ? count($this->functionData['forumIndexTemplate']) : 0;
         $this->functionData['forumIndexTemplate'][$count_1c0d88849d33c13a953f8d516e9dfae1]['forum_data'] = $forum_data;
         $this->functionData['forumIndexTemplate'][$count_1c0d88849d33c13a953f8d516e9dfae1]['announce_data'] = $announce_data;
         $this->functionData['forumIndexTemplate'][$count_1c0d88849d33c13a953f8d516e9dfae1]['topic_data'] = $topic_data;
         $this->functionData['forumIndexTemplate'][$count_1c0d88849d33c13a953f8d516e9dfae1]['other_data'] = $other_data;
         $this->functionData['forumIndexTemplate'][$count_1c0d88849d33c13a953f8d516e9dfae1]['multi_mod_data'] = $multi_mod_data;
         $this->functionData['forumIndexTemplate'][$count_1c0d88849d33c13a953f8d516e9dfae1]['sub_forum_data'] = $sub_forum_data;
         $this->functionData['forumIndexTemplate'][$count_1c0d88849d33c13a953f8d516e9dfae1]['footer_filter'] = $footer_filter;
         $this->functionData['forumIndexTemplate'][$count_1c0d88849d33c13a953f8d516e9dfae1]['active_user_data'] = $active_user_data;
         $this->functionData['forumIndexTemplate'][$count_1c0d88849d33c13a953f8d516e9dfae1]['mod_data'] = $mod_data;
         $this->functionData['forumIndexTemplate'][$count_1c0d88849d33c13a953f8d516e9dfae1]['inforum'] = $inforum;
     }
     $IPBHTML .= "<h2>" . IPSText::truncate($forum_data['name']) . "</h2>\n" . ((is_array($sub_forum_data) and count($sub_forum_data)) ? "\n\t<div class='master_list' id='board_index'>\n\t\t" . $this->__f__657fdca28a215b7889a52919d0d2c30e($forum_data, $announce_data, $topic_data, $other_data, $multi_mod_data, $sub_forum_data, $footer_filter, $active_user_data, $mod_data, $inforum) . "\t</div>\n" : "") . "\n<div class='master_list'>\n\t" . ($forum_data['sub_can_post'] ? "<!--<h2>{$forum_data['name']}</h2>-->\n\t\t<div class='controls'>\n\t\t\t<div class='buttons'>\n\t\t\t\t" . ($forum_data['_user_can_post'] ? "\n\t\t\t\t\t<a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("module=post&amp;section=post&amp;do=new_post&amp;f={$forum_data['id']}", "publicWithApp", ''), "", "") . "' title='{$this->lang->words['topic_start']}' accesskey='s' class='button'>{$this->lang->words['topic_start']}</a>\n\t\t\t\t" : "") . "\n\t\t\t\t{$forum_data['SHOW_PAGES']}\n\t\t\t</div>\n\t\t</div>\n\t\t\n\t\t" . ((is_array($announce_data) and count($announce_data)) ? "\n\t\t\t" . $this->__f__6dbe4c72a84744daf9627a13b0c09751($forum_data, $announce_data, $topic_data, $other_data, $multi_mod_data, $sub_forum_data, $footer_filter, $active_user_data, $mod_data, $inforum) . "\t\t" : "") . "\n\t\t\n\t\t" . ((is_array($topic_data) and count($topic_data)) ? "\n\t\t\t<h3>{$this->lang->words['forum_topic_list']}</h3>\n\t\t\t" . $this->__f__fc42cc8e03b8a187527c238f5293feb2($forum_data, $announce_data, $topic_data, $other_data, $multi_mod_data, $sub_forum_data, $footer_filter, $active_user_data, $mod_data, $inforum) . "\t\t" : "\n\t\t\t<div class='row no_messages'>\n\t\t\t\t{$this->lang->words['no_topics']}\n\t\t\t</div>\n\t\t") . "\n\t\t<div class='controls'>\n\t\t\t<div class='buttons'>\n\t\t\t\t" . ($forum_data['_user_can_post'] ? "\n\t\t\t\t\t<a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("module=post&amp;section=post&amp;do=new_post&amp;f={$forum_data['id']}", "publicWithApp", ''), "", "") . "' title='{$this->lang->words['topic_start']}' accesskey='s' class='button'>{$this->lang->words['topic_start']}</a>\n\t\t\t\t" : "") . "\n\t\t\t\t{$forum_data['SHOW_PAGES']}\n\t\t\t</div>\n\t\t</div>" : "") . "\t\n</div>";
     return $IPBHTML;
 }
コード例 #6
0
 /**
  * Show the recently started topic titles
  *
  * @access	public
  * @return	string		HTML content to replace tag with
  */
 public function recent_topics_discussions_last_x()
 {
     //-----------------------------------------
     // INIT
     //-----------------------------------------
     $results = array();
     $limit = $this->settings['recent_topics_discuss_number'] ? $this->settings['recent_topics_discuss_number'] : 5;
     $where_clause = array();
     /* Loop through the forums and build a list of forums we're allowed access to */
     $forumIdsOk = array();
     foreach ($this->registry->class_forums->forum_by_id as $id => $data) {
         /* Can we read? */
         if (!$this->registry->permissions->check('read', $data)) {
             continue;
         }
         /* Can read, but is it password protected, etc? */
         if (!$this->registry->class_forums->forumsCheckAccess($id, 0, 'forum', array(), true)) {
             continue;
         }
         if (!$data['can_view_others']) {
             continue;
         }
         if ($data['min_posts_view'] > $this->memberData['posts']) {
             continue;
         }
         $forumIdsOk[] = $id;
     }
     if (count($forumIdsOk)) {
         /* Add allowed forums */
         $where_clause[] = "t.forum_id IN (" . implode(",", $forumIdsOk) . ")";
         $this->DB->build(array('select' => 't.tid, t.title, t.posts, t.start_date as post_date, t.views, t.title_seo', 'from' => array('topics' => 't'), 'where' => "t.approved=1 and t.state != 'closed' and (t.state != 'link') " . (count($where_clause) ? ' AND ' . implode(' AND ', $where_clause) : ''), 'order' => 't.tid DESC', 'limit' => array(0, $limit), 'add_join' => array(array('from' => array('forums' => 'f'), 'where' => "f.id=t.forum_id", 'type' => 'left'), array('select' => 'm.member_id, m.members_display_name, m.members_seo_name', 'from' => array('members' => 'm'), 'where' => "m.member_id=t.starter_id", 'type' => 'left'))));
         $outer = $this->DB->execute();
         while ($row = $this->DB->fetch($outer)) {
             $row['title_display'] = IPSText::truncate($row['title'], 30);
             $row['date'] = $this->registry->class_localization->getDate($row['post_date'], "manual{{$this->settings['csite_article_date']}}");
             $results[] = $row;
         }
     }
     return $this->registry->getClass('output')->getTemplate('portal')->latestPosts($results);
 }
コード例 #7
0
ファイル: cp_skin_global.php プロジェクト: mover5/imobackup
    /**
     * manageBookmarks
     *
     * @param	array	Bookmarks
     * @return	@e string
     */
    public function manageBookmarks($bookmarks)
    {
        $IPBHTML = "";
        //--starthtml--//
        $IPBHTML .= <<<EOF
<h3>{$this->lang->words['bookmarks_title']}</h3>
<div class='ipsPad fixed_inner'>
<div class='right desctext'>{$this->lang->words['bookmarks_make_home']}</div>
<br />
<ul id='sortable'>
EOF;
        foreach ($bookmarks as $id => $data) {
            $url = IPSText::truncate($data['bookmark_url'], 42);
            $sel = $data['bookmark_home'] ? ' checked="checked" ' : '';
            $pos = intval($data['bookmark_pos']);
            $IPBHTML .= <<<EOF
\t<li data-rowid='{$id}' id='bookmark_{$id}'>
\t\t<span class="draghandle"></span>
\t\t<div class='right'>
\t\t\t<input type='checkbox' data-cboxid='{$id}' name='bookmarkHome[{$id}]' value='{$id}' {$sel}>
\t\t\t&nbsp; <img src="{$this->settings['skin_acp_url']}/images/aff_cross.png" data-deleteid="{$id}" class='clickable' />
\t\t</div>
\t\t<input type='text' class='input_text' size='60' data-inputname="{$id}" name='bookmarkName[{$id}]' value='{$data['bookmark_title']}' />
\t\t<span class='desctext'><a href="{$this->settings['_base_url']}&amp;{$data['bookmark_url']}" target="_blank">{$url}</a></span>
\t</li>
EOF;
        }
        $IPBHTML .= <<<EOF
</ul>
<div class='ipsPad'><input type='button' id='saveBookmarksManage' class='realbutton right' value='{$this->lang->words['bookmarks_save']}' /></div>
</div>
<script type="text/javascript">
(function(\$){
\t\$("#sortable").sortable();
}(jQuery));
</script>
EOF;
        //--endhtml--//
        return $IPBHTML;
    }
コード例 #8
0
 /**
  * Adds a new profile comment to the database
  *
  * @access	public
  * @param	integer	$comment_for_id	Member id that this comment is for
  * @param	string	$comment		Text of the comment to create
  * @return	string					Error key on failure, blank on success
  */
 public function addCommentToDB($comment_for_id, $comment)
 {
     /* Load the member that this comment is for */
     $member = IPSMember::load($comment_for_id);
     /* Make sure we found a member */
     if (!$member['member_id']) {
         return 'error';
     }
     /* Are we allowed to comment? */
     if (!$this->memberData['g_reply_other_topics']) {
         return 'nopermission';
     }
     if ($this->memberData['restrict_post']) {
         if ($this->memberData['restrict_post'] == 1) {
             return 'nopermission';
         }
         $post_arr = IPSMember::processBanEntry($this->memberData['restrict_post']);
         if (time() >= $post_arr['date_end']) {
             /* Update this member's profile */
             IPSMember::save($this->memberData['member_id'], array('core' => array('restrict_post' => 0)));
         } else {
             return 'nopermission';
         }
     }
     /* Does this member have mod_posts enabled? */
     $comment_approved = 1;
     if ($this->memberData['mod_posts']) {
         if ($this->memberData['mod_posts'] == 1) {
             $comment_approved = 0;
         } else {
             $mod_arr = IPSMember::processBanEntry($this->memberData['mod_posts']);
             if (time() >= $mod_arr['date_end']) {
                 /* Update this member's profile */
                 IPSMember::save($this->memberData['member_id'], array('core' => array('mod_posts' => 0)));
             } else {
                 $comment_approved = 0;
             }
         }
     }
     /* Format the comment */
     $comment = IPSText::truncate($comment, 400);
     $comment = preg_replace("#(\r\n|\r|\n|<br />|<br>){1,}#s", "\n", $comment);
     $comment = trim(IPSText::getTextClass('bbcode')->stripBadWords($comment));
     /* Make sure we still have a comment */
     if (!$comment) {
         return 'error-no-comment';
     }
     /* Comment requires approval? */
     if ($member['pp_setting_moderate_comments'] and $member['member_id'] != $this->memberData['member_id']) {
         $comment_approved = 0;
     }
     /* Member is ignoring you! */
     if ($comment_approved) {
         $_you_are_being_ignored = explode(",", $member['ignored_users']);
         if (is_array($_you_are_being_ignored) and count($_you_are_being_ignored)) {
             if (in_array($this->memberData['member_id'], $_you_are_being_ignored)) {
                 $comment_approved = 0;
             }
         }
     }
     /* Add comment to the DB... */
     $this->DB->insert('profile_comments', array('comment_for_member_id' => $comment_for_id, 'comment_by_member_id' => $this->memberData['member_id'], 'comment_date' => time(), 'comment_ip_address' => $this->member->ip_address, 'comment_approved' => $comment_approved, 'comment_content' => nl2br($comment)));
     $new_id = $this->DB->getInsertId();
     /* Send notifications.. */
     if (!$comment_approved and $member['pp_setting_notify_comments'] and $member['member_id'] != $this->memberData['member_id']) {
         IPSText::getTextClass('email')->getTemplate("new_comment_request", $member['language']);
         IPSText::getTextClass('email')->buildMessage(array('MEMBERS_DISPLAY_NAME' => $member['members_display_name'], 'COMMENT_NAME' => $this->memberData['members_display_name'], 'LINK' => $this->settings['board_url'] . '/index.' . $this->settings['php_ext'] . '?showuser='******'member_id']));
         $message = IPSText::getTextClass('email')->message;
         $subject = IPSText::getTextClass('email')->subject;
         $to = $member;
         $from = $this->memberData;
         $return_msg = 'pp_comment_added_mod';
     } else {
         if ($member['pp_setting_notify_comments'] and $member['member_id'] != $this->memberData['member_id']) {
             IPSText::getTextClass('email')->getTemplate("new_comment_added", $member['language']);
             IPSText::getTextClass('email')->buildMessage(array('MEMBERS_DISPLAY_NAME' => $member['members_display_name'], 'COMMENT_NAME' => $this->memberData['members_display_name'], 'LINK' => $this->settings['board_url'] . '/index.' . $this->settings['php_ext'] . '?showuser='******'member_id']));
             $message = IPSText::getTextClass('email')->message;
             $subject = IPSText::getTextClass('email')->subject;
             $to = $member;
             $from = $this->memberData;
             $return_msg = '';
         }
     }
     /* Got anything to send? */
     if ($message and $subject) {
         /* Email ? */
         if ($member['pp_setting_notify_comments'] == 'email' or $member['pp_setting_notify_comments'] and $member['members_disable_pm']) {
             IPSText::getTextClass('email')->subject = $subject;
             IPSText::getTextClass('email')->message = $message;
             IPSText::getTextClass('email')->to = $to['email'];
             IPSText::getTextClass('email')->sendMail();
         } else {
             if ($member['pp_setting_notify_comments'] != 'none') {
                 require_once IPSLib::getAppDir('members') . '/sources/classes/messaging/messengerFunctions.php';
                 $this->messengerFunctions = new messengerFunctions($this->registry);
                 try {
                     $this->messengerFunctions->sendNewPersonalTopic($to['member_id'], $from['member_id'], array(), $subject, IPSText::getTextClass('editor')->method == 'rte' ? nl2br($message) : $message, array('origMsgID' => 0, 'fromMsgID' => 0, 'postKey' => md5(microtime()), 'trackMsg' => 0, 'addToSentFolder' => 0, 'hideCCUser' => 0, 'forcePm' => 1, 'isSystem' => 1));
                 } catch (Exception $error) {
                     $msg = $error->getMessage();
                     $toMember = IPSMember::load($toMemberID, 'core', 'displayname');
                     if (strstr($msg, 'BBCODE_')) {
                         $msg = str_replace('BBCODE_', $msg, 10258);
                         $this->registry->output->showError($msg);
                     } else {
                         if (isset($this->lang->words['err_' . $msg])) {
                             $this->lang->words['err_' . $msg] = $this->lang->words['err_' . $msg];
                             $this->lang->words['err_' . $msg] = str_replace('#NAMES#', implode(",", $this->messengerFunctions->exceptionData), $this->lang->words['err_' . $msg]);
                             $this->lang->words['err_' . $msg] = str_replace('#TONAME#', $toMember['members_display_name'], $this->lang->words['err_' . $msg]);
                             $this->lang->words['err_' . $msg] = str_replace('#FROMNAME#', $this->memberData['members_display_name'], $this->lang->words['err_' . $msg]);
                             $this->registry->output->showError('err_' . $msg, 10259);
                         } else {
                             $_msgString = $this->lang->words['err_UNKNOWN'] . ' ' . $msg;
                             $this->registry->output->showError('err_UNKNOWN', 10260);
                         }
                     }
                 }
             }
         }
     }
     return $return_msg;
 }
コード例 #9
0
ファイル: skin_search.php プロジェクト: mover5/imobackup
 function __f__d15d4688fdc77171a81348ac17a00ed7($results)
 {
     $_ips___x_retval = '';
     $__iteratorCount = 0;
     foreach ($results as $forum_data) {
         $__iteratorCount++;
         $_ips___x_retval .= "\n\t\t\t<tr class='_recordRow " . ($forum_data['_has_unread'] ? "unread" : "") . "'>\n\t\t\t\t<td class='col_c_icon altrow'>\n\t\t\t\t\t" . ($forum_data['_has_unread'] ? "\n\t\t\t\t\t\t<a id='forum_img_{$forum_data['id']}' href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=forums&amp;module=forums&amp;section=markasread&amp;marktype=forum&amp;forumid={$forum_data['id']}&amp;returntoforumid={$this->request['f']}&amp;i=1", "public", ''), "", "") . "\" data-tooltip=\"{$this->lang->words['bi_markread']}\" class='forum_marker'><img src='{$this->settings['img_url']}/f_icon.png' /></a>\n\t\t\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\t\t\tipb.global.registerMarker( \"forum_img_{$forum_data['id']}\", \"{$forum_data['img_new_post']}\", markerURL + \"&forumid={$forum_data['id']}\" );\n\t\t\t\t\t\t</script>\n\t\t\t\t\t" : "\n\t\t\t\t\t\t<img src='{$this->settings['img_url']}/f_icon_read.png' />\n\t\t\t\t\t") . "\n\t\t\t\t</td>\n\t\t\t\t<td class='col_c_forum'>\n\t\t\t\t\t<h4><a href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("showforum={$forum_data['id']}", "public", ''), "{$forum_data['name_seo']}", "showforum") . "\" title='{$forum_data['name']}'>{$forum_data['name']}</a></h4>\n\t\t\t\t\t\n\t\t\t\t\t" . (($forum_data['show_subforums'] and count($forum_data['subforums']) and $forum_data['show_subforums']) ? "\n\t\t\t\t\t\t<br />\n\t\t\t\t\t\t<ol class='ipsList_inline ipsType_small subforums toggle_notify_off' id='subforums_{$forum_data['id']}'>\n\t\t\t\t\t\t\t" . $this->__f__b22b473bc6d31fed5fc9aec77ee0f2f5($results, $forum_data) . "\t\t\t\t\t\t</ol>\n\t\t\t\t\t" : "") . "\n\t\t\t\t\t" . (count($forum_data['_followData']) ? "\n\t\t\t\t\t\t" . (method_exists($this->registry->getClass('output')->getTemplate('search'), 'followData') ? $this->registry->getClass('output')->getTemplate('search')->followData($forum_data['_followData']) : '') . "\n\t\t\t\t\t" : "") . "\n\t\t\t\t</td>\n\t\t\t\t<td class='col_c_stats ipsType_small'>\n\t\t\t\t\t<strong>{$forum_data['topics']}</strong> {$this->lang->words['topics']}<br />\n\t\t\t\t\t<strong>{$forum_data['posts']}</strong> {$this->lang->words['replies']}\n\t\t\t\t</td>\n\t\t\t\t<td class='col_c_post'>\n\t\t\t\t\t" . ($forum_data['hide_last_info'] ? "\n\t\t\t\t\t\t<ul class='last_post'>\n\t\t\t\t\t\t\t<li class='desc'>{$this->lang->words['f_protected']}</li>\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t" : "" . (($forum_data['pp_small_photo'] and !$forum_data['hide_last_info']) ? "\n\t\t\t\t\t\t\t<a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("showuser={$forum_data['last_poster_id']}", "public", ''), "{$forum_data['seo_last_name']}", "showuser") . "' class='ipsUserPhotoLink left'>\n\t\t\t\t\t\t\t\t<img src='{$forum_data['pp_small_photo']}' alt='{$this->lang->words['photo']}' class='ipsUserPhoto ipsUserPhoto_mini' />\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t" : "") . "\n\t\t\t\t\t\t<ul class='last_post ipsType_small'>\n\t\t\t\t\t\t\t" . (!$forum_data['last_id'] ? "\n\t\t\t\t\t\t\t\t<li class='desc lighter'><em>{$this->lang->words['f_none']}</em></li>\n\t\t\t\t\t\t\t" : "<li>\n\t\t\t\t\t\t\t\t\t<a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("showtopic={$forum_data['last_topic_id']}&amp;view=getnewpost", "public", ''), "{$forum_data['seo_last_title']}", "showtopic") . "' title=\"{$this->lang->words['view_new_post']}\">\n\t\t\t\t\t\t\t\t\t\t" . IPSText::truncate($forum_data['last_title'], 28) . "\n\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t" . ($forum_data['last_poster_id'] ? "\n\t\t\t\t\t\t\t\t\t<li>{$this->lang->words['by_ucfirst']} " . (method_exists($this->registry->getClass('output')->getTemplate('global'), 'userHoverCard') ? $this->registry->getClass('output')->getTemplate('global')->userHoverCard($forum_data) : '') . "</li>\n\t\t\t\t\t\t\t\t" : "") . "\n\t\t\t\t\t\t\t\t" . ($forum_data['_hide_last_date'] ? "\n\t\t\t\t\t\t\t\t\t<li class='desc lighter'>" . IPSText::htmlspecialchars($this->registry->getClass('class_localization')->getDate($forum_data['last_post'], "DATE", 0)) . "</li>\n\t\t\t\t\t\t\t\t" : "\n\t\t\t\t\t\t\t\t\t<li class='desc lighter blend_links'><a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("showtopic={$forum_data['last_id']}&amp;view=getlastpost", "public", ''), "{$forum_data['seo_last_title']}", "showtopic") . "' title='{$this->lang->words['view_last_post']}'>" . IPSText::htmlspecialchars($this->registry->getClass('class_localization')->getDate($forum_data['last_post'], "DATE", 0)) . "</a></li>\n\t\t\t\t\t\t\t\t") . "") . "\n\t\t\t\t\t\t</ul>") . "\n\t\t\t\t</td>\n\t\t\t\t<td class='col_f_mod'>\n\t\t\t\t\t<a href='#' class='ipsButton_secondary no_width ipbmenu' id='change_{$forum_data['id']}'>{$this->lang->words['followed_changeopts']}</a>\n\t\t\t\t\t<input class='input_check checkall toggle_notify_on' type=\"checkbox\" name=\"likes[]\" value=\"{$forum_data['_followData']['like_app']}-{$forum_data['_followData']['like_area']}-{$forum_data['_followData']['like_rel_id']}\" />\n\t\t\t\t\t<div class='ipbmenu_content' id='change_{$forum_data['id']}_menucontent' style='display: none; width: 400px; padding: 5px;'>\n\t\t\t\t\t\t<select name='modaction_row' class='input_select' id='form_change_{$forum_data['id']}'>\n\t\t\t\t\t\t\t<option value=''>{$this->lang->words['like_mod__chose']}</option>\n\t\t\t\t\t\t\t<option value='delete'>{$this->lang->words['like_mod__delete']}</option>\n\t\t\t\t\t\t\t<option value='change-donotify'>{$this->lang->words['like_mod__change_donotify']}</option>\n\t\t\t\t\t\t\t<option value='change-donotnotify'>{$this->lang->words['like_mod__change_nonotify']}</option>\n\t\t\t\t\t\t\t<option value='change-immediate'>{$this->lang->words['like_mod__change_immediate']}</option>\n\t\t\t\t\t\t\t<option value='change-offline'>{$this->lang->words['like_mod__change_offline']}</option>\n\t\t\t\t\t\t\t" . ($this->request['search_app'] == 'forums' ? "\n\t\t\t\t\t\t\t\t<option value='change-daily'>{$this->lang->words['like_mod__change_daily']}</option>\n\t\t\t\t\t\t\t\t<option value='change-weekly'>{$this->lang->words['like_mod__change_weekly']}</option>\n\t\t\t\t\t\t\t" : "") . "\n\t\t\t\t\t\t\t<option value='change-anon'>{$this->lang->words['like_mod__change_anon']}</option>\n\t\t\t\t\t\t\t<option value='change-noanon'>{$this->lang->words['like_mod__change_noanon']}</option>\n\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t<input type=\"submit\" class=\"input_submit submit_modaction_row\" value=\"{$this->lang->words['update_selected']}\" />\n\t\t\t\t\t</div>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\n";
     }
     $_ips___x_retval .= '';
     unset($__iteratorCount);
     return $_ips___x_retval;
 }
コード例 #10
0
 function __f__9798b4ea44a00f669a45f347ab223c07($results)
 {
     $_ips___x_retval = '';
     $__iteratorCount = 0;
     foreach ($results as $data) {
         $__iteratorCount++;
         $_ips___x_retval .= "\n\t\t<div class='post_block hentry clear no_sidebar ipsBox_container'>\n\t\t\t<div class='post_wrap'>\n\t\t\t\t" . ($data['author_id'] ? "\n\t\t\t\t\t<h3 class='row2'>\n\t\t\t\t" : "\n\t\t\t\t\t<h3 class='guest row2'>\n\t\t\t\t") . "\n\t\t\t\t\t<span class='post_id right ipsType_small desc blend_links'><a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("showtopic={$data['topic_id']}&amp;view=findpost&amp;p={$data['pid']}", "public", ''), "{$data['title_seo']}", "showtopic") . "' rel='bookmark' title='{$data['topic_title']}{$this->lang->words['link_to_post']} #{$data['pid']}'>#{$data['pid']}</a></span>\n\t\t\t\t\t<a href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("showtopic={$data['tid']}", "public", ''), "{$data['title_seo']}", "showtopic") . "\">" . IPSText::truncate($data['topic_title'], 80) . "</a>\n\t\t\t\t</h3>\n\t\t\t\t<div class='post_body'>\n\t\t\t\t\t<p class='posted_info desc lighter ipsType_small'>\n\t\t\t\t\t\t<img src='{$data['pp_thumb_photo']}' class='ipsUserPhoto ipsUserPhoto_tiny' /> {$this->lang->words['posted']} {$this->lang->words['search_by']}\n\t\t\t\t\t\t" . ($data['member_id'] ? "<span class=\"author vcard\">" . (method_exists($this->registry->getClass('output')->getTemplate('global'), 'userHoverCard') ? $this->registry->getClass('output')->getTemplate('global')->userHoverCard($data) : '') . "</span>" : "{$data['members_display_name']}") . "\n\t\t\t\t\t\t{$this->lang->words['on']} <abbr class=\"published\" title=\"" . date('c', $data['post_date']) . "\">" . IPSText::htmlspecialchars($this->registry->getClass('class_localization')->getDate($data['post_date'], "long", 0)) . "</abbr>\n\t\t\t\t\t\t" . ($data['_forum_trail'] ? "\n\t\t\t\t\t\t\tin\n\t\t\t\t\t\t\t" . $this->__f__14837d740329e582a4ef8455d2aa03a6($results, $data) . "\t\t\t\t\t\t" : "") . "\n\t\t\t\t\t</p>\n\t\t\t\t\t<div class='post entry-content clearfix'>\n\t\t\t\t\t\t{$data['post']}\n\t\t\t\t\t\t<br />\n\t\t\t\t\t\t" . (method_exists($this->registry->getClass('output')->getTemplate('global_other'), 'repButtons') ? $this->registry->getClass('output')->getTemplate('global_other')->repButtons($data, array_merge(array('primaryId' => $data['pid'], 'domLikeStripId' => 'like_post_' . $data['pid'], 'domCountId' => 'rep_post_' . $data['pid'], 'app' => 'forums', 'type' => 'pid', 'likeFormatted' => $data['repButtons']['formatted'], 'has_given_rep' => $data['repButtons']['iLike']), $data)) : '') . "\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<br />\n\t\t</div>\n\t\t<br />\n\t\n";
     }
     $_ips___x_retval .= '';
     unset($__iteratorCount);
     return $_ips___x_retval;
 }
コード例 #11
0
 /**
  * Loads the content for the friends tab
  *
  * @access	private
  * @return	void		[Prints to screen]
  * @since	IPB 2.2.0.2006-08-15
  */
 private function _iframeList()
 {
     //-----------------------------------------
     // INIT
     //-----------------------------------------
     $member_id = intval($this->request['member_id']);
     $content = '';
     $friends = array();
     //-----------------------------------------
     // Load member
     //-----------------------------------------
     $member = IPSMember::load($member_id);
     //-----------------------------------------
     // Check
     //-----------------------------------------
     if (!$member['member_id']) {
         $this->returnString($this->lang->words['nofriendid']);
     }
     //-----------------------------------------
     // Grab the friends
     //-----------------------------------------
     $this->DB->build(array('select' => 'f.*', 'from' => array('profile_friends' => 'f'), 'where' => 'f.friends_member_id=' . $member_id . ' AND f.friends_approved=1', 'order' => 'm.members_display_name ASC', 'add_join' => array(1 => array('select' => 'pp.*', 'from' => array('profile_portal' => 'pp'), 'where' => 'pp.pp_member_id=f.friends_friend_id', 'type' => 'left'), 2 => array('select' => 'm.*', 'from' => array('members' => 'm'), 'where' => 'm.member_id=f.friends_friend_id', 'type' => 'left'))));
     $outer = $this->DB->execute();
     //-----------------------------------------
     // Get and store...
     //-----------------------------------------
     while ($row = $this->DB->fetch($outer)) {
         $row['members_display_name_short'] = IPSText::truncate($row['members_display_name'], 13);
         $friends[] = IPSMember::buildDisplayData($row, 0);
     }
     //-----------------------------------------
     // Ok.. show the friends
     //-----------------------------------------
     $content = $this->registry->getClass('output')->getTemplate('profile')->friendsIframe($member, $friends);
     $this->returnHtml($content);
 }
コード例 #12
0
ファイル: moderate.php プロジェクト: mover5/imobackup
 /**
  * Post multi-mod: Merge posts
  *
  * @return	@e void		[Outputs to screen]
  */
 protected function _multiMergePost()
 {
     $this->_resetModerator($this->topic['forum_id']);
     $this->_genericPermissionCheck('split_merge');
     if (count($this->pids) < 2) {
         $this->_showError('mod_only_one_pid', 10383);
     }
     //-----------------------------------------
     // Form or print?
     //-----------------------------------------
     if (!$this->request['checked']) {
         //-----------------------------------------
         // Get post data
         //-----------------------------------------
         $master_post = "";
         $dropdown = array();
         $authors = array();
         $seen_author = array();
         $upload_html = "";
         $seoTitle = '';
         //-----------------------------------------
         // Grab teh posts
         //-----------------------------------------
         $this->DB->build(array('select' => 'p.*', 'from' => array('posts' => 'p'), 'where' => "p.pid IN (" . implode(",", $this->pids) . ")", 'add_join' => array(array('select' => 't.forum_id, t.title_seo', 'from' => array('topics' => 't'), 'where' => 't.tid=p.topic_id', 'type' => 'left'))));
         $outer = $this->DB->execute();
         while ($p = $this->DB->fetch($outer)) {
             if (IPSMember::checkPermissions('read', $p['forum_id']) == TRUE) {
                 $master_post .= $p['post'] . "<br /><br />";
                 $dropdown[] = array($p['pid'], ipsRegistry::getClass('class_localization')->getDate($p['post_date'], 'LONG') . " (#{$p['pid']})");
                 if (!in_array($p['author_id'], $seen_author)) {
                     $authors[] = array($p['author_id'], "{$p['author_name']} (#{$p['pid']})");
                     $seen_author[] = $p['author_id'];
                 }
                 $seoTitle = $p['title_seo'];
             }
         }
         //-----------------------------------------
         // Get Attachment Data
         //-----------------------------------------
         $this->DB->build(array('select' => '*', 'from' => 'attachments', 'where' => "attach_rel_module='post' AND attach_rel_id IN (" . implode(",", $this->pids) . ")"));
         $this->DB->execute();
         while ($row = $this->DB->fetch()) {
             $row['image'] = $this->caches['attachtypes'][$row['attach_ext']]['atype_img'];
             $row['size'] = IPSLib::sizeFormat($row['attach_filesize']);
             $row['attach_file'] = IPSText::truncate($row['attach_file'], 50);
             $attachments[] = $row;
         }
         //-----------------------------------------
         // Print form
         //-----------------------------------------
         /* Load editor stuff */
         $classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite');
         $_editor = new $classToLoad();
         $_editor->setContent(trim($master_post));
         $editor = $_editor->show('Post', array('autoSaveKey' => md5('merge-' . $this->topic['tid']), 'height' => 350));
         $this->output .= $this->registry->getClass('output')->getTemplate('mod')->mergePostForm($editor, $dropdown, $authors, $attachments, $seoTitle);
         if ($this->topic['tid']) {
             $this->registry->getClass('output')->addNavigation($this->topic['title'], "showtopic={$this->topic['tid']}", $this->topic['title_seo'], 'showtopic');
         }
         $this->registry->getClass('output')->addNavigation($this->lang->words['cm_title'], '');
         $this->registry->getClass('output')->setTitle($this->lang->words['cm_title'] . ' - ' . ipsRegistry::$settings['board_name']);
         $this->registry->output->addContent($this->output);
         $this->registry->getClass('output')->sendOutput();
     } else {
         //-----------------------------------------
         // DO THE THING, WITH THE THING!!
         //-----------------------------------------
         $this->request['postdate'] = intval($this->request['postdate']);
         if (empty($this->request['selectedpids']) || empty($this->request['postdate']) || empty($this->request['Post'])) {
             $this->_showError('mod_merge_posts', 10384);
         }
         /* Load editor stuff */
         $classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite');
         $_editor = new $classToLoad();
         /* remove saved content */
         if ($this->memberData['member_id']) {
             $_editor->removeAutoSavedContent(array('member_id' => $this->memberData['member_id'], 'autoSaveKey' => md5('merge-' . $this->topic['tid'])));
         }
         IPSText::getTextClass('bbcode')->parse_smilies = 1;
         IPSText::getTextClass('bbcode')->parse_html = 0;
         IPSText::getTextClass('bbcode')->parse_bbcode = 1;
         IPSText::getTextClass('bbcode')->parsing_section = 'topics';
         $post = $_editor->process($_POST['Post']);
         $post = IPSText::getTextClass('bbcode')->preDbParse($post);
         //-----------------------------------------
         // Post to keep...
         //-----------------------------------------
         $posts = array();
         $author = array();
         $post_to_delete = array();
         $new_post_key = md5(time());
         $topics = array();
         $forums = array();
         $append_edit = 0;
         //-----------------------------------------
         // Grab teh posts
         //-----------------------------------------
         $this->DB->build(array('select' => 'p.*', 'from' => array('posts' => 'p'), 'where' => "p.pid IN (" . implode(",", $this->pids) . ")", 'add_join' => array(array('select' => 't.forum_id', 'from' => array('topics' => 't'), 'where' => 't.tid=p.topic_id', 'type' => 'left'))));
         $outer = $this->DB->execute();
         while ($p = $this->DB->fetch($outer)) {
             $posts[$p['pid']] = $p;
             $topics[$p['topic_id']] = $p['topic_id'];
             $forums[$p['forum_id']] = $p['forum_id'];
             if ($p['author_id'] == $this->request['postauthor']) {
                 $author = array('id' => $p['author_id'], 'name' => $p['author_name']);
             }
             if ($p['pid'] != $this->request['postdate']) {
                 $post_to_delete[] = $p['pid'];
             }
             if ($p['append_edit']) {
                 $append_edit = 1;
             }
         }
         //-----------------------------------------
         // Update main post...
         //-----------------------------------------
         $this->DB->update('posts', array('author_id' => $author['id'], 'author_name' => $author['name'], 'post' => $post, 'post_key' => $new_post_key, 'edit_time' => time(), 'edit_name' => $this->memberData['members_display_name'], 'append_edit' => ($append_edit or !$this->memberData['g_append_edit']) ? 1 : 0), 'pid=' . $this->request['postdate']);
         /* Run moderation sync */
         $this->modLibrary->runModSync('postMerge', $this->pids, $this->request['postdate']);
         //-----------------------------------------
         // Fix attachments
         //-----------------------------------------
         $attach_keep = array();
         $attach_kill = array();
         foreach ($_POST as $key => $value) {
             if (preg_match('/^attach_(\\d+)$/', $key, $match)) {
                 if ($this->request[$match[0]] == 'keep') {
                     $attach_keep[] = $match[1];
                 } else {
                     $attach_kill[] = $match[1];
                 }
             }
         }
         $attach_keep = IPSLib::cleanIntArray($attach_keep);
         $attach_kill = IPSLib::cleanIntArray($attach_kill);
         //-----------------------------------------
         // Keep
         //-----------------------------------------
         if (count($attach_keep)) {
             $this->DB->update('attachments', array('attach_rel_id' => $this->request['postdate'], 'attach_post_key' => $new_post_key, 'attach_member_id' => $author['id']), 'attach_id IN(' . implode(",", $attach_keep) . ')');
         }
         //-----------------------------------------
         // Kill Attachments
         //-----------------------------------------
         if (count($attach_kill)) {
             $classToLoad = IPSLib::loadLibrary(IPSLib::getAppDir('core') . '/sources/classes/attach/class_attach.php', 'class_attach');
             $class_attach = new $classToLoad($this->registry);
             $class_attach->type = 'post';
             $class_attach->init();
             $class_attach->bulkRemoveAttachment($attach_kill, 'attach_id');
         }
         //-----------------------------------------
         // Kill old posts
         //-----------------------------------------
         if (count($post_to_delete)) {
             $this->DB->delete('posts', 'pid IN(' . implode(",", $post_to_delete) . ')');
             IPSDeleteLog::removeEntries($post_to_delete, 'post', TRUE);
             /* Handle Rep */
             $this->DB->delete('reputation_cache', "app='forums' AND type='pid' AND type_id IN(" . implode(",", $post_to_delete) . ")");
             $this->DB->delete('reputation_index', "app='forums' AND type='pid' AND type_id IN(" . implode(",", $post_to_delete) . ")");
             foreach ($post_to_delete as $post) {
                 $this->DB->delete('reputation_totals', "rt_key=MD5('forums;pid;" . $post . "') AND rt_type_id=" . $post);
             }
         }
         foreach ($topics as $t) {
             $this->modLibrary->rebuildTopic($t, 0);
         }
         foreach ($forums as $f) {
             $this->modLibrary->forumRecount($f);
         }
         $this->cache->rebuildCache('stats', 'global');
         /* Clear the content cache */
         IPSContentCache::drop('post', $this->pids);
         $this->_addModeratorLog(sprintf($this->lang->words['acp_merged_posts'], implode(", ", $this->pids)));
     }
 }
コード例 #13
0
 function modCPpost($post, $displayData, $topic, $type)
 {
     $IPBHTML = "";
     if (IPSLib::locationHasHooks('skin_modcp', $this->_funcHooks['modCPpost'])) {
         $count_2cc4004cd3ee4869731c07f458d6e93d = is_array($this->functionData['modCPpost']) ? count($this->functionData['modCPpost']) : 0;
         $this->functionData['modCPpost'][$count_2cc4004cd3ee4869731c07f458d6e93d]['post'] = $post;
         $this->functionData['modCPpost'][$count_2cc4004cd3ee4869731c07f458d6e93d]['displayData'] = $displayData;
         $this->functionData['modCPpost'][$count_2cc4004cd3ee4869731c07f458d6e93d]['topic'] = $topic;
         $this->functionData['modCPpost'][$count_2cc4004cd3ee4869731c07f458d6e93d]['type'] = $type;
     }
     $IPBHTML .= "<!--post:{$post['post']['pid']}-->\n<script type=\"text/javascript\">\nvar pid = parseInt({$post['post']['pid']});\nif ( pid > ipb.topic.topPid ){\n\tipb.topic.topPid = pid;\n}\n</script>\n<div class='post_block hentry clear no_sidebar " . ($this->settings['reputation_enabled'] ? "with_rep" : "") . "' id='post_id_{$post['post']['pid']}'>\n\t<a id='entry{$post['post']['pid']}'></a>\n\t" . ((!empty($post['post']['_repignored']) and $post['post']['_repignored'] == 1 && $post['post']['_ignored'] != 1) ? "<div class='post_ignore'>\n\t\t\t" . ($post['post']['rep_points'] == 0 ? "\n\t\t\t\t<span class='reputation zero' title='{$this->lang->words['top_rep']}'>\n\t\t\t" : "") . "\n\t\t\t" . ($post['post']['rep_points'] > 0 ? "\n\t\t\t\t<span class='reputation positive' title='{$this->lang->words['top_rep']}'>\n\t\t\t" : "") . "\n\t\t\t" . ($post['post']['rep_points'] < 0 ? "\n\t\t\t\t<span class='reputation negative' title='{$this->lang->words['top_rep']}' >\n\t\t\t" : "") . "\n\t\t\t\t\t{$post['post']['rep_points']}</span> {$this->lang->words['top_this_post_by']} <a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("showuser={$post['author']['member_id']}", "public", ''), "", "") . "'>{$post['author']['members_display_name']}</a> {$this->lang->words['top_below_thresh']}. <a href='#' title='{$this->lang->words['ignore_view_post']}' id='unhide_post_{$post['post']['pid']}'>{$this->lang->words['rep_view_anyway']}</a>\n\t\t</div>" : "") . "\n\t\n\t<div class='post_wrap'>\n\t\t<h3 class='" . (empty($post['author']['member_id']) ? "guest " : "") . "row2'>\n\t\t\t<img src='{$post['author']['pp_small_photo']}' class='ipsUserPhoto ipsUserPhoto_tiny' />&nbsp;\n\t\t\t" . ($post['author']['member_id'] ? "\n\t\t\t\t<span class=\"author vcard\">" . (method_exists($this->registry->getClass('output')->getTemplate('global'), 'userHoverCard') ? $this->registry->getClass('output')->getTemplate('global')->userHoverCard($post['author']) : '') . "</span>\n\t\t\t" : "\n\t\t\t\t" . (method_exists($this->registry->getClass('output')->getTemplate('global'), 'userHoverCard') ? $this->registry->getClass('output')->getTemplate('global')->userHoverCard($post['author']) : '') . "\n\t\t\t") . "\n\t\t\t\n\t\t\t" . ($post['post']['_show_ip'] ? "<span class='ip right ipsType_small'>({$this->lang->words['ip']}:\n\t\t\t\t" . ($post['author']['g_access_cp'] ? "\n\t\t\t\t\t<em>{$this->lang->words['ip_private']}</em>\n\t\t\t\t" : "\n\t\t\t\t\t<a href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=core&amp;module=modcp&amp;tab=iplookup&amp;fromapp=members&amp;_do=submit&amp;ip={$post['post']['ip_address']}", "public", ''), "", "") . "\" title='{$this->lang->words['info_about_this_ip']}'>{$post['post']['ip_address']}</a>\n\t\t\t\t") . ")\n\t\t\t\t</span>" : "") . "\n\t\t</h3>\n\t\t\n\t\t<div class='post_body'>\n\t\t\t" . ($type == 'deleted' ? "<ul class='ipsList_inline modcp_post_controls right'>\n\t\t\t\t\t" . (!$post['post']['_isDeleted'] ? "\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<img data-tooltip=\"{$this->lang->words['hard_delete_warn_post']}\" src='{$this->settings['img_url']}/icon_timewarning.png' />\n\t\t\t\t\t\t</li>\n\t\t\t\t\t" : "") . "\n\t\t\t\t\t" . ($this->registry->getClass('class_forums')->canSoftDeletePosts($post['post']['forum_id'], $post) ? "\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=forums&amp;module=moderate&amp;section=moderate&amp;do=p_hrestore&amp;f={$post['post']['forum_id']}&amp;t={$post['post']['topic_id']}&amp;pid[]={$post['post']['pid']}&amp;st={$this->request['st']}&amp;auth_key={$this->member->form_hash}&amp;return=modcp:deleted", "public", ''), "", "") . "' class='ipsButton_secondary ipsType_smaller' title='{$this->lang->words['restore_post_desc']}'>{$this->lang->words['restore_post']}</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t" : "") . "\n\t\t\t\t\t" . ($this->registry->getClass('class_forums')->canHardDeletePosts($post['post']['forum_id'], $post) ? "\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=forums&amp;module=moderate&amp;section=moderate&amp;do=p_hdelete&amp;f={$post['post']['forum_id']}&amp;t={$post['post']['topic_id']}&amp;pid[]={$post['post']['pid']}&amp;st={$this->request['st']}&amp;auth_key={$this->member->form_hash}&amp;return=modcp:deleted", "public", ''), "", "") . "' class='ipsButton_secondary ipsType_smaller important' title='{$this->lang->words['perm_delete_post']}'>{$this->lang->words['perm_delete_post']}</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t" : "") . "\n\t\t\t\t</ul>\n\t\t\t\t<ul class='ipsList_inline" . (empty($displayData['sdData'][$post['post']['pid']]) ? " modcp_post_controls" : "") . "'>\n\t\t\t\t\t<li class='desc'>\n\t\t\t\t\t\t<strong>{$this->lang->words['posted']}</strong> <span class='desc lighter'>" . IPSText::htmlspecialchars($this->registry->getClass('class_localization')->getDate($post['post']['post_date'], "short", 0)) . "</span>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li class='desc'>\n\t\t\t\t\t\t<strong>{$this->lang->words['deleted_post_date']}</strong> <span class='desc lighter'>" . IPSText::htmlspecialchars($this->registry->getClass('class_localization')->getDate($topic['post']['pdelete_time'], "short", 0)) . "</span>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li class='desc'>\n\t\t\t\t\t\t<strong>{$this->lang->words['delete_from_topic']}</strong> <a class='desc lighter' href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("showtopic={$topic['post']['tid']}", "public", ''), "{$topic['post']['title_seo']}", "showtopic") . "' title='{$this->lang->words['go_to_topic']}'>" . IPSText::truncate($topic['post']['title'], 25) . "</a>\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t\t" . (!empty($displayData['sdData'][$post['post']['pid']]) ? "<ul class='ipsList_inline modcp_post_controls'>\n\t\t\t\t\t\t<li class='desc'>\n\t\t\t\t\t\t\t<strong>{$this->lang->words['dlt_topic_deletedby']}</strong> <span class='desc lighter blend_links'>" . (method_exists($this->registry->getClass('output')->getTemplate('global'), 'userHoverCard') ? $this->registry->getClass('output')->getTemplate('global')->userHoverCard($displayData['sdData'][$post['post']['pid']]) : '') . "</span>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t" . ($post['post']['_softDeleteReason'] ? "<li class='desc'>\n\t\t\t\t\t\t\t\t<strong>{$this->lang->words['dlt_topic_reason']}</strong> <span class='desc lighter'><em>" . ($displayData['sdData'][$post['post']['pid']]['sdl_obj_reason'] ? "{$displayData['sdData'][$post['post']['pid']]['sdl_obj_reason']}" : "{$this->lang->words['tdb__noreasongi']}") . "</em></span>\n\t\t\t\t\t\t\t</li>" : "") . "\n\t\t\t\t\t</ul>" : "") . "" : "") . "\n\t\t\t" . ($type == 'unapproved' ? "<ul class='ipsList_inline modcp_post_controls'>\n\t\t\t\t\t" . ($post['post']['_can_edit'] === TRUE ? "\n\t\t\t\t\t\t<li class='post_edit'><a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=forums&amp;module=post&amp;section=post&amp;do=edit_post&amp;f={$post['post']['forum_id']}&amp;t={$post['post']['topic_id']}&amp;p={$post['post']['pid']}&amp;st={$this->request['st']}&amp;return=modcp:unapproved", "public", ''), "", "") . "' title='{$this->lang->words['post_edit_title']}' class='ipsButton_secondary ipsType_smaller' id='edit_post_{$post['post']['pid']}'>{$this->lang->words['post_edit']}</a></li>\n\t\t\t\t\t" : "") . "\n\t\t\t\t\t<!-- Matt: Approve / unapprove post button -->\n\t\t\t\t\t" . ($this->memberData['is_mod'] ? "<li id='toggle_post_{$post['post']['pid']}'>\n\t\t\t\t\t\t\t<a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=forums&amp;module=moderate&amp;section=moderate&amp;do=postchoice&amp;tact=approve&amp;selectedpids[{$post['post']['pid']}]={$post['post']['pid']}&amp;t={$post['post']['topic_id']}&amp;f={$post['post']['forum_id']}&amp;auth_key={$this->member->form_hash}&amp;return=modcp:unapproved", "public", ''), "", "") . "' title='{$this->lang->words['post_toggle_visible']}' class='ipsButton_secondary ipsType_smaller'><span id='toggletext_post_{$post['post']['pid']}'>" . ($post['post']['queued'] == 1 ? "{$this->lang->words['post_approve']}" : "{$this->lang->words['post_unapprove']}") . "</span></a>\n\t\t\t\t\t\t</li>" : "") . "\n\t\t\t\t\t" . (($post['post']['_can_delete'] === TRUE or $post['post']['_softDelete']) ? "\n\t\t\t\t\t\t<li class='post_del' id='del_post_{$post['post']['pid']}'>\n\t\t\t\t\t\t\t<a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=forums&amp;module=moderate&amp;section=moderate&amp;do=04&amp;f={$post['post']['forum_id']}&amp;t={$post['post']['topic_id']}&amp;p={$post['post']['pid']}&amp;st={$this->request['st']}&amp;auth_key={$this->member->form_hash}&amp;return=modcp:unapproved", "public", ''), "", "") . "' title='{$this->lang->words['post_delete_title']}' class='delete_post ipsButton_secondary important ipsType_smaller'>{$this->lang->words['post_delete']}</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t" : "") . "\n\t\t\t\t\t" . ($this->memberData['_cache']['report_temp']['post_marker']['post'][$post['post']['pid']]['gfx'] > 0 ? "\n\t\t\t\t\t\t<img src=\"{$this->settings['img_url']}/reports/post_alert_{$this->memberData['_cache']['report_temp']['post_marker']['post'][$post['post']['pid']]['gfx']}.png\" alt=\"\" class='ipbmenu clickable' id='post-report-{$post['post']['pid']}' />\n\t\t\t\t\t" : "") . "\n\t\t\t\t\t<li class='desc'>\n\t\t\t\t\t\t<strong>{$this->lang->words['posted']}</strong> <span class='desc lighter'>" . IPSText::htmlspecialchars($this->registry->getClass('class_localization')->getDate($post['post']['post_date'], "short", 0)) . "</span>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li class='desc'>\n\t\t\t\t\t\t<strong>{$this->lang->words['in_topic']}</strong> <a class='desc lighter' href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("showtopic={$topic['post']['tid']}", "public", ''), "{$topic['post']['title_seo']}", "showtopic") . "'>" . IPSText::truncate($topic['post']['title'], 35) . "</a>\n\t\t\t\t\t</li>\n\t\t\t\t</ul>" : "") . "\n\t\t\t<div class='post entry-content " . ($post['post']['_repignored'] == 1 ? "imgsize_ignore" : "") . "'>\n\t\t\t\t{$post['post']['post']}\n\t\t\t\t{$post['post']['attachmentHtml']}\n\t\t\t\t<br />\n\t\t\t\t" . ($post['post']['edit_by'] ? "<p class='edit'>\n\t\t\t\t\t\t{$post['post']['edit_by']}\n\t\t\t\t\t\t" . ($post['post']['post_edit_reason'] != '' ? "\n\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t<span class='reason'>{$post['post']['post_edit_reason']}</span>\n\t\t\t\t\t\t" : "") . "\n\t\t\t\t\t</p>" : "") . "\n\t\t\t</div>\n\t\t\t<br />\n\t\t</div>\n\t\t\n\t\t<script type='text/javascript'>\n\t\t\tif( \$('toggle_post_{$post['post']['pid']}') ){\n\t\t\t\t\$('toggle_post_{$post['post']['pid']}').show();\n\t\t\t}\n\t\t\t\n\t\t\t// Add perm data\n\t\t\tipb.topic.deletePerms[{$post['post']['pid']}] = { 'canDelete' : " . intval($post['post']['_can_delete']) . ", 'canSoftDelete' : " . intval($post['post']['_softDelete']) . " };\n\t\t</script>\n\t\t" . ($this->memberData['_cache']['report_temp']['post_marker']['post'][$post['post']['pid']]['gfx'] > 0 ? "\n\t\t\t<ul id='post-report-{$post['post']['pid']}_menucontent' class='ipbmenu_content report_menu' style='display: none'>\n\t\t\t\t<li><a href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=core&amp;module=reports&amp;do=show_report&amp;rid={$this->memberData['_cache']['report_temp']['post_marker']['post'][$post['post']['pid']]['info']['id']}", "public", ''), "", "") . "\" id='report_mark_{$post['post']['pid']}'><img src='{$this->settings['img_url']}/reports/mark_complete.png' alt='' /> {$this->lang->words['report_menu_mark_complete']}</a></li>\n\t\t\t\t<li><a href=\"{$this->settings['base_url']}app=core&amp;module=reports&amp;section=reports&amp;do=show_report&amp;rid={$this->memberData['_cache']['report_temp']['post_marker']['post'][$post['post']['pid']]['info']['id']}\"><img src='{$this->settings['img_url']}/reports/view_report.png' alt='' /> {$this->lang->words['report_menu_view_report']}</a></li>\n\t\t\t</ul>\n\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\$('report_mark_{$post['post']['pid']}').observe('click',\n\t\t\t\t \tipb.global.updateReportStatus.bindAsEventListener( \t\n\t\t\t\t\t\tthis, {$this->memberData['_cache']['report_temp']['post_marker']['post'][$post['post']['pid']]['info']['id']},2,2\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t</script>\n\t\t" : "") . "\n\t</div>\n</div>";
     return $IPBHTML;
 }
コード例 #14
0
 /**
  * Show the attachments form
  *
  * @author	Matt Mecham
  * @return	string		Processed HTML
  */
 public function showFormAttachments()
 {
     //-----------------------------------------
     // INIT
     //-----------------------------------------
     $info = array();
     $start = intval($this->request['st']);
     $perpage = 15;
     $sort_key = "";
     $attachments = array();
     $this->hide_form_and_save_button = 1;
     //-----------------------------------------
     // Sort it
     //-----------------------------------------
     switch ($this->request['sort']) {
         case 'date':
             $sort_key = 'a.attach_date ASC';
             $info['date_order'] = 'rdate';
             $info['size_order'] = 'size';
             break;
         case 'rdate':
             $sort_key = 'a.attach_date DESC';
             $info['date_order'] = 'date';
             $info['size_order'] = 'size';
             break;
         case 'size':
             $sort_key = 'a.attach_filesize DESC';
             $info['date_order'] = 'date';
             $info['size_order'] = 'rsize';
             break;
         case 'rsize':
             $sort_key = 'a.attach_filesize ASC';
             $info['date_order'] = 'date';
             $info['size_order'] = 'size';
             break;
         default:
             $sort_key = 'a.attach_date DESC';
             $info['date_order'] = 'date';
             $info['size_order'] = 'size';
             break;
     }
     //-----------------------------------------
     // Get some stats...
     //-----------------------------------------
     $maxspace = intval($this->memberData['g_attach_max']);
     if ($this->memberData['g_attach_max'] == -1) {
         $this->registry->getClass('output')->showError('no_permission_to_attach', 1010);
     }
     //-----------------------------------------
     // Limit by forums
     //-----------------------------------------
     $stats = $this->DB->buildAndFetch(array('select' => 'count(*) as count, ' . $this->DB->buildCoalesce(array('sum(attach_filesize)', 0)) . ' as sum', 'from' => 'attachments', 'where' => 'attach_member_id=' . $this->memberData['member_id'] . " AND attach_rel_module IN( 'post', 'msg' )"));
     if ($maxspace > 0) {
         //-----------------------------------------
         // Figure out percentage used
         //-----------------------------------------
         $info['has_limit'] = 1;
         $info['full_percent'] = $stats['sum'] ? sprintf("%.0f", $stats['sum'] / ($maxspace * 1024) * 100) : 0;
         if ($info['full_percent'] > 100) {
             $info['full_percent'] = 100;
         } else {
             if ($info['full_percent'] < 1 and $stats['count'] > 0) {
                 $info['full_percent'] = 1;
             }
         }
         $info['attach_space_count'] = sprintf($this->lang->words['attach_space_count'], intval($stats['count']), intval($info['full_percent']));
         $info['attach_space_used'] = sprintf($this->lang->words['attach_space_used'], IPSLib::sizeFormat($stats['sum']), IPSLib::sizeFormat($maxspace * 1024));
     } else {
         $info['has_limit'] = 0;
         $info['attach_space_used'] = sprintf($this->lang->words['attach_space_unl'], IPSLib::sizeFormat($stats['sum']));
     }
     //-----------------------------------------
     // Pages
     //-----------------------------------------
     $pages = $this->registry->getClass('output')->generatePagination(array('totalItems' => $stats['count'], 'itemsPerPage' => $perpage, 'currentStartValue' => $start, 'baseUrl' => "app=core&amp;module=usercp&amp;tab=core&amp;area=attachments&amp;sort=" . $this->request['sort'] . ""));
     //-----------------------------------------
     // Get attachments...
     //-----------------------------------------
     if ($stats['count']) {
         $this->DB->build(array('select' => 'a.*', 'from' => array('attachments' => 'a'), 'where' => "a.attach_member_id=" . $this->memberData['member_id'] . " AND a.attach_rel_module IN( 'post', 'msg' )", 'order' => $sort_key, 'limit' => array($start, $perpage), 'add_join' => array(array('select' => 'p.topic_id', 'from' => array('posts' => 'p'), 'where' => 'p.pid=a.attach_rel_id', 'type' => 'left'), array('select' => 't.*', 'from' => array('topics' => 't'), 'where' => 't.tid=p.topic_id', 'type' => 'left'))));
         $outer = $this->DB->execute();
         $this->registry->getClass('class_localization')->loadLanguageFile(array('public_topic'), 'forums');
         $cache = $this->cache->getCache('attachtypes');
         /* Load topic class */
         if (!$this->registry->isClassLoaded('topics')) {
             $classToLoad = IPSLib::loadLibrary(IPSLib::getAppDir('forums') . "/sources/classes/topics.php", 'app_forums_classes_topics', 'forums');
             $this->registry->setClass('topics', new $classToLoad($this->registry));
         }
         while ($row = $this->DB->fetch($outer)) {
             $row['_link'] = true;
             if (!$this->registry->topics->canView($row)) {
                 $row['title'] = $this->lang->words['attach_topicmoved'];
                 $row['_link'] = false;
             }
             //-----------------------------------------
             // Full attachment thingy
             //-----------------------------------------
             if ($row['attach_rel_module'] == 'post') {
                 $row['_type'] = 'post';
             } else {
                 if ($row['attach_rel_module'] == 'msg') {
                     $row['_type'] = 'msg';
                     $row['title'] = $this->lang->words['attach_inpm'];
                 }
             }
             /* IPB 2.x conversion */
             $row['image'] = str_replace('folder_mime_types', 'mime_types', $cache[$row['attach_ext']]['atype_img']);
             $row['short_name'] = IPSText::truncate($row['attach_file'], 30);
             $row['attach_date'] = $this->registry->getClass('class_localization')->getDate($row['attach_date'], 'SHORT');
             $row['real_size'] = IPSLib::sizeFormat($row['attach_filesize']);
             $attachments[] = $row;
         }
     }
     return $this->registry->getClass('output')->getTemplate('ucp')->coreAttachments($info, $pages, $attachments);
 }
コード例 #15
0
 /**
  * Recursively build up the tracked forums
  *
  * @access	private
  * @param	array 		Tracked forums
  * @param	integer		Forum id to start at
  * @param	array 		Forum data thus far
  * @param	integer		Depth level
  * @return	array 		Forums
  */
 private function _showForumSubsRecurse($forums, $root, $forumArray = array(), $depth = 0)
 {
     if (is_array($this->registry->getClass('class_forums')->forum_cache[$root]) and count($this->registry->getClass('class_forums')->forum_cache[$root])) {
         foreach ($this->registry->getClass('class_forums')->forum_cache[$root] as $id => $forum) {
             if (in_array($id, array_keys($forums))) {
                 //-----------------------------------------
                 // Got perms to see this forum?
                 //-----------------------------------------
                 if (!$this->registry->getClass('class_forums')->forum_by_id[$forum['id']]) {
                     continue;
                 }
                 $forum['_depth'] = $depth;
                 $forum['_newTopics'] = $forums[$forum['id']]['_newTopics'];
                 $forum['_type'] = $forums[$forum['id']]['_type'];
                 $forum['folder_icon'] = $this->registry->getClass('class_forums')->forumsNewPosts($forum);
                 $forum['last_title'] = str_replace("&#33;", "!", $forum['last_title']);
                 $forum['last_title'] = str_replace("&quot;", '"', $forum['last_title']);
                 if (IPSText::mbstrlen($forum['last_title']) > 30) {
                     $forum['last_title'] = IPSText::truncate($forum['last_title'], 30);
                 }
                 $forumArray[$forum['id']] = $forum;
             }
             $forumArray = $this->_showForumSubsRecurse($forums, $forum['id'], $forumArray, $depth + 1);
         }
     }
     return $forumArray;
 }
コード例 #16
0
 /**
  * Return the HTML to display the tab
  *
  * @return	@e string
  */
 public function showTab($string)
 {
     //-----------------------------------------
     // Are we a member?
     //-----------------------------------------
     if (!$this->memberData['member_id']) {
         return '';
     }
     //-----------------------------------------
     // How many attachments do we have?
     //-----------------------------------------
     $mimes = $this->cache->getCache('attachtypes');
     $st = intval($this->request['st']);
     $each = 30;
     $where = '';
     if ($string) {
         $where = " AND attach_file LIKE '%{$string}%'";
     }
     /* Exclude PMs */
     $count = $this->DB->buildAndFetch(array('select' => 'COUNT(*) as total', 'from' => 'attachments', 'where' => "attach_rel_module != 'msg' AND attach_member_id={$this->memberData['member_id']}" . $where));
     $rows = array();
     $pages = $this->registry->output->generatePagination(array('totalItems' => $count['total'], 'itemsPerPage' => $each, 'currentStartValue' => $st, 'seoTitle' => '', 'method' => 'nextPrevious', 'noDropdown' => true, 'ajaxLoad' => 'mymedia_content', 'baseUrl' => "app=core&amp;module=ajax&amp;section=media&amp;do=loadtab&amp;tabapp=core&amp;tabplugin=attachments&amp;search=" . urlencode($string)));
     $this->DB->build(array('select' => '*', 'from' => 'attachments', 'where' => "attach_rel_module != 'msg' AND attach_member_id={$this->memberData['member_id']}" . $where, 'order' => 'attach_date DESC', 'limit' => array($st, $each)));
     $outer = $this->DB->execute();
     while ($r = $this->DB->fetch($outer)) {
         if ($r['attach_thumb_location']) {
             $image = $this->settings['upload_url'] . '/' . $r['attach_thumb_location'];
             $dims = IPSLib::scaleImage(array('cur_width' => $r['attach_thumb_width'], 'cur_height' => $r['attach_thumb_height'], 'max_width' => 80, 'max_height' => 80));
             $width = $dims['img_width'];
             $height = $dims['img_height'];
         } else {
             $image = $this->settings['public_dir'] . $mimes[$r['attach_ext']]['atype_img'];
             $width = 0;
             $height = 0;
         }
         $rows[] = array('image' => $image, 'width' => $width, 'height' => $height, 'title' => IPSText::truncate($r['attach_file'], 25), 'desc' => '', 'insert' => "core:attachments:" . $r['attach_id']);
     }
     return $this->registry->output->getTemplate('editors')->mediaGenericWrapper($rows, $pages, 'core', 'attachments');
 }
コード例 #17
0
 /**
  * Modern profile
  *
  * @access	private
  * @return	void		[Outputs to screen]
  */
 private function _viewModern()
 {
     //-----------------------------------------
     // INIT
     //-----------------------------------------
     $member_id = intval($this->request['id']) ? intval($this->request['id']) : intval($this->request['MID']);
     $member_id = $member_id ? $member_id : $this->memberData['member_id'];
     $tab = substr(IPSText::alphanumericalClean(str_replace('..', '', trim($this->request['tab']))), 0, 20);
     $firsttab = '';
     $member = array();
     $comments = array();
     $comments_html = "";
     $friends = array();
     $visitors = array();
     $comment_perpage = 5;
     $pips = 0;
     $tabs = array();
     $_tabs = array();
     $_positions = array(0 => 0);
     $custom_path = IPSLib::getAppDir('members') . '/sources/tabs';
     $_member_ids = array();
     $sql_extra = '';
     $pass = 0;
     $mod = 0;
     $_todays_date = getdate();
     $time_adjust = $this->settings['time_adjust'] == "" ? 0 : $this->settings['time_adjust'];
     $board_posts = $this->caches['stats']['total_topics'] + $this->caches['stats']['total_replies'];
     //-----------------------------------------
     // Check input..
     //-----------------------------------------
     if (!$member_id) {
         $this->registry->output->silentRedirect($this->settings['base_url']);
     }
     //-----------------------------------------
     // Configure tabs
     //-----------------------------------------
     if (is_dir($custom_path)) {
         foreach (new DirectoryIterator($custom_path) as $f) {
             if (!$f->isDot() && !$f->isDir()) {
                 $file = $f->getFileName();
                 if ($file[0] == '.') {
                     continue;
                 }
                 if (preg_match("#\\.conf\\.php\$#i", $file)) {
                     $classname = str_replace(".conf.php", "", $file);
                     require $custom_path . '/' . $file;
                     //-------------------------------
                     // Allowed to use?
                     //-------------------------------
                     if ($CONFIG['plugin_enabled']) {
                         if (in_array($this->settings['search_method'], array('traditional', 'sphinx')) && $CONFIG['plugin_key'] == 'recentActivity') {
                             continue;
                         }
                         $_position = in_array($CONFIG['plugin_order'], $_positions) ? count($_positions) + 1 : $CONFIG['plugin_order'];
                         $_tabs[$_position] = $CONFIG;
                         $_positions[$_position] = $_position;
                     }
                 }
             }
         }
     }
     ksort($_tabs);
     foreach ($_tabs as $_pos => $data) {
         if (!$firsttab) {
             $firsttab = $data['plugin_key'];
         }
         $data['_lang'] = isset($this->lang->words[$data['plugin_lang_bit']]) ? $this->lang->words[$data['plugin_lang_bit']] : $data['plugin_name'];
         $tabs[$data['plugin_key']] = $data;
     }
     if ($tab != 'comments' and $tab != 'settings' and !file_exists($custom_path . '/' . $tab . '.php')) {
         $tab = $firsttab;
     }
     //-----------------------------------------
     // Grab all data...
     //-----------------------------------------
     $member = IPSMember::load($member_id, 'profile_portal,pfields_content,sessions,groups', 'id');
     if (!$member['member_id']) {
         $this->registry->output->showError('profiles_no_member', 10246);
     }
     /* Check USER permalink... */
     $this->registry->getClass('output')->checkPermalink($member['members_seo_name'] ? $member['members_seo_name'] : IPSText::makeSeoTitle($member['members_display_name']));
     /* Build data */
     $member = IPSMember::buildDisplayData($member, array('customFields' => 1, 'cfSkinGroup' => 'profile', 'checkFormat' => 1, 'cfGetGroupData' => 1, 'signature' => 1));
     //-----------------------------------------
     // Recent visitor?
     //-----------------------------------------
     if ($member['member_id'] != $this->memberData['member_id']) {
         list($be_anon, $loggedin) = explode('&', $this->memberData['login_anonymous']);
         if (!$be_anon) {
             $this->_addRecentVisitor($member, $this->memberData['member_id']);
         }
     }
     //-----------------------------------------
     // DST?
     //-----------------------------------------
     if ($member['dst_in_use'] == 1) {
         $member['time_offset'] += 1;
     }
     //-----------------------------------------
     // Format extra user data
     //-----------------------------------------
     $member['_age'] = $member['bday_year'] ? date('Y') - $member['bday_year'] : 0;
     if ($member['bday_month'] > date('n')) {
         $member['_age'] -= 1;
     } else {
         if ($member['bday_month'] == date('n')) {
             if ($member['bday_day'] > date('j')) {
                 $member['_age'] -= 1;
             }
         }
     }
     $member['_local_time'] = $member['time_offset'] != "" ? gmstrftime($this->settings['clock_long'], time() + $member['time_offset'] * 3600 + $time_adjust * 60) : '';
     $member['g_title'] = IPSLib::makeNameFormatted($member['g_title'], $member['g_id'], $member['prefix'], $member['suffix']);
     $member['_posts_day'] = 0;
     $member['_total_pct'] = 0;
     $member['_bday_month'] = $member['bday_month'] ? $this->lang->words['M_' . $member['bday_month']] : 0;
     //-----------------------------------------
     // BIO
     //-----------------------------------------
     $member['pp_bio_content'] = IPSText::getTextClass('bbcode')->stripBadWords($member['pp_bio_content']);
     $member['pp_bio_content'] = IPSText::wordwrap($member['pp_bio_content'], '25', ' ');
     if (!$this->settings['disable_profile_stats']) {
         $posts = $this->DB->buildAndFetch(array('select' => "COUNT(*) as total_posts", 'from' => "posts", 'where' => "author_id=" . $member['member_id']));
         $member['posts'] = $posts['total_posts'];
         //-----------------------------------------
         // Total posts
         //-----------------------------------------
         if ($member['posts'] and $board_posts) {
             $member['_posts_day'] = round($member['posts'] / ((time() - $member['joined']) / 86400), 2);
             # Fix the issue when there is less than one day
             $member['_posts_day'] = $member['_posts_day'] > $member['posts'] ? $member['posts'] : $member['_posts_day'];
             $member['_total_pct'] = sprintf('%.2f', $member['posts'] / $board_posts * 100);
         }
         $member['_posts_day'] = floatval($member['_posts_day']);
         //-----------------------------------------
         // Most active in
         //-----------------------------------------
         $favorite = $this->DB->buildAndFetch(array('select' => 'COUNT(p.author_id) as f_posts', 'from' => array('posts' => 'p'), 'where' => 'p.author_id=' . $member['member_id'] . ' AND ' . $this->registry->permissions->buildPermQuery('i'), 'order' => 'f_posts DESC', 'group' => 't.forum_id', 'add_join' => array(array('select' => 't.forum_id', 'from' => array('topics' => 't'), 'where' => 't.tid=p.topic_id'), array('from' => array('permission_index' => 'i'), 'where' => "i.perm_type='forum' AND i.perm_type_id=t.forum_id"))));
         $member['favorite_id'] = $favorite['forum_id'];
         $member['_fav_posts'] = $favorite['f_posts'];
         if ($member['posts']) {
             $member['_fav_percent'] = round($favorite['f_posts'] / $member['posts'] * 100);
         }
     }
     //-----------------------------------------
     // Comments
     //-----------------------------------------
     if ($member['pp_setting_count_comments']) {
         require_once IPSLib::getAppDir('members') . '/sources/comments.php';
         $comment_lib = new profileCommentsLib($this->registry);
         $comment_html = $comment_lib->buildComments($member);
     }
     //-----------------------------------------
     // Visitors
     //-----------------------------------------
     if ($member['pp_setting_count_visitors']) {
         $_pp_last_visitors = unserialize($member['pp_last_visitors']);
         $_visitor_info = array();
         $_count = 1;
         if (is_array($_pp_last_visitors)) {
             krsort($_pp_last_visitors);
             $_members = IPSMember::load(array_values($_pp_last_visitors), 'extendedProfile');
             foreach ($_members as $_id => $_member) {
                 $_visitor_info[$_id] = IPSMember::buildDisplayData($_member, 0);
             }
             foreach ($_pp_last_visitors as $_time => $_id) {
                 if ($_count > $member['pp_setting_count_visitors']) {
                     break;
                 }
                 $_count++;
                 if (!$_visitor_info[$_id]['members_display_name_short']) {
                     $_visitor_info[$_id] = IPSMember::setUpGuest();
                 }
                 $_visitor_info[$_id]['_visited_date'] = ipsRegistry::getClass('class_localization')->getDate($_time, 'TINY');
                 $_visitor_info[$_id]['members_display_name_short'] = $_visitor_info[$_id]['members_display_name_short'] ? $_visitor_info[$_id]['members_display_name_short'] : $this->lang->words['global_guestname'];
                 $visitors[] = $_visitor_info[$_id];
             }
         }
     }
     //-----------------------------------------
     // Friends
     //-----------------------------------------
     # Get random number from member's friend cache... grab 10 random. array_rand( array, no.)
     # also fall back on last 10 if no cache
     if ($member['pp_setting_count_friends'] > 0 && $this->settings['friends_enabled']) {
         $member['_cache'] = IPSMember::unpackMemberCache($member['members_cache']);
         if (is_array($member['_cache']['friends']) and count($member['_cache']['friends'])) {
             foreach ($member['_cache']['friends'] as $id => $approved) {
                 $id = intval($id);
                 if ($approved and $id) {
                     $_member_ids[] = $id;
                 }
             }
             $member['_total_approved_friends'] = count($_member_ids);
             if (is_array($_member_ids) and count($_member_ids)) {
                 $_max = count($_member_ids) > 50 ? 50 : count($_member_ids);
                 $_rand = array_rand($_member_ids, $_max);
                 $_final = array();
                 # If viewing member is in list, let's show em
                 if (in_array($this->memberData['member_id'], $_member_ids)) {
                     $_final[] = $this->memberData['member_id'];
                     $new_mids = array();
                     foreach ($_member_ids as $mid) {
                         if ($mid == $this->memberData['member_id']) {
                             continue;
                         }
                         $new_mids[] = $mid;
                     }
                     $_member_ids = $new_mids;
                     unset($new_mids);
                     if (is_array($_rand)) {
                         if (count($_rand) >= 50) {
                             array_pop($_rand);
                         }
                     }
                 }
                 if (is_array($_rand) and count($_rand)) {
                     foreach ($_rand as $_id) {
                         $_final[] = $_member_ids[$_id];
                     }
                 }
                 if (count($_final)) {
                     $sql_extra = ' AND pf.friends_friend_id IN (' . IPSText::cleanPermString(implode(',', $_final)) . ')';
                 }
             }
         }
         $this->DB->build(array('select' => 'pf.*', 'from' => array('profile_friends' => 'pf'), 'where' => 'pf.friends_member_id=' . $member_id . ' AND pf.friends_approved=1' . $sql_extra, 'limit' => array(0, 50), 'order' => 'm.members_display_name ASC', 'add_join' => array(array('select' => 'm.*', 'from' => array('members' => 'm'), 'where' => 'm.member_id=pf.friends_friend_id', 'type' => 'left'), array('select' => 'pp.*', 'from' => array('profile_portal' => 'pp'), 'where' => 'pp.pp_member_id=m.member_id', 'type' => 'left'))));
         $outer = $this->DB->execute();
         while ($row = $this->DB->fetch($outer)) {
             $row['_friends_added'] = ipsRegistry::getClass('class_localization')->getDate($row['friends_added'], 'SHORT');
             $row['_location'] = $row['location'] ? $row['location'] : $this->lang->words['no_info'];
             $row = IPSMember::buildProfilePhoto($row);
             $row['members_display_name_short'] = IPSText::truncate($row['members_display_name'], 13);
             $friends[] = $row;
         }
     }
     $member['_total_displayed_friends'] = count($friends);
     //-----------------------------------------
     // Online location
     //-----------------------------------------
     $member = IPSMember::getLocation($member);
     //-----------------------------------------
     // Add profile view
     //-----------------------------------------
     $this->DB->insert('profile_portal_views', array('views_member_id' => $member['member_id']), true);
     //-----------------------------------------
     // Grab default tab...
     //-----------------------------------------
     $tab_html = '';
     if ($tab != 'comments' and $tab != 'settings') {
         if (file_exists($custom_path . '/' . $tab . '.php')) {
             require $custom_path . '/pluginParentClass.php';
             require $custom_path . '/' . $tab . '.php';
             $_func_name = 'profile_' . $tab;
             $plugin = new $_func_name($this->registry);
             $tab_html = $plugin->return_html_block($member);
         }
     }
     //-----------------------------------------
     // Set description tag
     //-----------------------------------------
     $_desc = $member['pp_about_me'] ? $member['pp_about_me'] : $member['signature'];
     if ($_desc) {
         $this->registry->output->addMetaTag('description', $member['members_display_name'] . ': ' . IPSText::getTextClass('bbcode')->stripAllTags($_desc));
     }
     //-----------------------------------------
     // Add to output
     //-----------------------------------------
     $this->member_name = $member['members_display_name'];
     $this->output = $this->registry->getClass('output')->getTemplate('profile')->profileModern($tabs, $member, $comment_html, $friends, $visitors, $tab, $tab_html, $fields);
 }
コード例 #18
0
 /**
  * Shows attachment statistics
  *
  * @return	@e void
  */
 public function attachmentStatsOverview()
 {
     /* Get attachment Types */
     $cache['attachtypes'] = array();
     $this->DB->build(array('select' => 'atype_extension,atype_mimetype,atype_post,atype_img', 'from' => 'attachments_type', 'where' => "atype_post=1"));
     $this->DB->execute();
     while ($r = $this->DB->fetch()) {
         $cache['attachtypes'][$r['atype_extension']] = $r;
     }
     $stats = $this->DB->buildAndFetch(array('select' => 'count(*) as count, sum(attach_filesize) as sum', 'from' => 'attachments', 'where' => 'attach_rel_module=\'post\''));
     /* Overall Stats */
     $overall_stats = array('total_attachments' => $this->registry->class_localization->formatNumber($stats['count']), 'total_size' => IPSLib::sizeFormat($stats['sum']));
     /* Last 5 Attachments */
     $this->DB->build(array('select' => 'a.*', 'from' => array('attachments' => 'a'), 'where' => "attach_rel_module='post'", 'order' => "a.attach_date DESC", 'limit' => array(0, 5), 'add_join' => array(array('select' => 'p.author_id, p.author_name, p.post_date', 'from' => array('posts' => 'p'), 'where' => 'p.pid=a.attach_rel_id', 'type' => 'left'), array('select' => 't.tid, t.forum_id, t.title', 'from' => array('topics' => 't'), 'where' => 'p.topic_id=t.tid', 'type' => 'left'), array('select' => 'm.members_display_name', 'from' => array('members' => 'm'), 'where' => 'm.member_id=a.attach_member_id', 'type' => 'left'))));
     $this->DB->execute();
     /* Loop through the last 5 */
     $last_5 = array();
     while ($r = $this->DB->fetch()) {
         /* Format Fields */
         $r['stitle'] = $r['title'] ? "<a href='{$this->settings['board_url']}/index.php?showtopic={$r['tid']}&view=findpost&p={$r['attach_rel_id']}' title='{$r['title']}'>" . IPSText::truncate($r['title'], 30) . "</a>" : $this->lang->words['attach_not_topic'];
         $r['_icon'] = $this->settings['mime_img'] . '/' . $cache['attachtypes'][$r['attach_ext']]['atype_img'];
         $r['attach_filesize'] = IPSLib::sizeFormat($r['attach_filesize']);
         $r['post_date'] = $this->registry->class_localization->getDate($r['attach_date'], 'SHORT', 1);
         /* Add to output array */
         $last_5[] = $r;
     }
     /* Largest 5 Attachments */
     $this->DB->build(array('select' => 'a.*', 'from' => array('attachments' => 'a'), 'where' => "attach_rel_module='post'", 'order' => "a.attach_filesize DESC", 'limit' => array(0, 5), 'add_join' => array(array('select' => 'p.author_id, p.author_name, p.post_date', 'from' => array('posts' => 'p'), 'where' => 'p.pid=a.attach_rel_id', 'type' => 'left'), array('select' => 't.tid, t.forum_id, t.title', 'from' => array('topics' => 't'), 'where' => 'p.topic_id=t.tid', 'type' => 'left'), array('select' => 'm.members_display_name', 'from' => array('members' => 'm'), 'where' => 'm.member_id=a.attach_member_id', 'type' => 'left'))));
     $this->DB->execute();
     /* Loop through the last 5 */
     $largest_5 = array();
     while ($r = $this->DB->fetch()) {
         /* Format Fields */
         $r['stitle'] = $r['title'] ? "<a href='{$this->settings['board_url']}/index.php?showtopic={$r['tid']}&view=findpost&p={$r['attach_rel_id']}' title='{$r['title']}'>" . IPSText::truncate($r['title'], 30) . "</a>" : $this->lang->words['attach_not_topic'];
         $r['_icon'] = $this->settings['mime_img'] . '/' . $cache['attachtypes'][$r['attach_ext']]['atype_img'];
         $r['attach_filesize'] = IPSLib::sizeFormat($r['attach_filesize']);
         $r['post_date'] = $this->registry->class_localization->getDate($r['attach_date'], 'SHORT', 1);
         /* Add to output array */
         $largest_5[] = $r;
     }
     /* 5 Most Viewed Downloads */
     $this->DB->build(array('select' => 'a.*', 'from' => array('attachments' => 'a'), 'where' => "attach_rel_module='post'", 'order' => "a.attach_hits DESC", 'limit' => array(0, 5), 'add_join' => array(array('select' => 'p.author_id, p.author_name, p.post_date', 'from' => array('posts' => 'p'), 'where' => 'p.pid=a.attach_rel_id', 'type' => 'left'), array('select' => 't.tid, t.forum_id, t.title', 'from' => array('topics' => 't'), 'where' => 'p.topic_id=t.tid', 'type' => 'left'), array('select' => 'm.members_display_name', 'from' => array('members' => 'm'), 'where' => 'm.member_id=a.attach_member_id', 'type' => 'left'))));
     $this->DB->execute();
     /* Loop through the last 5 */
     $most_viewed_5 = array();
     while ($r = $this->DB->fetch()) {
         /* Format Fields */
         $r['stitle'] = $r['title'] ? "<a href='{$this->settings['board_url']}/index.php?showtopic={$r['tid']}&view=findpost&p={$r['attach_rel_id']}' title='{$r['title']}'>" . IPSText::truncate($r['title'], 30) . "</a>" : $this->lang->words['attach_not_topic'];
         $r['_icon'] = $this->settings['mime_img'] . '/' . $cache['attachtypes'][$r['attach_ext']]['atype_img'];
         $r['attach_filesize'] = IPSLib::sizeFormat($r['attach_filesize']);
         $r['post_date'] = $this->registry->class_localization->getDate($r['attach_date'], 'SHORT', 1);
         /* Add to output array */
         $most_viewed_5[] = $r;
     }
     /* Output */
     $this->registry->output->html .= $this->html->attachmentStats($overall_stats, $last_5, $largest_5, $most_viewed_5);
 }
コード例 #19
0
ファイル: icalendar.php プロジェクト: mover5/imobackup
 /**
  * Import and parse an iCalendar feed
  *
  * @param	string		$content	Feed content
  * @param	int			$member_id	Member to save events under
  * @param	int			$feed_id	Feed id
  * @return	mixed		False on failure, otherwise an array with keys 'skipped' and 'imported'
  */
 public function import($content, $member_id = 0, $feed_id = 0)
 {
     //-----------------------------------------
     // Init
     //-----------------------------------------
     $this->lang->loadLanguageFile(array('admin_calendar'), 'calendar');
     //-----------------------------------------
     // Error checking
     //-----------------------------------------
     if (!$content) {
         $this->_error = $this->lang->words['icali_nocontent'];
         return;
     }
     $_raw = preg_replace("#(\n\r|\r|\n){1,}#", "\n", $content);
     $_raw = explode("\n", $_raw);
     if (!count($_raw)) {
         $this->_error = $this->lang->words['icali_nocontent'];
         return;
     }
     if ($_raw[0] != 'BEGIN:VCALENDAR') {
         $this->_error = $this->lang->words['icali_badcontent'];
         return;
     }
     $this->_rawIcsData = $_raw;
     //-----------------------------------------
     // Loop and start parsing
     //-----------------------------------------
     foreach ($this->_rawIcsData as $k => $v) {
         $line = explode(':', $v);
         switch ($line[0]) {
             case 'BEGIN':
                 $this->_parseBeginBlock($line[1], $k);
                 break;
                 /* Unsupported at this time */
             /* Unsupported at this time */
             case 'CALSCALE':
             case 'METHOD':
             case 'X-WR-TIMEZONE':
             case 'X-WR-RELCALID':
             default:
                 break;
         }
     }
     //-----------------------------------------
     // Process raw ICS data now
     //-----------------------------------------
     if (count($this->_parsedIcsData)) {
         $this->_parsedIcsData = $this->_convertToGmt($this->_parsedIcsData);
     }
     //-----------------------------------------
     // And loop over results to insert
     //-----------------------------------------
     $_imported = 0;
     $_skipped = 0;
     // Leave this here - useful for debugging
     //print_r($this->_parsedIcsData);exit;
     if (count($this->_parsedIcsData)) {
         //-----------------------------------------
         // Get member data
         //-----------------------------------------
         $_member = IPSMember::load($member_id);
         if (!$_member) {
             $this->_error = $this->lang->words['icali_nomember'];
             return false;
         }
         //-----------------------------------------
         // Get like class for notifications
         //-----------------------------------------
         require_once IPS_ROOT_PATH . 'sources/classes/like/composite.php';
         /*noLibHook*/
         $_like = classes_like::bootstrap('calendar', 'calendars');
         //-----------------------------------------
         // Loop over the events
         //-----------------------------------------
         foreach ($this->_parsedIcsData['events'] as $event) {
             $event['uid'] = $event['uid'] ? $event['uid'] : md5(implode(',', $event));
             $event_unix_from = $event['start']['gmt_ts'];
             $event_unix_to = $event['end']['gmt_ts'];
             $event_all_day = $event['start']['type'] == 'DATE' ? 1 : 0;
             //-----------------------------------------
             // End dates are "exclusive" in iCalendar format, meaning
             // they are actually the day ahead.
             // @link	http://microformats.org/wiki/dtend-issue
             //-----------------------------------------
             if ($event_unix_to and $event['end']['type'] == 'DATE') {
                 $event_unix_to -= 86400;
             }
             //-----------------------------------------
             // If end date is same as start date, it's a single day event
             //-----------------------------------------
             if ($event_unix_from == $event_unix_to) {
                 $event_unix_to = 0;
             }
             //-----------------------------------------
             // If no end date, but we have a duration, calculate end date
             //-----------------------------------------
             if (!$event_unix_to and $event['duration']) {
                 preg_match("#(\\d+?)H#is", $event['duration'], $match);
                 $hour = $match[1] ? $match[1] : 0;
                 preg_match("#(\\d+?)M#is", $event['duration'], $match);
                 $minute = $match[1] ? $match[1] : 0;
                 preg_match("#(\\d+?)S#is", $event['duration'], $match);
                 $second = $match[1] ? $match[1] : 0;
                 $event_unix_to = $event_unix_from + $hour * 3600 + $minute * 60 + $second;
             }
             //-----------------------------------------
             // Recurring...
             //-----------------------------------------
             $recurring = 0;
             if (isset($event['recurr']['FREQ'])) {
                 if ($event['recurr']['FREQ'] == 'MONTHLY' and $event['recurr']['INTERVAL'] == 12) {
                     $event['recurr']['FREQ'] = 'YEARLY';
                 }
                 switch ($event['recurr']['FREQ']) {
                     case 'WEEKLY':
                         $recurring = 1;
                         break;
                     case 'MONTHLY':
                         $recurring = 2;
                         break;
                     case 'YEARLY':
                         $recurring = 3;
                         break;
                 }
                 $event_unix_to = $event['recurr']['until_ts'] ? $event['recurr']['until_ts'] : time() + 86400 * 365 * 10;
             }
             //-----------------------------------------
             // Adjust timestamps if all day event
             //-----------------------------------------
             if ($event_all_day) {
                 $event_unix_from = gmmktime(0, 0, 0, gmstrftime('%m', $event_unix_from), gmstrftime('%d', $event_unix_from), gmstrftime('%Y', $event_unix_from));
                 $event_unix_to = $event_unix_to ? gmmktime(0, 0, 0, gmstrftime('%m', $event_unix_to), gmstrftime('%d', $event_unix_to), gmstrftime('%Y', $event_unix_to)) : 0;
             }
             //-----------------------------------------
             // If we are missing crucial data, skip
             //-----------------------------------------
             if (!($event['description'] or $event['summary']) or !$event_unix_from) {
                 $_skipped++;
                 continue;
             }
             //-----------------------------------------
             // Skip previously imported events
             //-----------------------------------------
             if ($event['uid']) {
                 $_check = $this->DB->buildAndFetch(array('select' => 'import_id', 'from' => 'cal_import_map', 'where' => "import_guid='" . $this->DB->addSlashes($event['uid']) . "'"));
                 if ($_check['import_id']) {
                     $_skipped++;
                     continue;
                 }
             }
             //-----------------------------------------
             // Format array for storage
             //-----------------------------------------
             $_eventData = array('event_calendar_id' => $this->calendar['cal_id'], 'event_member_id' => $_member['member_id'], 'event_content' => $event['description'] ? nl2br($event['description']) : $event['summary'], 'event_title' => $event['summary'] ? $event['summary'] : IPSText::truncate($event['description'], 100), 'event_title_seo' => IPSText::makeSeoTitle($event['summary']), 'event_smilies' => 1, 'event_comments' => 0, 'event_rsvp' => count($event['attendee']) ? 1 : 0, 'event_perms' => '*', 'event_private' => 0, 'event_approved' => 1, 'event_saved' => $event['created'] ? $event['created'] : time(), 'event_lastupdated' => $event['last_modified'] ? $event['last_modified'] : ($event['created'] ? $event['created'] : time()), 'event_recurring' => $recurring, 'event_start_date' => strftime("%Y-%m-%d %H:%M:00", $event_unix_from), 'event_end_date' => $event_unix_to ? strftime("%Y-%m-%d %H:%M:00", $event_unix_to) : 0, 'event_post_key' => md5(uniqid(microtime(), true)), 'event_sequence' => intval($event['sequence']), 'event_all_day' => $event_all_day);
             //-----------------------------------------
             // Data hooks
             //-----------------------------------------
             IPSLib::doDataHooks($_eventData, 'calendarAddEvent');
             //-----------------------------------------
             // Insert
             //-----------------------------------------
             $this->DB->insert('cal_events', $_eventData);
             $event_id = $this->DB->getInsertId();
             $_imported++;
             //-----------------------------------------
             // Insert mapping
             //-----------------------------------------
             $this->DB->insert('cal_import_map', array('import_feed_id' => $feed_id, 'import_event_id' => $event_id, 'import_guid' => $event['uid']));
             //-----------------------------------------
             // If we have attendees that are members, insert them
             //-----------------------------------------
             if (isset($event['attendee']) and count($event['attendee'])) {
                 foreach ($event['attendee'] as $attendee) {
                     if ($attendee['email']) {
                         $_loadedMember = IPSMember::load($attendee['email']);
                         if ($_loadedMember['member_id']) {
                             $this->DB->insert('cal_event_rsvp', array('rsvp_member_id' => $_loadedMember['member_id'], 'rsvp_event_id' => $event_id, 'rsvp_date' => time()));
                         }
                     }
                 }
             }
             //-----------------------------------------
             // Send notifications
             //-----------------------------------------
             $_url = $this->registry->output->buildSEOUrl('app=calendar&amp;module=calendar&amp;section=view&amp;do=showevent&amp;event_id=' . $event_id, 'public', $_eventData['event_title_seo'], 'cal_event');
             $_like->sendNotifications($_eventData['event_calendar_id'], array('immediate', 'offline'), array('notification_key' => 'new_event', 'notification_url' => $_url, 'email_template' => 'add_event_follow', 'email_subject' => sprintf($this->lang->words['add_event_follow_subject'], $_url, $_eventData['event_title']), 'build_message_array' => array('NAME' => '-member:members_display_name-', 'AUTHOR' => $_member['members_display_name'], 'TITLE' => $_eventData['event_title'], 'URL' => $_url)));
         }
     }
     //-----------------------------------------
     // Rebuild cache
     //-----------------------------------------
     $this->cache->rebuildCache('calendar_events', 'calendar');
     //-----------------------------------------
     // Return
     //-----------------------------------------
     return array('skipped' => $_skipped, 'imported' => $_imported);
 }
コード例 #20
0
 function __f__bf0676578ba11c43f36d90ca05d422e7($rows, $pages, $app, $plugin)
 {
     $_ips___x_retval = '';
     $__iteratorCount = 0;
     foreach ($rows as $row) {
         $__iteratorCount++;
         $_ips___x_retval .= "\r\n\t\t\t\t<li class='result' onclick=\"return CKEDITOR.plugins.ipsmedia.insert( '{$row['insert']}' );\">\r\n\t\t\t\t\t" . ($row['image'] ? "<img src='{$row['image']}' alt=''" . ($row['width'] ? " width='{$row['width']}'" : "") . "" . ($row['height'] ? " height='{$row['height']}'" : "") . " style='max-width: 80px;' class='media_image' /><br />" : "") . "\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t<strong>" . IPSText::truncate($row['title'], 15) . "</strong>\r\n\t\t\t\t\t\t" . ($row['desc'] ? "\r\n\t\t\t\t\t\t\t<br /><span class='desc'>" . IPSText::truncate($row['desc'], 15) . "</span>\r\n\t\t\t\t\t\t" : "") . "\r\n\t\t\t\t</li>\r\n\t\t\t\r\n";
     }
     $_ips___x_retval .= '';
     unset($__iteratorCount);
     return $_ips___x_retval;
 }
コード例 #21
0
ファイル: skin_stats.php プロジェクト: mover5/imobackup
 function whoPosted($tid = 0, $title = "", $rows = array())
 {
     $IPBHTML = "";
     if (IPSLib::locationHasHooks('skin_stats', $this->_funcHooks['whoPosted'])) {
         $count_682cc4077843e4f14b43b94dd5aaa8dc = is_array($this->functionData['whoPosted']) ? count($this->functionData['whoPosted']) : 0;
         $this->functionData['whoPosted'][$count_682cc4077843e4f14b43b94dd5aaa8dc]['tid'] = $tid;
         $this->functionData['whoPosted'][$count_682cc4077843e4f14b43b94dd5aaa8dc]['title'] = $title;
         $this->functionData['whoPosted'][$count_682cc4077843e4f14b43b94dd5aaa8dc]['rows'] = $rows;
     }
     if (!isset($this->registry->templateStriping['whoposted'])) {
         $this->registry->templateStriping['whoposted'] = array(FALSE, "row1", "row2");
     }
     $IPBHTML .= "" . ($this->request['module'] == 'ajax' ? "\n\t<h3>{$this->lang->words['who_farted']} " . IPSText::truncate($title, 40) . "</h3>\n" : "\n\t<h3 class='maintitle'>{$this->lang->words['who_farted']} " . IPSText::truncate($title, 30) . "</h3>\n") . "\n<div class='fixed_inner'>\n\t<table class='ipb_table'>\n\t\t<tr class='header'>\n\t\t\t<th>{$this->lang->words['whoposted_name']}</th>\n\t\t\t<th>{$this->lang->words['whoposted_posts']}</th>\n\t\t</tr>\n\t\t" . ((count($rows) and is_array($rows)) ? "\n\t\t\t\t\t\t" . $this->__f__8e1d7e7cfdd4fdfb6ec79d87f9ab967e($tid, $title, $rows) . "\t\t" : "") . "\n\t</table>\n</div>";
     return $IPBHTML;
 }
コード例 #22
0
ファイル: search.php プロジェクト: ConnorChristie/GrabViews
 /**
  * Attachment search results
  *
  * @return	@e void		[Outputs to screen]
  */
 protected function _searchResults()
 {
     $show = intval($this->request['show']);
     $show = $show > 100 ? 100 : $show;
     //-----------------------------------------
     // Build URL
     //-----------------------------------------
     $url = "";
     $url_components = array('extension', 'filesize', 'filesize_gt', 'days', 'days_gt', 'hits', 'hits_gt', 'filename', 'authorname', 'onlyimage', 'orderby', 'sort', 'show');
     foreach ($url_components as $u) {
         $url .= $u . '=' . $this->request[$u] . '&';
     }
     //-----------------------------------------
     // Build Query
     //-----------------------------------------
     $queryfinal = "";
     $query = array();
     if ($this->request['extension']) {
         $query[] = 'a.attach_ext="' . strtolower(str_replace(".", "", $this->request['extension'])) . '"';
     }
     if ($this->request['filesize']) {
         $gt = $this->request['filesize_gt'] == 'gt' ? '>=' : '<';
         $query[] = "a.attach_filesize {$gt} " . intval($this->request['filesize'] * 1024);
     }
     if ($this->request['days']) {
         $day_break = time() - intval($this->request['days'] * 86400);
         $gt = $this->request['days_gt'] == 'lt' ? '>=' : '<';
         $query[] = "a.attach_date {$gt} {$day_break}";
     }
     if ($this->request['hits']) {
         $gt = $this->request['hits_gt'] == 'gt' ? '>=' : '<';
         $query[] = "a.attach_hits {$gt} " . intval($this->request['hits']);
     }
     if ($this->request['filename']) {
         $query[] = $this->DB->buildLower('a.attach_file') . ' LIKE "%' . strtolower($this->request['filename']) . '%"';
     }
     if ($this->request['authorname']) {
         $query[] = $this->DB->buildLower('p.author_name') . ' LIKE "%' . strtolower($this->request['authorname']) . '%"';
     }
     if ($this->request['onlyimage']) {
         $query[] = 'a.attach_is_image=1';
     }
     if (count($query)) {
         $queryfinal = 'AND ' . implode(" AND ", $query);
     }
     $rows = array();
     $this->DB->build(array('select' => 'a.*', 'from' => array('attachments' => 'a'), 'where' => "attach_rel_module='post'" . $queryfinal, 'add_join' => array(0 => array('select' => 'p.author_id, p.author_name, p.post_date', 'from' => array('posts' => 'p'), 'where' => 'p.pid=a.attach_rel_id', 'type' => 'left'), 1 => array('select' => 't.tid, t.forum_id, t.title', 'from' => array('topics' => 't'), 'where' => 'p.topic_id=t.tid', 'type' => 'left'), 2 => array('select' => 'm.members_display_name', 'from' => array('members' => 'm'), 'where' => 'm.member_id=a.attach_member_id', 'type' => 'left')), 'order' => "a.attach_" . $this->request['orderby'] . " " . $this->request['sort'], 'limit' => array(0, $show)));
     $this->DB->execute();
     while ($r = $this->DB->fetch()) {
         $r['stitle'] = $r['title'] ? "<a href='{$this->settings['board_url']}/index.php?showtopic={$r['tid']}&view=findpost&p={$r['attach_rel_id']}' title='{$r['title']}'>" . IPSText::truncate($r['title'], 30) . "</a>" : $this->lang->words['attach_not_topic'];
         $r['attach_filesize'] = IPSLib::sizeFormat($r['attach_filesize']);
         $r['attach_date'] = ipsRegistry::getClass('class_localization')->getDate($r['attach_date'], 'SHORT', 1);
         $rows[] = $r;
     }
     $this->registry->output->html .= $this->html->attachmentSearchResults($url, $rows);
 }
コード例 #23
0
 function whoPosted($tid = 0, $title = "", $rows = array())
 {
     $IPBHTML = "";
     if (IPSLib::locationHasHooks('skin_stats', $this->_funcHooks['whoPosted'])) {
         $count_6826a7d9bb95f2e1fe78d8ad30aa5bcd = is_array($this->functionData['whoPosted']) ? count($this->functionData['whoPosted']) : 0;
         $this->functionData['whoPosted'][$count_6826a7d9bb95f2e1fe78d8ad30aa5bcd]['tid'] = $tid;
         $this->functionData['whoPosted'][$count_6826a7d9bb95f2e1fe78d8ad30aa5bcd]['title'] = $title;
         $this->functionData['whoPosted'][$count_6826a7d9bb95f2e1fe78d8ad30aa5bcd]['rows'] = $rows;
     }
     if (!isset($this->registry->templateStriping['whoposted'])) {
         $this->registry->templateStriping['whoposted'] = array(FALSE, "row1", "row2");
     }
     $IPBHTML .= "" . ($this->request['module'] == 'ajax' ? "\n\t<h3>{$this->lang->words['who_farted']} " . IPSText::truncate($title, 40) . "</h3>\n" : "" . $this->registry->getClass('output')->getReplacement("header_start") . "<h3 class='maintitle'>{$this->lang->words['who_farted']} " . IPSText::truncate($title, 30) . "</h3>" . $this->registry->getClass('output')->getReplacement("header_end") . "\n") . "\n<div class='fixed_inner'>\n\t<table class='ipb_table'>\n\t\t<tr class='header'>\n\t\t\t<th>{$this->lang->words['whoposted_name']}</th>\n\t\t\t<th>{$this->lang->words['whoposted_posts']}</th>\n\t\t</tr>\n\t\t" . ((count($rows) and is_array($rows)) ? "\n\t\t\t\t\t\t" . $this->__f__c561ed423aade4daac2f916c7a4a0459($tid, $title, $rows) . "\t\t" : "") . "\n\t</table>\n</div>\n" . (!($this->request['module'] == 'ajax') ? "" . $this->registry->getClass('output')->getReplacement("box_end") . "" : "") . "";
     return $IPBHTML;
 }
コード例 #24
0
 /**
  * Sorts out the last poster, etc
  *
  * @param	array 	$forum_data
  * @return	array
  */
 public function forumsFormatLastinfo($forum_data)
 {
     //-----------------------------------------
     // INIT
     //-----------------------------------------
     $this->settings['disable_subforum_show'] = intval($this->settings['disable_subforum_show']);
     $show_subforums = $this->registry->permissions->check('view', $this->forum_by_id[$forum_data['id']]) ? 1 : 0;
     $this->request['f'] = isset($this->request['f']) ? intval($this->request['f']) : 0;
     $forum_data['img_new_post'] = $this->forumsNewPosts($forum_data);
     $forum_data['last_topic_title'] = $this->lang->words['f_none'];
     $forum_data['last_topic_id'] = 0;
     $forum_data['full_last_title'] = isset($forum_data['last_title']) ? $forum_data['last_title'] : '';
     $forum_data['_hide_last_date'] = false;
     if (isset($forum_data['last_title']) && $forum_data['last_id']) {
         $forum_data['last_title'] = strip_tags($forum_data['last_title']);
         $forum_data['last_title'] = str_replace("&#33;", "!", $forum_data['last_title']);
         $forum_data['last_title'] = str_replace("&quot;", '"', $forum_data['last_title']);
         $forum_data['last_title'] = IPSText::truncate($forum_data['last_title'], 30);
         if (!empty($forum_data['password']) or $this->registry->permissions->check('read', $this->forum_by_id[$forum_data['fid']]) != TRUE and $this->forum_by_id[$forum_data['fid']]['permission_showtopic'] == 0) {
             $forum_data['last_topic_title'] = $this->lang->words['f_protected'];
             $forum_data['_hide_last_date'] = true;
         } else {
             if ($forum_data['hide_last_info']) {
                 $forum_data['last_topic_title'] = $this->lang->words['f_protected'];
                 $forum_data['_hide_last_date'] = true;
             } else {
                 $forum_data['last_topic_id'] = $forum_data['last_id'];
                 if ($this->memberData['member_id'] || $this->settings['topic_marking_guests']) {
                     $forum_data['last_topic_title'] = "<a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("showtopic={$forum_data['last_id']}&amp;view=getnewpost", 'public'), $forum_data['seo_last_title'], 'showtopic') . "' title='{$forum_data['full_last_title']}'>{$forum_data['last_title']}</a>";
                 } else {
                     $forum_data['last_topic_title'] = "<a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("showtopic={$forum_data['last_id']}", 'public'), $forum_data['seo_last_title'], 'showtopic') . "' title='{$forum_data['full_last_title']}'>{$forum_data['last_title']}</a>";
                 }
             }
         }
     }
     $forum_data['posts'] = $this->registry->getClass('class_localization')->formatNumber($forum_data['posts']);
     $forum_data['topics'] = $this->registry->getClass('class_localization')->formatNumber($forum_data['topics']);
     if ($this->settings['disable_subforum_show'] == 0 and $show_subforums == 1) {
         if (isset($forum_data['subforums']) and is_array($forum_data['subforums']) and count($forum_data['subforums'])) {
             $forum_data['show_subforums'] = 1;
             /* Rock star programming yo */
             $lastSubForum = array_pop($forum_data['subforums']);
             $lastSubForum[4] = 1;
             $forum_data['subforums'][$lastSubForum['id']] = $lastSubForum;
         }
     }
     $_mod = isset($this->_memberData['forumsModeratorData']) ? $this->_memberData['forumsModeratorData'] : array();
     if ($this->_memberData['g_is_supmod'] or !empty($_mod[$forum_data['id']]['post_q'])) {
         if ($forum_data['queued_posts'] or $forum_data['queued_topics']) {
             $forum_data['_has_queued_and_can_see_icon'] = 1;
             $forum_data['queued_posts'] = intval($forum_data['queued_posts']);
             $forum_data['queued_topics'] = intval($forum_data['queued_topics']);
         }
     }
     return $forum_data;
 }
コード例 #25
0
 function tabSingleColumn($row = array(), $read_more_link = '', $url = '', $title = '')
 {
     $IPBHTML = "";
     if (IPSLib::locationHasHooks('skin_profile', $this->_funcHooks['tabSingleColumn'])) {
         $count_cd97a7c3902c5e3d4c36385431362c7f = is_array($this->functionData['tabSingleColumn']) ? count($this->functionData['tabSingleColumn']) : 0;
         $this->functionData['tabSingleColumn'][$count_cd97a7c3902c5e3d4c36385431362c7f]['row'] = $row;
         $this->functionData['tabSingleColumn'][$count_cd97a7c3902c5e3d4c36385431362c7f]['read_more_link'] = $read_more_link;
         $this->functionData['tabSingleColumn'][$count_cd97a7c3902c5e3d4c36385431362c7f]['url'] = $url;
         $this->functionData['tabSingleColumn'][$count_cd97a7c3902c5e3d4c36385431362c7f]['title'] = $title;
     }
     $IPBHTML .= "<post>\n<title><![CDATA[" . IPSText::truncate($title, 90) . "]]></title>\n<url><![CDATA[{$url}]]></url>\n<text><![CDATA[{$row['post']}]]></text>\n<date>" . IPSText::htmlspecialchars($this->registry->getClass('class_localization')->getDate($row['_raw_date'], "long", 0)) . "</date>\n</post>";
     return $IPBHTML;
 }
コード例 #26
0
 /**
  * Parse a member for display
  *
  * @access	public
  * @param	mixed	Either array of member data, or member ID to self load
  * @param	array 	Array of flags to parse: 'signature', 'customFields', 'avatar', 'warn'
  * @return	array 	Parsed member data
  */
 public static function buildDisplayData($member, $_parseFlags = array())
 {
     $_NOW = IPSDebug::getMemoryDebugFlag();
     //-----------------------------------------
     // Figure out parse flags
     //-----------------------------------------
     $parseFlags = array('signature' => isset($_parseFlags['signature']) ? $_parseFlags['signature'] : 0, 'customFields' => isset($_parseFlags['customFields']) ? $_parseFlags['customFields'] : 0, 'avatar' => isset($_parseFlags['avatar']) ? $_parseFlags['avatar'] : 1, 'warn' => isset($_parseFlags['warn']) ? $_parseFlags['warn'] : 1, 'cfSkinGroup' => isset($_parseFlags['cfSkinGroup']) ? $_parseFlags['cfSkinGroup'] : '', 'cfGetGroupData' => isset($_parseFlags['cfGetGroupData']) ? $_parseFlags['cfGetGroupData'] : '', 'cfLocation' => isset($_parseFlags['cfLocation']) ? $_parseFlags['cfLocation'] : '', 'checkFormat' => isset($_parseFlags['checkFormat']) ? $_parseFlags['checkFormat'] : 0);
     if (isset($_parseFlags['__all__'])) {
         foreach ($parseFlags as $k => $v) {
             $parseFlags[$k] = 1;
         }
         $parseFlags['cfSkinGroup'] = '';
     }
     //-----------------------------------------
     // Load the member?
     //-----------------------------------------
     if (!is_array($member) and ($member == intval($member) and $member > 0)) {
         $member = self::load($member, 'all');
     }
     if (!$member['member_group_id']) {
         $member['member_group_id'] = ipsRegistry::$settings['guest_group'];
     }
     /* Unpack bitwise if required */
     if (!isset($member['bw_is_spammer'])) {
         $member = self::buildBitWiseOptions($member);
     }
     //-----------------------------------------
     // INIT
     //-----------------------------------------
     $rank_cache = ipsRegistry::cache()->getCache('ranks');
     $group_cache = ipsRegistry::cache()->getCache('group_cache');
     $group_name = IPSLib::makeNameFormatted($group_cache[$member['member_group_id']]['g_title'], $member['member_group_id']);
     $pips = 0;
     $topic_id = intval(isset(ipsRegistry::$request['t']) ? ipsRegistry::$request['t'] : 0);
     $forum_id = intval(isset(ipsRegistry::$request['f']) ? ipsRegistry::$request['f'] : 0);
     //-----------------------------------------
     // SEO Name
     //-----------------------------------------
     $member['members_seo_name'] = self::fetchSeoName($member);
     //-----------------------------------------
     // Avatar
     //-----------------------------------------
     if ($parseFlags['avatar']) {
         $member['avatar'] = self::buildAvatar($member);
     }
     $member['_group_formatted'] = $group_name;
     //-----------------------------------------
     // Ranks
     //-----------------------------------------
     if (is_array($rank_cache) and count($rank_cache)) {
         foreach ($rank_cache as $k => $v) {
             if ($member['posts'] >= $v['POSTS']) {
                 if (!isset($member['title']) || $member['title'] === '' || is_null($member['title'])) {
                     $member['title'] = $v['TITLE'];
                 }
                 $pips = $v['PIPS'];
                 break;
             }
         }
     }
     //-----------------------------------------
     // Group image
     //-----------------------------------------
     $member['member_rank_img'] = '';
     $member['member_rank_img_i'] = '';
     if ($group_cache[$member['member_group_id']]['g_icon']) {
         $_img = $group_cache[$member['member_group_id']]['g_icon'];
         if (substr($_img, 0, 4) != 'http') {
             $_img = ipsRegistry::$settings['_original_base_url'] . '/' . ltrim($_img, '/');
         }
         $member['member_rank_img_i'] = 'img';
         $member['member_rank_img'] = $_img;
     } else {
         if ($pips) {
             if (is_numeric($pips)) {
                 for ($i = 1; $i <= $pips; ++$i) {
                     $member['member_rank_img_i'] = 'pips';
                     $member['member_rank_img'] .= ipsRegistry::getClass('output')->getReplacement('pip_pip');
                 }
             } else {
                 $member['member_rank_img_i'] = 'img';
                 $member['member_rank_img'] = ipsRegistry::$settings['public_dir'] . 'style_extra/team_icons/' . $pips;
             }
         }
     }
     //-----------------------------------------
     // Spammer status
     //-----------------------------------------
     $member['spamStatus'] = NULL;
     $member['spamImage'] = NULL;
     $moderator = ipsRegistry::member()->getProperty('forumsModeratorData');
     if (isset($moderator[$forum_id]['bw_flag_spammers']) and $moderator[$forum_id]['bw_flag_spammers'] or ipsRegistry::member()->getProperty('g_is_supmod') == 1) {
         if (!ipsRegistry::$settings['warn_on'] or !strstr(',' . ipsRegistry::$settings['warn_protected'] . ',', ',' . $member['member_group_id'] . ',')) {
             if ($member['bw_is_spammer']) {
                 $member['spamStatus'] = TRUE;
             } else {
                 $member['spamStatus'] = FALSE;
             }
         }
     }
     //-----------------------------------------
     // Warny porny?
     //-----------------------------------------
     if ($parseFlags['warn'] and $member['member_id']) {
         $member['warn_percent'] = NULL;
         $member['can_edit_warn'] = false;
         $member['warn_img'] = NULL;
         if (ipsRegistry::$settings['warn_on'] and !strstr(',' . ipsRegistry::$settings['warn_protected'] . ',', ',' . $member['member_group_id'] . ',')) {
             /* Warnings */
             if (isset($moderator[$forum_id]['allow_warn']) and $moderator[$forum_id]['allow_warn'] or ipsRegistry::member()->getProperty('g_is_supmod') == 1 or ipsRegistry::$settings['warn_show_own'] and ipsRegistry::member()->getProperty('member_id') == $member['member_id']) {
                 // Work out which image to show.
                 if ($member['warn_level'] <= ipsRegistry::$settings['warn_min']) {
                     $member['warn_img'] = '{parse replacement="warn_0"}';
                     $member['warn_percent'] = 0;
                 } else {
                     if ($member['warn_level'] >= ipsRegistry::$settings['warn_max']) {
                         $member['warn_img'] = '{parse replacement="warn_5"}';
                         $member['warn_percent'] = 100;
                     } else {
                         $member['warn_percent'] = $member['warn_level'] ? sprintf("%.0f", $member['warn_level'] / ipsRegistry::$settings['warn_max'] * 100) : 0;
                         if ($member['warn_percent'] > 100) {
                             $member['warn_percent'] = 100;
                         }
                         if ($member['warn_percent'] >= 81) {
                             $member['warn_img'] = '{parse replacement="warn_5"}';
                         } else {
                             if ($member['warn_percent'] >= 61) {
                                 $member['warn_img'] = '{parse replacement="warn_4"}';
                             } else {
                                 if ($member['warn_percent'] >= 41) {
                                     $member['warn_img'] = '{parse replacement="warn_3"}';
                                 } else {
                                     if ($member['warn_percent'] >= 21) {
                                         $member['warn_img'] = '{parse replacement="warn_2"}';
                                     } else {
                                         if ($member['warn_percent'] >= 1) {
                                             $member['warn_img'] = '{parse replacement="warn_1"}';
                                         } else {
                                             $member['warn_img'] = '{parse replacement="warn_0"}';
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
                 if ($member['warn_percent'] < 1) {
                     $member['warn_percent'] = 0;
                 }
                 /* Bug 14770 - Change so you can't warn yourself */
                 if ((isset($moderator[$forum_id]['allow_warn']) and $moderator[$forum_id]['allow_warn'] or ipsRegistry::member()->getProperty('g_is_supmod') == 1) and $member['member_id'] != ipsRegistry::member()->getProperty('member_id')) {
                     $member['can_edit_warn'] = true;
                 }
             }
         }
     }
     //-----------------------------------------
     // Profile fields stuff
     //-----------------------------------------
     $member['custom_fields'] = "";
     if ($parseFlags['customFields'] == 1 and $member['member_id']) {
         if (isset(self::$_parsedCustomFields[$member['member_id']])) {
             $member['custom_fields'] = self::$_parsedCustomFields[$member['member_id']];
             if ($parseFlags['cfGetGroupData'] and isset(self::$_parsedCustomGroups[$member['member_id']]) and is_array(self::$_parsedCustomGroups[$member['member_id']])) {
                 $member['custom_field_groups'] = self::$_parsedCustomGroups[$member['member_id']];
             }
         } else {
             if (!is_object(self::$custom_fields_class)) {
                 require_once IPS_ROOT_PATH . 'sources/classes/customfields/profileFields.php';
                 self::$custom_fields_class = new customProfileFields();
             }
             if (self::$custom_fields_class) {
                 self::$custom_fields_class->member_data = $member;
                 self::$custom_fields_class->skinGroup = $parseFlags['cfSkinGroup'];
                 self::$custom_fields_class->initData();
                 self::$custom_fields_class->parseToView($parseFlags['checkFormat'], $parseFlags['cfLocation']);
                 $member['custom_fields'] = self::$custom_fields_class->out_fields;
                 self::$_parsedCustomFields[$member['member_id']] = $member['custom_fields'];
                 if ($parseFlags['cfGetGroupData']) {
                     $member['custom_field_groups'] = self::$custom_fields_class->fetchGroupTitles();
                     self::$_parsedCustomGroups[$member['member_id']] = $member['custom_field_groups'];
                 }
             }
         }
     }
     //-----------------------------------------
     // Profile photo
     //-----------------------------------------
     $member = self::buildProfilePhoto($member);
     //-----------------------------------------
     // Personal statement 'bbcode'
     //-----------------------------------------
     if (stripos($member['pp_bio_content'], '[b]') !== false) {
         if (stripos($member['pp_bio_content'], '[/b]') > stripos($member['pp_bio_content'], '[b]')) {
             $member['pp_bio_content'] = str_ireplace('[b]', '<strong>', $member['pp_bio_content']);
             $member['pp_bio_content'] = str_ireplace('[/b]', '</strong>', $member['pp_bio_content']);
         }
     }
     if (stripos($member['pp_bio_content'], '[i]') !== false) {
         if (stripos($member['pp_bio_content'], '[/i]') > stripos($member['pp_bio_content'], '[i]')) {
             $member['pp_bio_content'] = str_ireplace('[i]', '<em>', $member['pp_bio_content']);
             $member['pp_bio_content'] = str_ireplace('[/i]', '</em>', $member['pp_bio_content']);
         }
     }
     if (stripos($member['pp_bio_content'], '[u]') !== false) {
         if (stripos($member['pp_bio_content'], '[/u]') > stripos($member['pp_bio_content'], '[u]')) {
             $member['pp_bio_content'] = str_ireplace('[u]', '<span class="underscore">', $member['pp_bio_content']);
             $member['pp_bio_content'] = str_ireplace('[/u]', '</span>', $member['pp_bio_content']);
         }
     }
     //-----------------------------------------
     // Signature bbcode
     //-----------------------------------------
     if (isset($member['signature']) and $member['signature'] and $parseFlags['signature']) {
         if (isset(self::$_parsedSignatures[$member['member_id']])) {
             $member['signature'] = self::$_parsedSignatures[$member['member_id']];
         } else {
             if ($member['cache_content']) {
                 $member['signature'] = '<!--cached-' . gmdate('r', $member['cache_updated']) . '-->' . $member['cache_content'];
             } else {
                 IPSText::getTextClass('bbcode')->parse_bbcode = ipsRegistry::$settings['sig_allow_ibc'];
                 IPSText::getTextClass('bbcode')->parse_smilies = 1;
                 IPSText::getTextClass('bbcode')->parse_html = ipsRegistry::$settings['sig_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']);
                 IPSContentCache::update($member['member_id'], 'sig', $member['signature']);
             }
             self::$_parsedSignatures[$member['member_id']] = $member['signature'];
         }
     }
     //-----------------------------------------
     // If current session, reset last_activity
     //-----------------------------------------
     if (!empty($member['running_time'])) {
         $member['last_activity'] = $member['running_time'] > $member['last_activity'] ? $member['running_time'] : $member['last_activity'];
     }
     //-----------------------------------------
     // Online?
     //-----------------------------------------
     $time_limit = time() - ipsRegistry::$settings['au_cutoff'] * 60;
     $member['_online'] = 0;
     if (!ipsRegistry::$settings['disable_anonymous'] and isset($member['login_anonymous'])) {
         list($be_anon, $loggedin) = explode('&', $member['login_anonymous']);
     } else {
         $be_anon = 0;
         $loggedin = $member['last_activity'] > $time_limit ? 1 : 0;
     }
     $bypass_anon = 0;
     $our_mgroups = array();
     if (ipsRegistry::member()->getProperty('mgroup_others')) {
         $our_mgroups = explode(",", IPSText::cleanPermString(ipsRegistry::member()->getProperty('mgroup_others')));
     }
     $our_mgroups[] = ipsRegistry::member()->getProperty('member_group_id');
     if (ipsRegistry::member()->getProperty('g_access_cp') and !ipsRegistry::$settings['disable_admin_anon']) {
         $bypass_anon = 1;
     }
     if (($member['last_visit'] > $time_limit or $member['last_activity'] > $time_limit) and ($be_anon != 1 or $bypass_anon == 1) and $loggedin == 1) {
         $member['_online'] = 1;
     }
     //-----------------------------------------
     // Last Active
     //-----------------------------------------
     $member['_last_active'] = ipsRegistry::getClass('class_localization')->getDate($member['last_activity'], 'SHORT');
     if ($be_anon == 1) {
         // Member last logged in anonymous
         if (!ipsRegistry::member()->getProperty('g_access_cp') or ipsRegistry::$settings['disable_admin_anon']) {
             $member['_last_active'] = ipsRegistry::getClass('class_localization')->words['private'];
         }
     }
     //-----------------------------------------
     // Rating
     //-----------------------------------------
     $member['_pp_rating_real'] = intval($member['pp_rating_real']);
     //-----------------------------------------
     // Long display names
     //-----------------------------------------
     $member['members_display_name_short'] = IPSText::truncate($member['members_display_name'], 16);
     //-----------------------------------------
     // Reputation
     //-----------------------------------------
     if (!ipsRegistry::isClassLoaded('repCache')) {
         require_once IPS_ROOT_PATH . 'sources/classes/class_reputation_cache.php';
         ipsRegistry::setClass('repCache', new classReputationCache());
     }
     $member['pp_reputation_points'] = $member['pp_reputation_points'] ? $member['pp_reputation_points'] : 0;
     $member['author_reputation'] = ipsRegistry::getClass('repCache')->getReputation($member['pp_reputation_points']);
     //-----------------------------------------
     // Other stuff not worthy of individual comments
     //-----------------------------------------
     $member['members_profile_views'] = isset($member['members_profile_views']) ? $member['members_profile_views'] : 0;
     $member['_pp_profile_views'] = ipsRegistry::getClass('class_localization')->formatNumber($member['members_profile_views']);
     IPSDebug::setMemoryDebugFlag("IPSMember::buildDisplayData: " . $member['member_id'] . " - Completed", $_NOW);
     return $member;
 }
コード例 #27
0
 function tabSingleColumn($row = array(), $read_more_link = '', $url = '', $title = '')
 {
     $IPBHTML = "";
     $IPBHTML .= "<post>\r\n<title><![CDATA[" . IPSText::truncate($title, 90) . "]]></title>\r\n<url><![CDATA[{$url}]]></url>\r\n<text><![CDATA[{$row['post']}]]></text>\r\n<date>" . IPSText::htmlspecialchars($this->registry->getClass('class_localization')->getDate($row['_raw_date'], "long", 0)) . "</date>\r\n</post>";
     return $IPBHTML;
 }
コード例 #28
0
 /**
  * Compiles an array of poll questions
  *
  * @return	array
  */
 protected function compilePollData()
 {
     //-----------------------------------------
     // Check poll
     //-----------------------------------------
     $questions = array();
     $choices_count = 0;
     $is_mod = $this->getAuthor('g_is_supmod') ? $this->getAuthor('g_is_supmod') : (isset($this->moderator['edit_topic']) ? intval($this->moderator['edit_topic']) : 0);
     if ($this->can_add_poll) {
         if (isset($_POST['question']) and is_array($_POST['question']) and count($_POST['question'])) {
             foreach ($_POST['question'] as $id => $q) {
                 if (!$q or !$id) {
                     continue;
                 }
                 $questions[intval($id)]['question'] = IPSText::truncate(IPSText::getTextClass('bbcode')->stripBadWords(IPSText::parseCleanValue(IPSText::stripAttachTag($q))), 255);
             }
         }
         if (isset($_POST['multi']) and is_array($_POST['multi']) and count($_POST['multi'])) {
             foreach ($_POST['multi'] as $id => $q) {
                 if (!$q or !$id) {
                     continue;
                 }
                 $questions[intval($id)]['multi'] = intval($q);
             }
         }
         //-----------------------------------------
         // Choices...
         //-----------------------------------------
         if (isset($_POST['choice']) and is_array($_POST['choice']) and count($_POST['choice'])) {
             foreach ($_POST['choice'] as $mainid => $choice) {
                 if (trim($choice) == '') {
                     continue;
                 }
                 list($question_id, $choice_id) = explode("_", $mainid);
                 $question_id = intval($question_id);
                 $choice_id = intval($choice_id);
                 if (!$question_id or !isset($choice_id)) {
                     continue;
                 }
                 if (!$questions[$question_id]['question']) {
                     continue;
                 }
                 $questions[$question_id]['choice'][$choice_id] = IPSText::truncate(IPSText::getTextClass('bbcode')->stripBadWords(IPSText::parseCleanValue(IPSText::stripAttachTag($choice))), 255);
                 if (!$is_mod or $this->request['poll_view_voters'] or $this->poll_data['poll_view_voters']) {
                     $questions[$question_id]['votes'][$choice_id] = intval($this->poll_answers[$question_id]['votes'][$choice_id]);
                 } else {
                     $_POST['votes'] = isset($_POST['votes']) ? $_POST['votes'] : 0;
                     $questions[$question_id]['votes'][$choice_id] = intval($_POST['votes'][$question_id . '_' . $choice_id]);
                 }
                 $this->poll_total_votes += $questions[$question_id]['votes'][$choice_id];
             }
         }
         //-----------------------------------------
         // Make sure we have choices for each
         //-----------------------------------------
         foreach ($questions as $id => $data) {
             if (!is_array($data['choice']) or !count($data['choice']) or count($data['choice']) < 2) {
                 unset($questions[$id]);
             } else {
                 $choices_count += intval(count($data['choice']));
             }
         }
         //-----------------------------------------
         // Error check...
         //-----------------------------------------
         if (count($questions) > $this->max_poll_questions) {
             $this->_postErrors = 'poll_to_many';
         }
         if (count($choices_count) > $this->max_poll_questions * $this->max_poll_choices_per_question) {
             $this->_postErrors = 'poll_to_many';
         }
     }
     return $questions;
 }
コード例 #29
0
 /**
  * Add meta tag
  * <code>$output->addMetaTag( 'description', 'This is a short description' );</code>
  *
  * @param	string		$tag		Tag name
  * @param	string		$content	Tag content
  * @param	boolean		$encode		Encode content
  * @param	integer		$trimLen	Length to trim to (default 500)
  * @return	@e void
  * @link	http://community.invisionpower.com/tracker/issue-22826-case-sensitivity-in-meta-tags/
  * @link	http://community.invisionpower.com/tracker/issue-32572-bbcode-included-in-meta-description
  */
 public function addMetaTag($tag, $content, $encode = true, $trimLen = 500)
 {
     $encode = $encode === FALSE ? FALSE : TRUE;
     $trimLen = $trimLen - 3;
     $tag = trim(strtolower($tag));
     // 'ROBOTS' should overwrite 'robots'
     switch ($tag) {
         case 'description':
             /* Clear out 'Quote' if it's present in the bbcode parsed content */
             $content = str_replace(array('"', "'"), '', $content);
             $content = preg_replace('/\\<p class=\'citation\'\\>.+?\\<\\/p\\>/ims', '', $content);
             $content = strip_tags(IPSText::stripAttachTag($content));
             # Hebrew chars screw up Facebook sharer
             if ($this->member->iAmFacebook) {
                 $content = $this->encodeMetaTagContent($content, true);
             }
             # There is no max value, but we trim so we don't bloat the output.
             # It's not just search engines that use this, also link sharing services
             # pick up the meta description.
             $content = IPSText::truncate($content, $trimLen);
             break;
         case 'keywords':
             /* @link http://community.invisionpower.com/resources/bugs.html/_/ip-board/seo-meta-keyworks-doesnt-work-correctly-r38420
                @link http://community.invisionpower.com/resources/bugs.html/_/ip-board/meta-issues-r39358
                When encode is passed as true, we should assume the block of text has not been formatted, and that we need to convert spaces to commas basically.
                When encode is passed as false, we should assume that the keywords coming in have been explicitly set (with commas) and not change that */
             if ($encode === TRUE) {
                 $content = IPSText::stripAttachTag($content);
                 //Bug #15323 breaks accented characters, etc
                 //$content = strtolower( preg_replace( "/[^0-9a-zA-Z ]/", "", preg_replace( "/&([^;]+?);/", "", $content ) ) );
                 $content = str_replace(array('.', '!', ':', ';', ',', '"', '@', '%', '*', '(', ')'), '', preg_replace("/&([^;]+?);/", "", $content));
                 //Also breaks accented characters
                 //$_vals   = preg_split( '/\s+?/', $content, -1, PREG_SPLIT_NO_EMPTY );
                 $_vals = explode(' ', $content);
                 $_sw = explode(',', $this->lang->words['_stopwords_']);
                 $_fvals = array();
                 $_limit = 30;
                 $_c = 0;
                 if (is_array($_vals)) {
                     foreach ($_vals as $_v) {
                         if (strlen($_v) >= 3 and !in_array($_v, array_values($_fvals)) and !in_array($_v, $_sw)) {
                             $_fvals[] = $_v;
                         }
                         if ($_c >= $_limit) {
                             break;
                         }
                         $_c++;
                     }
                 }
                 $content = implode(',', $_fvals);
             } else {
                 $content = str_replace(array('.', '!', ':', ';', "'", '"', '@', '%', '*', '(', ')'), '', preg_replace("/&([^;]+?);/", "", $content));
             }
             $content = IPSText::truncate($content, $trimLen);
             break;
     }
     $this->_metaTags[$tag][0] = $encode === TRUE ? preg_replace('#&amp;(amp|gt|lt|quot);#', '&\\1;', $this->encodeMetaTagContent(preg_replace('/&amp;#(\\d+?);/', "&#\\1;", htmlspecialchars($content)))) : preg_replace('#&amp;(amp|gt|lt|quot);#', '&\\1;', $content);
 }
コード例 #30
0
ファイル: status.php プロジェクト: ConnorChristie/GrabViews
 /**
  * Clean up content suitable for posting
  *
  * @param	string		In
  * @return	string		Out
  */
 protected function _cleanContent($content)
 {
     /* Just cut off after X chars. */
     $content = IPSText::truncate(IPSText::getTextClass('bbcode')->stripBadWords($content), $this->settings['su_max_chars']);
     return $content;
 }