1
Totoro
xoopsmembers : a link to the list of all members ?
  • 2005/1/24 16:29

  • Totoro

  • Just popping in

  • Posts: 9

  • Since: 2002/9/1 2


Hello

I'd like to create a personal bloc with a link pointing directly to the list of all the members of my XOOPS site (without geting the useless form page).

I know how to make a bloc ... the issue is the link, because I always get the form page of the xoopsmembers.php page, even if I create a link like " http://www.myxoopsite/modules/xoopsmembers/index.php?op=submit"

Thanx for you help

best regards

Totoro

2
Totoro
Re: xoopsmembers : a link to the list of all members ?
  • 2005/1/25 10:28

  • Totoro

  • Just popping in

  • Posts: 9

  • Since: 2002/9/1 2


Ok, solved my problem by creating a file dedicated to do this

3
purchapl
Re: xoopsmembers : a link to the list of all members ?
  • 2005/2/23 3:05

  • purchapl

  • Just popping in

  • Posts: 3

  • Since: 2005/2/23


Could you elaborate on how you accomplished this? It is precisely what I'm attempting to do...

Thanks.

4
Totoro
Re: xoopsmembers : a link to the list of all members ?
  • 2005/2/28 16:46

  • Totoro

  • Just popping in

  • Posts: 9

  • Since: 2002/9/1 2


I created a file called all.php, with this code in :

// $Id: index.php,v 1.18 2004/12/26 19:12:10 Onokazu Exp $
//  ------------------------------------------------------------------------ //
//                XOOPS - PHP Content Management System                      //
//                    Copyright (c) 2000 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 //
//  ------------------------------------------------------------------------ //
include "../../mainfile.php";

$op "submit";

if ( 
$op == "submit" ) {
    
$xoopsOption['template_main'] = 'xoopsmembers_searchresults.html';
    include 
XOOPS_ROOT_PATH."/header.php";
    
$iamadmin $xoopsUserIsAdmin;
    
$myts =& MyTextSanitizer::getInstance();
    
$criteria = new CriteriaCompo();
    if ( !empty(
$HTTP_POST_VARS['user_uname']) ) {
        
$match = (!empty($HTTP_POST_VARS['user_uname_match'])) ? intval($HTTP_POST_VARS['user_uname_match']) : XOOPS_MATCH_START;
        switch ( 
$match ) {
        case 
XOOPS_MATCH_START:
            
$criteria->add(new Criteria('uname'$myts->addSlashes(trim($HTTP_POST_VARS['user_uname'])).'%''LIKE'));
            break;
        case 
XOOPS_MATCH_END:
            
$criteria->add(new Criteria('uname''%'.$myts->addSlashes(trim($HTTP_POST_VARS['user_uname'])), 'LIKE'));
            break;
        case 
XOOPS_MATCH_EQUAL:
            
$criteria->add(new Criteria('uname'$myts->addSlashes(trim($HTTP_POST_VARS['user_uname']))));
            break;
        case 
XOOPS_MATCH_CONTAIN:
            
$criteria->add(new Criteria('uname''%'.$myts->addSlashes(trim($HTTP_POST_VARS['user_uname'])).'%''LIKE'));
            break;
        }
    }
    if ( !empty(
$HTTP_POST_VARS['user_name']) ) {
        
$match = (!empty($HTTP_POST_VARS['user_name_match'])) ? intval($HTTP_POST_VARS['user_name_match']) : XOOPS_MATCH_START;
        switch (
$match) {
        case 
XOOPS_MATCH_START:
            
$criteria->add(new Criteria('name'$myts->addSlashes(trim($HTTP_POST_VARS['user_name'])).'%''LIKE'));
            break;
        case 
XOOPS_MATCH_END:
            
$criteria->add(new Criteria('name''%'.$myts->addSlashes(trim($HTTP_POST_VARS['user_name'])).'%''LIKE'));
            break;
        case 
XOOPS_MATCH_EQUAL:
            
$criteria->add(new Criteria('name'$myts->addSlashes(trim($HTTP_POST_VARS['user_name']))));
            break;
        case 
XOOPS_MATCH_CONTAIN:
            
$criteria->add(new Criteria('name''%'.$myts->addSlashes(trim($HTTP_POST_VARS['user_name'])).'%''LIKE'));
            break;
        }
    }
    if ( !empty(
$HTTP_POST_VARS['user_email']) ) {
        
$match = (!empty($HTTP_POST_VARS['user_email_match'])) ? intval($HTTP_POST_VARS['user_email_match']) : XOOPS_MATCH_START;
        switch (
$match) {
        case 
XOOPS_MATCH_START:
            
$criteria->add(new Criteria('email'$myts->addSlashes(trim($HTTP_POST_VARS['user_email'])).'%''LIKE'));
            break;
        case 
XOOPS_MATCH_END:
            
$criteria->add(new Criteria('email''%'.$myts->addSlashes(trim($HTTP_POST_VARS['user_email'])), 'LIKE'));
            break;
        case 
XOOPS_MATCH_EQUAL:
            
$criteria->add(new Criteria('email'$myts->addSlashes(trim($HTTP_POST_VARS['user_email']))));
            break;
        case 
XOOPS_MATCH_CONTAIN:
            
$criteria->add(new Criteria('email''%'.$myts->addSlashes(trim($HTTP_POST_VARS['user_email'])).'%''LIKE'));
            break;
        }
        if ( !
$iamadmin ) {
            
$criteria->add(new Criteria('user_viewemail'1));
        }
    }
    if ( !empty(
$HTTP_POST_VARS['user_url']) ) {
        
$url formatURL(trim($HTTP_POST_VARS['user_url']));
        
$criteria->add(new Criteria('url'$myts->addSlashes($url).'%''LIKE'));
    }
    if ( !empty(
$HTTP_POST_VARS['user_icq']) ) {
        
$match = (!empty($HTTP_POST_VARS['user_icq_match'])) ? intval($HTTP_POST_VARS['user_icq_match']) : XOOPS_MATCH_START;
        switch (
$match) {
        case 
XOOPS_MATCH_START:
            
$criteria->add(new Criteria('user_icq'$myts->addSlashes(trim($HTTP_POST_VARS['user_icq'])).'%''LIKE'));
            break;
        case 
XOOPS_MATCH_END:
            
$criteria->add(new Criteria('user_icq''%'.$myts->addSlashes(trim($HTTP_POST_VARS['user_icq'])), 'LIKE'));
            break;
        case 
XOOPS_MATCH_EQUAL:
            
$criteria->add(new Criteria('user_icq'$myts->addSlashes(trim($HTTP_POST_VARS['user_icq']))));
            break;
        case 
XOOPS_MATCH_CONTAIN:
            
$criteria->add(new Criteria('user_icq''%'.$myts->addSlashes(trim($HTTP_POST_VARS['user_icq'])).'%''LIKE'));
            break;
        }
    }
    if ( !empty(
$HTTP_POST_VARS['user_aim']) ) {
        
$match = (!empty($HTTP_POST_VARS['user_aim_match'])) ? intval($HTTP_POST_VARS['user_aim_match']) : XOOPS_MATCH_START;
        switch (
$match) {
        case 
XOOPS_MATCH_START:
            
$criteria->add(new Criteria('user_aim'$myts->addSlashes(trim($HTTP_POST_VARS['user_aim'])).'%''LIKE'));
            break;
        case 
XOOPS_MATCH_END:
            
$criteria->add(new Criteria('user_aim''%'.$myts->addSlashes(trim($HTTP_POST_VARS['user_aim'])), 'LIKE'));
            break;
        case 
XOOPS_MATCH_EQUAL:
            
$criteria->add(new Criteria('user_aim'$myts->addSlashes(trim($HTTP_POST_VARS['user_aim']))));
            break;
        case 
XOOPS_MATCH_CONTAIN:
            
$criteria->add(new Criteria('user_aim''%'.$myts->addSlashes(trim($HTTP_POST_VARS['user_aim'])).'%''LIKE'));
            break;
        }
    }
    if ( !empty(
$HTTP_POST_VARS['user_yim']) ) {
        
$match = (!empty($HTTP_POST_VARS['user_yim_match'])) ? intval($HTTP_POST_VARS['user_yim_match']) : XOOPS_MATCH_START;
        switch (
$match) {
        case 
XOOPS_MATCH_START:
            
$criteria->add(new Criteria('user_yim'$myts->addSlashes(trim($HTTP_POST_VARS['user_yim'])).'%''LIKE'));
            break;
        case 
XOOPS_MATCH_END:
            
$criteria->add(new Criteria('user_yim''%'.$myts->addSlashes(trim($HTTP_POST_VARS['user_yim'])), 'LIKE'));
            break;
        case 
XOOPS_MATCH_EQUAL:
            
$criteria->add(new Criteria('user_yim'$myts->addSlashes(trim($HTTP_POST_VARS['user_yim']))));
            break;
        case 
XOOPS_MATCH_CONTAIN:
            
$criteria->add(new Criteria('user_yim''%'.$myts->addSlashes(trim($HTTP_POST_VARS['user_yim'])).'%''LIKE'));
            break;
        }
    }
    if ( !empty(
$HTTP_POST_VARS['user_msnm']) ) {
        
$match = (!empty($HTTP_POST_VARS['user_msnm_match'])) ? intval($HTTP_POST_VARS['user_msnm_match']) : XOOPS_MATCH_START;
        switch (
$match) {
        case 
XOOPS_MATCH_START:
            
$criteria->add(new Criteria('user_msnm'$myts->addSlashes(trim($HTTP_POST_VARS['user_msnm'])).'%''LIKE'));
            break;
        case 
XOOPS_MATCH_END:
            
$criteria->add(new Criteria('user_msnm''%'.$myts->addSlashes(trim($HTTP_POST_VARS['user_msnm'])), 'LIKE'));
            break;
        case 
XOOPS_MATCH_EQUAL:
            
$criteria->add(new Criteria('user_msnm'$myts->addSlashes(trim($HTTP_POST_VARS['user_msnm']))));
            break;
        case 
XOOPS_MATCH_CONTAIN:
            
$criteria->add(new Criteria('user_msnm''%'.$myts->addSlashes(trim($HTTP_POST_VARS['user_msnm'])).'%''LIKE'));
            break;
        }
    }
    if ( !empty(
$HTTP_POST_VARS['user_from']) ) {
        
$criteria->add(new Criteria('user_from''%'.$myts->addSlashes(trim($HTTP_POST_VARS['user_from'])).'%''LIKE'));
    }
    if ( !empty(
$HTTP_POST_VARS['user_intrest']) ) {
        
$criteria->add(new Criteria('user_intrest''%'.$myts->addSlashes(trim($HTTP_POST_VARS['user_intrest'])).'%''LIKE'));
    }
    if ( !empty(
$HTTP_POST_VARS['user_occ']) ) {
        
$criteria->add(new Criteria('user_occ''%'.$myts->addSlashes(trim($HTTP_POST_VARS['user_occ'])).'%''LIKE'));
    }

    if ( !empty(
$HTTP_POST_VARS['user_lastlog_more']) && is_numeric($HTTP_POST_VARS['user_lastlog_more']) ) {
        
$f_user_lastlog_more intval(trim($HTTP_POST_VARS['user_lastlog_more']));
        
$time time() - (60 60 24 $f_user_lastlog_more);
        if ( 
$time ) {
            
$criteria->add(new Criteria('last_login'$time'<'));
        }
    }
    if ( !empty(
$HTTP_POST_VARS['user_lastlog_less']) && is_numeric($HTTP_POST_VARS['user_lastlog_less']) ) {
        
$f_user_lastlog_less intval(trim($HTTP_POST_VARS['user_lastlog_less']));
        
$time time() - (60 60 24 $f_user_lastlog_less);
        if ( 
$time ) {
            
$criteria->add(new Criteria('last_login'$time'>'));
        }
    }
    if ( !empty(
$HTTP_POST_VARS['user_reg_more']) && is_numeric($HTTP_POST_VARS['user_reg_more']) ) {
        
$f_user_reg_more intval(trim($HTTP_POST_VARS['user_reg_more']));
        
$time time() - (60 60 24 $f_user_reg_more);
        if ( 
$time ) {
            
$criteria->add(new Criteria('user_regdate'$time'<'));
        }
    }
    if ( !empty(
$HTTP_POST_VARS['user_reg_less']) && is_numeric($HTTP_POST_VARS['user_reg_less']) ) {
        
$f_user_reg_less intval($HTTP_POST_VARS['user_reg_less']);
        
$time time() - (60 60 24 $f_user_reg_less);
        if ( 
$time ) {
            
$criteria->add(new Criteria('user_regdate'$time'>'));
        }
    }
    if ( isset(
$HTTP_POST_VARS['user_posts_more']) && is_numeric($HTTP_POST_VARS['user_posts_more']) ) {
        
$criteria->add(new Criteria('posts'intval($HTTP_POST_VARS['user_posts_more']), '>'));
    }
    if ( !empty(
$HTTP_POST_VARS['user_posts_less']) && is_numeric($HTTP_POST_VARS['user_posts_less']) ) {
        
$criteria->add(new Criteria('posts'intval($HTTP_POST_VARS['user_posts_less']), '<'));
    }
    
$criteria->add(new Criteria('level'0'>'));
    
$validsort = array("uname""email""last_login""user_regdate""posts");
    
$sort = (!in_array($HTTP_POST_VARS['user_sort'], $validsort)) ? "uname" $HTTP_POST_VARS['user_sort'];
    
$order "ASC";
    if ( isset(
$HTTP_POST_VARS['user_order']) && $HTTP_POST_VARS['user_order'] == "DESC") {
        
$order "DESC";
    }
    
$limit = (!empty($HTTP_POST_VARS['limit'])) ? intval($HTTP_POST_VARS['limit']) : 99;
    if ( 
$limit == || $limit 99 ) {
        
$limit 99;
    }
    
$start = (!empty($HTTP_POST_VARS['start'])) ? intval($HTTP_POST_VARS['start']) : 0;
    
$member_handler =& xoops_gethandler('member');
    
$total $member_handler->getUserCount($criteria);
    
$xoopsTpl->assign('lang_search'_MM_SEARCH);
    
$xoopsTpl->assign('lang_results'_MM_RESULTS);
    
$xoopsTpl->assign('total_found'$total);
    if ( 
$total == ) {
        
$xoopsTpl->assign('lang_nonefound'_MM_NOFOUND);
    } elseif ( 
$start $total ) {
        
$xoopsTpl->assign('lang_username'_MM_UNAME);
        
$xoopsTpl->assign('lang_realname'_MM_REALNAME);
        
$xoopsTpl->assign('lang_avatar'_MM_AVATAR);
        
$xoopsTpl->assign('lang_email'_MM_EMAIL);
        
$xoopsTpl->assign('lang_privmsg'_MM_PM);
        
$xoopsTpl->assign('lang_regdate'_MM_REGDATE);
        
$xoopsTpl->assign('lang_lastlogin'_MM_LASTLOGIN);
        
$xoopsTpl->assign('lang_posts'_MM_POSTS);
        
$xoopsTpl->assign('lang_url'_MM_URL);
        
$xoopsTpl->assign('lang_admin'_MM_ADMIN);
        if ( 
$iamadmin ) {
            
$xoopsTpl->assign('is_admin'true);
        }
        
$criteria->setSort($sort);
        
$criteria->setOrder($order);
        
$criteria->setStart($start);
        
$criteria->setLimit($limit);
        
$foundusers =& $member_handler->getUsers($criteriatrue);
        foreach (
array_keys($foundusers) as $j) {
            
$userdata['avatar'] = $foundusers[$j]->getVar("user_avatar") ? ".XOOPS_UPLOAD_URL."/".$foundusers[$j]->getVar("user_avatar")."' alt='' />" " ";
            
$userdata['realname'] = $foundusers[$j]->getVar("name") ? $foundusers[$j]->getVar("name") : " ";
            
$userdata['name'] = $foundusers[$j]->getVar("uname");
            
$userdata['id'] = $foundusers[$j]->getVar("uid");
            if ( 
$foundusers[$j]->getVar("user_viewemail") == || $iamadmin ) {
                
$userdata['email'] = ".$foundusers[$j]->getVar("email")."'>.XOOPS_URL."/images/icons/email.gif' border='0' alt='".sprintf(_SENDEMAILTO,$foundusers[$j]->getVar("uname""E"))."' />";
            } else {
                
$userdata['email'] = " ";
            }
            if ( 
$xoopsUser ) {
                
$userdata['pmlink'] = "/pmlite.php?send2=1&to_userid=".$foundusers[$j]->getVar("uid")."","pmlite",450,370);'>.XOOPS_URL."/images/icons/pm.gif' border='0' alt='".sprintf(_SENDPMTO,$foundusers[$j]->getVar("uname""E"))."' />";
            } else {
                
$userdata['pmlink'] = " ";
            }
            if ( 
$foundusers[$j]->getVar("url","E") != "" ) {
                
$userdata['website'] =  ".$foundusers[$j]->getVar("url","E")."' target='_blank'>.XOOPS_URL."/images/icons/www.gif' border='0' alt='"._VISITWEBSITE."' />";
            } else {
                
$userdata['website'] =  " ";
            }
            
$userdata['registerdate'] = formatTimeStamp($foundusers[$j]->getVar("user_regdate"),"s");
            if ( 
$foundusers[$j]->getVar("last_login") != ) {
                
$userdata['lastlogin'] =  formatTimeStamp($foundusers[$j]->getVar("last_login"),"m");
            } else {
                
$userdata['lastlogin'] =  " ";
            }
            
$userdata['posts'] = $foundusers[$j]->getVar("posts");
            if ( 
$iamadmin ) {
                
$userdata['adminlink'] = ".XOOPS_URL."/modules/system/admin.php?fct=users&uid=".$foundusers[$j]->getVar("uid")."&op=modifyUser'>"._EDIT." | .XOOPS_URL."/modules/system/admin.php?fct=users&op=delUser&uid=".$foundusers[$j]->getVar("uid")."'>"._DELETE."";
            }
            
$xoopsTpl->append('users'$userdata);
        }
        
$totalpages ceil($total $limit);
        if ( 
$totalpages ) {
            
$hiddenform "";
            foreach ( 
$HTTP_POST_VARS as $k => $v ) {
                
$hiddenform .= ".$myts->oopsHtmlSpecialChars($k)."' value='".$myts->makeTboxData4PreviewInForm($v)."' />n";
            }
            if (!isset(
$HTTP_POST_VARS['limit'])) {
                
$hiddenform .= ".$limit."' />n";
            }
            if (!isset(
$HTTP_POST_VARS['start'])) {
                
$hiddenform .= ".$start."' />n";
            }
            
$prev $start $limit;
            if ( 
$start $limit >= ) {
                
$hiddenform .= ".$prev.";document.findnext.submit();'>"._MM_PREVIOUS." n";
            }
            
$counter 1;
            
$currentpage = ($start+$limit) / $limit;
            while ( 
$counter <= $totalpages ) {
                if ( 
$counter == $currentpage ) {
                    
$hiddenform .= "".$counter." "
;
                } elseif ( (
$counter $currentpage-&& $counter $currentpage+4) || $counter == || $counter == $totalpages ) {
                    if ( 
$counter == $totalpages && $currentpage $totalpages-) {
                        
$hiddenform .= "... ";
                    }
                    
$hiddenform .= ".$counter."' onclick='javascript:document.findnext.start.value=".($counter-1)*$limit.";document.findnext.submit();'>".$counter." ";
                    if ( 
$counter == && $currentpage ) {
                        
$hiddenform .= "... ";
                    }
                }
                
$counter++;
            }
            
$next $start+$limit;
            if ( 
$total $next ) {
                
$hiddenform .= .$total."' onclick='javascript:document.findnext.start.value=".$next.";document.findnext.submit();'>"._MM_NEXT."n";
            }
            
$hiddenform .= "";
            
$xoopsTpl->assign('pagenav'$hiddenform);
            
$xoopsTpl->assign('lang_numfound'sprintf(_MM_USERSFOUND$total));
        }
    }
}

include_once 
XOOPS_ROOT_PATH."/footer.php";
?>


hope it helps you ...

5
kumzzy
Re: xoopsmembers : a link to the list of all members ?
  • 2005/2/28 16:56

  • kumzzy

  • Just popping in

  • Posts: 78

  • Since: 2005/1/9 4


hey this looks like a cool script but how do i use it?

6
Totoro
Re: xoopsmembers : a link to the list of all members ?
  • 2005/3/11 14:02

  • Totoro

  • Just popping in

  • Posts: 9

  • Since: 2002/9/1 2


just put the all.php file into your modules/xoopmembers/ directory
just make a link to this file

7
kymseen
Re: xoopsmembers : a link to the list of all members ?
  • 2006/10/6 6:28

  • kymseen

  • Just popping in

  • Posts: 23

  • Since: 2006/9/11


Hello, I got this script to work!

I was wondering if some one could modify this to make it that that, only the user avatars and name show(this must be easy) and have it line up left to right, top to bottom.
like this

+ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + +=user avatar

right now the users are aligned by user name in alphabetical order, but can it b modified to be aligned by "last log in date"??

I think this modification would make a good block for the users to see other fellow members of the site!

has anyone done this kind of thing???

Login

Who's Online

285 user(s) are online (208 user(s) are browsing Support Forums)


Members: 0


Guests: 285


more...

Donat-O-Meter

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

Latest GitHub Commits