本文整理匯總了PHP中IPSMember::unpackGroup方法的典型用法代碼示例。如果您正苦於以下問題:PHP IPSMember::unpackGroup方法的具體用法?PHP IPSMember::unpackGroup怎麽用?PHP IPSMember::unpackGroup使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類IPSMember
的用法示例。
在下文中一共展示了IPSMember::unpackGroup方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _groupForm
/**
* Show the add/edit group form
*
* @param string 'add' or 'edit'
* @return @e void [Outputs to screen]
* @todo _initTab doesn't seem to work anymore with the new tabs, need to update each app to have a unique name/id
*/
protected function _groupForm($type = 'edit')
{
//-----------------------------------------
// Grab group data and start us off
//-----------------------------------------
if ($type == 'edit') {
if ($this->request['id'] == "") {
$this->registry->output->showError($this->lang->words['g_whichgroup'], 11210);
}
$group = $this->DB->buildAndFetch(array('select' => '*', 'from' => 'groups', 'where' => "g_id=" . intval($this->request['id'])));
$group = IPSMember::unpackGroup($group, FALSE, TRUE);
//-----------------------------------------
// Check restrictions.
//-----------------------------------------
if ($group['g_access_cp']) {
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg('groups_edit_admin');
}
} else {
$group = array();
if ($this->request['id']) {
$group = $this->DB->buildAndFetch(array('select' => '*', 'from' => 'groups', 'where' => "g_id=" . intval($this->request['id'])));
$group = IPSMember::unpackGroup($group, FALSE, TRUE);
}
$group['g_title'] = 'New Group';
}
//-----------------------------------------
// Grab permission masks
//-----------------------------------------
$perm_masks = array();
$this->DB->build(array('select' => '*', 'from' => 'forum_perms', 'order' => 'perm_name ASC'));
$this->DB->execute();
while ($r = $this->DB->fetch()) {
$perm_masks[] = array($r['perm_id'], $r['perm_name']);
}
//-----------------------------------------
// Ok? Load interface and child classes
//-----------------------------------------
$blocks = array('tabs' => array(), 'area' => array());
IPSLib::loadInterface('admin/group_form.php');
$tabsUsed = 5;
$firstTab = empty($this->request['_initTab']) ? false : trim($this->request['_initTab']);
foreach (IPSLib::getEnabledApplications() as $app_dir => $app_data) {
if (is_file(IPSLib::getAppDir($app_dir) . '/extensions/admin/group_form.php')) {
$_class = IPSLib::loadLibrary(IPSLib::getAppDir($app_dir) . '/extensions/admin/group_form.php', 'admin_group_form__' . $app_dir, $app_dir);
if (class_exists($_class)) {
$_object = new $_class($this->registry);
$data = $_object->getDisplayContent($group, $tabsUsed);
$blocks['area'][$app_dir] = $data['content'];
$blocks['tabs'][$app_dir] = $data['tabs'];
$tabsUsed = $data['tabsUsed'] ? $tabsUsed + $data['tabsUsed'] : $tabsUsed + 1;
if (!empty($this->request['_initTab']) && $this->request['_initTab'] == $app_dir) {
$firstTab = $tabsUsed;
}
}
}
}
//-----------------------------------------
// And output to form
//-----------------------------------------
$this->registry->output->extra_nav[] = array("{$this->settings['base_url']}&{$this->form_code}", $this->lang->words['menu__manage_groups']);
$this->registry->output->html .= $this->html->groupsForm($type, $group, $perm_masks, $blocks, $firstTab);
}
示例2: load
//.........這裏部分代碼省略.........
$_totalUsers = count($multiple_ids);
$_gotFromCache = 0;
$_fromCache = array();
foreach ($multiple_ids as $_memberValue) {
$member = self::_fetchFromCache($_memberValue, $_usedTables);
if ($member !== FALSE) {
$_fromCache[$member['member_id']] = $member;
$_gotFromCache++;
}
}
//-----------------------------------------
// Did we find all the members in cache?
//-----------------------------------------
if ($_gotFromCache == $_totalUsers) {
return $_fromCache;
}
}
}
self::$ignoreCache = FALSE;
//-----------------------------------------
// Fix up joins...
//-----------------------------------------
if ($tables['pfields_content']) {
$joins[] = array('select' => 'p.*', 'from' => array('pfields_content' => 'p'), 'where' => 'p.member_id=m.member_id', 'type' => 'left');
}
if ($tables['profile_portal']) {
$joins[] = array('select' => 'pp.*', 'from' => array('profile_portal' => 'pp'), 'where' => 'pp.pp_member_id=m.member_id', 'type' => 'left');
}
if ($tables['groups']) {
$joins[] = array('select' => 'g.*', 'from' => array('groups' => 'g'), 'where' => 'g.g_id=m.member_group_id', 'type' => 'left');
}
if ($tables['sessions']) {
$joins[] = array('select' => 's.*', 'from' => array('sessions' => 's'), 'where' => 's.member_id=m.member_id', 'type' => 'left');
}
if ($tables['core_item_markers_storage']) {
$joins[] = array('select' => 'im.*', 'from' => array('core_item_markers_storage' => 'im'), 'where' => 'im.item_member_id=m.member_id', 'type' => 'left');
}
if ($tables['members_partial']) {
$joins[] = array('select' => 'mp.*', 'from' => array('members_partial' => 'mp'), 'where' => 'mp.partial_member_id=m.member_id', 'type' => 'left');
}
if (IPSContentCache::isEnabled()) {
if (IPSContentCache::fetchSettingValue('sig')) {
$joins[] = IPSContentCache::join('sig', 'm.member_id', 'ccb', 'left', 'ccb.cache_content');
}
}
//-----------------------------------------
// Do eeet
//-----------------------------------------
if (count($joins)) {
ipsRegistry::DB()->build(array('select' => 'm.*, m.member_id as my_member_id', 'from' => array('members' => 'm'), 'where' => (is_array($multiple_ids) and count($multiple_ids)) ? 'm.' . $member_field . ' IN (' . implode(',', $multiple_ids) . ')' : 'm.' . $member_field . '=' . $member_value, 'add_join' => $joins));
} else {
ipsRegistry::DB()->build(array('select' => '*', 'from' => 'members', 'where' => (is_array($multiple_ids) and count($multiple_ids)) ? $member_field . ' IN (' . implode(',', $multiple_ids) . ')' : $member_field . '=' . $member_value));
}
//-----------------------------------------
// Execute
//-----------------------------------------
ipsRegistry::DB()->execute();
while ($mem = ipsRegistry::DB()->fetch()) {
if (isset($mem['my_member_id'])) {
$mem['member_id'] = $mem['my_member_id'];
}
$mem['full'] = true;
if (!$mem['email'] or !$mem['members_display_name'] or $mem['email'] == $mem['name'] . '@' . $mem['joined']) {
$mem['full'] = false;
$mem['timenow'] = $mem['joined'];
}
/* Clean secondary groups */
$mem['mgroup_others'] = $mem['mgroup_others'] != '' ? IPSText::cleanPermString($mem['mgroup_others']) : '';
//-----------------------------------------
// Be sure we properly apply secondary permissions
//-----------------------------------------
if ($tables['groups']) {
$mem = ips_MemberRegistry::setUpSecondaryGroups($mem);
/* Unpack groups */
$mem = IPSMember::unpackGroup($mem, TRUE, TRUE);
}
//-----------------------------------------
// Unblockable
//-----------------------------------------
$mem['_canBeIgnored'] = self::isIgnorable($mem['member_group_id'], $mem['mgroup_others']);
/* Bitwise Options */
$mem = self::buildBitWiseOptions($mem);
/* Twitter is disabled them remove twitter tokens and such */
if ($mem['twitter_id'] && !IPSLib::twitter_enabled()) {
$mem['twitter_token'] = '';
$mem['twitter_secret'] = '';
$mem['twitter_id'] = '';
}
/* Add to array */
$members[$mem['member_id']] = $mem;
//-----------------------------------------
// Add to cache
//-----------------------------------------
self::_addToCache($mem, $_usedTables);
}
//-----------------------------------------
// Return just a single if we only sent one id
//-----------------------------------------
return (is_array($multiple_ids) and count($multiple_ids)) ? $members : array_shift($members);
}