XOOPS  2.6.0
newmembers.php
Go to the documentation of this file.
1 <?php
2 /*
3  You may not change or alter any portion of this comment or credits
4  of supporting developers from this source code or any supporting source code
5  which is considered copyrighted (c) material of the original comment or credit authors.
6 
7  This program is distributed in the hope that it will be useful,
8  but WITHOUT ANY WARRANTY; without even the implied warranty of
9  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 */
11 
14 
30 {
32  $block = array();
33  $criteria = new CriteriaCompo(new Criteria('level', 0, '>'));
34  $limit = (!empty($options[0])) ? $options[0] : 10;
35  $criteria->setOrder('DESC');
36  $criteria->setSort('user_regdate');
37  $criteria->setLimit($limit);
38  $member_handler = $xoops->getHandlerMember();
39  $newmembers = $member_handler->getUsers($criteria);
40  $count = count($newmembers);
41  for ($i = 0; $i < $count; ++$i) {
42  if ($options[1] == 1) {
43  $block['users'][$i]['avatar'] = $newmembers[$i]->getVar('user_avatar') != 'blank.gif' ? \XoopsBaseConfig::get('uploads-url') . '/' . $newmembers[$i]->getVar('user_avatar') : '';
44  } else {
45  $block['users'][$i]['avatar'] = '';
46  }
47  $block['users'][$i]['id'] = $newmembers[$i]->getVar('uid');
48  $block['users'][$i]['name'] = $newmembers[$i]->getVar('uname');
49  $block['users'][$i]['joindate'] = XoopsLocale::formatTimestamp($newmembers[$i]->getVar('user_regdate'), 's');
50  }
51  return $block;
52 }
53 
55 {
56  $block_form = new Xoops\Form\BlockForm();
57  $block_form->addElement( new Xoops\Form\Text(SystemLocale::NUMBER_OF_USERS_TO_DISPLAY, 'options[0]', 1, 3, $options[0]), true);
58  $block_form->addElement(new Xoops\Form\RadioYesNo(SystemLocale::DISPLAY_USERS_AVATARS, 'options[1]', $options[1]));
59  return $block_form->render();
60 }
static formatTimestamp($time, $format= 'l', $timeoffset=null)
Definition: Abstract.php:289
if($uname== ''||$pass== '') $member_handler
Definition: checklogin.php:44
$i
Definition: dialog.php:68
b_system_newmembers_edit($options)
Definition: newmembers.php:54
static getInstance()
Definition: Xoops.php:160
$options['editor']
$xoops
Definition: admin.php:25
static get($name)
$limit
Definition: findusers.php:202
const NUMBER_OF_USERS_TO_DISPLAY
Definition: en_US.php:352
$criteria
b_system_newmembers_show($options)
Definition: newmembers.php:29
const DISPLAY_USERS_AVATARS
Definition: en_US.php:262