当前位置: 首页>>代码示例>>PHP>>正文


PHP MEMBER::createFromID方法代码示例

本文整理汇总了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 '';
 }
开发者ID:hatone,项目名称:Nucleus-v3.64,代码行数:29,代码来源:ADMIN.php

示例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;
 }
开发者ID:hatone,项目名称:Nucleus-v3.64,代码行数:19,代码来源:BLOG.php

示例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;
 }
开发者ID:hatone,项目名称:Nucleus-v3.64,代码行数:15,代码来源:MANAGER.php


注:本文中的MEMBER::createFromID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。