/** * @param string key * @param string value */ public function setMemberData($k, $v = '') { if (is_integer($k)) { $this->_memberData = empty($k) ? IPSMember::setUpGuest() : IPSMember::load($k, 'all'); } else { if (is_string($k) && $k == intval($k)) { $this->_memberData = empty($k) ? IPSMember::setUpGuest() : IPSMember::load($k, 'all'); } else { if (is_array($k)) { $this->_memberData = $k; } else { if (!empty($k)) { $this->_memberData[$k] = $v; } } } } /* Set perm ids and that */ if ($this->memberData['member_id'] == $this->_memberData['member_id']) { $this->_memberData['_perm_id_array'] = $this->member->perm_id_array; } else { /* Force to guest for now */ $permId = !empty($this->_memberData['org_perm_id']) ? $this->_memberData['org_perm_id'] : $this->_memberData['g_perm_id']; $this->_memberData['_perm_id_array'] = array_unique(explode(",", $permId)); } }
/** * Process Results * * @param array Row from database using query specified in fetch() * @return array Same data with any additional processing necessary */ public function process($row) { /* Build poster's display data */ $member = $row['author_id'] ? IPSMember::load($row['author_id'], 'profile_portal,pfields_content,sessions,groups', 'id') : IPSMember::setUpGuest(); $row = array_merge($row, IPSMember::buildDisplayData($member, array('reputation' => 0, 'warn' => 0))); /* Get forum data (damn HTML >.<) */ $forumData = ipsRegistry::getClass('class_forums')->getForumById($row['forum_id']); /* Parse BBCode */ IPSText::getTextClass('bbcode')->parse_smilies = $row['use_emo']; IPSText::getTextClass('bbcode')->parse_html = ($forumData['use_html'] and $member['g_dohtml'] and $row['post_htmlstate']) ? 1 : 0; IPSText::getTextClass('bbcode')->parse_nl2br = $row['post_htmlstate'] == 2 ? 1 : 0; IPSText::getTextClass('bbcode')->parse_bbcode = 1; IPSText::getTextClass('bbcode')->parsing_section = 'topics'; IPSText::getTextClass('bbcode')->parsing_mgroup = $member['member_group_id']; IPSText::getTextClass('bbcode')->parsing_mgroup_others = $member['mgroup_others']; $row['post'] = IPSText::getTextClass('bbcode')->preDisplayParse($row['post']); /* Parse attachments */ $messageHTML = array($row['pid'] => $row['post']); $attachHTML = $this->class_attach->renderAttachments($messageHTML, array($row['pid'])); if (is_array($attachHTML) and count($attachHTML)) { /* Get rid of any lingering attachment tags */ if (stristr($attachHTML[$row['pid']]['html'], "[attachment=")) { $attachHTML[$row['pid']]['html'] = IPSText::stripAttachTag($attachHTML[$row['pid']]['html']); } $row['post'] = $attachHTML[$row['pid']]['html'] . $attachHTML[$row['pid']]['attachmentHtml']; } /* Get rep buttons */ if ($row['repUserGiving'] == ipsRegistry::member()->getProperty('member_id')) { $row['has_given_rep'] = $row['rep_rating']; } $row['rep_points'] = ipsRegistry::getClass('repCache')->getRepPoints(array('app' => 'forums', 'type' => 'pid', 'type_id' => $row['pid'], 'rep_points' => $row['rep_points'])); $row['repButtons'] = ipsRegistry::getClass('repCache')->getLikeFormatted(array('app' => 'forums', 'type' => 'pid', 'id' => $row['pid'], 'rep_like_cache' => $row['rep_like_cache'])); /* Return */ return $row; }
/** * Class entry point * * @access public * @param object Registry reference * @return void [Outputs to screen] */ public function doExecute(ipsRegistry $registry) { //----------------------------------------- // Security check //----------------------------------------- if ($this->request['k'] != $this->member->form_hash) { $this->registry->getClass('output')->showError('no_permission', 20314); } //----------------------------------------- // INIT //----------------------------------------- $info = array(); $id = intval($this->memberData['member_id']); //----------------------------------------- // Get HTML and skin //----------------------------------------- $this->registry->class_localization->loadLanguageFile(array('public_profile'), 'members'); //----------------------------------------- // Can we access? //----------------------------------------- if (!$this->memberData['g_mem_info']) { $this->registry->output->showError('status_off', 10268); } if (!$id) { $this->registry->output->showError('status_off', 10269); } $newStatus = trim(IPSText::getTextClass('bbcode')->stripBadWords($this->request['new_status'])); IPSMember::save($id, array('extendedProfile' => array('pp_status' => $newStatus, 'pp_status_update' => time()))); $this->registry->output->redirectScreen($this->lang->words['status_was_changed'], $this->settings['base_url'] . 'showuser='******'members_seo_name']); }
/** * Class entry point * * @access public * @param object Registry reference * @return void [Outputs to screen] */ public function doExecute(ipsRegistry $registry) { //----------------------------------------- // INIT //----------------------------------------- $info = array(); $id = intval($this->memberData['member_id']); //----------------------------------------- // Get HTML and skin //----------------------------------------- $this->registry->class_localization->loadLanguageFile(array('public_profile'), 'members'); //----------------------------------------- // Can we access? //----------------------------------------- if (!$this->memberData['g_mem_info'] or $this->memberData['gbw_no_status_update']) { $this->returnJsonError($this->lang->words['status_off']); } if (!$id) { $this->returnJsonError($this->lang->words['status_off']); } $newStatus = trim(IPSText::getTextClass('bbcode')->stripBadWords(IPSText::parseCleanValue($_POST['new_status']))); IPSMember::save($id, array('extendedProfile' => array('pp_status' => $newStatus, 'pp_status_update' => time()))); $this->returnJsonArray(array('status' => 'success', 'new_status' => $newStatus)); exit; }
/** * Class entry point * * @access public * @param object Registry reference * @return void [Outputs to screen] */ public function doExecute(ipsRegistry $registry) { $this->registry->class_localization->loadLanguageFile(array('public_profile')); /* INIT */ $member_id = intval($this->request['mid']); //----------------------------------------- // Can we access? //----------------------------------------- if (!$this->memberData['g_mem_info']) { $this->returnString('error'); } if (!$member_id) { $this->returnString('error'); } $member = IPSMember::load($member_id, 'profile_portal,pfields_content,sessions,groups,basic', 'id'); if (!$member['member_id']) { $this->returnString('error'); } $this->registry->class_localization->loadLanguageFile(array('public_online'), 'members'); $member = IPSMember::buildDisplayData($member, array('customFields' => 1, 'cfSkinGroup' => 'profile')); $member = IPSMember::getLocation($member); $board_posts = $this->caches['stats']['total_topics'] + $this->caches['stats']['total_replies']; 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']); $this->returnHtml($this->registry->getClass('output')->getTemplate('profile')->showCard($member)); }
function globalTemplate($html, $documentHeadItems, $css, $jsModules, $metaTags, array $header_items, $items = array(), $footer_items = array(), $stats = array()) { $IPBHTML = ""; $uses_name = false; $uses_email = false; $_redirect = ''; foreach ($this->cache->getCache('login_methods') as $method) { if ($method['login_user_id'] == 'username' or $method['login_user_id'] == 'either') { $uses_name = true; } if ($method['login_user_id'] == 'email' or $method['login_user_id'] == 'either') { $uses_email = true; } if ($method['login_login_url']) { $_redirect = $method['login_login_url']; } } //These strings are hardcoded for a reason :) if ($uses_name and $uses_email) { $this->lang->words['enter_name'] = "USERNAME OR EMAIL"; } else { if ($uses_email) { $this->lang->words['enter_name'] = "EMAIL"; } else { $this->lang->words['enter_name'] = "USERNAME"; } } $IPBHTML .= "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\r\n<ipb>\r\n<title><![CDATA[{$header_items['title']}]]></title>\r\n<boardURL><![CDATA[{$this->settings['board_url']}]]></boardURL>\r\n<publicURL><![CDATA[{$this->settings['public_dir']}]]></publicURL>\r\n<forumHome><![CDATA[" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("act=idx", "public", ''), "", "") . "]]></forumHome>\r\n<styleRevision><![CDATA[{$this->settings['style_last_updated']}]]></styleRevision>\r\n\r\n\r\n<memberData>\r\n\t" . (IPSMember::canReceiveMobileNotifications($this->memberData) ? "\r\n\t<push_enabled>1</push_enabled>\r\n " : "") . "\r\n\t<member_id>{$this->memberData['member_id']}</member_id>\r\n\t<notificationCnt>{$this->memberData['notification_cnt']}</notificationCnt>\r\n\t<messageCnt>{$this->memberData['msg_count_new']}</messageCnt>\r\n\t<isSuperMod>{$this->memberData['g_is_supmod']}</isSuperMod>\r\n\t<isMod>{$this->memberData['is_mod']}</isMod>\r\n\t<isAdmin>{$this->memberData['g_access_cp']}</isAdmin>\r\n\t<membersDisplayName><![CDATA[{$this->memberData['members_display_name']}]]></membersDisplayName>\r\n\t<secureHash>{$this->member->form_hash}</secureHash>\r\n\t<sessionId>{$this->member->session_id}</sessionId>\r\n\t<avatarThumb><![CDATA[{$this->memberData['pp_thumb_photo']}]]></avatarThumb>\r\n\t<profileURL><![CDATA[" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("showuser={$this->memberData['member_id']}", "public", ''), "{$this->memberData['members_seo_name']}", "showuser") . "]]></profileURL>\r\n</memberData>\r\n<admob>\r\n <adLocation>{$this->settings['admob_top']}|{$this->settings['admob_bottom']}</adLocation>\r\n <adCode>{$this->settings['admob_pub_id']}</adCode>\r\n</admob><loginMethod>{$this->lang->words['enter_name']}</loginMethod>\r\n\r\n{$html}\r\n</ipb>"; return $IPBHTML; }
/** * Main class entry point * * @param object ipsRegistry reference * @return @e void [Outputs to screen] */ public function doExecute(ipsRegistry $registry) { //----------------------------------------- // Got sess ID and mem ID? //----------------------------------------- if (!$this->member->getProperty('member_id')) { $this->returnString("no"); } //----------------------------------------- // Check that we have the key //----------------------------------------- if ($this->settings['ipb_reg_number']) { $this->settings['ipschat_account_key'] = $this->settings['ipb_reg_number']; } if (!$this->settings['ipschat_account_key']) { $this->returnString("no"); } //----------------------------------------- // Can we access? //----------------------------------------- $access_groups = explode(",", $this->settings['ipschat_group_access']); $my_groups = array($this->memberData['member_group_id']); if ($this->memberData['mgroup_others']) { $my_groups = array_merge($my_groups, explode(",", IPSText::cleanPermString($this->memberData['mgroup_others']))); } $access_allowed = false; foreach ($my_groups as $group_id) { if (in_array($group_id, $access_groups)) { $access_allowed = 1; break; } } if (!$access_allowed) { $this->returnString("no"); } if ($this->memberData['chat_banned']) { $this->returnString("no"); } $permissions = 0; if ($this->settings['ipschat_mods']) { $mod_groups = explode(",", $this->settings['ipschat_mods']); foreach ($my_groups as $group_id) { if (in_array($group_id, $mod_groups)) { $permissions = 1; break; } } } if (!$permissions) { $this->returnString("no"); } //----------------------------------------- // Ban member //----------------------------------------- IPSMember::save($this->request['id'], array('core' => array('chat_banned' => 1))); //----------------------------------------- // Something to return //----------------------------------------- $this->returnString("ok"); }
/** * Get Content URL * * @param array $warning Row from members_warn_logs * @return @e array array( url => URL to the content the warning came from, title => Title ) */ public function getContentUrl($warning) { ipsRegistry::getClass('class_localization')->loadLanguageFile(array('public_profile'), 'members'); if ($warning['wl_content_id1']) { $post = ipsRegistry::DB()->buildAndFetch(array('select' => '*', 'from' => 'message_posts', 'where' => "msg_id=" . intval($warning['wl_content_id1']))); if (!empty($post['msg_topic_id'])) { $topic = ipsRegistry::DB()->buildAndFetch(array('select' => '*', 'from' => 'message_topics', 'where' => "mt_id={$post['msg_topic_id']}")); if (!empty($topic['mt_id'])) { ipsRegistry::DB()->build(array('select' => '*', 'from' => 'message_topic_user_map', 'where' => "map_topic_id={$post['msg_topic_id']}")); ipsRegistry::DB()->execute(); while ($row = ipsRegistry::DB()->fetch()) { if ($row['map_user_id'] == ipsRegistry::member()->getProperty('member_id')) { return array('url' => ipsRegistry::getClass('output')->buildUrl("app=members&module=messaging&section=view&do=findMessage&topicID={$topic['mt_id']}&msgID={$post['msg_id']}"), 'title' => $topic['mt_title']); } } return array('url' => ipsRegistry::getClass('output')->buildUrl("app=core&module=reports§ion=reports&do=showMessage&topicID={$topic['mt_id']}&msg={$post['msg_id']}"), 'title' => $topic['mt_title']); } } } else { $member = IPSMember::load($warning['wl_member']); if (!empty($member['member_id'])) { return array('url' => ipsRegistry::getClass('output')->buildSEOUrl("showuser={$member['member_id']}", 'public', $member['members_seo_name'], 'showuser'), 'title' => ipsRegistry::getClass('class_localization')->words['warnings_profile']); } } }
/** * Class entry point * * @access public * @param object Registry reference * @return void [Outputs to screen/redirects] */ public function doExecute(ipsRegistry $registry) { //----------------------------------------- // INIT //----------------------------------------- $info = array(); $id = intval($this->request['id']); //----------------------------------------- // Get HTML and skin //----------------------------------------- $this->registry->class_localization->loadLanguageFile(array('public_profile'), 'members'); //----------------------------------------- // Can we access? //----------------------------------------- if (!$this->memberData['g_mem_info']) { $this->registry->output->showError('photos_profiles_off', 10242); } if (!$id) { $this->registry->output->showError('photos_no_id', 10243); } $member = IPSMember::load($id); $member = IPSMember::buildDisplayData($member); $html = $this->registry->getClass('output')->getTemplate('profile')->showPhoto($member); //----------------------------------------- // Push to print handler //----------------------------------------- $this->registry->getClass('output')->setTitle($this->lang->words['photo_title']); $this->registry->getClass('output')->popUpWindow($html); }
/** * Show the form * * @return @e void [Outputs to screen] */ protected function show() { //----------------------------------------- // INIT //----------------------------------------- $name = trim(IPSText::alphanumericalClean(ipsRegistry::$request['name'])); $member_id = intval(ipsRegistry::$request['member_id']); $output = ''; //----------------------------------------- // Get member data //----------------------------------------- $member = IPSMember::load($member_id, 'extendedProfile,customFields'); //----------------------------------------- // Got a member? //----------------------------------------- if (!$member['member_id']) { $this->returnJsonError($this->lang->words['t_noid']); } //----------------------------------------- // Return the form //----------------------------------------- if (method_exists($this->html, $name)) { $output = $this->html->{$name}($member); } //----------------------------------------- // Print... //----------------------------------------- $this->returnHtml($output); }
/** * Returns possible matches for the string input * * @access private * @return void Outputs to screen */ private function _getMemberNames() { //----------------------------------------- // INIT //----------------------------------------- $name = $this->convertAndMakeSafe(ipsRegistry::$request['name'], 0); //----------------------------------------- // Check length //----------------------------------------- if (IPSText::mbstrlen($name) < 3) { $this->returnJsonError('requestTooShort'); } //----------------------------------------- // Try query... //----------------------------------------- $this->DB->build(array('select' => 'm.members_display_name, m.name, m.member_id, m.member_group_id', 'from' => array('members' => 'm'), 'where' => "LOWER(m.members_display_name) LIKE '" . $this->DB->addSlashes($name) . "%'", 'order' => $this->DB->buildLength('m.members_display_name') . ' ASC', 'limit' => array(0, 15), 'add_join' => array(array('select' => 'p.*', 'from' => array('profile_portal' => 'p'), 'where' => 'p.pp_member_id=m.member_id', 'type' => 'left')))); $this->DB->execute(); //----------------------------------------- // Got any results? //----------------------------------------- if (!$this->DB->getTotalRows()) { $this->returnJsonArray(array()); } $return = array(); while ($r = $this->DB->fetch()) { $photo = IPSMember::buildProfilePhoto($r); $group = IPSLib::makeNameFormatted('', $r['member_group_id']); $return[$r['member_id']] = array('name' => $r['members_display_name'], 'showas' => '<strong>' . $r['members_display_name'] . '</strong> (' . $group . ')', 'img' => $photo['pp_thumb_photo'], 'img_w' => $photo['pp_mini_width'], 'img_h' => $photo['pp_mini_height']); } $this->returnJsonArray($return); }
/** * Class entry point * * @param object Registry reference * @return @e void [Outputs to screen] */ public function doExecute(ipsRegistry $registry) { //----------------------------------------- // INIT //----------------------------------------- $member_id = intval(ipsRegistry::$request['member_id']); $md5check = IPSText::md5Clean($this->request['md5check']); $CONFIG = array(); $tab = explode(':', ipsRegistry::$request['tab']); $app = substr(IPSText::alphanumericalClean(str_replace('..', '', trim($tab[0]))), 0, 20); $tab = substr(IPSText::alphanumericalClean(str_replace('..', '', trim($tab[1]))), 0, 20); $this->registry->class_localization->loadLanguageFile(array('public_profile'), 'members'); //----------------------------------------- // MD5 check //----------------------------------------- if ($md5check != $this->member->form_hash) { $this->returnString('error'); } //----------------------------------------- // Load member //----------------------------------------- $member = IPSMember::load($member_id); //----------------------------------------- // Check //----------------------------------------- if (!$member['member_id']) { $this->returnString('error'); } //----------------------------------------- // Load config //----------------------------------------- if (!is_file(IPSLib::getAppDir($app) . '/extensions/profileTabs/' . $tab . '.conf.php')) { $this->returnString('error'); } require IPSLib::getAppDir($app) . '/extensions/profileTabs/' . $tab . '.conf.php'; /*noLibHook*/ //----------------------------------------- // Active? //----------------------------------------- if (!$CONFIG['plugin_enabled']) { $this->returnString('error'); } //----------------------------------------- // Load main class... //----------------------------------------- if (!is_file(IPSLib::getAppDir($app) . '/extensions/profileTabs/' . $tab . '.php')) { $this->returnString('error'); } require IPSLib::getAppDir('members') . '/sources/tabs/pluginParentClass.php'; /*noLibHook*/ $classToLoad = IPSLib::loadLibrary(IPSLib::getAppDir($app) . '/extensions/profileTabs/' . $tab . '.php', 'profile_' . $tab, $app); $plugin = new $classToLoad($this->registry); $html = $plugin->return_html_block($member); //----------------------------------------- // Return it... //----------------------------------------- $this->returnHtml($html); }
function __f__bbeb34120594dcbbf1392e3622a54dac($rows, $links = "", $defaults = array(), $our_mgroups = array()) { $_ips___x_retval = ''; foreach ($rows as $session) { $_ips___x_retval .= "\n\t\t\t<tr>\n\t\t\t\t<td class='row1'>\n\t\t\t\t\t<img src='{$session['_memberData']['pp_thumb_photo']}' alt=\"{$session['_memberData']['members_display_name']}{$this->lang->words['users_photo']}\" width='{$session['_memberData']['pp_thumb_width']}' height='{$session['_memberData']['pp_thumb_height']}' class='photo' />\n\t\t\t\t</td>\n\t\t\t\t<td class='" . IPSLib::next($this->registry->templateStriping["online"]) . "'>\n\t\t\t\t\t" . ($session['member_name'] ? "" . ($session['member_id'] ? "\n\t\t\t\t\t\t\t<a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("showuser={$session['member_id']}", 'public', ''), "{$session['seo_name']}", "showuser") . "' title='{$this->lang->words['view_profile']}'>" . IPSLib::makeNameFormatted($session['member_name'], $session['member_group']) . "</a>" . $this->registry->getClass('output')->getTemplate('global')->user_popup($session['member_id'], $session['seo_name']) . "\n\t\t\t\t\t\t" : "\n\t\t\t\t\t\t\t" . IPSLib::makeNameFormatted($session['member_name'], $session['member_group']) . "\n\t\t\t\t\t\t") . "" : "\n\t\t\t\t\t\t{$this->lang->words['global_guestname']}\n\t\t\t\t\t") . "\n\t\t\t\t\t" . (($session['is_bot'] and $this->settings['spider_anon']) ? "" . ($this->memberData['g_access_cp'] ? "\n\t\t\t\t\t\t\t*\n\t\t\t\t\t\t" : "") . "" : "" . ($session['login_type'] == 1 ? "" . ((!$this->settings['disable_admin_anon'] and $this->memberData['g_access_cp']) ? "\n\t\t\t\t\t\t\t\t*\n\t\t\t\t\t\t\t" : "") . "" : "") . "") . "\n\t\t\t\t\t" . (($this->memberData['g_access_cp'] and !$this->settings['disable_online_ip']) ? "\n\t\t\t\t\t\t<span class='ip'>( {$session['ip_address']} )</span>\n\t\t\t\t\t" : "") . "\n\t\t\t\t</td>\n\t\t\t\t<td class='" . IPSLib::next($this->registry->templateStriping["online"]) . "'>\n\t\t\t\t\t" . (!$session['where_line'] ? "\n\t\t\t\t\t\t{$this->lang->words['board_index']}\n\t\t\t\t\t" : "" . (($session['where_link'] and !$session['where_line_more']) ? "\n\t\t\t\t\t\t\t<a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("{$session['where_link']}", 'public', ''), "", "") . "'>\n\t\t\t\t\t\t" : "") . "\n\t\t\t\t\t\t{$session['where_line']} \n\t\t\t\t\t\t" . ($session['where_line_more'] ? " \n\t\t\t\t\t\t\t" . ($session['_whereLinkSeo'] ? "\n\t\t\t\t\t\t\t\t<a href='{$session['_whereLinkSeo']}'>\n\t\t\t\t\t\t\t" : "" . ($session['where_link'] ? "<a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("{$session['where_link']}", 'public', ''), "", "") . "'>" : "") . "") . "\n\t\t\t\t\t\t\t{$session['where_line_more']}\n\t\t\t\t\t\t\t" . ($session['where_link'] ? "</a>" : "") . "" : "" . ($session['where_link'] ? "</a>" : "") . "") . "") . "\n\t\t\t\t</td>\n\t\t\t\t<td class='" . IPSLib::next($this->registry->templateStriping["online"]) . "'>\n\t\t\t\t\t" . $this->registry->getClass('class_localization')->getDate($session['running_time'], "long", 1) . "\n\t\t\t\t</td>\n\t\t\t\t<td class='" . IPSLib::next($this->registry->templateStriping["online"]) . "'>\n\t\t\t\t\t" . (($session['member_id'] and $session['member_name']) ? "<ul class='user_controls clear'>\n\t\t\t\t\t\t\t" . (($this->memberData['member_id'] and $this->memberData['member_id'] != $session['member_id'] && $this->settings['friends_enabled'] and $this->memberData['g_can_add_friends']) ? "" . (IPSMember::checkFriendStatus($session['member_id']) ? "\n\t\t\t\t\t\t\t\t\t<li class='mini_friend_toggle is_friend' id='friend_online_{$session['member_id']}'><a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=members&module=profile&section=friends&do=remove&member_id={$session['member_id']}&secure_key={$this->member->form_hash}", 'public', ''), "", "") . "' title='{$this->lang->words['remove_friend']}'>" . $this->registry->getClass('output')->getReplacement("remove_friend") . "</a></li>\n\t\t\t\t\t\t\t\t" : "\n\t\t\t\t\t\t\t\t\t<li class='mini_friend_toggle is_not_friend' id='friend_online_{$session['member_id']}'><a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=members&module=profile&section=friends&do=add&member_id={$session['member_id']}&secure_key={$this->member->form_hash}", 'public', ''), "", "") . "' title='{$this->lang->words['add_friend']}'>" . $this->registry->getClass('output')->getReplacement("add_friend") . "</a></li>\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t") . "" : "") . "\n\t\t\t\t\t\t\t" . (($this->memberData['member_id'] and $this->memberData['member_id'] != $session['member_id'] and $this->memberData['g_use_pm'] and $this->memberData['members_disable_pm'] == 0 and IPSLib::moduleIsEnabled('messaging', 'members')) ? "\n\t\t\t\t\t\t\t\t<li class='pm_button' id='pm_online_{$session['member_id']}'><a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=members&module=messaging&section=send&do=form&fromMemberID={$session['member_id']}", 'public', ''), "", "") . "' title='{$this->lang->words['pm_member']}'>" . $this->registry->getClass('output')->getReplacement("send_msg") . "</a></li>\n\t\t\t\t\t\t\t" : "") . "\n\t\t\t\t\t\t\t" . (($session['memberData']['has_blog'] and IPSLib::appIsInstalled('blog')) ? "\n\t\t\t\t\t\t\t\t<li><a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=blog&module=display&section=blog&mid={$session['member_id']}", 'public', ''), "", "") . "' title='{$this->lang->words['view_blog']}'>" . $this->registry->getClass('output')->getReplacement("blog_link") . "</a></li>\n\t\t\t\t\t\t\t" : "") . "\n\t\t\t\t\t\t\t" . (($session['memberData']['has_gallery'] and IPSLib::appIsInstalled('gallery')) ? "\n\t\t\t\t\t\t\t\t<li><a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=gallery&module=user&section=user&user={$session['member_id']}", 'public', ''), "", "") . "' title='{$this->lang->words['view_gallery']}'>" . $this->registry->getClass('output')->getReplacement("gallery_link") . "</a></li>\n\t\t\t\t\t\t\t" : "") . "\n\t\t\t\t\t\t</ul>" : "\n\t\t\t\t\t\t<span class='desc'>{$this->lang->words['no_options_available']}</span>\n\t\t\t\t\t") . "\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\n"; } $_ips___x_retval .= ''; return $_ips___x_retval; }
function __f__286c41c379bb925f4c65c76d211aefab($rows) { $_ips___x_retval = ''; foreach ($rows as $info) { $_ips___x_retval .= "\n\t\t\t<tr class='" . IPSLib::next($this->registry->templateStriping["top_posters"]) . "'>\n\t\t\t\t<td>\n\t\t\t\t\t<img src='{$info['pp_mini_photo']}' alt=\"{$info['members_display_name']}{$this->lang->words['users_photo']}\" class='photo' width='{$info['pp_mini_width']}' height='{$info['pp_mini_height']}' />\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t" . ($info['member_id'] > 0 ? "\n\t\t\t\t\t\t<a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("showuser={$info['member_id']}", 'public', ''), "{$info['members_seo_name']}", "showuser") . "' title='{$this->lang->words['view_profile']}'>{$info['members_display_name']}</a> " . $this->registry->getClass('output')->getTemplate('global')->user_popup($info['member_id'], $info['members_seo_name']) . "\n\t\t\t\t\t" : "\n\t\t\t\t\t\t{$info['members_display_name']}\n\t\t\t\t\t") . "\n\t\t\t\t</td>\n\t\t\t\t<td class='altrow'>\n\t\t\t\t\t" . $this->registry->getClass('class_localization')->getDate($info['joined'], "joined", 0) . "\n\t\t\t\t</td>\n\t\t\t\t<td class='short'>\n\t\t\t\t\t" . $this->registry->getClass('class_localization')->formatNumber($info['posts']) . "\n\t\t\t\t</td>\n\t\t\t\t<td class='altrow short'>\n\t\t\t\t\t" . $this->registry->getClass('class_localization')->formatNumber($info['tpost']) . "\n\t\t\t\t</td>\n\t\t\t\t<td class='short'>\n\t\t\t\t\t{$info['today_pct']}%\n\t\t\t\t</td>\n\t\t\t\t<td class='altrow short'>\n\t\t\t\t\t<ul class='user_controls clear'>\n\t\t\t\t\t\t" . (($this->memberData['member_id'] and $this->memberData['member_id'] != $info['member_id'] && $this->settings['friends_enabled'] and $this->memberData['g_can_add_friends']) ? "" . (IPSMember::checkFriendStatus($info['member_id']) ? "\n\t\t\t\t\t\t\t\t<li class='mini_friend_toggle is_friend' id='friend_xxx_{$info['member_id']}'><a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=members&module=profile&section=friends&do=remove&member_id={$info['member_id']}&secure_key={$this->member->form_hash}", 'public', ''), "", "") . "' title='{$this->lang->words['remove_friend']}'>" . $this->registry->getClass('output')->getReplacement("remove_friend") . "</a></li>\n\t\t\t\t\t\t\t" : "\n\t\t\t\t\t\t\t\t<li class='mini_friend_toggle is_not_friend' id='friend_xxx_{$info['member_id']}'><a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=members&module=profile&section=friends&do=add&member_id={$info['member_id']}&secure_key={$this->member->form_hash}", 'public', ''), "", "") . "' title='{$this->lang->words['add_friend']}'>" . $this->registry->getClass('output')->getReplacement("add_friend") . "</a></li>\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t") . "" : "") . "\n\t\t\t\t\t\t" . (($this->memberData['g_use_pm'] and $this->memberData['member_id'] != $info['member_id'] and $this->memberData['members_disable_pm'] == 0 and IPSLib::moduleIsEnabled('messaging', 'members')) ? "\n\t\t\t\t\t\t\t<li class='pm_button' id='pm_xxx_{$info['member_id']}'><a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=members&module=messaging&section=send&do=form&fromMemberID={$info['member_id']}", 'public', ''), "", "") . "' title='{$this->lang->words['pm_member']}'>" . $this->registry->getClass('output')->getReplacement("send_msg") . "</a></li>\n\t\t\t\t\t\t" : "") . "\n\t\t\t\t\t\t" . (($info['has_blog'] and IPSLib::appIsInstalled('blog')) ? "\n\t\t\t\t\t\t\t<li><a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=blog&module=display&section=blog&mid={$info['member_id']}", 'public', ''), "", "") . "' title='{$this->lang->words['view_blog']}'>" . $this->registry->getClass('output')->getReplacement("blog_link") . "</a></li>\n\t\t\t\t\t\t" : "") . "\n\t\t\t\t\t\t" . (($info['has_gallery'] and IPSLib::appIsInstalled('gallery')) ? "\n\t\t\t\t\t\t\t<li><a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=gallery&module=user&section=user&user={$info['member_id']}", 'public', ''), "", "") . "' title='{$this->lang->words['view_gallery']}'>" . $this->registry->getClass('output')->getReplacement("gallery_link") . "</a></li>\n\t\t\t\t\t\t" : "") . "\n\t\t\t\t\t</ul>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\n"; } $_ips___x_retval .= ''; return $_ips___x_retval; }
/** * Main function executed automatically by the controller * * @param object $registry Registry object * @return @e void */ public function doExecute(ipsRegistry $registry) { $member = IPSMember::load(intval($this->request['member']), 'none', 'id'); if ($member['member_id'] and $this->request['key'] == md5($member['email'] . ':' . $member['members_pass_hash'])) { IPSMember::save($member['member_id'], array('members' => array('allow_admin_mails' => 0))); $this->registry->getClass('output')->addContent($this->registry->output->getTemplate('ucp')->unsubscribed()); $this->registry->getClass('output')->sendOutput(); } $this->registry->output->showError('email_no_unsubscribe'); }
/** * Class entry point * * @param object Registry reference * @return @e void [Outputs to screen] */ public function doExecute(ipsRegistry $registry) { if (!$this->memberData['member_id']) { $this->returnNull(); } if ($this->memberData['members_auto_dst'] == 1 and $this->settings['time_dst_auto_correction']) { $newValue = $this->memberData['dst_in_use'] ? 0 : 1; IPSMember::save($this->memberData['member_id'], array('members' => array('dst_in_use' => $newValue))); } $this->returnNull(); }
/** * Parse/format the online list data for the records * * @author Brandon Farber * @param array Online list rows to check against * @return array Online list rows parsed */ public function parseOnlineEntries($rows) { if (!is_array($rows) or !count($rows)) { return $rows; } $final = array(); $profiles = array(); $members = array(); //----------------------------------------- // Extract the topic/forum data //----------------------------------------- foreach ($rows as $row) { if ($row['current_appcomponent'] != 'members' or !$row['current_module']) { continue; } if ($row['current_module'] == 'profile') { $profiles[] = $row['location_1_id']; } } if (count($profiles)) { ipsRegistry::DB()->build(array('select' => 'member_id, members_display_name, members_seo_name, member_banned, members_bitoptions', 'from' => 'members', 'where' => 'member_id IN(' . implode(',', $profiles) . ')')); $pr = ipsRegistry::DB()->execute(); while ($r = ipsRegistry::DB()->fetch($pr)) { /* Setup bitwise option to check for banned/spammer members */ $r = IPSMember::buildBitWiseOptions($r); if (!IPSMember::isInactive($r) || ipsRegistry::member()->getProperty('g_is_supmod')) { $members[$r['member_id']] = array('members_display_name' => $r['members_display_name'], 'members_seo_name' => $r['members_seo_name']); } } } foreach ($rows as $row) { if ($row['current_appcomponent'] == 'members') { if ($row['current_module'] == 'online') { $row['where_line'] = ipsRegistry::getClass('class_localization')->words['WHERE_online']; } if ($row['current_module'] == 'list') { $row['where_line'] = ipsRegistry::getClass('class_localization')->words['WHERE_members']; } if ($row['current_module'] == 'messaging') { $row['where_line'] = ipsRegistry::getClass('class_localization')->words['WHERE_msg']; } if ($row['current_module'] == 'profile') { if (isset($members[$row['location_1_id']])) { $row['where_line'] = ipsRegistry::getClass('class_localization')->words['WHERE_profile']; $row['where_line_more'] = $members[$row['location_1_id']]['members_display_name']; $row['where_link'] = 'showuser='******'location_1_id']; $row['_whereLinkSeo'] = ipsRegistry::getClass('output')->buildSEOUrl($row['where_link'], 'public', $members[$row['location_1_id']]['members_seo_name'], 'showuser'); } } } $final[$row['id']] = $row; } return $final; }
function __f__7046da7023dc6898b789bfa2de184ba2($rows, $links = "", $defaults = array()) { $_ips___x_retval = ''; $__iteratorCount = 0; foreach ($rows as $session) { $__iteratorCount++; $_ips___x_retval .= "\r\n\t\t\t\t\t<tr class='" . IPSLib::next($this->registry->templateStriping["online"]) . "'>\r\n\t\t\t\t\t\t<td>" . (method_exists($this->registry->getClass('output')->getTemplate('global'), 'userSmallPhoto') ? $this->registry->getClass('output')->getTemplate('global')->userSmallPhoto(array_merge($session['_memberData'], array('alt' => sprintf($this->lang->words['users_photo'], $session['_memberData']['members_display_name'] ? $session['_memberData']['members_display_name'] : $this->lang->words['global_guestname'])))) : '') . "</td>\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t" . ($session['_memberData']['member_id'] ? "\r\n\t\t\t\t\t\t\t\t" . (method_exists($this->registry->getClass('output')->getTemplate('global'), 'userHoverCard') ? $this->registry->getClass('output')->getTemplate('global')->userHoverCard(array_merge($session['_memberData'], array('members_display_name' => IPSMember::makeNameFormatted($session['_memberData']['members_display_name'], $session['_memberData']['member_group_id'])))) : '') . "\r\n\t\t\t\t\t\t\t" : "" . ($session['member_name'] ? "\r\n\t\t\t\t\t\t\t\t\t" . IPSMember::makeNameFormatted($session['member_name'], $session['member_group']) . "\r\n\t\t\t\t\t\t\t\t" : "\r\n\t\t\t\t\t\t\t\t\t{$this->lang->words['global_guestname']}\r\n\t\t\t\t\t\t\t\t") . "") . "\r\n\t\t\t\t\t\t\t" . ($session['login_type'] == 1 ? "" . ($this->memberData['g_access_cp'] || $session['_memberData']['member_id'] == $this->memberData['member_id'] ? "*" : "") . "" : "") . "\r\n\t\t\t\t\t\t\t" . ($this->memberData['g_is_supmod'] ? "\r\n\t\t\t\t\t\t\t\t<br />\r\n\t\t\t\t\t\t\t\t<span class='ip desc lighter ipsText_smaller'>({$session['ip_address']})</span>\r\n\t\t\t\t\t\t\t" : "") . "\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t" . (!$session['where_line'] || $session['in_error'] ? "\r\n\t\t\t\t\t\t\t\t{$this->lang->words['board_index']}\r\n\t\t\t\t\t\t\t" : "" . (($session['where_link'] and !$session['where_line_more']) ? "" . ($session['_whereLinkSeo'] ? "\r\n\t\t\t\t\t\t\t\t\t\t<a href='{$session['_whereLinkSeo']}'>\r\n\t\t\t\t\t\t\t\t\t" : "\r\n\t\t\t\t\t\t\t\t\t\t<a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("{$session['where_link']}", "public", ''), "", "") . "'>\r\n\t\t\t\t\t\t\t\t\t") . "" : "") . "\r\n\t\t\t\t\t\t\t\t{$session['where_line']} \r\n\t\t\t\t\t\t\t\t" . ($session['where_line_more'] ? " \r\n\t\t\t\t\t\t\t\t\t" . ($session['_whereLinkSeo'] ? "\r\n\t\t\t\t\t\t\t\t\t\t<a href='{$session['_whereLinkSeo']}'>\r\n\t\t\t\t\t\t\t\t\t" : "" . ($session['where_link'] ? "<a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("{$session['where_link']}", "public", ''), "", "") . "'>" : "") . "") . "\r\n\t\t\t\t\t\t\t\t\t{$session['where_line_more']}\r\n\t\t\t\t\t\t\t\t\t" . ($session['where_link'] ? "</a>" : "") . "" : "" . ($session['where_link'] ? "</a>" : "") . "") . "") . "\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t" . IPSText::htmlspecialchars($this->registry->getClass('class_localization')->getDate($session['running_time'], "long", 1)) . "\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t" . (($session['member_id'] and $session['member_name']) ? "<ul class='ipsList_inline ipsList_nowrap right'>\r\n\t\t\t\t\t\t\t\t\t" . (($this->memberData['member_id'] and $this->memberData['member_id'] != $session['member_id'] && $this->settings['friends_enabled'] and $this->memberData['g_can_add_friends']) ? "" . (IPSMember::checkFriendStatus($session['member_id']) ? "\r\n\t\t\t\t\t\t\t\t\t\t\t<li class='mini_friend_toggle is_friend' id='friend_online_{$session['member_id']}'><a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=members&module=profile&section=friends&do=remove&member_id={$session['member_id']}&secure_key={$this->member->form_hash}", "public", ''), "", "") . "' title='{$this->lang->words['remove_friend']}' class='ipsButton_secondary'>" . $this->registry->getClass('output')->getReplacement("remove_friend") . "</a></li>\r\n\t\t\t\t\t\t\t\t\t\t" : "\r\n\t\t\t\t\t\t\t\t\t\t\t<li class='mini_friend_toggle is_not_friend' id='friend_online_{$session['member_id']}'><a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=members&module=profile&section=friends&do=add&member_id={$session['member_id']}&secure_key={$this->member->form_hash}", "public", ''), "", "") . "' title='{$this->lang->words['add_friend']}' class='ipsButton_secondary'>" . $this->registry->getClass('output')->getReplacement("add_friend") . "</a></li>\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t") . "" : "") . "\r\n\t\t\t\t\t\t\t\t\t" . (($this->memberData['member_id'] and $this->memberData['member_id'] != $session['member_id'] and $this->memberData['g_use_pm'] and $this->memberData['members_disable_pm'] == 0 and IPSLib::moduleIsEnabled('messaging', 'members')) ? "\r\n\t\t\t\t\t\t\t\t\t\t<li class='pm_button' id='pm_online_{$session['member_id']}'><a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=members&module=messaging&section=send&do=form&fromMemberID={$session['member_id']}", "public", ''), "", "") . "' title='{$this->lang->words['pm_member']}' class='ipsButton_secondary'>" . $this->registry->getClass('output')->getReplacement("send_msg") . "</a></li>\r\n\t\t\t\t\t\t\t\t\t" : "") . "\r\n\t\t\t\t\t\t\t\t\t" . (($session['memberData']['has_blog'] and IPSLib::appIsInstalled('blog')) ? "\r\n\t\t\t\t\t\t\t\t\t\t<li><a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=blog&module=display&section=blog&show_members_blogs={$session['member_id']}", "public", ''), "", "") . "' title='{$this->lang->words['view_blog']}' class='ipsButton_secondary'>" . $this->registry->getClass('output')->getReplacement("blog_link") . "</a></li>\r\n\t\t\t\t\t\t\t\t\t" : "") . "\r\n\t\t\t\t\t\t\t\t\t" . (($session['memberData']['has_gallery'] and IPSLib::appIsInstalled('gallery')) ? "\r\n\t\t\t\t\t\t\t\t\t\t<li><a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=gallery&user={$session['member_id']}", "public", ''), "{$session['memberData']['members_seo_name']}", "useralbum") . "' title='{$this->lang->words['view_gallery']}' class='ipsButton_secondary'>" . $this->registry->getClass('output')->getReplacement("gallery_link") . "</a></li>\r\n\t\t\t\t\t\t\t\t\t" : "") . "\r\n\t\t\t\t\t\t\t\t</ul>" : "\r\n\t\t\t\t\t\t\t\t<span class='desc'>{$this->lang->words['no_options_available']}</span>\r\n\t\t\t\t\t\t\t") . "\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\r\n"; } $_ips___x_retval .= ''; unset($__iteratorCount); return $_ips___x_retval; }
function __f__d1fd60508c3bedc7e3ac15eb660de8fe($members, $pages = "", $dropdowns = array(), $defaults = array(), $custom_fields = null, $url = '') { $_ips___x_retval = ''; $__iteratorCount = 0; foreach ($members as $member) { $__iteratorCount++; $_ips___x_retval .= "\n\t\t\t<div class='row touch-row' id=\"mem-{$member['member_id']}\">\n\t\t\t\t<div class='icon'>\n\t\t\t\t\t<a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("showuser={$member['member_id']}", "public", ''), "{$member['members_seo_name']}", "showuser") . "' title='{$this->lang->words['view_profile']}'><img src='{$member['pp_mini_photo']}' alt=\"" . sprintf($this->lang->words['users_photo'], $member['members_display_name']) . "\" class='photo' /></a>\t\n\t\t\t\t</div>\n\t\t\t\t<strong><a class='title' href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("showuser={$member['member_id']}", "public", ''), "{$member['members_seo_name']}", "showuser") . "' title='{$this->lang->words['view_profile']}'>{$member['members_display_name']}</a></strong>\n\t\t\t\t<br />\n\t\t\t\t<span class='subtext'>" . $this->registry->getClass('class_localization')->formatNumber($member['posts']) . " {$this->lang->words['member_posts']} · {$this->lang->words['member_group']}: " . IPSMember::makeNameFormatted($member['group'], $member['member_group_id']) . "\n\t\t\t\t · <a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=core&module=search&do=user_activity&mid={$member['member_id']}", "public", ''), "", "") . "'>" . $this->registry->getClass('output')->getReplacement("find_topics_link") . " {$this->lang->words['gbl_find_my_content']}</a></span>\n\t\t\t</div>\n\t\t\n"; } $_ips___x_retval .= ''; unset($__iteratorCount); return $_ips___x_retval; }
/** * Changes the skin ID choice for the member * * @return @e void */ protected function _change() { $skinId = $this->request['skinId']; if ($this->request['skinId'] != 'setAsMobile' && $this->request['k'] != $this->member->form_hash) { $this->registry->output->showError('no_permission', 10122243, FALSE, '', 403); } if (is_numeric($skinId)) { /* Rudimentaty check */ if ($this->registry->output->allSkins[$skinId]['_youCanUse'] and $this->registry->output->allSkins[$skinId]['_gatewayExclude'] !== TRUE) { if ($this->memberData['member_id']) { /* Update... */ IPSMember::save($this->memberData['member_id'], array('core' => array('skin' => $skinId))); } else { IPSCookie::set('guestSkinChoice', $skinId); } /* Make sure mobile skin is removed */ IPSCookie::set("mobileApp", 'false', -1); IPSCookie::set("mobileBrowser", 0, -1); /* remove user agent bypass */ IPSCookie::set("uagent_bypass", 0, -1); /* Update member row */ $this->memberData['skin'] = $skinId; } } else { if ($skinId == 'fullVersion') { /* Set cookie */ IPSCookie::set("uagent_bypass", 1, -1); IPSCookie::set("mobileBrowser", 0, -1); } else { if ($skinId == 'unlockUserAgent') { $this->member->updateMySession(array('uagent_bypass' => 1)); /* Set cookie */ IPSCookie::set("uagent_bypass", 1, -1); IPSCookie::set("mobileBrowser", 0, -1); } else { if ($skinId == 'setAsMobile') { $this->member->updateMySession(array('uagent_bypass' => 0)); /* Set cookie */ IPSCookie::set("uagent_bypass", 0, -1); IPSCookie::set("mobileBrowser", 1, -1); } } } } /* Redirect */ if ($this->settings['query_string_real']) { $url = preg_replace('#&k=(?:\\S+?)($|&)#', '\\1', str_replace('&', '&', $this->settings['query_string_real'])); $url = preg_replace('#&settingNewSkin=(?:\\S+?)($|&)#', '\\1', $url); $url = preg_replace('#&setAsMobile=(?:\\S+?)($|&)#', '\\1', $url); $this->registry->getClass('output')->silentRedirect($this->settings['board_url'] . '?' . $url, '', true); } $this->registry->getClass('output')->silentRedirect($this->settings['board_url'], '', true); }
public function warning($member) { if (!ipsRegistry::$settings['warn_on']) { return false; } if (ipsRegistry::$settings['warn_protected']) { if (IPSMember::isInGroup($member, explode(',', ipsRegistry::$settings['warn_protected']))) { return false; } } return true; }
public function getOutput() { /* INIT */ $time_high = time(); $ids = array(); $rows = array(); $time_low = $time_high - 60 * 60 * 24; $todays_posts = 0; $store = array(); /* List of forum ids */ foreach (ipsRegistry::getClass('class_forums')->forum_by_id as $id => $data) { if (!isset($data['inc_postcount']) || !$data['inc_postcount']) { continue; } $ids[] = $id; } /* Found some forums? */ if (count($ids)) { /* Total Posts Today */ /*$total_today = $this->DB->buildAndFetch( array( 'select' => 'count(*) as cnt', 'from' => array( 'posts' => 'p' ), 'where' => "p.post_date > {$time_low} AND t.forum_id IN(" . implode( ",", $ids ) . ")", 'add_join' => array( array( 'from' => array( 'topics' => 't' ), 'where' => 't.tid=p.topic_id', 'type' => 'left' ) ) ) );*/ /* Query the top posters */ $this->DB->build(array('select' => 'COUNT(*) as tpost', 'from' => array('posts' => 'p'), 'where' => "p.post_date > {$time_low} AND t.forum_id IN(" . implode(",", $ids) . ")", 'group' => 'p.author_id', 'order' => 'tpost DESC', 'limit' => array(0, 9), 'add_join' => array(array('from' => array('topics' => 't'), 'where' => 't.tid=p.topic_id', 'type' => 'left'), array('select' => 'm.*', 'from' => array('members' => 'm'), 'where' => 'm.member_id=p.author_id', 'type' => 'left'), array('select' => 'pp.*', 'from' => array('profile_portal' => 'pp'), 'where' => 'pp.pp_member_id=m.member_id', 'type' => 'left')))); $this->DB->execute(); /* Loop through and save the members */ while ($r = $this->DB->fetch()) { $todays_posts += $r['tpost']; $store[] = $r; } /* Format the results for output */ if ($todays_posts) { foreach ($store as $info) { $info['total_today_posts'] = $todays_posts; if ($todays_posts > 0 and $info['tpost'] > 0) { //$info['today_pct'] = sprintf( '%.2f', ( $info['tpost'] / $total_today['cnt'] ) * 100 ); } $rows[] = IPSMember::buildDisplayData($info); } } } return $this->registry->getClass('output')->getTemplate('boards')->hookTopPosters($rows); }
/** * Checks to see if the specified member group can view ads * * @access public * * @param integer $group_id Group to check * @return bool */ public function userCanViewAds() { /* Check to see if the system is globally disabled */ if (!ipsRegistry::$settings['ad_code_global_enabled']) { return false; } /* Check to see if this member group can view ads */ if (ipsRegistry::$settings['ad_code_exempt_groups']) { if (IPSMember::isInGroup(ipsRegistry::member()->fetchMemberData(), explode(',', ipsRegistry::$settings['ad_code_exempt_groups']))) { return false; } } return true; }
/** * Class entry point * * @param object Registry reference * @return @e void [Outputs to screen/redirects] */ public function doExecute(ipsRegistry $registry) { //----------------------------------------- // INIT //----------------------------------------- $info = array(); $id = intval($this->request['id']); //----------------------------------------- // Get HTML and skin //----------------------------------------- $this->registry->class_localization->loadLanguageFile(array('public_profile'), 'members'); //----------------------------------------- // Can we access? //----------------------------------------- if (!$this->memberData['g_mem_info']) { $this->registry->output->showError('dname_profiles_off', 10233.22, null, null, 403); } if (!$this->settings['auth_allow_dnames']) { $this->registry->output->showError('dnames_off', 10234, null, null, 403); } if (!$id) { $this->registry->output->showError('dnames_no_id', 10235, null, null, 404); } $member = IPSMember::load($id); //----------------------------------------- // Get Dname history //----------------------------------------- $this->DB->build(array('select' => 'd.*', 'from' => array('dnames_change' => 'd'), 'where' => 'dname_member_id=' . $id, 'add_join' => array(0 => array('select' => 'm.members_display_name', 'from' => array('members' => 'm'), 'where' => 'm.member_id=d.dname_member_id', 'type' => 'inner')), 'order' => 'dname_date DESC')); $this->DB->execute(); while ($row = $this->DB->fetch()) { $records[] = $row; } /* Stop Google indexing soft 404s */ if (!count($records) && !$this->memberData['member_id']) { $this->registry->output->showError('404_soft', 10235.1, null, null, 404); } //----------------------------------------- // Print the pop-up window //----------------------------------------- $html = $this->registry->getClass('output')->getTemplate('profile')->dnameWrapper($member['members_display_name'], $records); //----------------------------------------- // Push to print handler //----------------------------------------- $this->registry->getClass('output')->setTitle($this->lang->words['dname_title'] . ' - ' . ipsRegistry::$settings['board_name']); $this->registry->getClass('output')->addNavigation($this->lang->words['dname_title'], ''); $this->registry->getClass('output')->addContent($html); $this->registry->output->sendOutput(); }
function boardIndexTemplate($lastvisit = "", $stats = array(), $cat_data = array(), $show_side_blocks = true, $side_blocks = array()) { $IPBHTML = ""; if (IPSLib::locationHasHooks('skin_boards', $this->_funcHooks['boardIndexTemplate'])) { $count_d79a4680f047b95f9c696f93b859d2a2 = is_array($this->functionData['boardIndexTemplate']) ? count($this->functionData['boardIndexTemplate']) : 0; $this->functionData['boardIndexTemplate'][$count_d79a4680f047b95f9c696f93b859d2a2]['lastvisit'] = $lastvisit; $this->functionData['boardIndexTemplate'][$count_d79a4680f047b95f9c696f93b859d2a2]['stats'] = $stats; $this->functionData['boardIndexTemplate'][$count_d79a4680f047b95f9c696f93b859d2a2]['cat_data'] = $cat_data; $this->functionData['boardIndexTemplate'][$count_d79a4680f047b95f9c696f93b859d2a2]['show_side_blocks'] = $show_side_blocks; $this->functionData['boardIndexTemplate'][$count_d79a4680f047b95f9c696f93b859d2a2]['side_blocks'] = $side_blocks; } $this->templateVars['sidebar_enabled'] = "{$show_side_blocks}"; $this->__default__templateVars['sidebar_enabled'] = "{$show_side_blocks}"; $IPBHTML .= "" . $this->registry->getClass('output')->addJSModule("board", "0") . "" . (true ? "" : "") . "\r\n<div id='board_index' class='ipsLayout " . ($this->templateVars['sidebar_enabled'] ? "ipsLayout_withright" : "") . " ipsLayout_largeright clearfix " . (IPSCookie::get('hide_sidebar') == '1' ? "no_sidebar" : "") . "'>\t\r\n\t<div id='categories' class='ipsLayout_content clearfix'>\r\n\t<!-- CATS AND FORUMS -->\r\n\t\t" . ((is_array($cat_data) and count($cat_data)) ? "\r\n\t\t\t" . $this->__f__f3046b4671aec0807f8ac620415036a8($lastvisit, $stats, $cat_data, $show_side_blocks, $side_blocks) . "\t\t" : "") . "\r\n\t</div>\r\n\t" . ($this->templateVars['sidebar_enabled'] ? "<div id='index_stats' class='ipsLayout_right clearfix' " . (IPSCookie::get('hide_sidebar') == '1' ? "style='display: none'" : "") . ">\r\n\t\t\t" . $this->__f__89030e7582e797890a67a50f095f2544($lastvisit, $stats, $cat_data, $show_side_blocks, $side_blocks) . "\t\t</div>\r\n\t\t<a href='#' id='toggle_sidebar' title='{$this->lang->words['toggle_sidebar']}' data-closed=\"{$this->lang->words['_laquo']}\" data-open=\"×\"> </a>" : "") . "\r\n</div>\r\n<script type='text/javascript'>\r\n//<![CDATA[\r\n\tvar markerURL = ipb.vars['base_url'] + \"app=forums&module=ajax§ion=markasread&i=1\"; // Ajax URL so don't use &\r\n\tvar unreadIcon = \"<img src='{$this->settings['img_url']}/f_icon_read.png' />\";\r\n\t\r\n\t" . ((is_array($cat_data) and count($cat_data)) ? "\r\n\t\t" . $this->__f__2d7df5c3f0ad6083957d5ca77bafc27f($lastvisit, $stats, $cat_data, $show_side_blocks, $side_blocks) . "\t" : "") . "\r\n//]]>\r\n</script>\r\n" . ($this->settings['show_totals'] ? "\r\n\t<div id='board_stats'>\t\t\r\n\t\t<ul class='ipsType_small ipsList_inline'>\r\n\t\t\t<li class='clear'>\r\n\t\t\t\t<span class='value'>{$stats['info']['total_posts']}</span>\r\n\t\t\t\t{$this->lang->words['total_posts']}\r\n\t\t\t</li>\r\n\t\t\t<li class='clear'>\r\n\t\t\t\t<span class='value'>{$stats['info']['mem_count']}</span>\r\n\t\t\t\t{$this->lang->words['total_members']}\r\n\t\t\t</li>\r\n\t\t\t<li class='clear'>\r\n\t\t\t\t" . IPSMember::makeProfileLink($stats['info']['last_mem_name'], $stats['info']['last_mem_id'], $stats['info']['last_mem_seo'], 'value') . "\r\n\t\t\t\t{$this->lang->words['newest_member']}\r\n\t\t\t</li>\r\n\t\t\t<li class='clear' data-tooltip=\"{$stats['info']['most_time']}\">\r\n\t\t\t\t<span class='value'>{$stats['info']['most_online']}</span>\r\n\t\t\t\t{$this->lang->words['online_at_once']}\r\n\t\t\t</li>\r\n\t\t</ul>\r\n\t</div>\r\n" : "") . "\r\n<div id='board_statistics' class='statistics clearfix'>\r\n\t<ul id='stat_links' class='ipsList_inline right ipsType_small'>\r\n\t\t" . (1 == 1 ? "<!-- Hook point -->\r\n\t\t\t<li><a href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=forums&module=extras&section=stats&do=leaders", "public", ''), "", "") . "\" title=\"{$this->lang->words['sm_forum_leaders_title']}\">{$this->lang->words['sm_forum_leaders']}</a></li>\r\n\t\t\t<li><a href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=forums&module=extras&section=stats", "public", ''), "", "") . "\" title=\"{$this->lang->words['sm_all_posters_title']}\">{$this->lang->words['sm_today_posters']}</a></li>\r\n\t\t\t<li><a href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=members&module=list&max_results=20&sort_key=posts&sort_order=desc&filter=ALL", "public", ''), "false", "") . "\" title=\"{$this->lang->words['sm_overall_posters_title']}\">{$this->lang->words['sm_overall_posters']}</a></li>\r\n\t\t\t" . ($this->settings['reputation_enabled'] ? "<li>\r\n\t\t\t\t\t<a href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=members&module=reputation&section=most", "public", ''), "most_liked", "most_liked") . "\" title=\"" . ($this->settings['reputation_point_types'] == 'like' ? "{$this->lang->words['most_rep_likes']}" : "{$this->lang->words['most_rep_rep']}") . "\">\r\n\t\t\t\t\t\t" . ($this->settings['reputation_point_types'] == 'like' ? "\r\n\t\t\t\t\t\t\t{$this->lang->words['most_rep_likes']}\r\n\t\t\t\t\t\t" : "\r\n\t\t\t\t\t\t\t{$this->lang->words['most_rep_rep']}\r\n\t\t\t\t\t\t") . "\r\n\t\t\t\t\t</a>\r\n\t\t\t\t</li>" : "") . "" : "") . "\r\n\t</ul>\r\n\t\r\n\t" . ($this->settings['show_active'] && $this->memberData['gbw_view_online_lists'] ? "<h4 class='statistics_head'>" . sprintf($this->lang->words['online_right_now'], $stats['TOTAL']) . " {$this->lang->words['active_users']}</h4>\r\n\t\t<p class='statistics_brief desc'>\r\n\t\t\t" . sprintf($this->lang->words['active_users_detail'], $stats['MEMBERS'], $stats['GUESTS'], $stats['ANON']) . "\r\n\t\t\t" . ($this->settings['allow_online_list'] ? " <a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=members&module=online&sort_order=desc", "public", ''), "", "") . "' title='{$this->lang->words['online_link']}'>({$this->lang->words['online_link']})</a>" : "") . "\r\n\t\t</p>" : "") . "\r\n\t" . (count($stats['NAMES']) && $this->settings['show_active'] ? "\r\n\t\t<br />\r\n\t\t<p>\r\n\t\t\t<span class='name'>" . implode(",</span> <span class='name'>", $stats['NAMES']) . "</span>\r\n\t\t</p>\r\n\t" : "") . "\r\n</div>"; return $IPBHTML; }
function boardIndexTemplate($lastvisit = "", $stats = array(), $cat_data = array(), $show_side_blocks = true, $side_blocks = array()) { $IPBHTML = ""; if (IPSLib::locationHasHooks('skin_boards', $this->_funcHooks['boardIndexTemplate'])) { $count_3caeb9bb43000ee1df74d49ffc12eae7 = is_array($this->functionData['boardIndexTemplate']) ? count($this->functionData['boardIndexTemplate']) : 0; $this->functionData['boardIndexTemplate'][$count_3caeb9bb43000ee1df74d49ffc12eae7]['lastvisit'] = $lastvisit; $this->functionData['boardIndexTemplate'][$count_3caeb9bb43000ee1df74d49ffc12eae7]['stats'] = $stats; $this->functionData['boardIndexTemplate'][$count_3caeb9bb43000ee1df74d49ffc12eae7]['cat_data'] = $cat_data; $this->functionData['boardIndexTemplate'][$count_3caeb9bb43000ee1df74d49ffc12eae7]['show_side_blocks'] = $show_side_blocks; $this->functionData['boardIndexTemplate'][$count_3caeb9bb43000ee1df74d49ffc12eae7]['side_blocks'] = $side_blocks; } $this->templateVars['sidebar_enabled'] = "{$show_side_blocks}"; $this->__default__templateVars['sidebar_enabled'] = "{$show_side_blocks}"; $IPBHTML .= "" . (($this->settings['hoverDescriptions'] = 'no') ? "" : "") . "\n" . (($this->settings['removeStatsColumn'] = 'no') ? "" : "") . "\n" . (($this->settings['customForumIcons'] = 'no') ? "" : "") . "\n" . (($this->settings['clickableRows'] = 'yes') ? "" : "") . "" . $this->registry->getClass('output')->addJSModule("board", "0") . "" . (true ? "" : "") . "\n<div id='board_index' class='ipsLayout " . ($this->templateVars['sidebar_enabled'] ? "ipsLayout_withleft" : "") . " ipsLayout_largeleft clearfix " . (IPSCookie::get('hide_sidebar') == '1' ? "no_sidebar" : "") . "'>\n\t" . ($this->templateVars['sidebar_enabled'] ? "<div id='index_stats' class='ipsLayout_left clearfix' " . (IPSCookie::get('hide_sidebar') == '1' ? "style='display: none'" : "") . ">\n" . ($this->settings['show_totals'] ? "\n <div class='ipsSideBlock clearfix'>\n <h3><span class='icon icon-span-text icon-block'></span>Статистика форума</h3>\n <div class='_sbcollapsable'>\n <ul class='ipsList_data csoStatistics clearfix'>\n <li class='clearfix'>\n <span class='value right'>" . $this->registry->getClass('class_localization')->formatNumber($this->caches['stats']['total_topics']) . "</span>\n <span class='label left'><i class=\"fa fa-comment\"></i> Всего тем</span>\n </li>\n <li class='clearfix'>\n <span class='value right'>{$stats['info']['total_posts']}</span>\n <span class='label left'><i class=\"fa fa-pencil-square-o\"></i> {$this->lang->words['total_posts']}</span>\n </li>\n <li class='clearfix'>\n <span class='value right'>{$stats['info']['mem_count']}</span>\n <span class='label left'><i class=\"fa fa-users\"></i> {$this->lang->words['total_members']}</span>\n </li>\n <li class='clearfix'>\n <span class='value right '>" . IPSMember::makeProfileLink($stats['info']['last_mem_name'], $stats['info']['last_mem_id'], $stats['info']['last_mem_seo'], 'value') . "</span>\n <span class='label left'><i class=\"fa fa-user\"></i> {$this->lang->words['newest_member']}</span>\n </li>\n <li class='clearfix' data-tooltip='{$stats['info']['most_time']}'>\n <span class='value right'>{$stats['info']['most_online']}</span>\n <span class='label left'><i class=\"fa fa-signal\"></i> {$this->lang->words['online_at_once']}</span>\n </li> \n </ul>\n </div>\n </div>\n" : "") . "\n\t\t\t" . $this->__f__b29a9c9cce830e12603033197489dc70($lastvisit, $stats, $cat_data, $show_side_blocks, $side_blocks) . "\t\t</div>\n\t\t<a href='#' id='toggle_sidebar' title='{$this->lang->words['toggle_sidebar']}' data-closed=\"{$this->lang->words['_laquo']}\" data-open=\"×\"> </a>" : "") . "\n\t<div id='categories' class='ipsLayout_content clearfix'>\n\t<!-- CATS AND FORUMS -->\n\t\t" . ((is_array($cat_data) and count($cat_data)) ? "\n\t\t\t" . $this->__f__5147475eaba97cbcedc3e8701382c4a7($lastvisit, $stats, $cat_data, $show_side_blocks, $side_blocks) . "\t\t" : "") . "\n\t</div>\n</div>\n<script type='text/javascript'>\n//<![CDATA[\n\tvar markerURL = ipb.vars['base_url'] + \"app=forums&module=ajax§ion=markasread&i=1\"; // Ajax URL so don't use &\n\tvar unreadIcon = \"<img src='{$this->settings['img_url']}/f_icon_read.png' />\";\n\t\n\t" . ((is_array($cat_data) and count($cat_data)) ? "\n\t\t" . $this->__f__a75b64ad1448186d22b780ae5692d94a($lastvisit, $stats, $cat_data, $show_side_blocks, $side_blocks) . "\t" : "") . "\n//]]>\n</script>\n<div id='board_statistics' class='statistics clearfix'>\n\t<h4 class='statistics_head clearfix'><ul id='stat_links' class='ipsList_inline right ipsType_small'>\n\t\t" . (1 == 1 ? "<!-- Hook point -->\n\t\t\t<li><a href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=forums&module=extras&section=stats&do=leaders", "public", ''), "", "") . "\" title=\"{$this->lang->words['sm_forum_leaders_title']}\">{$this->lang->words['sm_forum_leaders']}</a></li>\n\t\t\t<li><a href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=forums&module=extras&section=stats", "public", ''), "", "") . "\" title=\"{$this->lang->words['sm_all_posters_title']}\">{$this->lang->words['sm_today_posters']}</a></li>\n\t\t\t<li><a href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=members&module=list&max_results=20&sort_key=posts&sort_order=desc&filter=ALL", "public", ''), "false", "") . "\" title=\"{$this->lang->words['sm_overall_posters_title']}\">{$this->lang->words['sm_overall_posters']}</a></li>\n " . ($this->settings['reputation_enabled'] ? "<li>\n <a href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=members&module=reputation&section=most", "public", ''), "most_liked", "most_liked") . "\" title=\"" . ($this->settings['reputation_point_types'] == 'like' ? "{$this->lang->words['most_rep_likes']}" : "{$this->lang->words['most_rep_rep']}") . "\">\n " . ($this->settings['reputation_point_types'] == 'like' ? "\n {$this->lang->words['most_rep_likes']}\n " : "\n {$this->lang->words['most_rep_rep']}\n ") . "\n </a>\n </li>" : "") . "" : "") . "\n\t</ul>\n" . ($this->settings['show_active'] && $this->memberData['gbw_view_online_lists'] ? "" . sprintf($this->lang->words['online_right_now'], $stats['TOTAL']) . " {$this->lang->words['active_users']}" : "") . "</h4>\n\t" . ($this->settings['show_active'] ? "<p class='statistics_brief desc'>\n\t\t" . sprintf($this->lang->words['active_users_detail'], $stats['MEMBERS'], $stats['GUESTS'], $stats['ANON']) . "\n\t\t" . ($this->settings['allow_online_list'] ? " <a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=members&module=online&sort_order=desc", "public", ''), "", "") . "' title='{$this->lang->words['online_link']}'>({$this->lang->words['online_link']})</a>" : "") . "\n\t</p>" : "") . "\n\t\n\t" . (count($stats['NAMES']) && $this->settings['show_active'] ? "\n\t\t<br />\n\t\t<p>\n\t\t\t<span class='name'>" . implode(",</span> <span class='name'>", $stats['NAMES']) . "</span>\t\t\t\t\t\n\t\t</p>\n\t" : "") . "\n</div>"; return $IPBHTML; }
/** * Main class entry point * * @param object ipsRegistry reference * @return @e void [Outputs to screen] */ public function doExecute(ipsRegistry $registry) { //----------------------------------------- // Get member data and format //----------------------------------------- $user = intval($this->request['user']); $id = intval($this->request['id']); if (!$user) { $this->returnString("no"); } if ($id) { $member = IPSMember::buildDisplayData(IPSMember::load($id)); } else { $member = IPSMember::buildDisplayData(IPSMember::setUpGuest($this->lang->words['global_guestname'] . "_" . $user)); } //----------------------------------------- // Mod permissions //----------------------------------------- $my_groups = array($this->memberData['member_group_id']); if ($this->memberData['mgroup_others']) { $my_groups = array_merge($my_groups, explode(",", IPSText::cleanPermString($this->memberData['mgroup_others']))); } $permissions = 0; $private = 0; if ($this->settings['ipschat_mods']) { $mod_groups = explode(",", $this->settings['ipschat_mods']); foreach ($my_groups as $group_id) { if (in_array($group_id, $mod_groups)) { $permissions = 1; break; } } } if ($this->settings['ipschat_private']) { $mod_groups = explode(",", $this->settings['ipschat_private']); foreach ($my_groups as $group_id) { if (in_array($group_id, $mod_groups)) { $private = 1; break; } } } //----------------------------------------- // Return output //----------------------------------------- $this->returnJsonArray(array('html' => ipsRegistry::getClass('output')->replaceMacros($this->registry->getClass('output')->getTemplate('ipchat')->ajaxNewUser(array('user_id' => $user, 'moderator' => $permissions, 'private' => $private, 'member' => $member))), 'prefix' => $this->settings['ipschat_format_names'] ? str_replace('"', '__DBQ__', $member['prefix']) : '', 'suffix' => $this->settings['ipschat_format_names'] ? str_replace('"', '__DBQ__', $member['suffix']) : '', 'pp_small_photo' => $member['pp_small_photo'], 'name' => $member['members_display_name'], '_canBeIgnored' => $member['member_id'] ? $member['_canBeIgnored'] : 1, 'g_id' => $member['g_id'])); }
/** * Class entry point * * @param object Registry reference * @return @e void [Outputs to screen] */ public function doExecute(ipsRegistry $registry) { //----------------------------------------- // Can we access? //----------------------------------------- if (!$this->memberData['g_mem_info']) { $this->returnString('error'); } $this->registry->class_localization->loadLanguageFile(array('public_profile', 'public_online'), 'members'); /* Got a valid member? */ $member_id = intval($this->request['mid']); if (empty($member_id)) { $this->returnString('error'); } $member = IPSMember::load($member_id, 'profile_portal,pfields_content,sessions,groups,basic', 'id'); if (empty($member['member_id'])) { $this->returnString('error'); } $member = IPSMember::buildDisplayData($member, array('customFields' => 1, 'cfSkinGroup' => 'profile', 'spamStatus' => 1)); $member = IPSMember::getLocation($member); $board_posts = $this->caches['stats']['total_topics'] + $this->caches['stats']['total_replies']; 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']); /* Load status class */ if (!$this->registry->isClassLoaded('memberStatus')) { $classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/classes/member/status.php', 'memberStatus'); $this->registry->setClass('memberStatus', new $classToLoad(ipsRegistry::instance())); } /* Fetch */ $member['_status'] = $this->registry->getClass('memberStatus')->fetch($this->memberData, array('member_id' => $member['member_id'], 'limit' => 1)); if (is_array($member['_status']) and count($member['_status'])) { $member['_status'] = array_pop($member['_status']); } /* Reputation */ if ($this->settings['reputation_protected_groups']) { if (in_array($member['member_group_id'], explode(",", $this->settings['reputation_protected_groups']))) { $this->settings['reputation_show_profile'] = false; } } $this->returnHtml($this->registry->getClass('output')->getTemplate('profile')->showCard($member)); }
/** * Feturn HTML block * * @param array Member information * @return string HTML block */ public function return_html_block($member = array()) { //----------------------------------------- // Got a member? //----------------------------------------- if (!is_array($member) or !count($member)) { return $this->registry->getClass('output')->getTemplate('profile')->tabNoContent('err_no_aboutme_to_show'); } $friends = array(); //----------------------------------------- // Grab the friends //----------------------------------------- /* How many friends do we have? */ $count = $this->DB->buildAndFetch(array('select' => 'count(*) as dracula', 'from' => 'profile_friends', 'where' => 'friends_member_id=' . $member['member_id'] . ' AND friends_approved=1')); /* Sort out pagination */ $st = intval($this->request['st']) >= 0 ? intval($this->request['st']) : 0; $pagination = $this->registry->output->generatePagination(array('totalItems' => $count['dracula'], 'itemsPerPage' => self::FRIENDS_PER_PAGE, 'currentStartValue' => $st, 'baseUrl' => "showuser={$member['member_id']}&tab=friends", 'seoTemplate' => 'showuser', 'seoTitle' => $member['members_seo_name'])); /* Get em! */ $queryData = array('select' => 'f.*', 'from' => array('profile_friends' => 'f'), 'where' => 'f.friends_member_id=' . $member['member_id'] . ' AND f.friends_approved=1 AND m.member_banned=0 AND ( ! ' . IPSBWOptions::sql('bw_is_spammer', 'members_bitoptions', 'members', 'global', 'has') . ')', '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'))); // Ordering is bad because it causes a filesort, but if they have more than 100 members, we're going to have // to order so we can paginate if ($count['dracula'] > self::FRIENDS_PER_PAGE) { $queryData['order'] = 'm.members_display_name'; $queryData['limit'] = array($st, self::FRIENDS_PER_PAGE); } $this->DB->build($queryData); $outer = $this->DB->execute(); //----------------------------------------- // Get and store... //----------------------------------------- while ($row = $this->DB->fetch($outer)) { if ($row['member_id']) { $friends[IPSText::mbstrtolower($row['members_display_name'])] = IPSMember::buildDisplayData($row, 0); } } ksort($friends); $content = $this->registry->getClass('output')->getTemplate('profile')->tabFriends($friends, $member, $pagination); //----------------------------------------- // Macros... //----------------------------------------- $content = $this->registry->output->replaceMacros($content); //----------------------------------------- // Return content.. //----------------------------------------- return $content ? $content : $this->registry->getClass('output')->getTemplate('profile')->tabNoContent('err_no_aboutme_to_show'); }
/** * Create admin account * * @access public * @return @e void */ public static function createAdminAccount() { /* Build Entry */ $_mke_time = ipsRegistry::$settings['login_key_expire'] ? time() + intval(ipsRegistry::$settings['login_key_expire']) * 86400 : 0; $salt = IPSMember::generatePasswordSalt(5); $passhash = IPSMember::generateCompiledPasshash($salt, md5(IPSSetUp::getSavedData('admin_pass'))); $_dname = IPSSetUp::getSavedData('admin_user'); $member = array('name' => $_dname, 'members_l_username' => strtolower($_dname), 'members_display_name' => $_dname, 'members_l_display_name' => strtolower($_dname), 'members_seo_name' => IPSText::makeSeoTitle($_dname), 'member_login_key' => IPSMember::generateAutoLoginKey(), 'member_login_key_expire' => $_mke_time, 'title' => 'Administrator', 'email' => IPSSetUp::getSavedData('admin_email'), 'member_group_id' => 4, 'posts' => 1, 'joined' => time(), 'last_visit' => time(), 'last_activity' => time(), 'ip_address' => my_getenv('REMOTE_ADDR'), 'view_sigs' => 1, 'restrict_post' => 0, 'msg_show_notification' => 1, 'msg_count_total' => 0, 'msg_count_new' => 0, 'coppa_user' => 0, 'language' => IPSLib::getDefaultLanguage(), 'members_auto_dst' => 1, 'member_uploader' => 'flash', 'allow_admin_mails' => 0, 'members_pass_hash' => $passhash, 'members_pass_salt' => $salt, 'has_blog' => '', 'fb_token' => '', 'ignored_users' => '', 'members_cache' => '', 'failed_logins' => '', 'bday_day' => 0, 'bday_month' => 0, 'bday_year' => 0); /* Insert: MEMBERS */ ipsRegistry::DB()->setDataType(array('name', 'members_display_name', 'members_l_username', 'members_l_display_name'), 'string'); ipsRegistry::DB()->insert('members', $member); $member_id = ipsRegistry::DB()->getInsertId(); $member['member_id'] = $member_id; /* Insert into the custom profile fields DB */ ipsRegistry::DB()->insert('pfields_content', array('member_id' => $member_id)); /* Insert into pp */ ipsRegistry::DB()->insert('profile_portal', array('pp_member_id' => $member_id, 'pp_setting_count_friends' => 1, 'signature' => '', 'pconversation_filters' => '', 'pp_setting_count_comments' => 1, 'pp_setting_count_visitors' => 1)); }