NobuNobu
nobun****@users*****
2006年 3月 24日 (金) 22:04:25 JST
Index: xoops2jp/html/modules/user/blocks/index.html diff -u /dev/null xoops2jp/html/modules/user/blocks/index.html:1.1.2.1 --- /dev/null Fri Mar 24 22:04:25 2006 +++ xoops2jp/html/modules/user/blocks/index.html Fri Mar 24 22:04:25 2006 @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Index: xoops2jp/html/modules/user/blocks/user_login.php diff -u /dev/null xoops2jp/html/modules/user/blocks/user_login.php:1.1.2.1 --- /dev/null Fri Mar 24 22:04:25 2006 +++ xoops2jp/html/modules/user/blocks/user_login.php Fri Mar 24 22:04:25 2006 @@ -0,0 +1,28 @@ +<?php +function b_user_login_show() { + global $xoopsUser, $xoopsConfig; + if (!$xoopsUser) { + $block = array(); + if (isset($_COOKIE[$xoopsConfig['usercookie']])) { + $block['unamevalue'] = $_COOKIE[$xoopsConfig['usercookie']]; + } else { + $block['unamevalue'] = ''; + } + + //ToDo: Still Use System Module Config + $config_handler =& xoops_gethandler('config'); + $xoopsConfigUser =& $config_handler->getConfigsByCat(XOOPS_CONF_USER); + $block['allow_register'] = $xoopsConfigUser['allow_register']; + + $block['use_ssl'] = $xoopsConfig['use_ssl']; + if ($xoopsConfig['use_ssl'] == 1 && $xoopsConfig['sslloginlink'] != '') { + $block['sslloginlink'] = $xoopsConfig['sslloginlink']; + } else { + $block['use_ssl'] = 0; + $block['sslloginlink'] = ''; + } + return $block; + } + return false; +} +?> Index: xoops2jp/html/modules/user/blocks/user_newusers.php diff -u /dev/null xoops2jp/html/modules/user/blocks/user_newusers.php:1.1.2.1 --- /dev/null Fri Mar 24 22:04:25 2006 +++ xoops2jp/html/modules/user/blocks/user_newusers.php Fri Mar 24 22:04:25 2006 @@ -0,0 +1,41 @@ +<?php +function b_user_newusers_show($options) +{ + $block = array(); + $criteria = new CriteriaCompo(new Criteria('level', 0, '>')); + $limit = (!empty($options[0])) ? $options[0] : 10; + $criteria->setOrder('DESC'); + $criteria->setSort('user_regdate'); + $criteria->setLimit($limit); + $member_handler =& xoops_gethandler('member'); + $newmembers =& $member_handler->getUsers($criteria); + $count = count($newmembers); + for ($i = 0; $i < $count; $i++) { + if ( $options[1] == 1 ) { + $block['users'][$i]['avatar'] = $newmembers[$i]->getVar('user_avatar') != 'blank.gif' ? XOOPS_UPLOAD_URL.'/'.$newmembers[$i]->getVar('user_avatar') : ''; + } else { + $block['users'][$i]['avatar'] = ''; + } + $block['users'][$i]['id'] = $newmembers[$i]->getVar('uid'); + $block['users'][$i]['name'] = $newmembers[$i]->getVar('uname'); + $block['users'][$i]['joindate'] = formatTimestamp($newmembers[$i]->getVar('user_regdate'), 's'); + } + return $block; +} + +function b_user_newusers_edit($options) +{ + $inputtag = '<input type="text" name="options[]" value="'.$options[0].'" />'; + $form = sprintf(_MB_USER_DISPLAY,$inputtag); + $form .= '<br />'._MB_USER_DISPLAYA.' <input type="radio" id="options[]" name="options[]" value="1"'; + if ( $options[1] == 1 ) { + $form .= ' checked="checked"'; + } + $form .= ' /> '._YES.'<input type="radio" id="options[]" name="options[]" value="0"'; + if ( $options[1] == 0 ) { + $form .= ' checked="checked"'; + } + $form .= ' /> '._NO; + return $form; +} +?> Index: xoops2jp/html/modules/user/blocks/user_online.php diff -u /dev/null xoops2jp/html/modules/user/blocks/user_online.php:1.1.2.1 --- /dev/null Fri Mar 24 22:04:25 2006 +++ xoops2jp/html/modules/user/blocks/user_online.php Fri Mar 24 22:04:25 2006 @@ -0,0 +1,56 @@ +<?php +function b_user_online_show() +{ + global $xoopsUser, $xoopsModule; + $online_handler =& xoops_gethandler('online'); + mt_srand((double)microtime()*1000000); + // set gc probabillity to 10% for now.. + if (mt_rand(1, 100) < 11) { + $online_handler->gc(300); + } + if (is_object($xoopsUser)) { + $uid = $xoopsUser->getVar('uid'); + $uname = $xoopsUser->getVar('uname'); + } else { + $uid = 0; + $uname = ''; + } + if (is_object($xoopsModule)) { + $online_handler->write($uid, $uname, time(), $xoopsModule->get('mid'), $_SERVER['REMOTE_ADDR']); + } else { + // + // TODO We have to find the best method. + // + if (strpos(xoops_getenv('REQUEST_URI'),'misc.php') === false) { + $online_handler->write($uid, $uname, time(), 0, $_SERVER['REMOTE_ADDR']); + } + } + $onlines =& $online_handler->getAll(); + if (false != $onlines) { + $total = count($onlines); + $block = array(); + $guests = 0; + $members = ''; + for ($i = 0; $i < $total; $i++) { + if ($onlines[$i]['online_uid'] > 0) { + $member['uid'] = $onlines[$i]['online_uid']; + $member['uname'] = $onlines[$i]['online_uname']; + $member_list[] = $member; + } else { + $guests++; + } + } + $block['online_total'] = sprintf(_ONLINEPHRASE, $total); + if (is_object($xoopsModule)) { + $mytotal = $online_handler->getCount(new Criteria('online_module', $xoopsModule->getVar('mid'))); + $block['online_total'] .= ' ('.sprintf(_MB_USER_ONLINEPHRASEX, $mytotal, $xoopsModule->getVar('name')).')'; + } + $block['online_members'] = $total - $guests; + $block['online_member_list'] = $member_list; + $block['online_guests'] = $guests; + return $block; + } else { + return false; + } +} +?> Index: xoops2jp/html/modules/user/blocks/user_topusers.php diff -u /dev/null xoops2jp/html/modules/user/blocks/user_topusers.php:1.1.2.1 --- /dev/null Fri Mar 24 22:04:25 2006 +++ xoops2jp/html/modules/user/blocks/user_topusers.php Fri Mar 24 22:04:25 2006 @@ -0,0 +1,60 @@ +<?php +function b_user_topusers_show($options) +{ + $block = array(); + $criteria = new CriteriaCompo(new Criteria('level', 0, '>')); + $limit = (!empty($options[0])) ? $options[0] : 10; + $size = count($options); + for ( $i = 2; $i < $size; $i++) { + $criteria->add(new Criteria('rank', $options[$i], '<>')); + } + $criteria->setOrder('DESC'); + $criteria->setSort('posts'); + $criteria->setLimit($limit); + $member_handler =& xoops_gethandler('member'); + $topposters =& $member_handler->getUsers($criteria); + $count = count($topposters); + for ($i = 0; $i < $count; $i++) { + $block['users'][$i]['rank'] = $i+1; + if ( $options[1] == 1 ) { + $block['users'][$i]['avatar'] = $topposters[$i]->getVar('user_avatar') != 'blank.gif' ? XOOPS_UPLOAD_URL.'/'.$topposters[$i]->getVar('user_avatar') : ''; + } else { + $block['users'][$i]['avatar'] = ''; + } + $block['users'][$i]['id'] = $topposters[$i]->getVar('uid'); + $block['users'][$i]['name'] = $topposters[$i]->getVar('uname'); + $block['users'][$i]['posts'] = $topposters[$i]->getVar('posts'); + } + return $block; +} + +function b_user_topusers_edit($options) +{ + include_once XOOPS_ROOT_PATH.'/class/xoopslists.php'; + $inputtag = '<input type="text" name="options[]" value="'.intval($options[0]).'" />'; + $form = sprintf(_MB_USER_DISPLAY,$inputtag); + $form .= '<br />'._MB_USER_DISPLAYA.' <input type="radio" id="options[]" name="options[]" value="1"'; + if ( $options[1] == 1 ) { + $form .= ' checked="checked"'; + } + $form .= ' /> '._YES.'<input type="radio" id="options[]" name="options[]" value="0"'; + if ( $options[1] == 0 ) { + $form .= ' checked="checked"'; + } + $form .= ' /> '._NO; + $form .= '<br />'._MB_USER_NODISPGR.'<br /><select id="options[]" name="options[]" multiple="multiple">'; + $ranks =& XoopsLists::getUserRankList(); + $size = count($options); + foreach ($ranks as $k => $v) { + $sel = ""; + for ( $i = 2; $i < $size; $i++ ) { + if ($k == $options[$i]) { + $sel = ' selected="selected"'; + } + } + $form .= '<option value="'.$k.'"'.$sel.'>'.$v.'</option>'; + } + $form .= '</select>'; + return $form; +} +?>