Index du forum »»  Questions »» Tous les messages postés par un membre...

Modérateur(s)developpeurjpbJireck

Poster une réponse dans le sujet

A propos des messages publiés :
Les utilisateurs anonymes peuvent poster de nouveaux sujets et des réponses dans ce forum.

 

Aperçu des sujets :

gilbau gilbau
Posté : 06-11-2008 10:56
furax69 a peut etre oublié de poster le code, ce que je fais à sa place puisqu'il me l'a gentillement envoyé par email
Voici son fichier searchpost.php qu'il suffit d'appler via un menu dans un bloc ou ailleurs



<?PHP
/************************************************************************/
/* NPDS V : Net Portal Dynamic System .                                 */
/* ===========================                                          */
/*                                                                      */
/* Original Copyright (c) 2001 by Francisco Burzi (fburzi@ncc.org.ve)   */
/*                                                                      */
/* This version name NPDS Copyright (c) 2002-2008 by Thierry Schmitt    */
/* Pour www.magic-oasis.net                                             */
/*                                                                      */
/* =========================                                            */
/* Based on Parts of phpBB                                              */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/*                                                                      */
/* For limit the number off result : set the $Smax value - line 28      */
/*                                                                      */
/************************************************************************/
if (!function_exists("Mysql_Connexion")) {!include! ("mainfile.php");}

!include!(
"functions.php");
if ($SuperCache) 
{
   $cache_obj = new cacheManager();
}
!include!(
"auth.php");
$Smax=
"5000";


function ancre($forum_id,$topic_id,$post_id,$posts_per_page) 
{
   $rowQ1=Q_Select (
"SELECT post_id FROM posts WHERE forum_id='$forum_id' and topic_id='$topic_id' order by post_id ASC", 600);
   if (!$rowQ1)
      forumerror('0015');
   while (list(,$row) = each($rowQ1)) 
{
      if ($row
[post_id]==$post_id)
         break;
      $i++;
   
}
   $start=$i-($i%$posts_per_page);
   return (
"&amp;ancre=1&amp;start=$start#".$forum_id.$topic_id.$post_id);
}


/*Formulaire spécial TS*/

!include!('header.php');
   opentable();
   //echo 
"<CENTER><IMG SRC='images/searchpost.jpg'><br></CENTER>";
   echo 
"<table width=\"100%\" cellspacing=\"2\" cellpadding=\"2\" border=\"0\"><tr><td class=\"HEADER\">\n";
   echo 
"</td></tr></table>\n";
   echo 
"<br />";
   echo 
"<form name=\"search\" action=\"$PHP_SELF\" method=\"post\">";
   echo 
"<table border=\"0\" cellpadding=\"1\" cellspacing=\"1\" width=\"100%\">";
   
/*Dans quel forums ont cherche ?*/
   echo 
"<tr>";
   echo 
"<td class=\"LIGNB\" width=\"20%\" align=\"right\">";
   echo 
"<b>Où chercher ?</b> :";
   echo 
"</td>";
   echo 
"<td width=\"20%\">";
   echo 
"<select class=\"TEXTBOX_STANDARD\" name=\"forum\">";
   echo 
"<option value=\"all\">".translate("Search All Forums")."</option>";
   $rowQ1=Q_Select (
"SELECT forum_name,forum_id FROM forums", 3600);
   if (!$rowQ1)
      forumerror('0015');
   while (list(,$row) = each($rowQ1)) 
{
      echo 
"<option value=\"$row[forum_id]\">$row[forum_name]</option>";
   
}
   echo 
"</select>";
   echo 
"</td>";
   echo 
"</tr>";
   
/*Nom du membre pour la recherche*/
   echo 
"<tr>";
   echo 
"<td class=\"LIGNB\" width=\"20%\" align=\"right\">";
   echo 
"<b>Pour quel membre ?</b> :";
   echo 
"</td>";
   echo 
"<td width=\"200\">";
   echo 
"<input class=\"TEXTBOX\" type=\"text\" name=\"username\">";
   echo 
"</td>";
   echo 
"</tr>";


/*Je cache le choix de recherche pour ne laisser que par auteur ! */
   echo 
"<tr>";
   echo 
"<td class=\"LIGNB\" width=\"20%\" align=\"right\">";
   echo 
"</td>";
   echo 
"<td width=\"80%\">";
   echo 
"<input type=\"hidden\" name=\"sortby\" value=\"u.uname\" checked>";
   echo 
"</td>";
      echo 
"<td>";
      echo 
"<hr>";
      echo 
"</td>";
   echo 
"</tr>";


/*Boutons annuler et valider puis début de recherche */
   echo 
"<tr>";
   echo 
"<td colspan=\"2\" align=\"center\">";
   echo 
"<input class=\"BOUTON_STANDARD\" type=\"submit\" name=\"submit\" Value=".translate("Search").">&nbsp;&nbsp;<input class=\"BOUTON_STANDARD\" type=\"reset\" name=\"reset\" value=\"".translate("Clear")."\">";
   echo 
"</td></tr>";
   echo 
"</table>";
   echo 
"</form>";
   $query = 
"SELECT u.uid, f.forum_id, p.topic_id, p.post_id, u.uname, p.post_time, t.topic_title, f.forum_name, f.forum_type, f.forum_pass, f.arbre FROM posts p, users u, forums f, forumtopics t";
   if (isset($term)&&$term!=
""{
      $terms = split(
" ",stripslashes(removeHack(trim($term))));
      $addquery .= 
"( (p.post_text LIKE '%$terms[0]%' or strcmp(soundex(p.post_text), soundex('$terms[0]'))=0)";
      if ($addterms==
"any")
         $andor = 
"OR";
      else
         $andor = 
"AND";
      $size = sizeof($terms);
      for ($i=1;$i<$size;$i++)
          $addquery.=
" $andor (p.post_text LIKE '%$terms[$i]%' or strcmp(soundex(p.post_text), soundex('$terms[$i]'))=0)";
      $addquery.=
")";
   
}

   if (isset($forum)&&$forum!=
"all"{
      if (isset($addquery))
         $addquery.=
" AND p.forum_id='$forum' AND f.forum_id='$forum'";
      else
         $addquery.=
" p.forum_id='$forum' AND f.forum_id='$forum'";
   
}
   if (isset($username)&&$username!=
""{
      $username= removeHack($username);
      if (!$result = mysql_query(
"SELECT uid FROM users WHERE uname='$username'")) {
         forumerror(0001);
      
}
      list($userid) = mysql_fetch_row($result);
      if (isset($addquery))
         $addquery.=
" AND p.poster_id='$userid' AND u.uname='$username'";
      else
         $addquery.=
" p.poster_id='$userid' AND u.uname='$username'";
   
}

   if (!$user) 
{
      $addquery.=
" AND f.forum_type!='5' AND f.forum_type!='7' AND f.forum_type!='9'";
   
}

   if (isset($addquery))
      $query.=
" WHERE $addquery AND  ";
   else
      $query.=
" WHERE ";

   if ($only_solved) 
{
      $query.=
" p.topic_id = t.topic_id AND p.forum_id = f.forum_id AND p.poster_id = u.uid AND t.topic_status='2' GROUP BY t.topic_title ORDER BY $sortby DESC";
   
} else {
      $query.=
" p.topic_id = t.topic_id AND p.forum_id = f.forum_id AND p.poster_id = u.uid AND t.topic_status!='2' ORDER BY $sortby DESC";
   
}
   $Smax++;
   settype($Smax,
"integer");
   $query.=
" limit 0,$Smax";
   $result = mysql_query($query);

   $affiche=true;
   if (!$row = @mysql_fetch_array($result)) 
{
      echo 
"<p align=\"center\">Indiquez seulement le pseudo d'un membre unique et valide</p><br />";
      $affiche=false;
   
}
   if ($affiche) 
{
      $count=0;
      echo 
"<table width=\"100%\" cellspacing=\"0\" cellpadding=\"2\" border=\"0\">";
      do 
{
         $rowcolor = tablos();
         if (($row
[forum_type] == 5) or ($row[forum_type] == 7)) {
            $ok_affich=false;
            $tab_groupe=valid_group($user);
            $ok_affich=groupe_forum($row
[forum_pass], $tab_groupe);
         
} else {
            $ok_affich=true;
         
}
         if ($ok_affich) 
{
            if ($count==0) 
{
               echo 
"<tr>";
               echo 
"<td class=\"ONGL\" align=\"left\">&nbsp;</td>";
               echo 
"<td class=\"ONGL\" align=\"left\" nowrap=\"nowrap\">".translate("Forum")."</td>";
               echo 
"<td class=\"ONGL\" align=\"left\">".translate("Topic")."</td>";
               echo 
"<td class=\"ONGL\" align=\"left\" nowrap=\"nowrap\">".translate("Author")."</td>";
               echo 
"<td class=\"ONGL\" align=\"left\" nowrap=\"nowrap\">".translate("Posted")."</td>";
               echo 
"</tr>";
            
}
            echo 
"<tr $rowcolor>";
            echo 
"<td align=\"left\">".($count+1)."</td><td align=\"left\"><a href=\"viewforum.php?forum=$row[forum_id]\" class=\"NOIR\">".stripslashes($row[forum_name])."</a></td>";
            if ($row
[arbre]{$Hplus="H";} else {$Hplus="";}
            $ancre=ancre($row
[forum_id],$row[topic_id],$row[post_id],$posts_per_page);
            echo 
"<td align=\"left\"><a href=\"viewtopic$Hplus.php?topic=$row[topic_id]&amp;forum=$row[forum_id]$ancre\" class=\"NOIR\">".stripslashes($row[topic_title])."</a></td>";
            echo 
"<td align=\"left\"><a href=\"user.php?op=userinfo&amp;uname=$row[uname]\" class=\"NOIR\">$row[uname]</a></td>";
            echo 
"<td align=\"left\">".convertdate($row[post_time])."</td>";
            echo 
"</tr>";
            $count++;
         
}
      
} while ($row=@mysql_fetch_array($result));
      echo 
"</table>";
   
}
   closetable();
   mysql_free_result;
   !include!('footer.php');
?>


Hotfirenet Hotfirenet
Posté : 30-10-2008 20:11
c'est juste un requete a faire, en precisant l'uid du membre ou en se basant sur le champs name ..

Si le topic est clos merci de le mettre en résolu ...
gilbau gilbau
Posté : 30-10-2008 19:37
Je t'ai envoyé un MP pour ce script qui m'interrese. Avant le passage à évoluition j'avais ce script en fonctionnement sur mon site . Voir à http://www.npds.org/viewtopic.php?topic=23919&forum=4
Il y a à mon avis une peite modif à faire pour que ça fonctionne mais je ne sais pas le faire.
Hotfirenet Hotfirenet
Posté : 29-10-2008 23:41
ce qui serai cool et enrichissant pour la communauté serait de le déposer ici, si ton code plait à Dev peut être qui sera pressent dans la prochaine version ...
FURAX69 FURAX69
Posté : 29-10-2008 22:10
Bon ce code je l'ai pondu (à partir du module de recherche... Un petit MP avec votre adresse mail et je vous envoie tout ça...

++
killing killing
Posté : 01-09-2008 14:53

Voir tous les messages d'un membre (au moins pour l'admin) c'est effectivement une option que serait un plus pour NPDS.

;-)

Jireck Jireck
Posté : 31-08-2008 23:59
il faut faire un bout de code ....

de tete, je ne peux pas repondre comme cela, mais en regardant la fonction rechercher et en la modifiant ca peux le faire
FURAX69 FURAX69
Posté : 31-08-2008 21:38
Moi aussi, je cherche une solution pour cela...
Anonyme Anonyme
Posté : 11-07-2008 17:31
Bonsoir la communauté,

Voila, je cherche depuis longtemps le moyen de filtrer/afficher tous les messages postés sur l'ensemble
de mes forums par un membre précis. Avez-vous une idée ?

La fonction recherche des forums ne vise pas le nom des auteurs (La solution serait peut-être de modifier un bout du code ? Mais où ? comment ?

H E L P :-P :-?