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


PHP Connect::AddtoList方法代码示例

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


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

示例1: unset

            unset($idarray[$keyToDelete]);
        }
        //ID's deleted
        if (count($idarray) < 1) {
            echo "Error - all the people invited were duplicates";
        } else {
            if ($check && $groupexists->rowCount() > 0) {
                $currentarray = [];
                $currentarray[$profid] = $idarray;
                $current = serialize($currentarray);
                $postsql = $connectinfo->prepare("UPDATE Groups SET people_added = :current WHERE id = :groupid");
                $postsql->execute(array(':current' => $current, ':groupid' => $groupid));
                foreach ($idarray as $id) {
                    CreateNotification(1, $connectinfo, $id, $profid, $groupid);
                    //Send them a notification
                    $connection->AddtoList($connectinfo, 0, $groupid, "people_requested", $id);
                }
            } else {
                if ($check) {
                    echo "Error - group doesn't exist";
                } else {
                    echo "Error - original user was not a part of this group";
                }
            }
        }
    } else {
        echo "Error - authorization mismatch";
    }
} else {
    echo 'Error - invalid supplied post data (not enough info?). Alternatively, no people were added?';
}
开发者ID:96imranahmed,项目名称:Eventory,代码行数:31,代码来源:group_add.php

示例2: unserialize

}
if ($safe) {
    $authenticated = $connection->Verify($connectinfo, $profid, $token);
    if ($authenticated) {
        //Do only if user has notification
        $check = $connection->ListCheck($connectinfo, 1, $profid, "groups_pending", $groupid);
        $checkdeclined = $connection->ListCheck($connectinfo, 2, $profid, "groups_declined", $groupid);
        $checkleft = $connection->ListCheck($connectinfo, 2, $profid, "groups_left", $groupid);
        if ($check == true || $checkdeclined == true || $checkleft == true) {
            $targetvalues = $connection->GetValue($connectinfo, 0, $groupid, "people_added");
            $targetvaluesarray = unserialize($targetvalues);
            $targetid = ReturnTargetID($targetvaluesarray, $profid);
            $connection->RemoveItemfromList($connectinfo, 1, $profid, "groups_pending", "groupid:" . strval($groupid), "data");
            if ($accepted) {
                //Add on to people accepted
                $connection->AddtoList($connectinfo, 0, $groupid, "people_accepted", $profid);
                //Add to group list of accepted friends
                $connection->AddtoList($connectinfo, 2, $profid, "groups_accepted", $groupid);
                //Add to profile list of accepted groups
                //(Notify group inviter that a new user has accepted group request?
                if ($checkdeclined == false && $checkleft == false) {
                    CreateNotification(2, $connectinfo, $targetid, $profid, $groupid, TRUE);
                } else {
                    //Remove from list of left groups
                    if ($checkleft) {
                        $connection->RemovefromList($connectinfo, 2, $profid, "groups_left", $groupid);
                    }
                    if ($checkdeclined) {
                        $connection->RemovefromList($connectinfo, 2, $profid, "groups_declined", $groupid);
                    }
                }
开发者ID:96imranahmed,项目名称:Eventory,代码行数:31,代码来源:group_decision.php

示例3: intval

    $token = filter_input(INPUT_POST, 'token');
} else {
    $safe = false;
}
if ($safe) {
    $authenticated = $connection->Verify($connectinfo, $profid, $token);
    if ($authenticated) {
        try {
            $starter = $idarray[0];
            $starterid = intval($starter);
            $prepsql = $connectinfo->prepare("INSERT INTO `Groups` (`name`, `people_requested`, `people_accepted`, `starter`) VALUES (:name,:idstring,:starter,:starterid)");
            $prepsql->execute(array(':name' => $name, ':idstring' => $idstring, 'starter' => $starter, ':starterid' => $starterid));
            $groupid = $connectinfo->lastInsertId();
            echo $groupid;
            //Add group to thread starter's list of groups
            $connection->AddtoList($connectinfo, 2, $starter, "groups_accepted", $groupid);
            //Notify users of new group
            array_shift($idarray);
            //Knock thread starter off!
            $added = array($starter => $idarray);
            //Setup added list
            $addedstring = serialize($added);
            $postsql = $connectinfo->prepare("UPDATE Groups SET people_added = :addedstring WHERE id = :groupid");
            $postsql->execute(array(':addedstring' => $addedstring, ':groupid' => $groupid));
            foreach ($idarray as $id) {
                $params = ["groupid" => $groupid, "sourceid" => $profid, "date" => time()];
                //Add to notifications for that particular id
                CreateNotification(1, $connectinfo, $id, $starter, $groupid);
            }
        } catch (PDOException $e) {
            echo 'Error ' . $e->GetMessage();
开发者ID:96imranahmed,项目名称:Eventory,代码行数:31,代码来源:group_create.php


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