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


PHP Rights::friend方法代码示例

本文整理汇总了PHP中Rights::friend方法的典型用法代码示例。如果您正苦于以下问题:PHP Rights::friend方法的具体用法?PHP Rights::friend怎么用?PHP Rights::friend使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Rights的用法示例。


在下文中一共展示了Rights::friend方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: commit

 public function commit()
 {
     $mem = $this->group->caste(Rights::member());
     $fri = $this->group->caste(Rights::friend());
     if ($mem->userfilter()) {
         return false;
     }
     $mem->addUser($this->user);
     $fri->removeUser($this->user);
     return true;
 }
开发者ID:netixx,项目名称:frankiz,代码行数:11,代码来源:membervalidate.php

示例2: conv

        } else {
            $groups_member->add($g);
        }
        $u->comments($g, conv($g_datas['remarque']));
        if ($g->id() == 1 && strlen(conv_name($u->nickname())) > 1) {
            $u->addStudy(0, $datas['promo'], (int) $datas['promo'] + 4, $datas['promo'], conv_name($u->nickname()));
        }
    }
    $temp = new Collection('Group');
    $temp->safeMerge(array($groups_member, $groups_friend));
    $temp->select(GroupSelect::castes());
    foreach ($groups_member as $g) {
        $g->caste(Rights::member())->addUser($u);
    }
    foreach ($groups_friend as $g) {
        $g->caste(Rights::friend())->addUser($u);
    }
    $k++;
    echo 'User ' . str_pad($k, 4, '0', STR_PAD_LEFT) . '/' . $users . ' : ' . str_pad($u->id(), 5, '0', STR_PAD_LEFT) . ' - ' . $datas['promo'] . ' - ' . str_pad($groups_member->count(), 2, '0', STR_PAD_LEFT) . " members - " . str_pad($groups_friend->count(), 2, '0', STR_PAD_LEFT) . " friends - " . substr(microtime(true) - $t, 0, 5) . '   ' . $u->login() . "\n";
}
echo "-----------------------------------------------\n";
XDB::execute('UPDATE account SET skin = "default"');
echo "default skin set \n";
XDB::execute('INSERT INTO users_minimodules
                          (SELECT uid, "birthday",     "COL_LEFT",   0 FROM account WHERE uid > 0)');
XDB::execute('INSERT INTO users_minimodules
                          (SELECT uid, "days",         "COL_LEFT",   1 FROM account WHERE uid > 0)');
XDB::execute('INSERT INTO users_minimodules
                          (SELECT uid, "ik",           "COL_LEFT",   2 FROM account WHERE uid > 0)');
XDB::execute('INSERT INTO users_minimodules
                          (SELECT uid, "qdj",          "COL_MIDDLE", 0 FROM account WHERE uid > 0)');
开发者ID:netixx,项目名称:frankiz,代码行数:31,代码来源:convert.php

示例3: insert

 public function insert($id = null, $type = 'all')
 {
     if ($id == null) {
         $this->name = uniqid();
         XDB::execute('INSERT INTO groups SET name = {?}', $this->name);
         $this->id = XDB::insertId();
     } else {
         $this->name = 'g_' . $id;
         XDB::execute('INSERT INTO groups SET gid = {?}, name= {?}', $id, $this->name);
         $this->id = $id;
     }
     /*
      * Create the castes
      */
     if ($type == 'user') {
         // A user group only needs an admin caste & a restricted caste.
         $this->addCaste(Rights::admin());
         $this->addCaste(Rights::restricted());
     } else {
         $admins = $this->addCaste(Rights::admin());
         $members = $this->addCaste(Rights::member());
         $logics = $this->addCaste(Rights::logic());
         $friends = $this->addCaste(Rights::friend());
         /*
          * Create the 'restricted' caste
          */
         $restricted = new UserFilter(new UFC_Caste(array($admins, $members, $logics)));
         $this->addCaste(Rights::restricted())->userfilter($restricted);
         /*
          * Create the 'everybody' caste
          * It's better not to refer to the restricted caste, as we don't know in what
          * order the bubbling is going to happen
          */
         $everybody = new UserFilter(new UFC_Caste(array($admins, $members, $logics, $friends)));
         $this->addCaste(Rights::everybody())->userfilter($everybody);
     }
 }
开发者ID:netixx,项目名称:frankiz,代码行数:37,代码来源:group.php

示例4: handler_group_subscribe

 function handler_group_subscribe($page, $group, $right = 'friend')
 {
     S::assert_xsrf_token();
     $group = Group::fromId($group);
     if (!$group) {
         $page->assign('title', "Ce groupe n'existe pas");
         $page->changeTpl('groups/no_group.tpl');
         return;
     } elseif ($right == 'friend') {
         $group->select(GroupSelect::subscribe());
         $group->caste(Rights::friend())->addUser(S::user());
         S::user()->select(UserSelect::castes());
         pl_redirect('groups/see/' . $group->name());
         exit;
     } elseif ($right == 'member') {
         $group->select(GroupSelect::subscribe());
         if ($group->caste(Rights::member())->userfilter()) {
             throw new Exception('You can\'t apply to this group');
         }
         $iv = new MemberValidate(S::user(), $group);
         $v = new Validate(array('writer' => S::user(), 'group' => $group, 'item' => $iv, 'type' => 'member'));
         $v->insert();
         $page->assign('title', "Demande de statut de membre");
         $page->changeTpl('groups/member.tpl');
     }
 }
开发者ID:netixx,项目名称:frankiz,代码行数:26,代码来源:groups.php


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