當前位置: 首頁>>代碼示例>>PHP>>正文


PHP XoopsUser::getValues方法代碼示例

本文整理匯總了PHP中XoopsUser::getValues方法的典型用法代碼示例。如果您正苦於以下問題:PHP XoopsUser::getValues方法的具體用法?PHP XoopsUser::getValues怎麽用?PHP XoopsUser::getValues使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在XoopsUser的用法示例。


在下文中一共展示了XoopsUser::getValues方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: show_users

/**
* Shows all registered users in a list with filter and manage options
*/
function show_users()
{
    global $xoopsSecurity;
    define('RMCSUBLOCATION', 'allusers');
    RMTemplate::get()->add_style('users.css', 'rmcommon');
    RMTemplate::get()->add_style('js-widgets.css');
    //Scripts
    RMTemplate::get()->add_local_script('users.js', 'rmcommon', 'include');
    RMTemplate::get()->add_local_script('jquery.checkboxes.js', 'rmcommon', 'include');
    RMTemplate::get()->add_head('<script type="text/javascript">var rmcu_select_message = "' . __('You have not selected any user!', 'rmcommon') . '";
        var rmcu_message = "' . __('Dou you really wish to delete selected users?', 'rmcommon') . '";</script>');
    $form = new RMForm('', '', '');
    // Date Field
    $login1 = new RMFormDate('', 'login1', '');
    $login2 = new RMFormDate('', 'login2', '');
    // Registered Field
    $register1 = new RMFormDate('', 'registered1', '');
    $register2 = new RMFormDate('', 'registered2', '');
    xoops_cp_location(__('Users Management', 'rmcommon'));
    RMFunctions::create_toolbar();
    // Show the theme
    xoops_cp_header();
    $db = XoopsDatabaseFactory::getDatabaseConnection();
    $sql = "SELECT COUNT(*) FROM " . $db->prefix("users") . " " . formatSQL();
    $page = rmc_server_var($_REQUEST, 'pag', 1);
    $limit = rmc_server_var($_REQUEST, 'limit', 15);
    $order = rmc_server_var($_GET, 'order', 'uid');
    list($num) = $db->fetchRow($db->query($sql));
    $tpages = ceil($num / $limit);
    $page = $page > $tpages ? $tpages : $page;
    $start = $num <= 0 ? 0 : ($page - 1) * $limit;
    $nav = new RMPageNav($num, $limit, $page, 5);
    $nav->target_url('users.php?limit=' . $limit . '&order=' . $order . '&pag={PAGE_NUM}');
    $sql = str_replace("COUNT(*)", '*', $sql);
    $sql .= "ORDER BY {$order} LIMIT {$start}, {$limit}";
    $result = $db->query($sql);
    $users = array();
    $user = new XoopsUser();
    $t = array();
    // Temporary
    while ($row = $db->fetchArray($result)) {
        $user->assignVars($row);
        $t = $user->getValues();
        $t['groups'] = $user->groups();
        $t = RMEvents::get()->run_event('rmcommon.loading.users.list', $t);
        $users[] = $t;
        $t = array();
    }
    $xgh = new XoopsGroupHandler($db);
    $users = RMEvents::get()->run_event('rmcommon.users.list.loaded', $users);
    // Users template
    include RMTemplate::get()->get_template('rmc_users.php', 'module', 'rmcommon');
    xoops_cp_footer();
}
開發者ID:laiello,項目名稱:bitcero-modules,代碼行數:57,代碼來源:users.php


注:本文中的XoopsUser::getValues方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。