<?php
// ------------------------------------------------------------------------- //
//                XOOPS - PHP Content Management System                      //
//                       <http://www.xoops.org/>                             //
// ------------------------------------------------------------------------- //
// Based on:								     //
// myPHPNUKE Web Portal System - http://myphpnuke.com/	  		     //
// PHP-NUKE Web Portal System - http://phpnuke.org/	  		     //
// Thatware - http://thatware.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.                                      //
//                                                                           //
//  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 //
// ------------------------------------------------------------------------- //
function b_xoopsmembers_new_show($options){
	$block = array();
	$block['content'] = "<table border='0' cellpadding='0' cellspacing='0' valign='top' width='100%'><tr><td class='bg2'><table width='100%' border='0' cellpadding='4' cellspacing='1'>\n";
	$criteria = array("level>0");
	$limit = (!empty($options[0])) ? $options[0] : 10;
	$newmembers = XoopsUser::getAllUsers($criteria, true, "user_regdate DESC", $limit);
	foreach ( $newmembers as $nb ) {
		$block['content'] .= "<tr class='bg1'>";
		if ( $options[1] == 1 ) {
			$avatar = $nb->getVar("user_avatar") ? "<img src='".XOOPS_URL."/images/avatar/".$nb->getVar("user_avatar")."' alt='' width='32' />" : "&nbsp;";
			$block['content'] .= "<td align='center'>$avatar</td>";
		}
		$block['content'] .= "<td><a href='".XOOPS_URL."/userinfo.php?uid=".$nb->getVar("uid")."'>".$nb->getVar("uname")."</a></td><td align='center'>".formatTimestamp($nb->getVar("user_regdate"), "s")."</td>";
	}
	$block['content'] .= "</tr></table></td></tr></table>\n";
	$block['title'] = _MB_MEMBERS_TITLE2;

	return $block;
}

function b_xoopsmembers_new_edit($options) {
	$inputtag = "<input type='text' name='options[]' value='".$options[0]."' />";
	$form = sprintf(_MB_MEMBERS_DISPLAY,$inputtag);
	$form .= "<br />"._MB_MEMBERS_DISPLAYA."&nbsp;<input type='radio' id='options[]' name='options[]' value='1'";
	if ( $options[1] == 1 ) {
		$form .= " checked='checked'";
	}
	$form .= " />&nbsp;"._YES."<input type='radio' id='options[]' name='options[]' value='0'";
	if ( $options[1] == 0 ) {
		$form .= " checked='checked'";
	}
	$form .= " />&nbsp;"._NO."";
	return $form;
}
?>