本文整理汇总了PHP中GWF_User::setGDOData方法的典型用法代码示例。如果您正苦于以下问题:PHP GWF_User::setGDOData方法的具体用法?PHP GWF_User::setGDOData怎么用?PHP GWF_User::setGDOData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GWF_User
的用法示例。
在下文中一共展示了GWF_User::setGDOData方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
public function execute()
{
GWF3::setConfig('log_request', false);
$_GET['ajax'] = 1;
$cut = time() - GWF_ONLINE_TIMEOUT;
$user = new GWF_User();
$table = GDO::table('GWF_Session');
$profiles = '';
if (false === ($result = $table->select('sess_user,user_name,user_options,user_level', "sess_time>={$cut}", 'user_name ASC', array('user')))) {
return;
}
$guest = 0;
$member = 0;
$total = 0;
$u_count = array();
$u_users = array();
while (false !== ($row = $table->fetch($result, GDO::ARRAY_A))) {
$total++;
$uid = $row['sess_user'];
if ($uid == 0) {
$guest++;
continue;
}
$member++;
$user->setGDOData($row);
if ($user->isOptionEnabled(GWF_User::HIDE_ONLINE)) {
continue;
}
if (isset($u_count[$uid])) {
$u_count[$uid]++;
} else {
$u_count[$uid] = 1;
$u_users[$uid] = $user->displayProfileLink();
}
}
$table->free($result);
foreach ($u_count as $uid => $cnt) {
$multi = $cnt > 1 ? "(x{$cnt})" : '';
$profiles .= ', ' . $u_users[$uid] . $multi;
}
$profiles = $profiles === '' ? '.' : ': ' . substr($profiles, 2) . '.';
return sprintf('%s Online%s', $total, $profiles);
}
示例2: templateDDOS
private function templateDDOS(WC_Site $site)
{
// require_once GWF_CORE_PATH.'module/WeChall/WC_RegAt.php';
$siteid = $site->getVar('site_id');
$regat = GWF_TABLE_PREFIX . 'wc_regat';
$users = GWF_TABLE_PREFIX . 'user';
$query = "SELECT u.* FROM {$regat} JOIN {$users} u ON regat_uid=user_id WHERE regat_sid={$siteid}";
$db = gdo_db();
if (false === ($result = $db->queryRead($query))) {
return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
}
$user = new GWF_User();
while (false !== ($row = $db->fetchAssoc($result))) {
$user->setGDOData($row);
$site->onUpdateUser($user, false);
}
$db->free($result);
$site->recalcSite();
}
示例3: array
<?php
Module_WeChall::includeForums();
$chall = $tVars['chall'];
$chall instanceof WC_Challenge;
$headers = array(array($tLang->lang('th_length'), 'wmc_length'), array($tLang->lang('th_csolve_date'), 'wmc_date'), array($tLang->lang('th_user_name'), 'user_name'), array($tLang->lang('th_solution'), 'wmc_solution'));
$chall->showHeader(true);
echo GWF_Box::box($tVars['table_title']);
echo $tVars['page_menu'];
echo GWF_Table::start();
//echo GWF_Table::displayHeaders1($headers, $tVars['sort_url'], 'wmc_date', 'ASC', 'by', 'dir', $tVars['table_title']);
echo GWF_Table::displayHeaders1($headers, $tVars['sort_url']);
$guest = GWF_Guest::getGuest();
$userr = new GWF_User(false);
foreach ($tVars['data'] as $row) {
if ($row['user_name'] === NULL) {
$username = GWF_HTML::lang('guest');
} else {
$userr->setGDOData($row);
$username = $userr->displayProfileLink();
}
echo GWF_Table::rowStart();
echo GWF_Table::column($row['wmc_length'], 'gwf_num');
echo GWF_Table::column(GWF_Time::displayDate($row['wmc_date']), 'gwf_date');
echo GWF_Table::column($username);
echo GWF_Table::column($row['wmc_solution']);
echo GWF_Table::rowEnd();
}
echo GWF_Table::end();
echo $tVars['page_menu'];