Fork me on GitHub






création d'un menu déroulant dans xmmemberstat
Xoops accro
Inscrit: 16/08/2005 19:46
De Nanterre
Messages: 2331
Objet: recherche multi-critère
Bonjour,
Depuis que, dans ma page d'inscription de membre, j'ai ajouter un menu déroulant genre, je cherche à mettre, dans les recherche de xmmemberstat un menu déroulant genre, ou le contenu de ce menu est à l'identique de celui des comptes.

Je ne suis pas clair? un exemple..

Le menu déroulant "genre" comprend Homme et Femme

Je voudrai que dans le genre de ma page de recherche dans xmmemberstat, il y est les même critère de recherche.

Je souhaiterai avoir les formules pour y parvenir, en effet, je suis le roi des copier/coller, mais nul face à des codes php et htlm...

Si ce projet abouti, cela va changer considérablement les recherches dans les sites qui ont personnaliser leurs pages d'inscription

Pour faciliter votre gracieuse aide, voici les liens des fichier de mon hack pour la page d'inscription de membres Hack des nullos.

et celui de mon xmmemberstat personnalisé au hack Xoopsmembers pour nullos

Je vous remercie d'avance et me tiens à votre dispo pour tout info +

Bonne journée

Posté le : 15/12/2007 10:52

eparcyl... tranquille.
Partager Twitter Partagez cette article sur GG+
Re: création d'un menu déroulant dans xoopsmembers
Xoops accro
Inscrit: 16/08/2005 19:46
De Nanterre
Messages: 2331
Un petit up svp

Posté le : 18/12/2007 21:38

eparcyl... tranquille.
Partager Twitter Partagez cette article sur GG+
Re: création d'un menu déroulant dans xoopsmembers
Xoops accro
Inscrit: 16/08/2005 19:46
De Nanterre
Messages: 2331
Bonjour,
Je vais essayer d'être plus explicite dans mes propos...
1 - j'ai un table sql nommé xoops_user

2 - dans cette table, est lister la clé "uid" , le pseudo "uname", le genre "genre" et enfin, code postal "codepostal".

3 - Dans cette base, j'ai 6 "hommes", 200 "femmes" et 20 "couples", le tout, reparti dans chaque code postal.

4 - Mon projet, c'est pour Xoopsmember et surtout xmmemberstat, que j'ai adapter à mes besoins.
Comme pour le petit menu déroulant en haut de cette page (pseuso, profil, mp, email etc), voir apparaitre (hommes, femmes, couple).

5 - et que si je selectionne "femmes" dans la page de recherche dont j'ajouterai le code, apparaisse les 200 femmes.

6 - et que dans un autre menu à coté, je selectionne parmi une liste déroulante (92 hauts de seine) et je vois ainsi toutes les femmes du 92.

J'espère vraiement avoir un coup de main pour me donner de bonne piste pour faire une chose pareil.

Merci d'avance et bonne journée

Posté le : 20/12/2007 13:27

eparcyl... tranquille.
Partager Twitter Partagez cette article sur GG+
Re: création d'un menu déroulant dans xoopsmembers
Semi pro
Inscrit: 13/12/2004 11:28
De Lyon
Messages: 1364
Salut,
Pour ma part, cela va etre dur, je suis trop occupé, mais pourquoi ne pas vraiement te lançer dans le dev

Posté le : 20/12/2007 13:36
Partager Twitter Partagez cette article sur GG+
Re: création d'un menu déroulant dans xoopsmembers
Aspirant
Inscrit: 18/12/2006 18:34
Messages: 67
Bonjour
te pondre le code comme cela c'est pas facile et puis nous avons tous pas mal de trucs à faire.
Aide toi, le ciel t'aideras

Donne nous un début de code, et pourra essayer de te donner les corrections. En plus de cette façon tu apprendras par toi meme

++

Posté le : 20/12/2007 13:43
Partager Twitter Partagez cette article sur GG+
Re: création d'un menu déroulant dans xmmemberstat
Xoops accro
Inscrit: 16/08/2005 19:46
De Nanterre
Messages: 2331
Bonsoir,
J'ai bien trouver un modèle... mais c'est du html
Citation :

<!-- ======= test debut============= -->
<html>
<p>
Recherche par genre </font>: <form action="include/functions.php" method="POST" name="" id="">
<select name="user_genre" id="user_genre">
<option value="homme">hommes</option>
<option value="femme">femmes</option>
<option value="couple">couple</option>
<option value="">Vide</option>
</select>
</p>

<p>Recherche par code postale</font>:
<select name="92 Hauts de Seine" id="92_Hauts de seine">
<option value="75 Paris">75 Paris</option>
<option value="Non Lister">Non lister</option>
</select></p>

<p>Recherche par pays</font>: <select name="themes" id="themes">
<option value="France">France</option>
<option value="Allemagne">Allemagne</option>
<option value="Suisse">Suisse</option>
<option value="vide">-</option> </select> </p>

<p><input name="valider" type="submit" value="valider"> <input name="effacer" type="reset" value="effacer">
</p>
<p><input type="checkbox" name="allcriteres" value="oui">Obligatoirement tous les critères</p>
</p>
</form>
</html>
<!-- ======= test fin =============== -->


Autrement, voici comment j'ai préparer le fichiers
xmmemberstat/index.php:
Citation :

<?php
// $Id: index.php,v 1.2 2003/01/25 22:52:08 onokazu Exp $
// ------------------------------------------------------------------------ //
// XOOPS - PHP Content Management System //
// Copyright (c) 2000 XOOPS.org //
// <http://www.xoops.org/> //
// ------------------------------------------------------------------------- //
// 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, or //
// (at your option) any later version. //
// //
// You may not change or alter any portion of this comment or credits //
// of supporting developers from this source code or any supporting //
// source code which is considered copyrighted (c) material of the //
// original comment or credit authors. //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with this program; if not, write to the Free Software //
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
// ------------------------------------------------------------------------ //
// ------------------------------------------------------------------------ //
// Modified by : Mohd Hilmi Bin Ngah (ComFlash2) //
// Compatible with : XOOPS 2.0.x //
// Tested With: XOOPS 2.0.13.1 //
// PHP 4.3.0 //
// Apache 1.3.27 //
// //
// ComFlash Technology //
// 330-18-13 Taman Gambir, //
// Jalan Bukit Gambir, //
// 11700 Sungai Dua, //
// Pulau Pinang, //
// Malaysia. //
// //
// (+6)012-7413082 //
// //
// * We design Custom PCB, Microcontroller Design, Firmware Programming, //
// Software Development (VB6, C++, C, JAVA, Delphi) in Windows/Linux, //
// PHP, PERL, Circuit Simulation / Debug. //
// ------------------------------------------------------------------------ //




include "../../mainfile.php";
//include "../../header.php";
function alpha() {
global $sortby, $xoopsConfig;
$alphabet = array (_ML_ALL, "A","B","C","D","E","F","G","H","I","J","K","L","M",
"N","O","P","Q","R","S","T","U","V","W","X","Y","Z","1","2","3","4","5","6","7","8","9","0",_ML_OTHER);
$num = count($alphabet) - 1;
echo "<div align='center'>[ "; // start of HTML
$counter = 0;
while (list(, $ltr) = each($alphabet)) {
echo "<a href='".XOOPS_URL."/modules/xmmemberstats/index.php?letter=".$ltr."&sortby=".$sortby."'>".$ltr."</a>";
if ( $counter == round($num/2) ) {
echo " ]\n<br />\n[ ";
} elseif ( $counter != $num ) {
echo "&nbsp;|&nbsp;\n";
}
$counter++;
}
echo " ]\n</div>\n<br />\n";
}

if ( $xoopsConfig['startpage'] == "xmmemberstats" ) {
$xoopsOption['show_rblock'] =1;
include(XOOPS_ROOT_PATH."/header.php");
make_cblock();
echo "<br />";
} else {
$xoopsOption['show_rblock'] =1;
include(XOOPS_ROOT_PATH."/header.php");
echo "<br />";
}
//$sortby= $_GET['sortby'];
//echo $sortby;


if(isset($_GET['letter']))
{
$letter= $_GET['letter'];
}

if(isset($_GET['sortby']))
{
$sortby= $_GET['sortby'];
}

if(isset($_GET['orderby']))
{
$orderby= $_GET['orderby'];
}

if(isset($_GET['page']))
{
$page= $_GET['page'];
}

if(isset($_GET['query']))
{
$query= $_GET['query'];
}

if(isset($_POST['query']))
{
$query= $_POST['query'];
}
//echo $query;
//$query="2003";
$pagesize = 10;

if ( !isset($letter) ) { $letter = _ML_ALL; }
if ( !isset($sortby) ) { $sortby = "uid"; }
if ( !isset($orderby) ) { $orderby = "ASC"; }
if ( !isset($page) ) { $page = 1; }

if ( isset($query) ) {
$where = " WHERE ".$xoopsDB->prefix("users").".level >0 AND (".$xoopsDB->prefix("users").".uname LIKE '%$query%' OR ".$xoopsDB->prefix("users").".name LIKE '%$query%'";
$where .= " OR ".$xoopsDB->prefix("users").".user_genre LIKE '%$query%'";
$where .= " OR ".$xoopsDB->prefix("users").".user_orientation LIKE '%$query%'";
$where .= " OR ".$xoopsDB->prefix("users").".user_codepostal LIKE '%$query%'";
$where .= " OR ".$xoopsDB->prefix("users").".user_planete LIKE '%$query%'";
$where .= " OR ".$xoopsDB->prefix("users").".user_icq LIKE '%$query%'";
$where .= " OR ".$xoopsDB->prefix("users").".user_from LIKE '%$query%'";
$where .= " OR ".$xoopsDB->prefix("users").".user_sig LIKE '%$query%'";
$where .= " OR ".$xoopsDB->prefix("users").".user_aim LIKE '%$query%'";
$where .= " OR ".$xoopsDB->prefix("users").".user_yim LIKE '%$query%'";
$where .= " OR ".$xoopsDB->prefix("users").".user_msnm LIKE '%$query%'";
if ( $xoopsUser ) {
if ( $xoopsUser->isAdmin() ) {
$where .= " OR ".$xoopsDB->prefix("users").".email LIKE '%$query%'";
}
}
$where .= ") ";
} else {
$where = " WHERE ".$xoopsDB->prefix("users").".level >0";
}
//echo "SELECT ".$xoopsDB->prefix("users").".uid, ".$xoopsDB->prefix("users").".uname FROM ".$xoopsDB->prefix("users")." ".$where." ORDER BY ".$xoopsDB->prefix("users").".uid DESC";
$result = $xoopsDB->query("SELECT ".$xoopsDB->prefix("users").".uid, ".$xoopsDB->prefix("users").".uname FROM ".$xoopsDB->prefix("users")." ".$where." ORDER BY ".$xoopsDB->prefix("users").".uid DESC",1,0);
list($lastuid, $lastuser) = $xoopsDB->fetchRow($result);

//$result = $xoopsDB->query("SELECT * FROM ".$xoopsDB->prefix("users")." $ ORDER BY profileid DESC",1,0);
//list($lastuid, $lastuser) = $xoopsDB->fetchRow($result);


echo "<div align='center'><b>";
printf(_ML_WELCOMETO,$xoopsConfig['sitename']);
echo "</b><br /><br />\n";
echo _ML_GREETINGS." <a href='".XOOPS_URL."/userinfo.php?uid=".$lastuid."'>".$lastuser."</a></div>\n";
if (isset($query) && trim($query) != "") {
$where = " WHERE ".$xoopsDB->prefix("users").".level >0 AND (".$xoopsDB->prefix("users").".uname LIKE '%$query%' OR ".$xoopsDB->prefix("users").".name LIKE '%$query%'";
$where .= " OR ".$xoopsDB->prefix("users").".user_icq LIKE '%$query%'";
$where .= " OR ".$xoopsDB->prefix("users").".user_from LIKE '%$query%'";
$where .= " OR ".$xoopsDB->prefix("users").".user_sig LIKE '%$query%'";
$where .= " OR ".$xoopsDB->prefix("users").".user_aim LIKE '%$query%'";
$where .= " OR ".$xoopsDB->prefix("users").".user_yim LIKE '%$query%'";
$where .= " OR ".$xoopsDB->prefix("users").".user_msnm LIKE '%$query%'";

if ( $xoopsUser ) {
if ( $xoopsUser->isAdmin() ) {
$where .= " OR ".$xoopsDB->prefix("users").".email LIKE '%$query%'";
}
}
$where .= ") ";
} else {
$where = " WHERE ".$xoopsDB->prefix("users").".level >0";
}

//echo "SELECT COUNT(*) FROM ".$xoopsDB->prefix("users")." ".$where;
list($numrows) = $xoopsDB->fetchRow($xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix("users")." ".$where));

echo "<div align='center'>";
echo "</div><br /><br />";

echo "<table align='center'><tr><td align='right' width=58%><form action='".XOOPS_URL."/modules/xmmemberstats/index.php' method='post'>";
if ( isset($query) ) {
echo "<input type='text' size='30' name='query' value='$query' />";
} else {
echo "<input type='text' size='30' name='query' />";
}
echo "<input type='submit' value='"._ML_SEARCH."' /></form></td><td>";

echo "<form action='".XOOPS_URL."/modules/xmmemberstats/index.php' method='post'>";
echo "<input type='submit' value='" ._ML_RESETSEARCH."' />";
echo "</form></td></tr></table>";
alpha();

$min = $pagesize * ($page - 1);
$max = $pagesize;

/*
SELECT field1, field2, field3
FROM first_table
INNER JOIN second_table
ON first_table.keyfield = second_table.foreign_keyfield
*/


$count = "SELECT COUNT(".$xoopsDB->prefix("users").".uid) AS total FROM ".$xoopsDB->prefix("users"); // Count all the users in the db..
$select = "SELECT * FROM ".$xoopsDB->prefix("users");
if ( ( $letter != _ML_OTHER ) AND ( $letter != _ML_ALL ) ) {
$where = " WHERE ".$xoopsDB->prefix("users").".level >0 AND ".$xoopsDB->prefix("users").".uname LIKE '".$letter."%' ";
} else if ( ( $letter == _ML_OTHER ) AND ( $letter != _ML_ALL ) ) {
$where = " WHERE ".$xoopsDB->prefix("users").".level >0 AND ".$xoopsDB->prefix("users").".uname REGEXP '^\[1-9]' ";
} else {
$where = " WHERE ".$xoopsDB->prefix("users").".level >0 ";
}

//echo $sortby;
$sortby2=$sortby;
if ($sortby == "uid") $sortby=$xoopsDB->prefix("users").".uid";
if ($sortby == "user_avatar") $sortby=$xoopsDB->prefix("users").".user_avatar";
if ($sortby == "user_photo") $sortby=$xoopsDB->prefix("users").".user_photo";
if ($sortby == "uname") $sortby=$xoopsDB->prefix("users").".uname";
if ($sortby == "user_genre") $sortby=$xoopsDB->prefix("users").".user_genre";
if ($sortby == "user_orientation") $sortby=$xoopsDB->prefix("users").".user_orientation";
if ($sortby == "user_codepostal") $sortby=$xoopsDB->prefix("users").".user_codepostal";
if ($sortby == "user_planete") $sortby=$xoopsDB->prefix("users").".user_planete";
if ($sortby == "user_regdate") $sortby=$xoopsDB->prefix("users").".user_regdate";
if ($sortby == "url") $sortby=$xoopsDB->prefix("users").".url";
if ($sortby == "email") $sortby=$xoopsDB->prefix("users").".email";

$sort = "order by $sortby $orderby";


if ( isset($query) ) {
$where = " WHERE ".$xoopsDB->prefix("users").".level >0 AND (".$xoopsDB->prefix("users").".uname LIKE '%$query%' OR ".$xoopsDB->prefix("users").".name LIKE '%$query%'";
$where .= " OR ".$xoopsDB->prefix("users").".user_genre LIKE '%$query%'";
$where .= " OR ".$xoopsDB->prefix("users").".user_orientation LIKE '%$query%'";
$where .= " OR ".$xoopsDB->prefix("users").".user_codepostal LIKE '%$query%'";
$where .= " OR ".$xoopsDB->prefix("users").".user_planete LIKE '%$query%'";
$where .= " OR ".$xoopsDB->prefix("users").".user_icq LIKE '%$query%'";
$where .= " OR ".$xoopsDB->prefix("users").".user_from LIKE '%$query%'";
$where .= " OR ".$xoopsDB->prefix("users").".user_sig LIKE '%$query%'";
$where .= " OR ".$xoopsDB->prefix("users").".user_aim LIKE '%$query%'";
$where .= " OR ".$xoopsDB->prefix("users").".user_yim LIKE '%$query%'";
$where .= " OR ".$xoopsDB->prefix("users").".user_msnm LIKE '%$query%'";
if ( $xoopsUser ) {
if ( $xoopsUser->isAdmin() ) {
$where .= " OR ".$xoopsDB->prefix("users").".email LIKE '%$query%'";
}
}
$where .= ") ";
}

//echo $count." ++ ".$where;
$count_result = $xoopsDB->query($count.$where);
list($num_rows_per_order) = $xoopsDB->fetchRow($count_result);
echo $num_rows_per_order." Membre(s) trouvé(s)";
//echo $min;
//echo $select.$where.$sort;
$result = $xoopsDB->query($select.$where.$sort,$max,$min) or die($xoopsDB->error() ); // Now lets do it !!

echo "<br />";
if ( $letter != "front" ) {
$orderby2=$orderby;
if ( $orderby == "ASC" ) {
$orderby = "DESC";
} else {
$orderby = "ASC";
}
if ( !isset($query) ) {
$query = "";
}
echo "<table border='0' cellpadding='0' cellspacing='0' valign='top' width='75%' class='head'><tr><td>\n";
echo "<table width='75%' border='0' cellspacing='1' cellpadding='4'><tr>\n";
echo "<td align='center'><span ><b><a href='".XOOPS_URL."/modules/xmmemberstats/index.php?letter=".$letter."&sortby=user_avatar&orderby=".$orderby."&query=".$query."'>"._ML_AVATAR."</a></b></span></td>\n";
echo "<td align='center'><span ><b><a href='".XOOPS_URL."/modules/xmmemberstats/index.php?letter=".$letter."&sortby=user_photo&orderby=".$orderby."&query=".$query."'>"._ML_PHOTO."</a></b></span></td>\n";
echo "<td align='center'><span ><b><a href='".XOOPS_URL."/modules/xmmemberstats/index.php?letter=".$letter."&sortby=uname&orderby=".$orderby."&query=".$query."'>"._ML_NICKNAME."</a></b></span></td>\n";
echo "<td align='center'><span ><b><a href='".XOOPS_URL."/modules/xmmemberstats/index.php?letter=".$letter."&sortby=user_genre&orderby=".$orderby."&query=".$query."'>"._ML_GENRE."</a></b></span></td>\n";
echo "<td align='center'><span ><b><a href='".XOOPS_URL."/modules/xmmemberstats/index.php?letter=".$letter."&sortby=user_orientation&orderby=".$orderby."&query=".$query."'>"._ML_ORIENTATION."</a></b></span></td>\n";
echo "<td align='center'><span ><b><a href='".XOOPS_URL."/modules/xmmemberstats/index.php?letter=".$letter."&sortby=user_codepostal&orderby=".$orderby."&query=".$query."'>"._ML_CODEPOSTAL."</a></b></span></td>\n";
echo "<td align='center'><span ><b><a href='".XOOPS_URL."/modules/xmmemberstats/index.php?letter=".$letter."&sortby=user_planete&orderby=".$orderby."&query=".$query."'>"._ML_PLANETE."</a></b></span></td>\n";
echo "<td align='center'><span ><b><a href='".XOOPS_URL."/modules/xmmemberstats/index.php?letter=".$letter."&sortby=user_regdate&orderby=".$orderby."&query=".$query."'>"._ML_REGDATE."</a></b></span></td>\n";
echo "<td align='center'><span ><b><a href='".XOOPS_URL."/modules/xmmemberstats/index.php?letter=".$letter."&sortby=email&orderby=".$orderby."&query=".$query."'>"._ML_EMAIL."</a></b></span></td>\n";
echo "<td align='center'><span ><b><a href='".XOOPS_URL."/modules/xmmemberstats/index.php?letter=".$letter."&sortby=email&orderby=".$orderby."&query=".$query."'>"._ML_PM."</a></b></span></td>\n";
echo "<td align='center'><span ><b><a href='".XOOPS_URL."/modules/xmmemberstats/index.php?letter=".$letter."&sortby=url&orderby=".$orderby."&query=".$query."'>"._ML_URL."</a></b></span></td>\n";
$cols = 7;
if ( $xoopsUser ) {
if ( $xoopsUser->isAdmin() ) {
$cols = 8;
echo "<td align='center'><span ><b><a href='".XOOPS_URL."/modules/xmmemberstats/index.php?letter=".$letter."&sortby=email&orderby=".$orderby."&query=".$query."'>"._ML_FUNCTIONS."</a></b></span></td>\n";
}
}
echo "</tr>";
$a = 0;
$dcolor_A = "odd";
$dcolor_B = "even";

$num_users = $xoopsDB->getRowsNum($result); //number of users per sorted and limit query
if ( $num_rows_per_order > 0 ) {
while ( $userinfo = $xoopsDB->fetchArray($result) ) {
$userinfo = new XoopsUser($userinfo['uid']);
$dcolor = ($a == 0 ? $dcolor_A : $dcolor_B);
echo "<tr class='".$dcolor."'>\n";
echo "<td align='center'><img src='".XOOPS_URL."/uploads/".$userinfo->user_avatar()."' alt='' width='50' height='50' />&nbsp;</td>\n";
echo "<td align='center'><img src='".XOOPS_URL."/uploads/".$userinfo->user_photo()."' alt='' width='50' height='50' />&nbsp;</td>\n";
echo "<td align='center'><a href='".XOOPS_URL."/userinfo.php?uid=".$userinfo->uid()."'>".$userinfo->uname("E")."</a>&nbsp;</td>\n";
echo "<td align='center'><a href='".XOOPS_URL."/userinfo.php?uid=".$userinfo->uid()."'>".$userinfo->user_genre("E")."</a>&nbsp;</td>\n";
echo "<td align='center'><a href='".XOOPS_URL."/userinfo.php?uid=".$userinfo->uid()."'>".$userinfo->user_orientation("E")."</a>&nbsp;</td>\n";
echo "<td align='center'><a href='".XOOPS_URL."/userinfo.php?uid=".$userinfo->uid()."'>".$userinfo->user_codepostal("E")."</a>&nbsp;</td>\n";
echo "<td align='center'><a href='".XOOPS_URL."/userinfo.php?uid=".$userinfo->uid()."'>".$userinfo->user_planete("E")."</a>&nbsp;</td>\n";
echo "\n";
echo "<td align='center'>".formatTimeStamp($userinfo->user_regdate(),"m")."&nbsp;</td>\n";
$showmail = 0;
if ( $userinfo->user_viewemail() ) {
$showmail = 1;
} else {
if ( $xoopsUser ) {
if ( $xoopsUser->isAdmin() ) {
$showmail = 1;
}
}

}
if ( $showmail ){
echo "<td align='center'><a href='mailto:".$userinfo->email("E")."'><img src='".XOOPS_URL."/images/icons/email.gif' border='0' alt='";
printf(_SENDEMAILTO,$userinfo->uname("E"));
echo "' /></a></td>\n";
} else {
echo "<td>&nbsp;</td>\n";
}
echo "<td align='center'>";
if ( $xoopsUser ) {
echo "<a href='javascript:openWithSelfMain(\"".XOOPS_URL."/pmlite.php?send2=1&to_userid=".$userinfo->uid()."\",\"pmlite\",450,370);'>";
echo "<img src='".XOOPS_URL."/images/icons/pm.gif' border='0' alt='";
printf(_SENDPMTO,$userinfo->uname("E"));
echo "' /></a>";
} else {
echo "&nbsp;";
}
echo "</td>\n";

if ( $userinfo->url("E") ) {
echo "<td align='center'><a href='".$userinfo->url("E")."' target=new><img src='".XOOPS_URL."/images/icons/www.gif' border='0' alt='"._VISITWEBSITE."' /></a></td>\n";
} else {
echo "<td>&nbsp;</td>\n";
}

if ( $xoopsUser ) {
if ( $xoopsUser->isAdmin() ) {
echo "<td align='center'>[ <a href='".XOOPS_URL."/modules/system/admin.php?fct=users&op=reactivate&uid=".$userinfo->uid()."&op=modifyUser'>"._ML_EDIT."</a> | \n";
echo "<a href='".XOOPS_URL."/modules/system/admin.php?fct=users&op=delUser&uid=".$userinfo->uid()."'>"._ML_DELETE."</a> ]</td>\n";
}
}
echo "</tr>";
$a = ($dcolor == $dcolor_A ? 1 : 0);
} // end while ()
echo "</table></td></tr></table>";
// start of next/prev/row links.
echo "<br /><br />";

echo "\n<table height='20' width='75%' cellspacing='0' cellpadding='0' border='0' ><tr><td class='bg1'>";

if ($query != "")
{
$isQuery="&query=".$query;
}else
{
$isQuery="";
}
if ( $num_rows_per_order > $pagesize ) {
$total_pages = ceil($num_rows_per_order / $pagesize); // How many pages are we dealing with here ??
$prev_page = $page - 1;

if ( $prev_page > 0 ) {
echo "<td align='left' width='15%'><a href='".XOOPS_URL."/modules/xmmemberstats/index.php?letter=".$letter."&sortby=".$sortby2."&page=".$prev_page.$isQuery."'>";
echo "<<($prev_page)</a></td>";
} else {
echo "<td width='15%'>&nbsp;</td>\n";
}

echo "<td align='center' width='70%'>";



echo "</td>";

$next_page = $page + 1;
if ( $next_page <= $total_pages ) {
echo "<td align='right' width='15%'><a href='".XOOPS_URL."/modules/xmmemberstats/index.php?letter=".$letter."&sortby=".$sortby2."&page=".$next_page."&orderby=".$orderby2.$isQuery."'>";
echo "(".$next_page.")>></a></td>";
} else {
echo "<td width='15%'>&nbsp;</td>\n";
}
/* Added a numbered page list, only shows up to 50 pages. */

echo "</tr><tr><td colspan='3' align='center'>";
echo " <small>[ </small>";

for ( $n = 1; $n < $total_pages; $n++ ) {
if ( $n == $page ) {
echo "<small><b>$n</b></small></a>";
} else {
echo "<a href='".XOOPS_URL."/modules/xmmemberstats/index.php?letter=".$letter."&sortby=".$sortby2."&page=".$n."&orderby=".$orderby2.$isQuery."'>";
echo "<small>$n</small></a>";
}
if ( $n >= 50 ) { // if more than 50 pages are required, break it at 50.
$break = true;
break;
} else { // guess not.
echo "<small> | </small>";
}
}

if(!isset($break)) { // are we sopposed to break ?
if ( $n == $page ) {
echo "<small><b>$n</b></small></a>";
} else {
echo "<a href='".XOOPS_URL."/modules/xmmemberstats/index.php?letter=".$letter."&sortby=".$sortby2."&page=".$total_pages."&orderby=".$orderby2.$isQuery."'>";
echo "<small>$n</small></a>";
}
}
echo " <small>]</small> ";
echo "</td></td></tr>";

}else{
echo "<td align='center'>";

echo "</td></td></tr>";

}

echo "</table>\n";

// end of next/prev/row links

} else {
echo "<tr><td class='bg3' colspan='".$cols."' align='center'><br />\n";
echo "<b>";
printf(_ML_NOUSERFOUND,$letter);
echo "</b>\n";
echo "<br /></td></tr>\n";
echo "</table></td></tr></table><br />\n";
}
}

include(XOOPS_ROOT_PATH."/footer.php");
?>


Il n'y a pas de templates dans ce module, alors pour mettre les menus déroulants, je pense que c'est au niveau de cela:
Citation :

if ( isset($query) ) {
$where = " WHERE ".$xoopsDB->prefix("users").".level >0 AND (".$xoopsDB->prefix("users").".uname LIKE '%$query%' OR ".$xoopsDB->prefix("users").".name LIKE '%$query%'";
$where .= " OR ".$xoopsDB->prefix("users").".user_genre LIKE '%$query%'";
$where .= " OR ".$xoopsDB->prefix("users").".user_orientation LIKE '%$query%'";
$where .= " OR ".$xoopsDB->prefix("users").".user_codepostal LIKE '%$query%'";
$where .= " OR ".$xoopsDB->prefix("users").".user_planete LIKE '%$query%'";
$where .= " OR ".$xoopsDB->prefix("users").".user_icq LIKE '%$query%'";
$where .= " OR ".$xoopsDB->prefix("users").".user_from LIKE '%$query%'";
$where .= " OR ".$xoopsDB->prefix("users").".user_sig LIKE '%$query%'";
$where .= " OR ".$xoopsDB->prefix("users").".user_aim LIKE '%$query%'";
$where .= " OR ".$xoopsDB->prefix("users").".user_yim LIKE '%$query%'";
$where .= " OR ".$xoopsDB->prefix("users").".user_msnm LIKE '%$query%'";
if ( $xoopsUser ) {
if ( $xoopsUser->isAdmin() ) {
$where .= " OR ".$xoopsDB->prefix("users").".email LIKE '%$query%'";

Mais, je n'en suis pas certain, et puis quoi mettre????

Bonne soirée

Posté le : 20/12/2007 20:36

eparcyl... tranquille.
Partager Twitter Partagez cette article sur GG+
Re: création d'un menu déroulant dans xmmemberstat
Xoops accro
Inscrit: 16/08/2005 19:46
De Nanterre
Messages: 2331
Je n'y arrive pas....
Y a t'il une petite aide pour m'aiguiller? un exemple quelque part que je peut reproduire?
La page que qui est sur ce lien: Exemple , est le resultat du code ci-dessus.
Merci de votre aide.
A+

Posté le : 22/12/2007 21:09

eparcyl... tranquille.
Partager Twitter Partagez cette article sur GG+
Re: création d'un menu déroulant dans xmmemberstat
Xoops accro
Inscrit: 04/02/2003 01:54
De Le Mans
Messages: 12273
Attention, ce module fait l'objet d'une alerte de sécurité.

Posté le : 26/02/2008 00:53
Partager Twitter Partagez cette article sur GG+
Re: création d'un menu déroulant dans xmmemberstat
Semi pro
Inscrit: 19/08/2005 21:01
De 97221
Messages: 1980
Y'a moyen de corriger cela ?

Citation :
Description:
Two vulnerabilities have been discovered in the XM-Memberstats module for Xoops, which can be exploited by malicious people to conduct SQL injection attacks.

Input passed to the "letter" and "sortby" parameters in xmmemberstats/index.php is not properly sanitised before being used in SQL queries. This can be exploited to manipulate SQL queries by injecting arbitrary SQL code.

The vulnerabilities are confirmed in version 2.0e. Other versions may also be affected.

Solution:
Edit the source code to ensure that input is properly sanitised.

Posté le : 26/02/2008 01:40

Open in new windowOpen in new window
Partager Twitter Partagez cette article sur GG+
Re: création d'un menu déroulant dans xmmemberstat
Xoops accro
Inscrit: 16/08/2005 19:46
De Nanterre
Messages: 2331
Bonjour,

Merci de prévenir.

Du "letter" et du "sortby", il y en a partout sur les code ci dessus, comment assainir tous cela?

En attendant, je vais le désactiver de mon site, il reste xoopsmember.

Bonne journée

Posté le : 26/02/2008 05:42

eparcyl... tranquille.
Partager Twitter Partagez cette article sur GG+

 Haut   Précédent   Suivant



Vous pouvez voir les sujets.
Vous ne pouvez pas débuter de nouveaux sujets.
Vous ne pouvez pas répondre aux contributions.
Vous ne pouvez pas éditer vos contributions.
Vous ne pouvez pas effacez vos contributions.
Vous ne pouvez pas ajouter de nouveaux sondages.
Vous ne pouvez pas voter en sondage.
Vous ne pouvez pas attacher des fichiers à vos contributions.
Vous ne pouvez pas poster sans approbation.

Propulsé avec XOOPS | Graphisme adapté par Tatane, Grosdunord, Montuy337513

52 Personne(s) en ligne (40 Personne(s) connectée(s) sur Forum) | Utilisateur(s): 0 | Invité(s): 52 | Plus ...