예제 #1
0
include_once NW_MODULE_PATH . '/class/class.newstopic.php';
include_once NW_MODULE_PATH . '/class/class.sfiles.php';
include_once NW_MODULE_PATH . '/include/functions.php';

if(!nw_getmoduleoption('newsbythisauthor', NW_MODULE_DIR_NAME)) {
    redirect_header('index.php',2,_ERRORS);
    exit();
}

$xoopsOption['template_main'] = 'nw_news_whos_who.html';
include_once XOOPS_ROOT_PATH.'/header.php';

$option = nw_getmoduleoption('displayname', NW_MODULE_DIR_NAME);
$article = new nw_NewsStory();
$uid_ids = array();
$uid_ids = $article->getWhosWho(nw_getmoduleoption('restrictindex', NW_MODULE_DIR_NAME));
if(count($uid_ids) > 0) {
	$lst_uid = implode(',', $uid_ids);
	$member_handler =& xoops_gethandler('member');
	$critere = new Criteria('uid', '('.$lst_uid.')', 'IN');
	$tbl_users = $member_handler->getUsers($critere);
	foreach($tbl_users as $one_user) {
		$uname = '';
		switch($option) {
			case 1:		// Username
				$uname = $one_user->getVar('uname');
				break;

			case 2:		// Display full name (if it is not empty)
				if(xoops_trim($one_user->getVar('name')) != '') {
					$uname = $one_user->getVar('name');