本文整理汇总了PHP中MEMBER::createFromID方法的典型用法代码示例。如果您正苦于以下问题:PHP MEMBER::createFromID方法的具体用法?PHP MEMBER::createFromID怎么用?PHP MEMBER::createFromID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MEMBER
的用法示例。
在下文中一共展示了MEMBER::createFromID方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deleteOneMember
/**
* @static
* @todo document this
*/
function deleteOneMember($memberid)
{
global $manager;
$memberid = intval($memberid);
$mem = MEMBER::createFromID($memberid);
if (!$mem->canBeDeleted()) {
return _ERROR_DELETEMEMBER;
}
$manager->notify('PreDeleteMember', array('member' => &$mem));
/* unlink comments from memberid */
if ($memberid) {
$query = 'UPDATE ' . sql_table('comment') . ' SET cmember="0", cuser="' . sql_real_escape_string($mem->getDisplayName()) . '" WHERE cmember=' . $memberid;
sql_query($query);
}
$query = 'DELETE FROM ' . sql_table('member') . ' WHERE mnumber=' . $memberid;
sql_query($query);
$query = 'DELETE FROM ' . sql_table('team') . ' WHERE tmember=' . $memberid;
sql_query($query);
$query = 'DELETE FROM ' . sql_table('activation') . ' WHERE vmember=' . $memberid;
sql_query($query);
// delete all associated plugin options
NucleusPlugin::_deleteOptionValues('member', $memberid);
$manager->notify('PostDeleteMember', array('member' => &$mem));
return '';
}
示例2: addTeamMember
function addTeamMember($memberid, $admin)
{
global $manager;
$memberid = intval($memberid);
$admin = intval($admin);
// check if member is already a member
$tmem = MEMBER::createFromID($memberid);
if ($tmem->isTeamMember($this->getID())) {
return 0;
}
$manager->notify('PreAddTeamMember', array('blog' => &$this, 'member' => &$tmem, 'admin' => &$admin));
// add to team
$query = 'INSERT INTO ' . sql_table('team') . ' (TMEMBER, TBLOG, TADMIN) ' . 'VALUES (' . $memberid . ', ' . $this->getID() . ', "' . $admin . '")';
sql_query($query);
$manager->notify('PostAddTeamMember', array('blog' => &$this, 'member' => &$tmem, 'admin' => $admin));
$logMsg = sprintf(_TEAM_ADD_NEWTEAMMEMBER, $tmem->getDisplayName(), $memberid, $this->getName());
ACTIONLOG::add(INFO, $logMsg);
return 1;
}
示例3:
/**
* Returns a MEMBER object
*/
function &getMember($memberid)
{
$mem =& $this->members[$memberid];
if (!$mem) {
// load class if needed
$this->_loadClass('MEMBER', 'MEMBER.php');
// create MEMBER object
$mem =& MEMBER::createFromID($memberid);
$this->members[$memberid] =& $mem;
}
return $mem;
}