<?php
//v1.0.4 www.bcoos.net 2006/10 GPL
//v1.7 www.bcoos.net 2006-08 GPL
//v1.6 www.exoops.info 2006/03 
// $Id: system_info.php,v 1.5 2003/03/19 07:04:15 half-dead Exp $
// ------------------------------------------------------------------------- //
//               E-Xoops: Content Management for the Masses                  //
//                       < http://www.e-xoops.com >                          //
// ------------------------------------------------------------------------- //
// Original Author: Kazumi Ono
// Author Website : http://www.mywebaddons.com/ , http://www.myweb.ne.jp
// License Type   : GPL: See /manual/LICENSES/GPL.txt
// ------------------------------------------------------------------------- //
//---------------------------------------------------------------------------------------//
/**
* Description
*
* @param type $var description
* @return type description
*/
function b_system_info_show($options) {
global $bcoosConfig, $xoopsUser, $db, $myts;
$block = array();
$block['title'] = _MB_SYSTEM_INFO;
$block['content'] = "<div style='text-align: center;'>";
if ( isset($options[3]) && $options[3] == 1 ) {
	$result = $db->query("SELECT u.uid, u.uname, u.email, u.user_viewemail, g.name AS groupname FROM ".$db->prefix("groups_users_link")." l LEFT JOIN ".$db->prefix("users")." u ON l.uid=u.uid LEFT JOIN ".$db->prefix("groups")." g ON l.groupid=g.groupid WHERE g.type='Admin' ORDER BY l.groupid");
	if ($db->getRowsNum($result) > 0) {
		$prev_cation = "";
		$block['content'] .= "<table width='92%' border='0' cellspacing='1' cellpadding='0' class='bg2'><tr><td>\n";
		$block['content'] .= "<table width='100%' border='0' cellspacing='1' cellpadding='8' class='bg1'><tr><td>\n";
		$prev_caption = "";
		while  ($userinfo = $db->fetchArray($result)) {
			if ($prev_caption != $userinfo['groupname']) {
				$prev_caption      = $userinfo['groupname'];
				$block['content'] .= "<tr><td colspan='2'>";
				$block['content'] .= "<b>".$myts->makeTboxData4Show($prev_caption)."</b>";
				$block['content'] .= "</td></tr>";
			}
			$userinfo['uname'] = $myts->makeTboxData4Show($userinfo['uname']);
			$block['content'] .= "<tr><td width='80%'>";
			$block['content'] .= "<a href='".XOOPS_URL."/userinfo.php?uid=".$userinfo['uid']."'>".$userinfo['uname']."</a>";
			$block['content'] .= "</td><td width='20%' align='right'>";
			if ($xoopsUser) {
				$block['content'] .= "<a href='javascript:openWithSelfMain(\"".XOOPS_URL."/pmlite.php?send2=1&amp;to_userid=".$userinfo['uid']."\",\"pmlite\",360,300);'>";
				$block['content'] .= "<img src='".XOOPS_URL."/images/icons/".$bcoosConfig['iconset']."pm_small.gif' border='0' width='27' height='17' alt='";
				$block['content'] .= sprintf(_MB_SYSTEM_SPMTO,$userinfo['uname']);
				$block['content'] .= "' /></a>";
			} else {
				if ($userinfo['user_viewemail']) {
					$block['content'] .= "<a href='mailto:".$userinfo['email']."'><img src='".XOOPS_URL."/images/icons/".$bcoosConfig['iconset']."em_small.gif' border='0' width='16' height='14' alt='";
					$block['content'] .= sprintf(_MB_SYSTEM_SEMTO,$userinfo['uname']);
					$block['content'] .= "' /></a>";
				} else {
					$block['content'] .= "&nbsp;";
				}
			}
				$block['content'] .= "</td></tr>";
		}
	$block['content'] .= "</table></td></tr></table>";
	}
}
if ( $xoopsUser ) { $block['content'] .= "<br /><a href='javascript:openWithSelfMain(\"".XOOPS_URL."/misc.php?action=showpopups&amp;type=friend&amp;op=sendform&amp;t=".time()."\",\"friend\",".$options[0].",".$options[1].")'>"._MB_SYSTEM_RECO."</a>"; }
else { $block['content'] .= "<br /><a href='mailto:?subject=".rawurlencode( sprintf(_MB_INTSITE, $bcoosConfig['title']) )."&body=".rawurlencode( _MB_INTSITEFOUND."\r\n".$bcoosConfig['title'].": ".XOOPS_URL )."'>"._MB_SYSTEM_RECO."</a>"; }
$block['content'] .= "</div>";
return $block;
}
//---------------------------------------------------------------------------------------//
/**
* Description
*
* @param type $var description
* @return type description
*/
function b_system_info_edit($options) {
$form = ""._MB_SYSTEM_PWWIDTH."&nbsp;";
$form .= "<input type='text' class='text' name='options[]' value='".$options[0]."' />";
$form .= "<br />"._MB_SYSTEM_PWHEIGHT."&nbsp;";
$form .= "<input type='text' class='text' name='options[]' value='".$options[1]."' />";
$form .= "<br />".sprintf(_MB_SYSTEM_LOGO,XOOPS_URL."/images/")."&nbsp;";
$form .= "<input type='text' class='text' name='options[]' value='".$options[2]."' />";
$form .= "<br />"._MB_SYSTEM_SADMIN."&nbsp;";
$chk = "";
if ( $options[3] == 1 ) {
		$chk = " checked='checked'";
}
$form .= "<input type='radio' class='radio' name='options[3]' value='1'".$chk." />&nbsp;"._YES."";
$chk = "";
if ( $options[3] == 0 ) {
	$chk = " checked=\"checked\"";
}
$form .= "&nbsp;<input type='radio' class='radio' name='options[3]' value='0'".$chk." />"._NO."";
return $form;
}
//---------------------------------------------------------------------------------------//
?>
