Member_List fix

"Mark Chaney" <[email protected]> Sun, 15 Sep 2002 21:52:37 -0400
Newsgroups gmane.comp.web.envolution.devel
Message-ID <018901c25d23$bd1ba7e0$a499abac@macscr>
This is a multi-part message in MIME format.

------=_NextPart_000_0186_01C25D02.34F3DCF0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

I already sent this to brook to put into the newest package, but it was
released before i got it to here, here it is if u want to put it in.

Just place in the Member_List module, its a replacement for the index.php
file.

Member_List
-fixed bug with Recent Registered users

------=_NextPart_000_0186_01C25D02.34F3DCF0
Content-Type: application/octet-stream;
	name="index.php"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="index.php"

<?php // $Id: index.php,v 1.49.2.5 2002/05/21 01:48:56 reptilerooms Exp =
$ $Name:  $
// =
----------------------------------------------------------------------
// POST-NUKE Content Management System
// Copyright (C) 2001 by the Post-Nuke Development Team.
// http://www.postnuke.com/
// =
----------------------------------------------------------------------
// Based on Bjorn Sodergrens MyPHPortal Modified Member List.
// PHP-NUKE Web Portal System - http://phpnuke.org/
// Thatware - http://thatware.org/
// Some code taken from MemberList coded by Paul Joseph Thompson
// of www.slug.okstate.edu
// In memoriam of Members List War ;)
// =
----------------------------------------------------------------------
// LICENSE
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License (GPL)
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// 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.
//
// To read the license please visit http://www.gnu.org/copyleft/gpl.html
// =
----------------------------------------------------------------------
// Original Author of file: Francisco Burzi
// Purpose of file: Displays member listings
// =
----------------------------------------------------------------------

if (!defined("LOADED_AS_MODULE")) {
    die ("You can't access this file directly...");
}

/**
 * Credits to Edgar Miller -- http://www.bosna.de/ from his post on =
PHP-Nuke
 * =
(http://phpnuke.org/article.php?sid=3D2010&mode=3Dnested&order=3D0&thold=3D=
0)
 * Further Credits go to Djordjevic Nebojsa (nesh) for the fix for the =
fix
 */

$ModName =3D basename( dirname( __FILE__ ) );

modules_get_language();

function alpha()
{

    // Creates the list of letters and makes them a link.
    global $sortby, $ModName;
        $alphabet =3D array (_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",_OTHER);
        $num =3D count($alphabet) - 1;
        echo "<center>[ ";
        $counter =3D 0;
        while(list(, $ltr) =3D each($alphabet)) {
            echo "<a class=3D\"pn-normal\" =
href=3D\"modules.php?op=3Dmodload&amp;name=3D$ModName&amp;file=3Dindex&am=
p;letter=3D$ltr&amp;sortby=3D$sortby\">".pnVarPrepHTMLDisplay($ltr)."</a>=
";
            if ($counter =3D=3D round($num/2)) {
                echo " ]\n<br>\n[ ";
            } elseif($counter !=3D $num) {
                echo "&nbsp;|&nbsp;\n";
            }
            $counter++;
        }
		echo " ]\n</center><br />\n";
        echo "<form method=3D\"POST\" action=3D\"$PHP_SELF\">\n";
		echo "  <table border=3D\"0\" cellspacing=3D\"2\" =
width=3D\"100%\">\n";
		echo "    <tr>\n";
		echo "      <td valign=3D\"top\" align=3D\"center\"><b>Search:</b>\n";
		echo "      <input type=3D\"text\" name=3D\"letter\" =
size=3D\"35\">\n";
		echo " 		&nbsp;<input type=3D\"submit\" value=3D\"Submit\"><br>\n";
		echo "      <input type=3D\"hidden\" name=3D\"op\" =
value=3D\"modload\">\n";
		echo "      <input type=3D\"hidden\" name=3D\"name\" =
value=3D\"$ModName\">\n";
		echo "      <input type=3D\"hidden\" name=3D\"file\" =
value=3D\"index\">\n";
		echo "      <input type=3D\"radio\" name=3D\"sortby\" =
value=3D\"uname\" checked>Username\n";
		echo "      <input type=3D\"radio\" name=3D\"sortby\" =
value=3D\"name\">Realname\n";
		echo "      <input type=3D\"radio\" name=3D\"sortby\" =
value=3D\"url\">Website\n";
		echo "      <input type=3D\"radio\" name=3D\"sortby\" =
value=3D\"femail\">Email\n";
		echo "      </td>\n";
		echo "    </tr>\n";
		echo "  </table>\n";
		echo "</form>\n";
}
       =20
function SortLinks($letter)
{
    // Makes order by links..
    global $sortby, $ModName;

    if ($letter =3D=3D "front") {
        $letter =3D _ALL;
    }
        echo "\n<div align=3D\"right\">\n";
        echo "<font class=3D\"pn-normal\"><b>"._SORTBY."&nbsp;[</b> =
</font>";
        if ($sortby =3D=3D "uname" OR !$sortby) {
            echo "<font =
class=3D\"pn-normal\"><b>"._MNICKNAME."&nbsp;|&nbsp;</b></font>";
        } else {
            echo "<a class=3D\"pn-normal\" =
href=3D\"modules.php?op=3Dmodload&amp;name=3D$ModName&amp;file=3Dindex&am=
p;letter=3D$letter&amp;sortby=3Duname\"><b>"._MNICKNAME."</b></a><b>&nbsp=
;|&nbsp;</b>";
        }
        if ($sortby =3D=3D "name") {
            echo "<font =
class=3D\"pn-normal\"><b>"._MREALNAME."&nbsp;|&nbsp;</b></font>";
        } else {
            echo "<a class=3D\"pn-normal\" =
href=3D\"modules.php?op=3Dmodload&amp;name=3D$ModName&amp;file=3Dindex&am=
p;letter=3D$letter&amp;sortby=3Dname\"><b>"._MREALNAME."</b></a><b>&nbsp;=
|&nbsp;</b>";
        }
        if ($sortby =3D=3D "femail") {
            echo "<font =
class=3D\"pn-normal\"><b>"._MEMAIL."&nbsp;|&nbsp;</b></font>";
        } else {
            echo "<a class=3D\"pn-normal\" =
href=3D\"modules.php?op=3Dmodload&amp;name=3D$ModName&amp;file=3Dindex&am=
p;letter=3D$letter&amp;sortby=3Dfemail\"><b>"._MEMAIL."</b></a><b>&nbsp;|=
&nbsp;</b>";
        }
        if ($sortby =3D=3D "url") {
            echo "<font =
class=3D\"pn-normal\"><b>"._MURL."&nbsp;</b></font>";
        } else {
            echo "<a class=3D\"pn-normal\" =
href=3D\"modules.php?op=3Dmodload&amp;name=3D$ModName&amp;file=3Dindex&am=
p;letter=3D$letter&amp;sortby=3Durl\"><b>"._MURL."</b></a><b>&nbsp;</b>";=

        }
        echo "<b>]</b>\n</div>\n";
}

include 'header.php';
    if (!pnSecAuthAction(0, 'Users::', '::', ACCESS_READ)) {
        echo _MODIFYUSERSNOAUTH;
        include 'footer.php';
        return;
    }

$pagesize =3D 20;
if ($sorting >'')
{
$sortby =3D $sorting;
}
else
 {
    $sortby =3D "pn_uname";
}

if (!isset($letter)) {
    $letter =3D "A";
}

if (!isset($page)) {
    $page =3D 1;
}


 // TODO
 // All of the code from here to around line 125 will be optimized a =
little later
 // This is the header section that displays the last registered and =
who's logged in and whatnot
list($dbconn) =3D pnDBGetConn();
$pntable =3D pnDBGetTables();

$column =3D &$pntable['users_column'];
$myquery =3D buildSimpleQuery ('users', array ('uname'), '', =
"$column[uid] DESC", 1);
$result =3D $dbconn->Execute($myquery);
list($lastuser) =3D $result->fields;

echo "\n\n<!-- MEMBERS LIST -->\n\n";
    OpenTable();
        echo "<center><font =
class=3D\"pn-pagetitle\">".pnConfigGetVar('sitename')." =
"._MEMBERSLIST."</font></center>\n";
    CloseTable();

        $result =3D $dbconn->Execute("SELECT COUNT(*) FROM =
$pntable[users]");
        list($numrows) =3D $result->fields;
        $result->Close();

        if(pnSecAuthAction(0, 'Users::', '::', ACCESS_COMMENT)){
            $sessioninfocolumn =3D &$pntable['session_info_column'];
            $sessioninfotable =3D $pntable['session_info'];

            $activetime =3D time() - (pnConfigGetVar('secinactivemins') =
* 60);

            // Get list of users on-line
            $sql =3D "SELECT DISTINCT $sessioninfocolumn[uid]
                    FROM $sessioninfotable
                    WHERE $sessioninfocolumn[uid] !=3D 0
                    AND $sessioninfocolumn[lastused] > $activetime";
            $result3 =3D $dbconn->Execute($sql);
            $unames =3D array();
            for (; !$result3->EOF; $result3->MoveNext()) {
                $unames[] =3D pnUserGetVar('uname', =
$result3->fields[0]);
            }
            $result3->Close();
            // Sort by username
            sort($unames);
            reset($unames);
            $numregusers =3D count($unames);

		$numrows --; =20
		// SAURON : do not see the Anonymous User for security reason
	=09
            echo "<center>[<font class=3D\"pn-normal\">"._WEHAVE." =
".pnVarPrepHTMLDisplay($numrows)." "._MREGISTERED." =
".pnVarPrepHTMLDisplay($numregusers)."</font>\n";
            echo "<font class=3D\"pn-normal\">"._MREGONLINE."</font>";
			echo "<font class=3D\"pn-normal\">"._GREETINGS."</font>
     		<a =
class=3D\"pn-normal\"href=3D\"user.php?op=3Duserinfo&amp;uname=3D$lastuse=
r\">".pnVarPrepHTMLDisplay($lastuser)."</a> ]<br /><br /><br =
/></center>\n";
            	$numrows ++; // ... GL (just for fun and to avoid any =
subsequent prob.)

        }
         =20
 alpha();
        SortLinks($letter);

// end of top memberlist section thingie
// This starts the beef...

        $min =3D $pagesize * ($page - 1); // This is where we start our =
record set from
        $max =3D $pagesize; // This is how many rows to select

        $column =3D &$pntable['users_column'];
        $count =3D "SELECT COUNT($column[uid]) FROM $pntable[users] ";
        if (($letter !=3D _OTHER) AND ($letter !=3D _ALL)) {
	    // are we listing all or "other" ?
	    // SAURON : do not see the Anonymous User for security reason
            $where =3D "UPPER($column[uname]) LIKE UPPER('".$letter."%') =
AND $column[uname] NOT LIKE 'Anonymous'";
	    // I guess we are not..
        } else if (($letter =3D=3D _OTHER) AND ($letter !=3D _ALL)) {
	    // But other is numbers ?
            $where =3D "($column[uname] LIKE '0%'
                          OR $column[uname] LIKE '1%'
                          OR $column[uname] LIKE '2%'
                          OR $column[uname] LIKE '3%'
                          OR $column[uname] LIKE '4%'
                          OR $column[uname] LIKE '5%'
                          OR $column[uname] LIKE '6%'
                          OR $column[uname] LIKE '7%'
                          OR $column[uname] LIKE '8%'
                          OR $column[uname] LIKE '9%'
                          OR $column[uname] LIKE '-%'
                          OR $column[uname] LIKE '.%'
                          OR $column[uname] LIKE '@%'
                          OR $column[uname] LIKE '$%')";

            // fifers: while this is not the most eloquent solution, it =
is
            // cross database compatible.  We could do an if dbtype is =
mysql
            // then do the regexp.  consider for performance =
enhancement.
            //
            // "WHERE $column[uname] REGEXP \"^\[1-9]\" "
            // REGEX :D, although i think its MySQL only
            // Will have to change this later.
            // if you know a better way to match only the first char
            // to be a number in uname, please change it and email
            // sweede-6beUIgBy/[email protected] the correction
            // or go to post-nuke project page and post
            // your correction there. Thanks, Bjorn.
       } else { // or we are unknown or all..
            $where =3D " $column[uname] NOT LIKE 'Anonymous'"; // this =
is to get rid of anoying "undefinied variable" message
            // SAURON : do not see the Anonymous User for security =
reason
        }
        $sort =3D "$sortby ASC"; //sorty by .....

        // This is where we get our limit'd result set.
        $myquery =3D buildSimpleQuery('users', array('uid', 'name', =
'uname', 'femail', 'url', 'user_avatar','user_icq'), $where, $sort, =
$max, $min); //select our data

        $result =3D $dbconn->Execute($myquery);
        if ($result =3D=3D=3D false) {
            error_log("Error: " . $dbconn->ErrorNo() . ": " . =
$dbconn->ErrorMsg());
           PN_DBMsgError($dbconn, __FILE__, __LINE__, "Error accesing to =
the database");
        }
        $num_rows_per_order =3D $result->PO_RecordCount();
        if ($letter !=3D "front") {
            echo "<table width=3D\"100%\" border=3D\"0\" =
cellpadding=3D\"3\" cellspacing=3D\"1\"><tr>\n";
            echo "<td BGCOLOR=3D\"$bgcolor2\" align=3D\"center\"><font =
class=3D\"pn-normal\"><b>"._MNICKNAME."</b></font></td>\n";
            echo "<td BGCOLOR=3D\"$bgcolor2\" align=3D\"center\"><font =
class=3D\"pn-normal\"><b>"._MREALNAME."</b></font></td>\n";
            echo "<td BGCOLOR=3D\"$bgcolor2\" align=3D\"center\"><font =
class=3D\"pn-normal\"><b>"._STATUS."</b></font></td>\n";
            echo "<td BGCOLOR=3D\"$bgcolor2\" align=3D\"center\"><font =
class=3D\"pn-normal\"><b>"._EMAIL."</b></font></td>\n";
            echo "<td BGCOLOR=3D\"$bgcolor2\" align=3D\"center\"><font =
class=3D\"pn-normal\"><b>"._HOMEPAGE."</b></font></td>\n";
            echo "<td BGCOLOR=3D\"$bgcolor2\" align=3D\"center\"><font =
class=3D\"pn-normal\"><b>"._ACTIONS."</b></font></td>\n";
            $cols =3D 6;
            if (pnSecAuthAction(0, 'Users::', '::', ACCESS_EDIT)){
                $cols =3D 7;
                echo "<td bgcolor=3D\"$bgcolor2\" =
align=3D\"center\"><font =
class=3D\"pn-normal\"><b>"._FUNCTIONS."</b></font></td>\n";
            }
            echo "</tr>";
            $a =3D 0;

            $dcolor_A =3D "$bgcolor3";
            $dcolor_B =3D "$bgcolor1";


            $num_users =3D $result->PO_RecordCount(); //number of users =
per sorted and limit query
            if($num_rows_per_order > 0 ) {
                while(!$result->EOF) {
                    $user =3D $result->GetRowAssoc(false);
                    $result->MoveNext();
                    $dcolor =3D ($a =3D=3D 0 ? $dcolor_A : $dcolor_B);
                    $avatar =3D "<center><img =
src=3D\"images/avatar/".$user['user_avatar']."\"n";

		$useruid=3D $user['uid'];
		$activetime =3D time() - (pnConfigGetVar('secinactivemins') * 60);
  $sessioninfocolumn =3D &$pntable['session_info_column'];
            $sessioninfotable =3D $pntable['session_info'];
 $onlinesess =3D mysql_query("SELECT DISTINCT $sessioninfocolumn[uid]
                    FROM $sessioninfotable
                    WHERE $sessioninfocolumn[uid] =3D $useruid and =
$sessioninfocolumn[lastused] > $activetime");
    list($online) =3D mysql_fetch_row($onlinesess);
    if ($online > ''){
    $check =3D "<center><font color=3Dred><b><img
src=3D\"modules/$ModName/images/online.gif\"  align=3Dbottom =
border=3D0></a> Online</b></font></center>";
    }
    else
    {
    $check =3D "<center><font color=3Dblack><img
src=3D\"modules/$ModName/images/offline.gif\" align=3Dbottom =
border=3D0></a> Offline</font></center>";
    }



                    echo "<tr><td bgcolor=3D\"$dcolor\">&nbsp;<a =
class=3D\"pn-normal\" =
href=3D\"user.php?op=3Duserinfo&amp;uname=3D$user[uname]\"><b>".pnVarPrep=
HTMLDisplay($user['uname'])."</b></a>&nbsp;</td>\n";
                    echo "<td bgcolor=3D\"$dcolor\"><font =
class=3D\"pn-normal\">".pnVarPrepHTMLDisplay($user['name'])." =
&nbsp;</font></td>\n";
                    echo "<td bgcolor=3D\"$dcolor\"><font =
class=3D\"pn-normal\">$check &nbsp;</font></td>\n";
                    echo "<td bgcolor=3D\"$dcolor\"><font =
class=3D\"pn-normal\">";
                                        if ($user['femail']) {
                                               // echo "<a =
class=3D\"pn-normal\" href=3D\"mailto:".$user['femail']."\" =
target=3D\"_blank\">".$user['femail']."</a>";
                                                echo "<center><a =
class=3D\"pn-normal\" href=3D\"mailto:".$user['femail']."\"><img =
src=3D\"modules/$ModName/images/email.gif\" border=3D\"0\" =
hspace=3D\"2\" alt=3D\""._EMAIL2."\"></center></a>";
                                        }
                                    echo "</font></td>\n";
                    echo "<td bgcolor=3D\"$dcolor\">";

                                if(("http://" =3D=3D $user['url']) || =
(!eregi("http://", $user['url'])) || (empty($user['url']))) {
                        $user['url'] =3D '';
                        }
            if (!empty($user['url'])) {
            echo "<center><a target=3D\"_blank\" class=3D\"pn-normal\" =
href=3D\"".$user['url']."\"><img =
src=3D\"modules/$ModName/images/site.gif\" align=3D\"bottom\" =
border=3D\"0\" hspace=3D\"2\" alt=3D\""._HPAGE."\"></a></center></td>";
            }

               echo "<td align=3D\"center\" bgcolor=3D\"$dcolor\">";
                                        if (($user[uname] !=3D =
"Anonymous") and ($user[uid] !=3D pnUserGetVar('uid')) ) {
                       echo "<a =
href=3D\"modules.php?op=3Dmodload&name=3DMessages&file=3Dreplypmsg&send=3D=
1&uname=3D$user[uname]\"><img src=3D\"modules/$ModName/images/pm.gif\" =
border=3D\"0\" hspace=3D\"2\" alt=3D\""._SENDPRIVMSG."\"></a>";

               }
               echo "</td>";

                    if (pnSecAuthAction(0, 'Users::', '::', =
ACCESS_EDIT)){
                        $authid =3D pnSecGenAuthKey();
                        echo "\n<td bgcolor=3D$dcolor =
align=3Dcenter><font class=3D\"pn-normal\"><a class=3D\"pn-normal\" =
href=3D\"admin.php?module=3DNS-User&amp;op=3DmodifyUser&amp;chng_uid=3D$u=
ser[uid]&amp;authid=3D$authid\"><font class=3D\"pn-normal\"><img =
src=3D\"modules/$ModName/images/edit.gif\" border=3D\"0\" hspace=3D\"2\" =
alt=3D\""._EDIT2."\"></font></a><font class=3D\"pn-sub\"></font>\n";
                        echo "<a class=3D\"pn-normal\" =
href=3D\"admin.php?module=3DNS-User&amp;op=3DdelUser&amp;chng_uid=3D$user=
[uid]&amp;authid=3D$authid\"><font class=3D\"pn-normal\"><img =
src=3D\"modules/$ModName/images/delete.gif\" border=3D\"0\" =
hspace=3D\"2\" alt=3D\""._DELUS."\"></font></a> </font></td>\n";
                    }
                    echo "</tr>";
                    $a =3D ($dcolor =3D=3D $dcolor_A ? 1 : 0);
                }
                // start of next/prev/row links.
                echo "\n<tr><td colspan=3D'$cols' align=3D'right'>\n";

        OpenTable();
                echo "\t<table width=3D'100%' cellspacing=3D'0' =
cellpadding=3D'0' border=3D0><tr>";
                if (!empty($where)) {
                    $where =3D " WHERE $where";
                } else {
                    $where =3D '';
                }

                $resultcount =3D $dbconn->Execute($count . $where);
                list ($numrows) =3D $resultcount->fields;
                $resultcount->Close();

                if ($numrows > $pagesize) {
                    $total_pages =3D ceil($numrows / $pagesize); // How =
many pages are we dealing with here ??
                    $prev_page =3D $page - 1;

                    if ( $prev_page > 0 ) {
                        echo "<td align=3D'left' width=3D'15%'><a =
class=3D\"pn-normal\" =
href=3D'modules.php?op=3Dmodload&amp;name=3D$ModName&amp;file=3Dindex&amp=
;letter=3D$letter&amp;sortby=3D$sortby&amp;page=3D$prev_page'>";
                        echo "<img =
src=3D\"modules/$ModName/images/left.gif\" border=3D\"0\" =
Alt=3D\""._PREVIOUS." =
(".pnVarPrepHTMLDisplay($prev_page).")\"></a></td>";
                    } else {
                        echo "<td width=3D'15%'>&nbsp;</td>\n";
                    }

                    echo "<td align=3D'center' width=3D'70%'>";
                    echo "<font class=3D\"pn-sub\">$numrows =
"._USERSFOUND." $letter ($total_pages "._PAGES.", $num_users =
"._USERSSHOWN.")</font>";
                    echo "</td>";

                    $next_page =3D $page + 1;
                    if ( $next_page <=3D $total_pages ) {
                        echo "<td align=3D'right' width=3D'15%'><a =
class=3D\"pn-normal\" =
href=3D'modules.php?op=3Dmodload&amp;name=3D$ModName&amp;file=3Dindex&amp=
;letter=3D$letter&amp;sortby=3D$sortby&amp;page=3D$next_page'>";
                        echo "<img =
src=3D\"modules/$ModName/images/right.gif\" border=3D\"0\" Alt=3D\"Next =
Page ($next_page)\"></a></td>";
                    } else {
                        echo "<td width=3D'15%'>&nbsp;</td></tr>\n";
                    }
                        // Added a numbered page list, only shows up to =
50 pages.
                        echo "<tr><td colspan=3D\"3\" =
align=3D\"center\">";
                        echo " <font class=3D\"pn-sub\">[ </font>";

                        for($n=3D1; $n < $total_pages; $n++) {
                            if ($n =3D=3D $page) {
                                echo "<font =
class=3D\"pn-sub\">$n</font></a>";
                        } else {
                echo "<a class=3D\"pn-normal\" =
href=3D'modules.php?op=3Dmodload&amp;name=3D$ModName&amp;file=3Dindex&amp=
;letter=3D$letter&amp;sortby=3D$sortby&amp;page=3D$n'>";
                echo "<font =
class=3D\"pn-sub\">".pnVarPrepHTMLDisplay($n)."</font></a>";
                }
                            if($n >=3D 50) {  // if more than 50 pages =
are required, break it at 50.
                                $break =3D true;
                                break;
                            } else {  // guess not.
                                echo "<font class=3D\"pn-sub\"> | =
</font>";
                            }
                        }

                        if(!isset($break)) { // are we supposed to break =
?
                if($n =3D=3D $page) {
                    echo "<font =
class=3D\"pn-sub\">".pnVarPrepHTMLDisplay($n)."</font></a>";
                } else {
                    echo "<a class=3D\"pn-normal\" =
href=3D'modules.php?op=3Dmodload&amp;name=3D$ModName&amp;file=3Dindex&amp=
;letter=3D$letter&amp;sortby=3D$sortby&amp;page=3D$total_pages'>";
                    echo "<font =
class=3D\"pn-sub\">".pnVarPrepHTMLDisplay($n)."</font></a>";
                }
                        }
                        echo " <font class=3D\"pn-sub\">]</font> ";
                        echo "</td></tr>";

// This is where it ends

                } else {  // or we dont have any users..
                    echo "<td align=3D'center'>";
                    echo "<font =
class=3D\"pn-sub\">".pnVarPrepHTMLDisplay($num_rows_per_order)." =
"._USERSFOUND." ".pnVarPrepHTMLDisplay($letter)."</font>";
                    echo "</td></tr>";
                 }
                 echo "</table>\n";
         CloseTable();
                echo "</td></tr>\n";


// end of next/prev/row links

            } else { // no members for this letter.
                echo "<tr><td bgcolor=3D\"$dcolor_A\" =
colspan=3D\"$cols\" align=3D\"center\"><br />\n";
                echo "<font class=3D\"pn-normal\">"._NOMEMBERS." =
".pnVarPrepHTMLDisplay($letter)."</font>\n";
                echo "<br></td></tr>\n";
            }
            echo "\n</table>\n";

		        echo "<table width=3D\"100%\"><tr><td width=3D\"100%\" =
align=3D\"left\" bgcolor=3D\"$bgcolor2\">\n";
                if ($numregusers !=3D 0) {
                echo '&nbsp;<font =
class=3D"pn-normal"><b><u>'._ONLINEREG.'</u></b></font>';
				echo "<td></tr><tr><td width=3D\"100%\" align=3D\"left\" =
bgcolor=3D\"$dcolor_A\">\n";
                foreach ($unames as $uname) {
                    echo '<a class=3D"pn-normal" =
href=3D"user.php?op=3Duserinfo&amp;uname=3D' . $uname . '">&nbsp;' =
.pnVarPrepForDisplay($uname).'</a>, ';
                }
            }
                echo "<br /><br /></td></tr></table>\n";
        =20
        }

//Last Registered Users

echo"<a name=3Dlast><br /><table width=3D100% bgcolor=3D$bgcolor2 =
cellspacing=3D1 cellpadding=3D3 align=3Dcenter><tr =
bgcolor=3D$multicolor><td  colspan=3D6><b><u>Last 10 registered =
users:</u></b></td></tr>";
$myquery2 =3D buildSimpleQuery('users', array('uid', 'name', 'uname', =
'femail', 'url','user_regdate'), "$column[uname] NOT LIKE 'Anonymous'" , =
'pn_user_regdate DESC' , 10); //select our data

        $result =3D $dbconn->Execute($myquery2);
		if ($result =3D=3D=3D false) {
            error_log("Error: " . $dbconn->ErrorNo() . ": " . =
$dbconn->ErrorMsg());
           PN_DBMsgError($dbconn, __FILE__, __LINE__, "Error accesing to =
the database");
        }
        $num_rows_per_order =3D $result->PO_RecordCount();
        echo "<br>";
             $a =3D 0;
=20
            $num_users =3D $result->PO_RecordCount(); //number of users =
per sorted and limit query
             if($num_rows_per_order > 0 ) {
                 while(!$result->EOF) {
                     $user =3D $result->GetRowAssoc(false);
                     $result->MoveNext();
                     $dcolor =3D ($a =3D=3D 0 ? $dcolor_A : $dcolor_B);
                    =20
					$newresult =3D mysql_query("select pn_user_regdate from =
$pntable[users] where pn_uid=3D".pnVarPrepHTMLDisplay($user['uid'])."");
	    list($user_regdate)=3Dmysql_fetch_row($newresult);
                    echo "<tr><td bgcolor=3D\"$dcolor\"><a =
class=3D\"pn-normal\" =
href=3D\"user.php?op=3Duserinfo&amp;uname=3D$user[uname]\"><b>".pnVarPrep=
HTMLDisplay($user['uname'])."</b></a></td><td width=3D\"20\" =
bgcolor=3D\"$dcolor\">".date("d.m.Y",$user_regdate)."</td><td =
align=3Dcenter bgcolor=3D\"$dcolor\">$check</td>\n";
                                       echo "<td bgcolor=3D\"$dcolor\" =
width=3D18>";
                                        if ($user['femail']) {
                                               // echo "<a =
class=3D\"pn-normal\" href=3D\"mailto:".$user['femail']."\" =
target=3D\"_blank\">".$user['femail']."</a>";
                                                echo "<a =
class=3D\"pn-normal\" href=3D\"mailto:".$user['femail']."\"><img =
src=3D\"modules/$ModName/images/email.gif\" border=3D\"0\" =
hspace=3D\"2\" alt=3D\""._EMAIL2."\"></a>";
                                        }
                                    echo "</td>\n";
                    echo "<td bgcolor=3D\"$dcolor\" width=3D11 =
align=3Dcenter>";
if(!$user['url'])  {
			$user['url'] =3D '';
			$img =3D'';
	    	    }
				else
				{
				$url =3D $user['url'] ;
				$img =3D"<img src=3D\"modules/$ModName/images/site.gif\" =
border=3D0>";
				}
			=09

            echo "<a href=3D\"$url\" =
target=3D\"_blank\">$img</a>&nbsp;</td>\n";
                  =20
 echo "<td bgcolor=3D\"$dcolor\" width=3D18 align=3Dright><b><font =
class=3D\"pn-normal\"><a =
href=3D\"modules.php?op=3Dmodload&name=3DMessages&file=3Dreplypmsg&send=3D=
1&uname=3D".pnVarPrepHTMLDisplay($user['uname'])."\"><img =
src=3D\"modules/$ModName/images/pm.gif\" border=3D0></a></font></td>\n";
                  =20
	    	  =20
                    echo "</tr>";
                    $a =3D ($dcolor =3D=3D $dcolor_A ? 1 : 0);
                }
		}
echo"</table><div align=3Dright>|<a href=3D\"#top\">Back to =
top</a>|</div><br>";

        include 'footer.php';
?>
------=_NextPart_000_0186_01C25D02.34F3DCF0--