Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
koscikte committed Dec 18, 2010
1 parent fb849c3 commit 18bac6a
Showing 1 changed file with 6 additions and 21 deletions.
27 changes: 6 additions & 21 deletions functions/user_session.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,40 +108,25 @@ function cancel_attend($args)
$result2 = mysql_query($query2);
return ($result && $result2) ? 1 : 0;
}
/*
* decrements popularity and adds user to attendees
* @param array $args data to aid in removal
* @return int 1 or 0 based on success
*/
function cancel_attend($args)
{
$eventID = addslashes($args[eventID]);
$userID = addslashes($args[userID]);
$query = "DELETE FROM attendees
WHERE userID = $userID AND eventID = $eventID;";
$result = mysql_query($query);
$query2 = "UPDATE events
SET popularity = popularity - 1
WHERE eventID = $eventID;";
$result2 = mysql_query($query2);
return ($result && $result2) ? 1 : 0;
}

/*
* hides event by adding user and event to hidden
* hides event by adding user and event to hidden, or shows by removing
* @param array $args data to aid in hiding event
* @return int 1, sets as hidden
*/
function hide_event($args)
{
$eventID = addslashes($args[eventID]);
$userID = addslashes($args[userID]);
$query = "INSERT INTO hidden (userID, eventID)
if(is_hidden($userID, $eventID)
$query = "INSERT INTO hidden (userID, eventID)
VALUES ($userID, $eventID);";
else
$query = "DELETE FROM hidden
WHERE userID = $userID AND eventID = $eventID;";
$result = mysql_query($query);
return ($result) ? 1 : 0;
}


/*
* sets event as flagged
Expand Down

0 comments on commit 18bac6a

Please sign in to comment.