website logo
Auteur
avatar
Anonyme

Forum » » Questions » » [Résolu] - Affichage de la dernière connexion dans userinfo ?


Posté : 7 juin 2007 à 21:50 icone du post

Ca y est... Ca marche !!!

Pour ceux que ça intéresserait, voici la fonction userinfo modifiée de telle façon que la fiche d'un membre, présente la date ou l'heure de sa dernière connexion :




function userinfo($uname, $bypass=0) {
    global $user, $sitename, $smilies, $short_user, $site_font, $oggi;
    global $name, $email, $url, $bio, $user_avatar, $user_icq, $user_aim, $user_yim, $user_msnm, $user_from, $user_occ, $user_intrest, $user_sig, $user_journal, $user_lastv;

    $uname=removeHack($uname);
    $result = mysql_query("SELECT uid, name, femail, url, bio, user_avatar, user_icq, user_aim, user_yim, user_msnm, user_from, user_occ, user_intrest, user_sig, user_journal, mns, user_lastvisit FROM users WHERE uname='$uname'");
    list($uid, $name, $femail, $url, $bio, $user_avatar, $user_icq, $user_aim, $user_yim, $user_msnm, $user_from, $user_occ, $user_intrest, $user_sig, $user_journal, $mns, $user_lastv) = mysql_fetch_array($result);
    if (!$uid) {
       header ("location: index.php");
    }
    if (!$bypass) {global $cookie;}
    !include!("header.php");
    
     
    $user_lastv=intval($user_lastv);
    $today=intval($today);
    $today = date("d.m.Y",time()+($gmt*3600)); //la date du jour
    $zlast=date("d.m.Y",$user_lastv); // la dernière connection
          if ($today==date("d.m.Y",$user_lastv)) { // si aujourd'hui, renvoi l'heure
      $zlast = date("H:i",$user_lastv);  //renvoi l'heure
      $oggi="Aujourd'hui à ";
      }
      if ($user_lastv<1) { $user_lastv="Jamais"; }
   
    if (($uname == $cookie[1]) || ($bypass==1)) {
       echo "<table width=\"100%\" cellspacing=\"2\" cellpadding=\"2\" border=\"0\"><tr><td class=\"HEADER\">\n";
       echo "$uname, ".translate("Welcome to")." $sitename";

       echo "</td></tr></table>\n";
       echo "<br />";
       echo "<p align=\"center\">".translate("This is your personal page")."</p><br />";
       nav($mns);
    }
    $email=removeHack($femail);
    $name=stripslashes(removeHack($name));
    $url=removeHack($url);
    $bio=stripslashes(removeHack($bio));
    $user_icq=stripslashes(removeHack($user_icq));
    $user_aim=stripslashes(removeHack($user_aim));
    $user_yim=stripslashes(removeHack($user_yim));
    $user_msnm=stripslashes(removeHack($user_msnm));
    $user_from=stripslashes(removeHack($user_from));
    $user_occ=stripslashes(removeHack($user_occ));
    $user_intrest=stripslashes(removeHack($user_intrest));
    $user_sig=nl2br(removeHack($user_sig));
    $user_journal=stripslashes(removeHack($user_journal));
    $op="userinfo";
    !include!("modules/sform/extend-user/aff_extend-user.php");
    echo "<br /><br />";
    opentable();
    if ($mns) {
       echo "<table width=\"100%\" cellspacing=\"2\" cellpadding=\"2\" border=\"0\"><tr><td class=\"HEADER\">\n";
       echo translate("Mini-Web site")." : <a href=\"minisite.php?op=$uname\" target=\"_blank\" class=\"ROUGE\"><b>".translate("the page")." ".translate("here")."</b></a></td></tr>";
       echo "</table>\n";
       echo "<br />";
    }
    echo "<table width=\"100%\" cellspacing=\"2\" cellpadding=\"2\" border=\"0\"><tr><td class=\"HEADER\">\n";
    echo "Dernière connexion de $uname : ";
    echo "</td></tr><tr><td>\n";
    
   
    echo $oggi, $zlast;
    echo "</td></tr></table>\n";

    echo "<table width=\"100%\" cellspacing=\"2\" cellpadding=\"2\" border=\"0\"><tr><td class=\"HEADER\">\n";
    echo translate("Online journal for")." $uname :";
    echo "</td></tr><tr><td>\n";
    echo $user_journal;
    echo "</td></tr></table>\n";


    echo "<br />";
    echo "<table width=\"100%\" cellspacing=\"2\" cellpadding=\"2\" border=\"0\"><tr><td class=\"HEADER\">\n";
    echo translate("Last 10 comments by")." $uname :";
    echo "</td></tr>\n";
    $result = mysql_query("select c.tid, c.sid, c.subject, s.ihome from comments c, stories s where c.sid=s.sid and name='$uname' order by tid DESC limit 0,10");
    while(list($tid, $sid, $subject, $ihome) = mysql_fetch_row($result)) {
       $rowcolor = tablos();
       if (ctrl_aff($ihome,0)) {
          echo "<tr $rowcolor><td><a href=\"article.php?thold=-1&mode=flat&order=0&sid=$sid#$tid\" class=\"NOIR\">$subject</a></td></tr>";
       }
    }
    echo "</table>\n";
    echo "<br />";
    echo "<table width=\"100%\" cellspacing=\"2\" cellpadding=\"2\" border=\"0\"><tr><td class=\"HEADER\">\n";
    echo translate("Last 10 news submissions sent by")." $uname :";
    echo "</td></tr>\n";
    $xtab=news_aff("libre", "where informant='$uname' order by sid DESC limit 10", "", 10);
    $story_limit=0;
    while (($story_limit<10) and ($story_limit<sizeof($xtab))) {
       $rowcolor = tablos();
       list($sid, $catid, $aid, $title) = $xtab[$story_limit];
       $story_limit++;
       echo "<tr $rowcolor><td><a href=\"article.php?sid=$sid\" class=\"NOIR\">".aff_langue($title)."</a></td></tr>";
    }
    echo "</table>\n";
    closetable();
    !include!("footer.php");
}







Cet article provient de NPDS
https://www.npds.org/viewtopic.php?topic=22360&forum=9