Пример #1
0
function my_projects($username)
{
    list($rc, $cooprojects) = ff_getleadprojects($username);
    if ($rc) {
        $cooprojects = array();
    }
    $myprojectids = array();
    // This allows an extra project to be specified in the URL
    if ($_REQUEST["p"]) {
        $myprojectids[] = $_REQUEST["p"];
    }
    // Get the list of the projects which this user is watching.
    list($rc, $watches) = al_getwatches($username);
    if (!$rc) {
        foreach ($watches as $watch) {
            if (ereg("^(p[0-9]+)-news\$", $watch["eventid"], $pieces)) {
                $myprojectids[] = $pieces[1];
            }
        }
    }
    // Get the list of the projects which this user has sponsored.
    global $memberdonations;
    list($rc, $memberdonations) = ff_memberdonations($username, false);
    if ($rc) {
        $memberdonations = array();
    }
    $myprojectids = array_merge($myprojectids, array_keys($memberdonations));
    // Get the list of projects which this user is subscribed to
    global $subscriptions;
    list($rc, $subscriptions) = ff_showsubscriptions($username);
    if ($rc) {
        $subscriptions = array();
    }
    $myprojectids = array_merge($myprojectids, array_keys($subscriptions));
    list($rc, $myprojects) = ff_getprojectinfo($myprojectids);
    if ($rc) {
        $myprojects = array();
    }
    $myprojects = array_merge($cooprojects, $myprojects);
    uasort($myprojects, cmp_projects);
    return $myprojects;
}
Пример #2
0
} else {
    $hiscredits = -1;
    ?>

<b>None</b>
<?php 
}
?>
<p>
<?php 
if ($username !== '') {
    list($rc, $memberinfo) = ff_getmemberinfo($username);
    if ($rc) {
        exit;
    }
    list($rc, $donations) = ff_memberdonations($username, $id);
    if ($rc) {
        exit;
    }
}
if ($username && $username !== $projinfo["lead"]) {
    if ($donations[$id]["credits"] && $donations[$id]["assignee"] !== $username) {
        ?>
You have assigned <?php 
        echo $donations[$id]["credits"];
        ?>
 credits to <a href="member.php?id=<?php 
        echo urlencode($donations[$id]["assignee"]);
        ?>
"><?php 
        echo htmlentities($donations[$id]["assignee"]);
Пример #3
0
        }
    }
    header("Location: account.php?tab=prefs");
    exit;
}
if (isset($_REQUEST['assigncredits'])) {
    // Get a list of the sponsorships keyed by project ID.
    $donations = array();
    foreach ($_REQUEST as $key => $value) {
        if (substr($key, 0, 6) !== 'assign') {
            continue;
        }
        $donations[substr($key, 6)] = floor($value * 100);
    }
    // Get all of our current donations
    list($rc, $curdonations) = ff_memberdonations($username);
    if ($rc) {
        header("Location: account.php?tab=projects&err=1");
        exit;
    }
    $err = 0;
    // Now perform the assignments
    $badassignee = '';
    foreach ($_REQUEST as $key => $value) {
        if (substr($key, 0, 2) !== 'a_') {
            continue;
        }
        $pid = substr($key, 2);
        $assignee = trim($value);
        $curassignee = isset($curdonations[$pid]) ? $curdonations[$pid]["assignee"] : $username;
        if ($assignee === $curassignee) {