Ejemplo n.º 1
1
<?php

include 'include.php';
isAllowed();
if (!isset($_GET['id'])) {
    setFlash("action impossible.", "danger");
    redirect("accueil.php");
    die;
}
$follower = $_SESSION['profil']['id'];
$following = $_GET['id'];
$follow = unfollow($follower, $following);
if ($follow == 400) {
    setFlash("action impossible.", "danger");
    redirect('acceuil.php');
} elseif ($follow == 500) {
    setFlash('Nos services sont en panne, nous faisons notre possible pour régler le problème.', 'danger');
    redirect('serveur_down.php');
} elseif ($follow == 200) {
    setFlash("Cette personne a bien été retiré de vos abonnements");
    redirect('profil.php?id=' . $following);
} else {
    setFlash('Nos services sont en panne, nous faisons notre possible pour régler le problème.', 'danger');
    redirect('serveur_down.php');
}
Ejemplo n.º 2
0
function record($id, $db, $login)
{
    $res = $db->querySingle("SELECT rowid, * FROM workshops WHERE rowid = {$id}", true);
    $res["persons"] = $res["persons"] . ",{$login}";
    $db->exec("UPDATE workshops SET persons = '" . $res["persons"] . "' WHERE rowid = {$id}");
    if (!(strpos($res["followers"], $login) === FALSE)) {
        unfollow($id, $db, $login);
    }
    @av_sendmail($db, $res["persons"] . "," . $res["followers"], $res["rowid"], "{$login} vient de rejoindre l'atelier", "");
}
Ejemplo n.º 3
0
         $message->setLadate(date("Y-m-d H:i:s"));
         addTouite($message, $bd);
         $th = new touitosHandler($bd);
         $user = $th->getByAttr("pseudo", $_SESSION['user'], PDO::PARAM_STR);
         $tr = new TouiteRender($user, $bd);
         $tr->render($message, $user);
     }
 } else {
     if (!empty($_GET['retouite'])) {
         recordRetouite($_GET['id'], $bd);
     } else {
         if (isset($_POST['follow'])) {
             follow($bd, $_POST['suivi']);
         } else {
             if (isset($_POST['unfollow'])) {
                 unfollow($bd, $_POST['suivi']);
             } else {
                 if (isset($_POST['unAcceptRequest'])) {
                     unAcceptRequest($bd, $_POST['suiveur']);
                 } else {
                     if (isset($_GET['getFollowers'])) {
                         show_followers($bd);
                     } else {
                         if (isset($_GET['getSuivi'])) {
                             show_whoIFollow($bd);
                         } else {
                             if (isset($_GET['getTimeline'])) {
                                 $touitos = gettouitos($bd, $_SESSION['id']);
                                 show_timeline($touitos, $bd);
                             } else {
                                 if (isset($_POST['acceptRequest'])) {
Ejemplo n.º 4
0
<?php

include "../universal/config.php";
//---followButton---//
if (isset($_POST["follow"])) {
    include "follow.php";
    $result = follow($_POST["q"]);
    echo $result;
} elseif (isset($_POST["unfollow"])) {
    include "unfollow.php";
    $result = unfollow($_POST["q"]);
    echo $result;
}
Ejemplo n.º 5
0
<?php

require 'config/initialize.php';
mustBeAuthenticated();
unfollow($_SESSION['id'], $_GET['unfollow'], $_GET['username'], $connection);
Ejemplo n.º 6
0
     //volcamos por pantalla y cerramos el output buffer
     ob_end_flush();
     echo "<div id=\"message\"><b>" . $indexphp_todo . " <b>" . $_POST['status'] . "</b> " . $indexphp_todo2 . "</div>";
     //FOLLOW COMMAND
 } elseif (eregi("^FOLLOW _", $_POST['status']) == true) {
     echo "<div id=\"message\">";
     $getnick = sacar($_POST["status"], "_", "_");
     $nicktofollow = idfromnick($getnick);
     follow($nicktofollow, $_SESSION['user_id']);
     echo "</div>";
     //UNFOLLOW COMMAND
 } elseif (eregi("^UNFOLLOW _", $_POST['status']) == true) {
     echo "<div id=\"message\">";
     $getnick = sacar($_POST["status"], "_", "_");
     $nicktofollow = idfromnick($getnick);
     unfollow($nicktofollow, $_SESSION['user_id']);
     echo "</div>";
     //DELETE TODO LIST COMMAND
 } elseif (eregi("^DONE _", $_POST['status']) == true) {
     $n_td_l = md5($_SESSION['user_id'] . "_todo_list");
     $name = "./todo/" . $n_td_l . ".txt";
     $line = sacar($_POST["status"], "_", "_");
     $line = $line - 1;
     $file = file($name);
     $file[$line] = "";
     $file = implode("", $file);
     $o = fopen($name, "w+");
     fwrite($o, $file);
     fclose($o);
     echo "<div id=\"message\">" . $indexphp_todo3 . "<b>" . ($line + 1) . "</b>.</div>";
     //ENVÍA EL TWITT
Ejemplo n.º 7
0
     $trips = getUserRecentTrips($userID);
     echo $trips;
     break;
 case 'search':
     $words = $_REQUEST['words'];
     echo searchALL($words);
     break;
 case 'start_following':
     $sessionUser = $_COOKIE['userID'];
     $profileUser = $_REQUEST['profileUser'];
     startFollowing($profileUser, $sessionUser);
     break;
 case 'unfollow':
     $sessionUser = $_COOKIE['userID'];
     $profileUser = $_REQUEST['profileUser'];
     unfollow($profileUser, $sessionUser);
     break;
 case 'is_follows':
     $sessionUser = $_COOKIE['userID'];
     $profileUser = $_REQUEST['profileUser'];
     isFollower($sessionUser, $profileUser);
     break;
 case 'cancel_trip':
     $tripID = $_REQUEST['tripID'];
     cancelTrip($tripID);
     break;
 case 'remove_passenger_from_trip':
     $tripID = $_REQUEST['tripID'];
     $userID = $_REQUEST['passengerID'];
     leaveTrip($userID, $tripID);
     break;
Ejemplo n.º 8
0
if ($unfollowerNumber != 0) {
    ?>
<h2>You have <?php 
    echo $unfollowerNumber;
    ?>
 people not following you back.</h2>

<form method="POST" action="<?php 
    echo $stylesheetPath;
    ?>
/templates/content-unfollow.php">
		<button type="submit" name="unfollow">Unfollow</button>
	</form> 
	<?php 
    if (isset($_REQUEST['unfollow'])) {
        unfollow($unfollowerArray, $connection);
    }
    /*
    	$i=1;
    	foreach($unfollowerArray as $unfollower) {
    		
    		echo "$i: $unfollower<br>";
    		$i++;
    	}
    */
} else {
    echo '<h2>Everyone is following you back!</h2>';
}
?>