1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
| $sql = "SELECT DISTINCT a.id_amide, pseudo_membre, blog_avatar, profil_pseudo, id_priorite, url_client_part FROM amis a, membres b, partenaires c WHERE b.part_id=c.part_id AND a.id_amide=b.id_membre AND (statut=1 OR statut=2 OR statut=3) AND a.id_membre=".$_SESSION['id']." AND (a.id_priorite=1 OR a.id_priorite=2) ";
$sql=sql_query($sql);
$nbamis=sql_num_rows($sql); // on a le nombre d'amis
while($data=sql_fetch_array($sql))
{
$nb=0;
$idamis=$data['id_amide'];
//REQUETE PERMETTANT DE RECUPERER TOUTES LES NEWS VIDEO ET SON POSTE PAR SES AMIS ORDONNEES PAR DATE DE MISE EN LIGNE
$requete ="
SELECT a.id_amide,pseudo_membre,date_creat, 'amis' AS origine
FROM amis a, membres b
where a.id_amide=b.id_membre
AND a.id_membre=".$idamis."
UNION ALL
SELECT id_membre,nom, date_creat, 'files' AS origine
FROM files
where id_membre=".$idamis."
AND (type=3 OR type=4 OR type=5)
UNION ALL
SELECT id_membre,sujet_news,date_modif, 'news' AS origine
FROM news where id_membre=".$idamis."
ORDER BY date_creat DESC";
echo "Amis :";
echo $data['pseudo_membre'];
if(!eregi("http://",$data['blog_avatar']) && is_file($sitePath."client/files/".$data['pseudo_membre']{0}."/".$data['pseudo_membre']."/".$data['blog_avatar'])){ ?>
<img src="/client/files/<?php echo $data['pseudo_membre']{0}."/".$data['pseudo_membre']."/".$data['blog_avatar']; ?>" width="80" alt="" height="80"/><br/>
<?php
}
echo '<br/>';
$requete=sql_query($requete);
while(($data2=sql_fetch_array($requete))&&($nb<5))
{
if($data2['origine']== 'files')
{
echo "a ajouté un fichier sur son player";
echo "<br/>";
}
if($data2['origine']== 'amis')
{
echo "a ajouté comme amis : ";
echo $data2['pseudo_membre'];
echo "<br/>";
}
if($data2['origine']== 'news')
{
echo "a ajouté une news sur sa page";
echo "<br/>";
}
echo ' le : ';
$date1=$data2['date_creat'];
list($date, $time) = explode(" ", $date1);
list($year, $month, $day) = explode("-", $date);
list($hour, $min, $sec) = explode(":", $time);
$months = array("janvier", "février", "mars", "avril", "mai", "juin",
"juillet", "août", "septembre", "octobre", "novembre", "décembre");
echo $date1 = "le $day ".$months[$month-1]." $year à ${hour}h${min}m";
echo '<br/>';
$nb++;
}
$nb=0;
} |
Partager