1
Totoro
Re: NewBB Spam Posts - Any simple challenge hack avail?
  • 2007/4/16 7:48

  • Totoro

  • Just popping in

  • Posts: 9

  • Since: 2002/9/1 2


Quote:

ianez wrote:
well I find the workaround..
it was an include missing because in cbb fomr is loaded via Frameworks files.

So after making the normal step suggested by Tobias you should add this line in Frameworks/xoops22/class/xoopsformloader.php right before the end
include_once XOOPS_ROOT_PATH."/class/xoopsform/securityimage.php";


and you're ok , you can test it on my site here
http://xoopsworks.isgreat.org/ where this great hack/module is added to CBB 3.08 and XOOPS comments

ciao

Ian


To be complete (and to get it work with XOOPS 2.0.16), you also have to add this code in [www XOOPS root]/class/xoopsformloader.php



2
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



3
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 :

<?php
// $Id: index.php,v 1.18 2004/12/26 19:12:10 Onokazu Exp $
//  ------------------------------------------------------------------------ //
//                XOOPS - PHP Content Management System                      //
//                    Copyright (c) 2000 XOOPS.org                           //
//                       <https://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") ? "<img src='".XOOPS_UPLOAD_URL."/".$foundusers[$j]->getVar("user_avatar")."' alt='' />" "&nbsp;";
            
$userdata['realname'] = $foundusers[$j]->getVar("name") ? $foundusers[$j]->getVar("name") : "&nbsp;";
            
$userdata['name'] = $foundusers[$j]->getVar("uname");
            
$userdata['id'] = $foundusers[$j]->getVar("uid");
            if ( 
$foundusers[$j]->getVar("user_viewemail") == || $iamadmin ) {
                
$userdata['email'] = "<a href='mailto:".$foundusers[$j]->getVar("email")."'><img src='".XOOPS_URL."/images/icons/email.gif' border='0' alt='".sprintf(_SENDEMAILTO,$foundusers[$j]->getVar("uname""E"))."' /></a>";
            } else {
                
$userdata['email'] = "&nbsp;";
            }
            if ( 
$xoopsUser ) {
                
$userdata['pmlink'] = "<a href='javascript:openWithSelfMain("".XOOPS_URL."/pmlite.php?send2=1&to_userid=".$foundusers[$j]->getVar("uid")."","pmlite",450,370);'><img src='".XOOPS_URL."/images/icons/pm.gif' border='0' alt='".sprintf(_SENDPMTO,$foundusers[$j]->getVar("uname""E"))."' /></a>";
            } else {
                
$userdata['pmlink'] = "&nbsp;";
            }
            if ( 
$foundusers[$j]->getVar("url","E") != "" ) {
                
$userdata['website'] =  "<a href='".$foundusers[$j]->getVar("url","E")."' target='_blank'><img src='".XOOPS_URL."/images/icons/www.gif' border='0' alt='"._VISITWEBSITE."' /></a>";
            } else {
                
$userdata['website'] =  "&nbsp;";
            }
            
$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'] =  "&nbsp;";
            }
            
$userdata['posts'] = $foundusers[$j]->getVar("posts");
            if ( 
$iamadmin ) {
                
$userdata['adminlink'] = "<a href='".XOOPS_URL."/modules/system/admin.php?fct=users&uid=".$foundusers[$j]->getVar("uid")."&op=modifyUser'>"._EDIT."</a> | <a href='".XOOPS_URL."/modules/system/admin.php?fct=users&op=delUser&uid=".$foundusers[$j]->getVar("uid")."'>"._DELETE."</a>";
            }
            
$xoopsTpl->append('users'$userdata);
        }
        
$totalpages ceil($total $limit);
        if ( 
$totalpages ) {
            
$hiddenform "<form name='findnext' action='index.php' method='post'>";
            foreach ( 
$HTTP_POST_VARS as $k => $v ) {
                
$hiddenform .= "<input type='hidden' name='".$myts->oopsHtmlSpecialChars($k)."' value='".$myts->makeTboxData4PreviewInForm($v)."' />n";
            }
            if (!isset(
$HTTP_POST_VARS['limit'])) {
                
$hiddenform .= "<input type='hidden' name='limit' value='".$limit."' />n";
            }
            if (!isset(
$HTTP_POST_VARS['start'])) {
                
$hiddenform .= "<input type='hidden' name='start' value='".$start."' />n";
            }
            
$prev $start $limit;
            if ( 
$start $limit >= ) {
                
$hiddenform .= "<a href='#0' onclick='javascript:document.findnext.start.value=".$prev.";document.findnext.submit();'>"._MM_PREVIOUS."</a>&nbsp;n";
            }
            
$counter 1;
            
$currentpage = ($start+$limit) / $limit;
            while ( 
$counter <= $totalpages ) {
                if ( 
$counter == $currentpage ) {
                    
$hiddenform .= "<b>".$counter."</b> ";
                } elseif ( (
$counter $currentpage-&& $counter $currentpage+4) || $counter == || $counter == $totalpages ) {
                    if ( 
$counter == $totalpages && $currentpage $totalpages-) {
                        
$hiddenform .= "... ";
                    }
                    
$hiddenform .= "<a href='#".$counter."' onclick='javascript:document.findnext.start.value=".($counter-1)*$limit.";document.findnext.submit();'>".$counter."</a> ";
                    if ( 
$counter == && $currentpage ) {
                        
$hiddenform .= "... ";
                    }
                }
                
$counter++;
            }
            
$next $start+$limit;
            if ( 
$total $next ) {
                
$hiddenform .= "&nbsp;<a href='#".$total."' onclick='javascript:document.findnext.start.value=".$next.";document.findnext.submit();'>"._MM_NEXT."</a>n";
            }
            
$hiddenform .= "</form>";
            
$xoopsTpl->assign('pagenav'$hiddenform);
            
$xoopsTpl->assign('lang_numfound'sprintf(_MM_USERSFOUND$total));
        }
    }
}

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


hope it helps you ...



4
Totoro
Re: Newbb 2.0.1 : A little feature is still missing when deleting users
  • 2005/2/7 8:45

  • Totoro

  • Just popping in

  • Posts: 9

  • Since: 2002/9/1 2


nobody ? it's sad ... :(



5
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



6
Totoro
Newbb 2.0.1 : A little feature is still missing when deleting users
  • 2005/1/25 10:16

  • Totoro

  • Just popping in

  • Posts: 9

  • Since: 2002/9/1 2


Hello

Did you notice that when a user is deleted, the posts he's made are then posted by "Anonymous" when you read them ?

It is because the "poster_name" field of the MySQL "_bb_posts" is not filled when the user is deleted.

When the user is still present, I guess the newbb routines get the "uid" info to show the name of the poster. But when the poster is deleted, the "uid" info of the "_users" table doesn't exist anymore.

By default, the "poster_name" field of the "_bb_posts" is always empty. If it could be filled by the name of the user (when the user is deleted, or when a post is created ?), the name of the user would appear in the forums whereas he's deleted.

You should say : "you know how it works, do it by yourself" ... yes, but I don't know php dev.

Could anymone help me creating this little feature ?

Thanx in advance



7
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 " www.myxoopsite/modules/xoopsmembers/index.php?op=submit"

Thanx for you help

best regards

Totoro



8
Totoro
Re: Newbb2 : forum menus don't auto hide
  • 2005/1/20 14:17

  • Totoro

  • Just popping in

  • Posts: 9

  • Since: 2002/9/1 2


Thanx for your help ! My problem is solved ;)



9
Totoro
Newbb2 : forum menus don't auto hide
  • 2005/1/20 13:37

  • Totoro

  • Just popping in

  • Posts: 9

  • Since: 2002/9/1 2


Hello (sorry for my english, I'm french ...)

I have a small but uggly bug in newbb2 with a couple of themes (blue lagoon, karate_redux_blue ...) : with those themes, the forum menus (aka Main Options, Forum Options, Search Forum ...) don't auto-hide : they are always plain shown.

I guess it is a bug of the themes, in a javascript function. But I'm not good enough to solve it myself.

Can anyone help me ?

Thanx

Best regards

Totoro

Resized Image




TopTop



Login

Who's Online

241 user(s) are online (129 user(s) are browsing Support Forums)


Members: 0


Guests: 241


more...

Donat-O-Meter

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

Latest GitHub Commits