本文整理匯總了PHP中IPSMember::fetchSeoName方法的典型用法代碼示例。如果您正苦於以下問題:PHP IPSMember::fetchSeoName方法的具體用法?PHP IPSMember::fetchSeoName怎麽用?PHP IPSMember::fetchSeoName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類IPSMember
的用法示例。
在下文中一共展示了IPSMember::fetchSeoName方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: doExecute
//.........這裏部分代碼省略.........
//-----------------------------------------
if ($pp_rating_real) {
$_queryPP = true;
$query[] = "pp.pp_rating_real > " . $pp_rating_real;
$url['pp_rating_real'] = "pp_rating_real=" . $pp_rating_real;
}
//-----------------------------------------
// Finish query
//-----------------------------------------
//$query[] = "m.members_l_display_name != ''";
$joins = array();
if ($_queryPP) {
$joins[] = array('from' => array('pfields_content' => 'p'), 'where' => 'p.member_id=m.member_id', 'type' => 'left');
$joins[] = array('from' => array('profile_portal' => 'pp'), 'where' => 'pp.pp_member_id=m.member_id', 'type' => 'left');
}
//-----------------------------------------
// Reputation
//-----------------------------------------
if (!ipsRegistry::isClassLoaded('repCache')) {
$classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/classes/class_reputation_cache.php', 'classReputationCache');
ipsRegistry::setClass('repCache', new $classToLoad());
}
//-----------------------------------------
// START THE LISTING
//-----------------------------------------
$notInMembers = 0;
foreach ($query as $q) {
if (!strstr($q, 'm.')) {
$notInMembers++;
}
}
/* Get the count */
if ($notInMembers > 0 or $this->sort_key != 'members_l_display_name' or $this->request['request_method'] == 'post') {
$_max = $this->DB->buildAndFetch(array('select' => 'COUNT( * ) as cnt', 'from' => array('members' => 'm'), 'where' => implode(" AND ", $query), 'add_join' => $joins));
$this->DB->build(array('select' => ' m.member_id', 'from' => array('members' => 'm'), 'where' => implode(" AND ", $query), 'order' => 'm.' . $this->sort_key . ' ' . $this->sort_order, 'limit' => array($this->first, $this->max_results), 'add_join' => $joins));
} else {
$_max = $this->DB->buildAndFetch(array('select' => 'COUNT( * ) as cnt', 'from' => 'members m', 'where' => implode(" AND ", $query)));
$this->DB->build(array('select' => 'm.member_id', 'from' => array('members' => 'm'), 'where' => implode(" AND ", $query), 'order' => 'm.' . $this->sort_key . ' ' . $this->sort_order, 'limit' => array($this->first, $this->max_results)));
}
/* Fetch IDs */
$mids = array();
$this->DB->execute();
while ($m = $this->DB->fetch()) {
if ($m['member_id']) {
$mids[] = $m['member_id'];
}
}
if (count($mids)) {
$members = array();
$_members = IPSMember::load($mids, 'all');
/* Make sure that we keep the ordering from the query */
foreach ($mids as $id) {
$members[$id] = $_members[$id];
}
}
$max = $_max['cnt'];
if (is_array($members) and count($members)) {
foreach ($members as $id => $member) {
/* Damn SQL thing with member_id */
if (!$member['member_id']) {
$member['member_id'] = $member['member_table_id'];
}
$member['members_display_name'] = $member['members_display_name'] ? $member['members_display_name'] : $member['name'];
$member['members_seo_name'] = IPSMember::fetchSeoName($member);
$member['group'] = $this->mem_groups[$member['member_group_id']]['TITLE'];
$member = IPSMember::buildProfilePhoto($member);
$member['pp_reputation_points'] = $member['pp_reputation_points'] ? $member['pp_reputation_points'] : 0;
$member['author_reputation'] = ipsRegistry::getClass('repCache')->getReputation($member['pp_reputation_points']);
/* Reputation */
if ($this->settings['reputation_protected_groups']) {
if (in_array($member['member_group_id'], explode(",", $this->settings['reputation_protected_groups']))) {
$member['pp_reputation_points'] = null;
$member['author_reputation'] = null;
}
}
$the_members[] = $member;
}
}
/* make sure URL doesn't contain empty params */
$_url = $url;
$url = array();
foreach ($_url as $key => $bit) {
if (strrpos($bit, '=') + 1 == strlen($bit)) {
continue;
}
$url[] = $bit;
}
$pages = $this->registry->output->generatePagination(array('totalItems' => $max, 'itemsPerPage' => $this->max_results, 'currentStartValue' => $this->first, 'seoTitle' => "false", 'seoTemplate' => 'members_list', 'baseUrl' => implode('&', $url)));
//-----------------------------------------
// Print...
//-----------------------------------------
$this->output .= $this->registry->getClass('output')->getTemplate('mlist')->member_list_show($the_members, $pages, $dropdowns, $defaults, $this->custom_fields, implode('&', $url));
//-----------------------------------------
// Push to print handler
//-----------------------------------------
$this->registry->output->addContent($this->output);
$this->registry->output->setTitle($this->lang->words['page_title'] . ' - ' . ipsRegistry::$settings['board_name']);
$this->registry->output->addNavigation($this->lang->words['page_title'], 'app=members', "false", 'members_list');
$this->registry->output->sendOutput();
}
示例2: _createMemberSession
/**
* Create a member session
*
* @access protected
* @return boolean Created successfully
*/
protected function _createMemberSession()
{
if (self::$data_store['member_id']) {
//-----------------------------------------
// Remove the defunct sessions
//-----------------------------------------
$this->_destroySessions("member_id=" . self::$data_store['member_id']);
$this->session_id = md5(uniqid(microtime(), true) . $this->_member->ip_address . $this->_userAgent);
//-----------------------------------------
// Get module settings
//-----------------------------------------
$vars = $this->_getLocationSettings();
//-----------------------------------------
// Still update?
//-----------------------------------------
if (!$this->do_update) {
return false;
}
IPSDebug::addMessage("Creating MEMBER session: " . $this->session_id);
//-----------------------------------------
// Get useragent stuff
//-----------------------------------------
$uAgent = $this->_processUserAgent('create');
//-----------------------------------------
// Insert the new session
//-----------------------------------------
$data = array('id' => $this->session_id, 'member_name' => self::$data_store['members_display_name'], 'seo_name' => IPSMember::fetchSeoName(self::$data_store), 'member_id' => intval(self::$data_store['member_id']), 'member_group' => self::$data_store['member_group_id'], 'login_type' => intval(substr(self::$data_store['login_anonymous'], 0, 1)), 'running_time' => IPS_UNIX_TIME_NOW, 'ip_address' => $this->_member->ip_address, 'browser' => $this->_userAgent, 'location' => isset($vars['location']) ? $vars['location'] : '', 'in_error' => 0, 'current_appcomponent' => $this->current_appcomponent, 'current_module' => $this->current_module, 'current_section' => $this->current_section, 'location_1_type' => isset($vars['location_1_type']) ? $vars['location_1_type'] : '', 'location_1_id' => isset($vars['location_1_id']) ? intval($vars['location_1_id']) : 0, 'location_2_type' => isset($vars['location_2_type']) ? $vars['location_2_type'] : '', 'location_2_id' => isset($vars['location_2_id']) ? intval($vars['location_2_id']) : 0, 'location_3_type' => isset($vars['location_3_type']) ? $vars['location_3_type'] : '', 'location_3_id' => isset($vars['location_3_id']) ? intval($vars['location_3_id']) : 0, 'uagent_key' => $uAgent['uagent_key'], 'uagent_version' => $uAgent['uagent_version'], 'uagent_type' => $uAgent['uagent_type'], 'uagent_bypass' => intval($uAgent['uagent_bypass']));
$this->DB->force_data_type = array('member_name' => 'string');
$this->DB->insert('sessions', $data, true);
//-----------------------------------------
// Force data
//-----------------------------------------
$this->session_data = array('uagent_key' => $uAgent['uagent_key'], 'uagent_version' => $uAgent['uagent_version'], 'uagent_type' => $uAgent['uagent_type'], 'uagent_bypass' => $uAgent['uagent_bypass'], 'id' => $data['id']);
//-----------------------------------------
// If this is a member, update their last visit times, etc.
//-----------------------------------------
if (time() - self::$data_store['last_activity'] > $this->settings['session_expiration']) {
//-----------------------------------------
// Reset the topics read cookie..
//-----------------------------------------
list($be_anon, $loggedin) = explode('&', self::$data_store['login_anonymous']);
$update = array('login_anonymous' => "{$be_anon}&1", 'last_visit' => self::$data_store['last_activity'], 'last_activity' => IPS_UNIX_TIME_NOW);
//-----------------------------------------
// Fix up the last visit/activity times.
//-----------------------------------------
self::$data_store['last_visit'] = self::$data_store['last_activity'];
self::$data_store['last_activity'] = time();
}
IPSCookie::set("pass_hash", self::$data_store['member_login_key'], $this->settings['login_key_expire'] ? 0 : 1, $this->settings['login_key_expire']);
$update['member_login_key_expire'] = time() + $this->settings['login_key_expire'] * 86400;
IPSMember::save(self::$data_store['member_id'], array('core' => $update));
} else {
$this->_createGuestSession();
}
/* Before this function is called, a guest is set up via ipsRegistry::setMember(0)
We want to override this now to provide search engine settings for the 'member' */
if ($uAgent['uagent_type'] == 'search') {
self::setSearchEngine($uAgent);
/* Reset some data */
$this->session_type = 'cookie';
$this->session_id = "";
}
/* Set type */
self::$data_store['_sessionType'] = 'create';
return true;
}
示例3: finalizePublicMember
/**
* Finalize public member
*
* Now that everything has loaded, lets do the final set up
*
* @return @e void
*/
public static function finalizePublicMember()
{
/* Build profile picture */
self::$data_store = IPSMember::buildProfilePhoto(self::$data_store);
/* SEO Name */
if (!self::$data_store['members_seo_name']) {
self::$data_store['members_seo_name'] = IPSMember::fetchSeoName(self::$data_store);
}
/* Rebuild messenger count if triggered */
if (self::$data_store['msg_count_reset']) {
/* Just instantiating the class will perform reset */
$classToLoad = IPSLib::loadLibrary(IPSLib::getAppDir('members') . '/sources/classes/messaging/messengerFunctions.php', 'messengerFunctions', 'members');
$messenger = new $classToLoad(ipsRegistry::instance());
}
}
示例4: _createMemberSession
/**
* Create a member session
*
* @access protected
* @return boolean Created successfully
*/
protected function _createMemberSession()
{
if (self::$data_store['member_id']) {
//-----------------------------------------
// Remove the defunct sessions
//-----------------------------------------
$this->_destroySessions("member_id=" . self::$data_store['member_id']);
$this->session_id = md5(uniqid(microtime(), true) . $this->_member->ip_address . $this->_userAgent);
//-----------------------------------------
// Get module settings
//-----------------------------------------
$vars = $this->_getLocationSettings();
//-----------------------------------------
// Get useragent stuff
// Do this before the do_update return for editor
//-----------------------------------------
$uAgent = $this->_processUserAgent('create');
//-----------------------------------------
// Force data
//-----------------------------------------
$this->session_data = array('uagent_key' => $uAgent['uagent_key'], 'uagent_version' => $uAgent['uagent_version'], 'uagent_type' => $uAgent['uagent_type'], 'uagent_bypass' => $uAgent['uagent_bypass'], 'id' => $this->session_id);
//-----------------------------------------
// Still update?
//-----------------------------------------
if (!$this->do_update) {
return false;
}
IPSDebug::addMessage("Creating MEMBER session: " . $this->session_id);
//-----------------------------------------
// Insert the new session
//-----------------------------------------
$data = array('id' => $this->session_id, 'member_name' => self::$data_store['members_display_name'], 'seo_name' => IPSMember::fetchSeoName(self::$data_store), 'member_id' => intval(self::$data_store['member_id']), 'member_group' => self::$data_store['member_group_id'], 'login_type' => IPSMember::isLoggedInAnon(self::$data_store), 'running_time' => IPS_UNIX_TIME_NOW, 'ip_address' => $this->_member->ip_address, 'browser' => $this->_userAgent, 'in_error' => 0, 'current_appcomponent' => $this->current_appcomponent, 'current_module' => $this->current_module, 'current_section' => $this->current_section, 'location_1_type' => isset($vars['location_1_type']) ? $vars['location_1_type'] : '', 'location_1_id' => isset($vars['location_1_id']) ? intval($vars['location_1_id']) : 0, 'location_2_type' => isset($vars['location_2_type']) ? $vars['location_2_type'] : '', 'location_2_id' => isset($vars['location_2_id']) ? intval($vars['location_2_id']) : 0, 'location_3_type' => isset($vars['location_3_type']) ? $vars['location_3_type'] : '', 'location_3_id' => isset($vars['location_3_id']) ? intval($vars['location_3_id']) : 0, 'uagent_key' => $uAgent['uagent_key'], 'uagent_version' => $uAgent['uagent_version'], 'uagent_type' => $uAgent['uagent_type'], 'uagent_bypass' => intval($uAgent['uagent_bypass']));
$this->DB->setDataType('member_name', 'string');
$this->DB->insert('sessions', $data, true);
//-----------------------------------------
// If this is a member, update their last visit times, etc.
//-----------------------------------------
if (time() - self::$data_store['last_activity'] > $this->settings['session_expiration']) {
//-----------------------------------------
// Reset the topics read cookie..
//-----------------------------------------
list($be_anon, $loggedin) = explode('&', self::$data_store['login_anonymous']);
$update = array('login_anonymous' => "{$be_anon}&1", 'last_visit' => self::$data_store['last_activity'], 'last_activity' => IPS_UNIX_TIME_NOW);
//-----------------------------------------
// Fix up the last visit/activity times.
//-----------------------------------------
self::$data_store['last_visit'] = self::$data_store['last_activity'];
self::$data_store['last_activity'] = time();
}
IPSCookie::set("member_id", self::$data_store['member_id'], 1);
IPSCookie::set("pass_hash", self::$data_store['member_login_key'], $this->settings['login_key_expire'] ? 0 : 1, $this->settings['login_key_expire']);
//-----------------------------------------
// IPS Connect
// @link http://community.invisionpower.com/resources/bugs.html/_/ip-board/ipsconnect-cookie-expiring-and-not-renewing-with-the-forums-cookie-r42160
//-----------------------------------------
foreach ($this->caches['login_methods'] as $k => $data) {
if ($data['login_folder_name'] == 'ipsconnect' and $data['login_enabled']) {
$ipsConnectSettings = unserialize($data['login_custom_config']);
if (IPSCookie::get("ipsconnect_" . md5($this->settings['board_url'] . '/interface/ipsconnect/ipsconnect.php'), FALSE)) {
IPSCookie::set("ipsconnect_" . md5($ipsConnectSettings['master_url']), IPSCookie::get("ipsconnect_" . md5($ipsConnectSettings['master_url']), FALSE), $this->settings['login_key_expire'] ? 0 : 1, $this->settings['login_key_expire'], FALSE, FALSE);
}
}
}
if (IPSCookie::get("ipsconnect_" . md5($this->settings['board_url'] . '/interface/ipsconnect/ipsconnect.php'), FALSE)) {
IPSCookie::set("ipsconnect_" . md5($this->settings['board_url'] . '/interface/ipsconnect/ipsconnect.php'), IPSCookie::get("ipsconnect_" . md5($this->settings['board_url'] . '/interface/ipsconnect/ipsconnect.php'), FALSE), $this->settings['login_key_expire'] ? 0 : 1, $this->settings['login_key_expire'], FALSE, FALSE);
}
$update['member_login_key_expire'] = $this->settings['login_key_expire'] ? time() + $this->settings['login_key_expire'] * 86400 : 0;
IPSMember::save(self::$data_store['member_id'], array('core' => $update));
} else {
$this->_createGuestSession();
}
/* Before this function is called, a guest is set up via ipsRegistry::setMember(0)
We want to override this now to provide search engine settings for the 'member' */
if ($uAgent['uagent_type'] == 'search') {
self::setSearchEngine($uAgent);
/* Reset some data */
$this->session_type = 'cookie';
//$this->session_id = "";
}
/* Set type */
self::$data_store['_sessionType'] = 'create';
return true;
}