21
Xtracted
Re: List members?
  • 2004/1/16 19:04

  • Xtracted

  • Not too shy to talk

  • Posts: 138

  • Since: 2004/1/7 2


Ok, done.. Now what?

22
shino
Re: List members?
  • 2004/1/16 19:41

  • shino

  • Theme Designer

  • Posts: 23

  • Since: 2003/7/16


it's a table with the "grades"
he's in french, sorry :p
translate yourself !


23
Xtracted
Re: List members?
  • 2004/1/16 19:55

  • Xtracted

  • Not too shy to talk

  • Posts: 138

  • Since: 2004/1/7 2


Eh.. what am I supposed to do with it? =P All I want is that it should say "Rank" on the top of the members search result page... =P

24
Mithrandir
Re: List members?

The hacked xoopsmembers/index.php

Where you added the previous code to fetch the user rank.

Outside of that is a list of $xoopsTpl->assign('lang_Something' => _MA_SOMETHING);

Add a
$xoopsTpl->assign('lang_rank' =>

Sorry - intoxicated atm.

Seems the code for saying "Rank" at the top of the page is in some weird language file in some weird module.

If this is a modification of a personal website and nothing to do with language-selection etc. Just edit the template to say
<td>Rank</td>

instead of
<td><{$lang_rank}></td>

Not as clean code - but if you run only English on your site, it doesn't matter, really.

25
irmtfan
Re: List members?
  • 2004/2/21 22:49

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


sorry for my basic question

i create list.php & grade.php how use them?? what is the next step?

i want to show member list in xoopsmembers/index.php instead search page & show ranks of users & any useful command in list.php & grades.php

26
irmtfan
Re: List members?
  • 2004/2/28 9:44

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


just a guide to use this hack plz

27
Xtracted
Re: List members?
  • 2005/4/20 14:42

  • Xtracted

  • Not too shy to talk

  • Posts: 138

  • Since: 2004/1/7 2


Ok, now with this hack, I get people who gets wrong rank displayed for users.. it works fine for me but for others the wrong rank is displayed in front of certain people in the memberlist.. I think that the ranks are moved down one step or something..

28
u2psycho
Re: List members?
  • 2005/5/23 0:00

  • u2psycho

  • Just popping in

  • Posts: 6

  • Since: 2005/1/3 2


i read and re-read this topic and still don't understand how to get the members rank displayed on my site members list.....can anyone help me? and show me the different steps ?

do i only have to modify my index.php file to make it work? make a new file? plz help the newb coder i am...i joined my index.php and i put in red the line where theres something missing....can some1 help me filling that part so the members rank can be displayed?or do i need to do seomthing else too? i tried a few things but always got a blank column....i really dont know wut to do :(

here's my index.php from modules/xoopsmembers

<?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                           //
//                       <https://xoops.org/>  &nbs ... nbsp;   //
// ------------------------------------------------------------------------- //
//  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 //
//  ------------------------------------------------------------------------ //
include "../../mainfile.php";
include 
"../../header.php";
function 
alpha() {
    global 
$sortby$xoopsConfig;
    
$alphabet = array ( "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", );
        
$num count($alphabet) - 1;
        echo 
"<div align='center'>[ "// start of HTML
        
$counter 0;
        while (list(, 
$ltr) = each($alphabet)) {
                echo 
"<a href='".XOOPS_URL."/modules/xoopsmembers/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'] == "xoopsmembers" ) {
    
$xoopsOption['show_rblock'] =1;
    include(
XOOPS_ROOT_PATH."/header.php");
    
make_cblock();
    echo 
"<br />";
} else {
    
$xoopsOption['show_rblock'] =0;
    include(
XOOPS_ROOT_PATH."/header.php");
}
$pagesize 20;

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 level>0 AND (uname LIKE '%$query%' OR user_icq LIKE '%$query%' ";
        
$where .= "OR user_from LIKE '%$query%' OR user_sig LIKE '%$query%' ";
        
$where .= "OR user_aim LIKE '%$query%' OR user_yim LIKE '%$query%' OR user_msnm like '%$query%'";
    if ( 
$xoopsUser ) {
            if ( 
$xoopsUser->isAdmin() ) {
                
$where .= " OR email LIKE '%$query%'";
        }
        }
    
$where .= ") ";
} else {
        
$where "WHERE level>0";
}
$result $xoopsDB->query("SELECT uid, uname FROM ".$xoopsDB->prefix("users").$where ORDER BY uid DESC",1,0);
list(
$lastuid$lastuser) = $xoopsDB->fetchRow($result);

OpenTable();
echo 
"<div align='center'><b>";
echo 
"</b><br /><br />n";
echo 
Last_User." <a href='".XOOPS_URL."/userinfo.php?uid=".$lastuid."'>".$lastuser."</a></div>n";
if (isset(
$query) && trim($query) != "") {
        
$where "WHERE level>0 AND (uname LIKE '%$query%' OR user_icq LIKE '%$query%' ";
        
$where .= "OR user_from LIKE '%$query%' OR user_sig LIKE '%$query%' ";
        
$where .= "OR user_aim LIKE '%$query%' OR user_yim LIKE '%$query%' OR user_msnm like '%$query%'";
        if ( 
$xoopsUser ) {
        if ( 
$xoopsUser->isAdmin() ) {
                
$where .= " OR email LIKE '%$query%'";
            }
    }
    
$where .= ") ";
} else {
        
$where "WHERE level>0";
}

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/xoopsmembers/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='".SEARCH."' /></form></td><td>";

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

$min $pagesize * ($page 1); 
$max $pagesize
        
$count "SELECT COUNT(uid) AS total FROM ".$xoopsDB->prefix("users")." "// Count all the users in the db..
$select "SELECT uid, name, uname, email, url, user_avatar, user_regdate, user_icq, user_from, user_aim, user_yim, user_msnm, user_viewemail FROM ".$xoopsDB->prefix("users")." ";
if ( ( 
$letter != _ML_OTHER ) AND ( $letter != _ML_ALL ) ) {
    
$where "WHERE level>0 AND uname LIKE '".$letter."%' ";
} else if ( ( 
$letter == _ML_OTHER ) AND ( $letter != _ML_ALL ) ) {
        
$where "WHERE level>0 AND uname REGEXP '^[1-9]' "
} else { 
        
$where "WHERE level>0 "
}
$sort "order by $sortby $orderby";


if ( isset(
$query) ) {
        
$where "WHERE level>0 AND (uname LIKE '%$query%' OR user_icq LIKE '%$query%' ";
        
$where .= "OR user_from LIKE '%$query%' OR user_sig LIKE '%$query%' ";
        
$where .= "OR user_aim LIKE '%$query%' OR user_yim LIKE '%$query%' OR user_msnm LIKE '%$query%'";
        if ( 
$xoopsUser ) {
        if ( 
$xoopsUser->isAdmin() ) {
                
$where .= "OR email LIKE '%$query%'";
        }
        }
    
$where .= ") ";
}
$count_result $xoopsDB->query($count.$where);
list(
$num_rows_per_order) = $xoopsDB->fetchRow($count_result);

$result $xoopsDB->query($select.$where.$sort,$max,$min) or die($xoopsDB->error() ); // Now lets do it !!
echo "<br />";
if ( 
$letter != "front" ) {
    if ( 
$orderby == "ASC" ) {
        
$orderby "DESC";
    } else {
        
$orderby "ASC";
    }
    if ( !isset(
$query) ) {
        
$query "";
    }
    echo 
"<table border='0' cellpadding='0' cellspacing='0' valign='top' width='100%' class='head'><tr><td>n";
    echo 
"<table width='100%' border='0' cellspacing='1' cellpadding='4'><tr>n";
    echo 
"<td align='center'><span ><b><a href='".XOOPS_URL."/modules/xoopsmembers/index.php?letter=".$letter."&sortby=user_avatar&orderby=".$orderby."&query=".$query."'>".Avatar."</a></b></span></td>n";
        echo 
"<td align='center'><span ><b><a href='".XOOPS_URL."/modules/xoopsmembers/index.php?letter=".$letter."&sortby=uname&orderby=".$orderby."&query=".$query."'>".NickName."</a></b></span></td>n";
        echo 
"<td align='center'><span ><b><a href='".XOOPS_URL."/modules/xoopsmembers/index.php?letter=".$letter."&sortby=url&orderby=".$orderby."&query=".$query."'>".Rank."</a></b></span></td>n";
        echo 
"<td align='center'><span ><b><a href='".XOOPS_URL."/modules/xoopsmembers/index.php?letter=".$letter."&sortby=name&orderby=".$orderby."&query=".$query."'>".Posts."</a></b></span></td>n";
    echo 
"<td align='center'><span ><b><a href='".XOOPS_URL."/modules/xoopsmembers/index.php?letter=".$letter."&sortby=user_regdate&orderby=".$orderby."&query=".$query."'>".RegDate."</a></b></span></td>n";
        echo 
"<td align='center'><span ><b><a href='".XOOPS_URL."/modules/xoopsmembers/index.php?letter=".$letter."&sortby=email&orderby=".$orderby."&query=".$query."'>".EMAIL."</a></b></span></td>n";
    echo 
"<td align='center'><span ><b><a href='".XOOPS_URL."/modules/xoopsmembers/index.php?letter=".$letter."&sortby=email&orderby=".$orderby."&query=".$query."'>".PM."</a></b></span></td>n";
        echo 
"<td align='center'><span ><b><a href='".XOOPS_URL."/modules/xoopsmembers/index.php?letter=".$letter."&sortby=url&orderby=".$orderby."&query=".$query."'>".URL."</a></b></span></td>n";
        
$cols 8;
        if ( 
$xoopsUser ) {
        if ( 
$xoopsUser->isAdmin() ) {
                    
$cols 9;
                    echo 
"<td align='center'><span ><b><a href='".XOOPS_URL."/modules/xoopsmembers/index.php?letter=".$letter."&sortby=email&orderby=".$orderby."&query=".$query."'>".Admin."</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 == $dcolor_A $dcolor_B);
                        echo 
"<tr class='".$dcolor."'>n";
            echo 
"<td align='center'><img src='".XOOPS_URL."/uploads/".$userinfo->user_avatar()."' alt='' />&nbsp;</td>n";
            echo 
"<td align='center'><a href='".XOOPS_URL."/userinfo.php?uid=".$userinfo->uid()."'>".$userinfo->uname("E")."</a>&nbsp;</td>n";
            [
color=FF0000]//missing lines to show rank here[/color]
                        
echo "<td>".$userinfo->posts("E")."&nbsp;</td>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";
            }
                        echo 
"</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'>".EDIT."</a>n";
                                echo 
"<a href='".XOOPS_URL."/modules/system/admin.php?fct=users&op=delUser&uid=".$userinfo->uid()."'>".DELETE."</a></td>n";
                }
                        }
                        echo 
"</tr>";
                        
$a = ($dcolor == $dcolor_A 0);
                } 
// end while ()
        
echo "</table></td></tr></table>";
                
// start of next/prev/row links.
        
echo "<br /><br />";

                echo 
"n<table height='20' width='100%' cellspacing='0' cellpadding='0' border='0' ><tr><td class='bg1'>";
                
                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 ) {
                            echo 
"<td align='left' width='15%'><a href='".XOOPS_URL."/modules/xoopsmembers/index.php?letter=".$letter."&sortby=".$sortby."&page=".$prev_page."'>";
                            echo 
"<<($prev_page)</a></td>";
                        } else { 
                            echo 
"<td width='15%'>&nbsp;</td>n"
                        }
                
                        echo 
"<td align='center' width='70%'>";


                        
$next_page $page 1;
                        if ( 
$next_page <= $total_pages ) {
                            echo 
"<td align='right' width='15%'><a href='".XOOPS_URL."/modules/xoopsmembers/index.php?letter=".$letter."&sortby=".$sortby."&page=".$next_page."'>";
                            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/xoopsmembers/index.php?letter=".$letter."&sortby=".$sortby."&page=".$n."'>";
                    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/xoopsmembers/index.php?letter=".$letter."&sortby=".$sortby."&page=".$total_pages."'>";
                                echo 
"<small>$n</small></a>";
                    }
                        }
                        echo 
" <small>]</small> ";
                        echo 
"</td></td></tr>";

                }else{ 
                        echo 
"<td align='center'>";
            
printf(_ML_USERSFOUND,$num_rows_per_order);
                        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";
        }
}
CloseTable();
include(
XOOPS_ROOT_PATH."/footer.php");

?>


thx in advance for ur help

29
areamike
Re: List members?
  • 2005/9/27 17:01

  • areamike

  • Just popping in

  • Posts: 33

  • Since: 2005/1/28


Quote:

I cannot access that link in order to try the same thing the poster of this topic did.

Login

Who's Online

65 user(s) are online (41 user(s) are browsing Support Forums)


Members: 0


Guests: 65


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Aug 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits