本文整理汇总了PHP中format_name函数 的典型用法代码示例。如果您正苦于以下问题:PHP format_name函数的具体用法?PHP format_name怎么用?PHP format_name使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了format_name函数 的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: asb_statistics_build_template
function asb_statistics_build_template($args)
{
extract($args);
global ${$template_var}, $mybb, $cache, $templates, $lang;
// Load global and custom language phrases
if (!$lang->asb_addon) {
$lang->load('asb_addon');
}
// get forum statistics
$statistics = $cache->read("stats");
$statistics['numthreads'] = my_number_format($statistics['numthreads']);
$statistics['numposts'] = my_number_format($statistics['numposts']);
$statistics['numusers'] = my_number_format($statistics['numusers']);
$newestmember = "<strong>{$lang->asb_stats_no_one}</strong>";
if ($statistics['lastusername']) {
if ($settings['format_username']) {
$last_user = get_user($statistics['lastuid']);
$last_username = format_name($last_user['username'], $last_user['usergroup'], $last_user['displaygroup']);
} else {
$last_username = $statistics['lastusername'];
}
$newestmember = build_profile_link($last_username, $statistics['lastuid']);
}
eval("\$" . $template_var . " = \"" . $templates->get('asb_statistics') . "\";");
return true;
}
开发者ID:badboy4life91, 项目名称:Advanced-Sidebox, 代码行数:26, 代码来源:statistics.php
示例2: Format
static function Format($uid, $username, $userGroup, $displayGroup)
{
global $mybb;
$formattedName = format_name($username, $userGroup, $displayGroup);
$profileUrl = $mybb->settings['bburl'] . "/member.php?action=profile&uid=" . $uid;
return "<a href=\"{$profileUrl}\">{$formattedName}</a>";
}
开发者ID:BadgerCode, 项目名称:BadgerChat, 代码行数:7, 代码来源:UsernameFormatter.php
示例3: action
/**
This is where you perform the action when the API is called, the parameter given is an instance of stdClass, this method should return an instance of stdClass.
*/
public function action()
{
global $mybb, $db, $cache;
require_once MYBB_ROOT . "inc/functions_online.php";
$timesearch = TIME_NOW - $mybb->settings['wolcutoffmins'] * 60;
switch ($db->type) {
case "sqlite":
$sessions = array();
$query = $db->simple_select("sessions", "sid", "time > {$timesearch}");
while ($sid = $db->fetch_field($query, "sid")) {
$sessions[$sid] = 1;
}
$online_count = count($sessions);
unset($sessions);
break;
case "pgsql":
default:
$query = $db->simple_select("sessions", "COUNT(sid) as online", "time > {$timesearch}");
$online_count = $db->fetch_field($query, "online");
break;
}
$query = $db->query("\n\t\t\tSELECT DISTINCT s.sid, s.ip, s.uid, s.time, s.location, u.username, s.nopermission, u.invisible, u.usergroup, u.displaygroup\n\t\t\tFROM " . TABLE_PREFIX . "sessions s\n\t\t\tLEFT JOIN " . TABLE_PREFIX . "users u ON (s.uid=u.uid)\n\t\t\tWHERE s.time>'{$timesearch}'\n\t\t\t");
//ORDER BY $sql
// LIMIT {$start}, {$perpage}
$users = array();
$guests = array();
$spiders = $cache->read("spiders");
while ($user = $db->fetch_array($query)) {
// Fetch the WOL activity
$user['activity'] = fetch_wol_activity($user['location'], $user['nopermission']);
$botkey = my_strtolower(str_replace("bot=", '', $user['sid']));
// Have a registered user
if ($user['uid'] > 0) {
if ($users[$user['uid']]['time'] < $user['time'] || !$users[$user['uid']]) {
$users[$user['uid']] = $user;
}
} else {
if (my_strpos($user['sid'], "bot=") !== false && $spiders[$botkey]) {
$user['bot'] = $spiders[$botkey]['name'];
$user['usergroup'] = $spiders[$botkey]['usergroup'];
$guests[] = $user;
} else {
$guests[] = $user;
}
}
}
foreach ($users as &$user) {
$user["display"] = format_name($user["username"], $user["usergroup"], $user["displaygroup"]);
}
$stdClass = new stdClass();
// remove keys from this otherwise we will get an object of objects, sigh!
$stdClass->users = array_values($users);
$stdClass->guests = $guests;
$stdClass->count = $online_count;
$stdClass->wolcutoffmins = $mybb->settings["wolcutoffmins"];
$stdClass->mostonline = $cache->read("mostonline");
return $stdClass;
}
开发者ID:Shade-, 项目名称:MyBB-RESTful-API-System, 代码行数:61, 代码来源:onlineapi.class.php
示例4: get_recommended_user_func
function get_recommended_user_func()
{
global $mybb, $db, $lang, $users, $tapatalk_users;
$tapatalk_users = array();
$users = array();
// Load global language phrases
$lang->load("memberlist");
//get tapatalk users
if (isset($_POST['mode']) && $_POST['mode'] == 2) {
$sql = "SELECT userid FROM " . TABLE_PREFIX . "tapatalk_users";
$query = $db->query($sql);
while ($user = $db->fetch_array($query)) {
$tapatalk_users[] = $user['userid'];
}
}
// get pm users
$sql = "SELECT p.toid as uid\n\tFROM " . TABLE_PREFIX . "privatemessages p \n\tWHERE p.uid = " . $mybb->user['uid'] . "\n\tGROUP BY p.toid\n\tLIMIT 0,1000";
get_recommended_user_list($sql, 'contact');
// get pm me users
$sql = "SELECT p.uid as uid\n\tFROM " . TABLE_PREFIX . "privatemessages p \n\tWHERE p.toid = " . $mybb->user['uid'] . "\n\tGROUP BY p.uid\n\tLIMIT 0,1000";
get_recommended_user_list($sql, 'contact');
//get sub topic users
$sql = "SELECT t.uid as uid\n\tFROM " . TABLE_PREFIX . "threadsubscriptions ts \n\tLEFT JOIN " . TABLE_PREFIX . "threads t ON ts.tid = t.tid \n\tWHERE ts.uid = " . $mybb->user['uid'] . "\n\tGROUP BY t.uid\n\tLIMIT 0,1000";
get_recommended_user_list($sql, 'watch');
//get sub me topic users
$sql = "SELECT ts.uid as uid\n\tFROM " . TABLE_PREFIX . "threadsubscriptions ts \n\tRIGHT JOIN " . TABLE_PREFIX . "threads t ON ts.tid = t.tid \n\tWHERE t.uid = " . $mybb->user['uid'] . "\n\tGROUP BY ts.uid\n\tLIMIT 0,1000";
get_recommended_user_list($sql, 'watch');
//get like or thank users
$prefix = "g33k_thankyoulike_";
if (file_exists('thankyoulike.php') && $db->table_exists($prefix . 'thankyoulike')) {
$sql = "SELECT thl.puid as uid\n\t\tFROM " . TABLE_PREFIX . $prefix . "thankyoulike thl \n\t\tWHERE thl.uid = " . $mybb->user['uid'] . "\n\t\tGROUP BY thl.puid\n\t\tLIMIT 0,1000";
get_recommended_user_list($sql, 'like');
$sql = "SELECT thl.uid as uid\n\t\tFROM " . TABLE_PREFIX . $prefix . "thankyoulike thl \n\t\tWHERE thl.puid = " . $mybb->user['uid'] . "\n\t\tGROUP BY thl.uid\n\t\tLIMIT 0,1000";
get_recommended_user_list($sql, 'liked');
}
$page = intval($_POST['page']);
$perpage = intval($_POST['perpage']);
$start = ($page - 1) * $perpage;
$return_user_lists = array();
$users_rank = tapa_rank_users($users);
$total = count($users_rank);
$users_slice = array_slice($users_rank, $start, $perpage);
$user_id_str = implode(',', $users_slice);
$mobi_api_key = loadAPIKey();
if (!empty($user_id_str)) {
$sql = "SELECT uid,username,email,avatar FROM " . TABLE_PREFIX . "users WHERE uid IN({$user_id_str})";
$query = $db->query($sql);
while ($user = $db->fetch_array($query)) {
$user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']);
if ($user['avatar'] != '') {
$user['avatar'] = absolute_url($user['avatar']);
}
$return_user_lists[] = new xmlrpcval(array('username' => new xmlrpcval(basic_clean($user['username']), 'base64'), 'user_id' => new xmlrpcval($user['uid'], 'string'), 'icon_url' => new xmlrpcval($user['avatar'], 'string'), 'type' => new xmlrpcval('', 'string'), 'enc_email' => new xmlrpcval(base64_encode(encrypt(trim($user['email']), $mobi_api_key)), 'string')), 'struct');
}
}
$suggested_users = new xmlrpcval(array('total' => new xmlrpcval($total, 'int'), 'list' => new xmlrpcval($return_user_lists, 'array')), 'struct');
return new xmlrpcresp($suggested_users);
}
开发者ID:dthiago, 项目名称:tapatalk-mybb, 代码行数:58, 代码来源:get_recommended_user.php
示例5: post_list
function post_list()
{
$posts = scandir("posts/");
$posts = array_diff($posts, array("..", "."));
$postDates = array();
foreach ($posts as $thisPost) {
$postDates[] = filectime("posts/" . $thisPost);
}
$posts = array_combine($postDates, $posts);
krsort($posts);
$output = "\n\t<ul id=\"posts\">";
foreach ($posts as $thisPost) {
$output .= "\n\t\t<li><a href=\"" . URL . BLOG_DIR . "/post/" . link_name($thisPost) . "\">" . date("Y-m-d", key($posts)) . " - " . format_name($thisPost) . "</a></li>";
}
$output .= "\n\t</ul>";
return $output;
}
开发者ID:robertdherb, 项目名称:just-a-blog, 代码行数:17, 代码来源:functions.php
示例6: build_postbit
//.........这里部分代码省略.........
} else {
$usergroup = $groupscache[1];
}
if (!is_array($titlescache)) {
$cached_titles = $cache->read("usertitles");
if (!empty($cached_titles)) {
foreach ($cached_titles as $usertitle) {
$titlescache[$usertitle['posts']] = $usertitle;
}
}
if (is_array($titlescache)) {
krsort($titlescache);
}
unset($usertitle, $cached_titles);
}
// Work out the usergroup/title stuff
$post['groupimage'] = '';
if (!empty($usergroup['image'])) {
$language = $mybb->settings['bblanguage'];
if (!empty($mybb->user['language'])) {
$language = $mybb->user['language'];
}
$usergroup['image'] = str_replace("{lang}", $language, $usergroup['image']);
$usergroup['image'] = str_replace("{theme}", $theme['imgdir'], $usergroup['image']);
eval("\$post['groupimage'] = \"" . $templates->get("postbit_groupimage") . "\";");
if ($mybb->settings['postlayout'] == "classic") {
$post['groupimage'] .= "<br />";
}
}
if ($post['userusername']) {
// This post was made by a registered user
$post['username'] = $post['userusername'];
$post['profilelink_plain'] = get_profile_link($post['uid']);
$post['username_formatted'] = format_name($post['username'], $post['usergroup'], $post['displaygroup']);
$post['profilelink'] = build_profile_link($post['username_formatted'], $post['uid']);
if (trim($post['usertitle']) != "") {
$hascustomtitle = 1;
}
if ($usergroup['usertitle'] != "" && !$hascustomtitle) {
$post['usertitle'] = $usergroup['usertitle'];
} elseif (is_array($titlescache) && !$usergroup['usertitle']) {
reset($titlescache);
foreach ($titlescache as $key => $titleinfo) {
if ($post['postnum'] >= $key) {
if (!$hascustomtitle) {
$post['usertitle'] = $titleinfo['title'];
}
$post['stars'] = $titleinfo['stars'];
$post['starimage'] = $titleinfo['starimage'];
break;
}
}
}
if ($usergroup['stars']) {
$post['stars'] = $usergroup['stars'];
}
if (empty($post['starimage'])) {
$post['starimage'] = $usergroup['starimage'];
}
if ($post['starimage'] && $post['stars']) {
// Only display stars if we have an image to use...
$post['starimage'] = str_replace("{theme}", $theme['imgdir'], $post['starimage']);
$post['userstars'] = '';
for ($i = 0; $i < $post['stars']; ++$i) {
$post['userstars'] .= "<img src=\"" . $post['starimage'] . "\" border=\"0\" alt=\"*\" />";
}
开发者ID:slothly, 项目名称:mybb, 代码行数:67, 代码来源:functions_post.php
示例7: Table
$start = ($pagecnt - 1) * $perpage;
} else {
$start = 0;
$pagecnt = 1;
}
$table = new Table();
$table->construct_header($lang->username, array('width' => '10%'));
$table->construct_header($lang->date, array('class' => 'align_center', 'width' => '15%'));
$table->construct_header($lang->information, array('class' => 'align_center', 'width' => '65%'));
$table->construct_header($lang->ipaddress, array('class' => 'align_center', 'width' => '10%'));
$query = $db->query("\n\t\tSELECT l.*, u.username, u.usergroup, u.displaygroup\n\t\tFROM " . TABLE_PREFIX . "adminlog l\n\t\tLEFT JOIN " . TABLE_PREFIX . "users u ON (u.uid=l.uid)\n\t\tWHERE 1=1 {$where}\n\t\tORDER BY {$sortby} {$order}\n\t\tLIMIT {$start}, {$perpage}\n\t");
while ($logitem = $db->fetch_array($query)) {
$information = '';
$logitem['dateline'] = date("jS M Y, G:i", $logitem['dateline']);
$trow = alt_trow();
$username = format_name($logitem['username'], $logitem['usergroup'], $logitem['displaygroup']);
$logitem['profilelink'] = build_profile_link($username, $logitem['uid'], "_blank");
$logitem['data'] = unserialize($logitem['data']);
// Get detailed information from meta
$information = get_admin_log_action($logitem);
$table->construct_cell($logitem['profilelink']);
$table->construct_cell($logitem['dateline'], array('class' => 'align_center'));
$table->construct_cell($information);
$table->construct_cell($logitem['ipaddress'], array('class' => 'align_center'));
$table->construct_row();
}
if ($table->num_rows() == 0) {
$table->construct_cell($lang->no_adminlogs, array('colspan' => '4'));
$table->construct_row();
}
$table->output($lang->admin_logs);
开发者ID:ThinhNguyenVB, 项目名称:Gradient-Studios-Website, 代码行数:31, 代码来源:adminlog.php
示例8: htmlspecialchars_uni
}
if ($customfieldval) {
$customfield['name'] = htmlspecialchars_uni($customfield['name']);
eval("\$customfields .= \"" . $templates->get("member_profile_customfields_field") . "\";");
$bgcolor = alt_trow();
}
}
}
if ($customfields) {
eval("\$profilefields = \"" . $templates->get("member_profile_customfields") . "\";");
}
$memprofile['postnum'] = my_number_format($memprofile['postnum']);
$lang->ppd_percent_total = $lang->sprintf($lang->ppd_percent_total, my_number_format($ppd), $post_percent);
$memprofile['threadnum'] = my_number_format($memprofile['threadnum']);
$lang->tpd_percent_total = $lang->sprintf($lang->tpd_percent_total, my_number_format($tpd), $thread_percent);
$formattedname = format_name($memprofile['username'], $memprofile['usergroup'], $memprofile['displaygroup']);
$bannedbit = '';
if ($memperms['isbannedgroup'] == 1 && $mybb->usergroup['canbanusers'] == 1) {
// Fetch details on their ban
$query = $db->simple_select('banned b LEFT JOIN ' . TABLE_PREFIX . 'users a ON (b.admin=a.uid)', 'b.*, a.username AS adminuser', "b.uid='{$uid}'", array('limit' => 1));
$memban = $db->fetch_array($query);
if ($memban['reason']) {
$memban['reason'] = htmlspecialchars_uni($parser->parse_badwords($memban['reason']));
} else {
$memban['reason'] = $lang->na;
}
if ($memban['lifted'] == 'perm' || $memban['lifted'] == '' || $memban['bantime'] == 'perm' || $memban['bantime'] == '---') {
$banlength = $lang->permanent;
$timeremaining = $lang->na;
} else {
// Set up the array of ban times.
开发者ID:nicopinto, 项目名称:fantasitura.com, 代码行数:31, 代码来源:member.php
示例9: render_shout
static function render_shout($data, $static = false)
{
global $mybb, $lang;
$id = $data['id'];
$text = $data['text'];
$date = my_date($mybb->settings['dvz_sb_dateformat'], $data['date']);
if ($uid = self::isPvt($text)) {
if ($uid != $mybb->user['uid'] && $data['username'] != $mybb->user['username']) {
return;
}
$replace = array("/pvt", $uid);
$lang->load('custom');
$usernameString = self::getUsername($uid, $data);
$text = str_replace($replace, "", $text);
}
$text = dvz_shoutbox::parse($text, $data['username']);
if ($usernameString) {
$replace = array('<p>', '</p>');
$text = $usernameString . str_replace($replace, "", $text);
}
$avatar = '<a href="/member.php?action=profile&' . $data['uid'] . '"><img src="' . (empty($data['avatar']) ? 'images/default_avatar.png' : $data['avatar']) . '" alt="avatar" /></a>';
$user = '<span class="username" data-id="' . (int) $data['uid'] . '"><a>' . format_name($data['username'], $data['usergroup'], $data['displaygroup']) . '</a></span>';
$notes = null;
$attributes = null;
$own = $data['uid'] == $mybb->user['uid'];
if ($static) {
if (dvz_shoutbox::access_mod()) {
$notes .= '<span class="ip">' . $data['ip'] . '</span>';
}
if (dvz_shoutbox::access_mod() || dvz_shoutbox::access_mod_own() && $own) {
$notes .= '<a href="" class="mod edit">E</a><a href="" class="mod del">X</a>';
}
}
if (dvz_shoutbox::access_mod() || dvz_shoutbox::access_mod_own() && $own) {
$attributes .= ' data-mod';
}
if ($own) {
$attributes .= ' data-own';
}
$notes .= '<a href="" class="mod report">REPORT</a>';
return '
<div class="entry" data-id="' . $id . '" data-username="' . $data['username'] . '"' . $attributes . '>
<div class="avatar">' . $avatar . '</div>
<div class="user">' . $user . ':</div>
<div class="text">' . $text . '</div>
<div class="info"><span class="date">' . $date . '</span>' . $notes . '</div>
</div>';
}
开发者ID:TheMaskedMonkey, 项目名称:dvz_shoutbox_pvt, 代码行数:48, 代码来源:dvz_shoutbox.php
示例10: array
$table->construct_header($lang->date_issued, array("class" => "align_center", 'width' => '20%'));
$table->construct_header($lang->expires, array("class" => "align_center", 'width' => '20%'));
$table->construct_header($lang->issued_by, array("class" => "align_center", 'width' => '15%'));
$table->construct_header($lang->options, array("class" => "align_center", 'width' => '5%'));
while ($row = $db->fetch_array($query)) {
if (!$row['username']) {
$row['username'] = $lang->guest;
}
$trow = alt_trow();
$username = format_name($row['username'], $row['usergroup'], $row['displaygroup']);
if (!$row['uid']) {
$username_link = $username;
} else {
$username_link = build_profile_link($username, $row['uid'], "_blank");
}
$mod_username = format_name($row['mod_username'], $row['mod_usergroup'], $row['mod_displaygroup']);
$mod_username_link = build_profile_link($mod_username, $row['mod_uid'], "_blank");
$issued_date = my_date($mybb->settings['dateformat'], $row['dateline']) . ' ' . my_date($mybb->settings['timeformat'], $row['dateline']);
$revoked_text = '';
if ($row['daterevoked'] > 0) {
$revoked_date = my_date($mybb->settings['dateformat'], $row['daterevoked']) . ' ' . my_date($mybb->settings['timeformat'], $row['daterevoked']);
$revoked_text = "<br /><small><strong>{$lang->revoked}</strong> {$revoked_date}</small>";
}
if ($row['expires'] > 0) {
$expire_date = my_date($mybb->settings['dateformat'], $row['expires']) . ' ' . my_date($mybb->settings['timeformat'], $row['expires']);
} else {
$expire_date = $lang->never;
}
$title = $row['title'];
if (empty($row['title'])) {
$title = $row['custom_title'];
开发者ID:GeorgeLVP, 项目名称:mybb, 代码行数:31, 代码来源:warninglog.php
示例11: asb_top_poster_build_template
function asb_top_poster_build_template($args)
{
extract($args);
global ${$template_var}, $db, $templates, $lang, $theme;
if (!$lang->asb_addon) {
$lang->load('asb_addon');
}
if (!$settings['time_frame']) {
$settings['time_frame'] = 1;
}
$timesearch = TIME_NOW - 86400 * $settings['time_frame'];
// build user group exclusions (if any)
$show = asb_build_id_list($settings['group_show_list'], 'u.usergroup');
$hide = asb_build_id_list($settings['group_hide_list'], 'u.usergroup');
$where['show'] = asb_build_SQL_where($show, ' OR ');
$where['hide'] = asb_build_SQL_where($hide, ' OR ', ' NOT ');
$group_where = asb_build_SQL_where($where, ' AND ', ' AND ');
$group_by = 'p.uid';
if ($db->type == 'pgsql') {
$group_by = $db->build_fields_string('users', 'u.');
}
$query = $db->query(<<<EOF
SELECT u.uid, u.username, u.usergroup, u.displaygroup, u.avatar, COUNT(*) AS poststoday
FROM {$db->table_prefix}posts p
LEFT JOIN {$db->table_prefix}users u ON (p.uid=u.uid)
WHERE p.dateline > {$timesearch}{$group_where}
GROUP BY {$group_by} ORDER BY poststoday DESC
LIMIT 1
EOF
);
// some defaults
$top_poster = $lang->asb_top_poster_no_one;
$top_poster_posts = $lang->asb_top_poster_no_posts;
$top_poster_text = $lang->asb_top_poster_no_top_poster;
$top_poster_avatar = '';
$ret_val = false;
// adjust language for time frame
switch ($settings['time_frame']) {
case 7:
$top_poster_timeframe = $lang->asb_top_poster_one_week;
break;
case 14:
$top_poster_timeframe = $lang->asb_top_poster_two_weeks;
break;
case 30:
$top_poster_timeframe = $lang->asb_top_poster_one_month;
break;
case 90:
$top_poster_timeframe = $lang->asb_top_poster_three_months;
break;
case 180:
$top_poster_timeframe = $lang->asb_top_poster_six_months;
break;
case 365:
$top_poster_timeframe = $lang->asb_top_poster_one_year;
break;
default:
$top_poster_timeframe = $lang->asb_top_poster_one_day;
}
$user = $db->fetch_array($query);
// if we have a user . . .
if ($user['poststoday']) {
// default to default :p
$avatar_width = (int) $width * 0.83;
if ((int) $settings['avatar_size']) {
$avatar_width = (int) $settings['avatar_size'];
}
// default to guest
$top_poster = $lang->guest;
if ($user['uid']) {
$username = format_name($user['username'], $user['usergroup'], $user['displaygroup']);
$top_poster = build_profile_link($username, $user['uid']);
}
$top_poster_posts = $user['poststoday'];
$post_lang = $lang->asb_top_poster_posts;
if ($top_poster_posts == 1) {
$post_lang = $lang->asb_top_poster_post;
}
$top_poster_avatar_src = "{$theme['imgdir']}/default_avatar.gif";
if ($user['avatar'] != '') {
$top_poster_avatar_src = $user['avatar'];
}
eval("\$top_poster_avatar = \"" . $templates->get('asb_top_poster_avatar') . "\";");
$top_poster_text = $lang->sprintf($lang->asb_top_poster_congrats, $top_poster, $top_poster_timeframe, $top_poster_posts, $post_lang);
$ret_val = true;
}
eval("\$\$template_var = \"" . $templates->get('asb_top_poster') . "\";");
// return true if your box has something to show, or false if it doesn't.
return $ret_val;
}
开发者ID:badboy4life91, 项目名称:Advanced-Sidebox, 代码行数:90, 代码来源:top_poster.php
示例12: format_name
}
if (!$event['starimage']) {
$event['starimage'] = $user_usergroup['starimage'];
}
for ($i = 0; $i < $post['stars']; ++$i) {
$event['userstars'] .= "<img src=\"" . $event['starimage'] . "\" border=\"0\" alt=\"*\" />";
}
if ($event['userstars'] && $event['starimage'] && $event['stars']) {
$event['userstars'] .= "<br />";
}
} else {
if (!$event['username']) {
$event['username'] = $lang->guest;
}
$event['username'] = $event['username'];
$event['profilelink'] = format_name($event['username'], 1);
if ($user_usergroup['usertitle']) {
$event['usertitle'] = $user_usergroup['usertitle'];
} else {
$event['usertitle'] = $lang->guest;
}
}
if ($event['ignoretimezone'] == 0) {
$offset = $event['timezone'];
} else {
$offset = $mybb->user['timezone'];
}
$event['starttime_user'] = $event['starttime'] + $offset * 3600;
// Events over more than one day
$time_period = '';
if ($event['endtime'] > 0 && $event['endtime'] != $event['starttime']) {
开发者ID:GeorgeLVP, 项目名称:mybb, 代码行数:31, 代码来源:calendar.php
示例13: foreach
<div class="assign-to-popup hide">
<a href="" class="close action toggler"><span class="replace">close</span></a>
<p class="popup-label">Assign to</p>
<ul class="assign-user-list">
<?php
foreach ($active_users as $u) {
?>
<li class="<?php
echo $u->id == $item['assigned'] ? 'assigned ' : '';
?>
user"><a rel="<?php
echo $u->id;
?>
" href=""><?php
echo format_name($u) . ' (' . format_name_as_initials($u) . ')';
?>
</a></li>
<?php
}
?>
</ul>
</div>
<?php
}
?>
<?php
}
?>
开发者ID:hharrysidhu, 项目名称:OpenVBX, 代码行数:29, 代码来源:inbox.php
示例14: buddylist_process
public function buddylist_process($buddylist, $count, $memprofile, $limit, $page)
{
global $lang, $templates, $settings, $mybb, $theme;
MyProfileUtils::lang_load_myprofile();
if (count($buddylist) == 0) {
/* show them we've got no friends :( */
$count_friends_text = $lang->sprintf($lang->mp_buddylist_no_friend, $memprofile["username"]);
$count_colspan = 1;
} else {
$count_friends_text = $lang->sprintf($lang->mp_buddylist_friends, $memprofile["username"], $count, count($buddylist));
$count_colspan = 4;
$buddylist_content = "";
for ($col = 0; $col < count($buddylist); $col += 4) {
$row_content = "";
for ($row = 0; $row < 4; $row++) {
if (isset($buddylist[$col + $row])) {
$buddy = $buddylist[$col + $row];
$td_class = alt_trow();
$profile_link = get_profile_link($buddy["uid"]);
list($avatar_src, $avatar_width_height) = array_values(format_avatar($buddy["avatar"], $buddy["avatardimensions"], $settings["mpbuddylistavatarmaxdimensions"]));
$username = format_name(htmlspecialchars_uni($buddy["username"]), $buddy["usergroup"], $buddy["displaygroup"]);
eval("\$row_content .= \"" . $templates->get('myprofile_buddylist_buddy') . "\";");
} else {
$td_class = alt_trow();
$td_colspan = 4 - $row;
$td_width = $td_colspan * 20;
eval("\$row_content .= \"" . $templates->get('myprofile_buddylist_spacer') . "\";");
break;
}
}
eval("\$buddylist_content .= \"" . $templates->get('myprofile_buddylist_row') . "\";");
}
}
$buddylist_pagination = multipage($count, $limit, $page, "javascript:MyProfile.buddylistLoadPage({page});");
if ($buddylist_pagination == null) {
$buddylist_pagination_style = 'style="display: none;"';
}
eval("\$buddylist_count .= \"" . $templates->get('myprofile_buddylist_buddy_count') . "\";");
eval("\$myprofile_buddylist .= \"" . $templates->get('myprofile_buddylist', 1, 0) . "\";");
return array("html" => $myprofile_buddylist, "count" => $count, "shown" => count($buddylist));
}
开发者ID:medbenji, 项目名称:MyProfile, 代码行数:41, 代码来源:myprofilebuddylist.class.php
示例15: teamonline_show
function teamonline_show()
{
global $cache, $groupscache, $db, $mybb, $teamonline, $lang, $theme, $templates, $online;
$lang->load('teamonline');
if ($mybb->settings['teamonline_gid']) {
$gid = " IN (" . $mybb->settings['teamonline_gid'] . ")";
$timesearch = TIME_NOW - $mybb->settings['wolcutoffmins'] * 60;
$teamonline_row = '';
$trowbg = alt_trow();
$query = $db->query("\n\t\t\tSELECT s.sid, s.ip, s.uid, u.username, s.time, u.avatar, u.usergroup, u.displaygroup, u.invisible\n\t\t\tFROM " . TABLE_PREFIX . "sessions s\n\t\t\tLEFT JOIN " . TABLE_PREFIX . "users u ON (s.uid=u.uid)\n\t\t\tWHERE u.usergroup {$gid} AND time>'{$timesearch}'\n\t\t\tORDER BY u.username ASC, s.time DESC\n\t\t\t");
if (!$db->num_rows($query)) {
eval("\$teamonline_no = \"" . $templates->get("teamonline_no") . "\";");
$invisible = 0;
$membercount = 0;
} else {
if (!is_array($groupscache)) {
$groupscache = $cache->read("usergroups");
}
while ($online = $db->fetch_array($query)) {
$invisible_mark = '';
if ($online['invisible'] == 1) {
$invisible_mark = '*';
}
if ($online['invisible'] != 1 || $mybb->usergroup['canviewwolinvis'] == 1 || $online['uid'] == $mybb->user['uid']) {
$avatar_teamonline = format_avatar($online['avatar']);
$online['username'] = format_name($online['username'], $online['usergroup'], $online['displaygroup']);
$online['profilelink'] = build_profile_link($online['username'], $online['uid']) . $invisible_mark;
$online['groupname'] = $groupscache[$online['usergroup']]['title'];
eval("\$teamonline_row .= \"" . $templates->get("teamonline_row") . "\";");
}
$invisible += $online['invisible'];
$membercount++;
}
}
eval("\$teamonline = \"" . $templates->get("teamonline") . "\";");
}
}
开发者ID:ambsalinas, 项目名称:anima, 代码行数:37, 代码来源:teamonline.php
示例16: build_wol_row
/**
* Build a Who's Online row for a specific user
*
* @param array Array of user information including activity information
* @return string Formatted online row
*/
function build_wol_row($user)
{
global $mybb, $lang, $templates, $theme, $session, $db;
// We have a registered user
if ($user['uid'] > 0) {
// Only those with "canviewwolinvis" permissions can view invisible users
if ($user['invisible'] != 1 || $mybb->usergroup['canviewwolinvis'] == 1 || $user['uid'] == $mybb->user['uid']) {
// Append an invisible mark if the user is invisible
if ($user['invisible'] == 1) {
$invisible_mark = "*";
} else {
$invisible_mark = '';
}
$user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']);
$online_name = build_profile_link($user['username'], $user['uid']) . $invisible_mark;
}
} elseif (!empty($user['bot'])) {
$online_name = format_name($user['bot'], $user['usergroup']);
} else {
$online_name = format_name($lang->guest, 1);
}
$online_time = my_date($mybb->settings['timeformat'], $user['time']);
// Fetch the location name for this users activity
$location = build_friendly_wol_location($user['activity']);
// Can view IPs, then fetch the IP template
if ($mybb->usergroup['canviewonlineips'] == 1) {
$user['ip'] = my_inet_ntop($db->unescape_binary($user['ip']));
if ($mybb->usergroup['canmodcp'] == 1 && $mybb->usergroup['canuseipsearch'] == 1) {
eval("\$lookup = \"" . $templates->get("online_row_ip_lookup") . "\";");
}
eval("\$user_ip = \"" . $templates->get("online_row_ip") . "\";");
} else {
$user_ip = $lookup = $user['ip'] = '';
}
// And finally if we have permission to view this user, return the completed online row
if ($user['invisible'] != 1 || $mybb->usergroup['canviewwolinvis'] == 1 || $user['uid'] == $mybb->user['uid']) {
eval("\$online_row = \"" . $templates->get("online_row") . "\";");
}
return $online_row;
}
开发者ID:olada, 项目名称:mybbintegrator, 代码行数:46, 代码来源:functions_online.php
示例17: foreach
// We still have birthdays - display them in our list!
if (!empty($today_bdays)) {
foreach ($today_bdays as $bdayuser) {
if ($bdayuser['displaygroup'] == 0) {
$bdayuser['displaygroup'] = $bdayuser['usergroup'];
}
// If this user's display group can't be seen in the birthday list, skip it
if ($groupscache[$bdayuser['displaygroup']] && $groupscache[$bdayuser['displaygroup']]['showinbirthdaylist'] != 1) {
continue;
}
$age = '';
$bday = explode('-', $bdayuser['birthday']);
if ($year > $bday['2'] && $bday['2'] != '') {
$age = ' (' . ($year - $bday['2']) . ')';
}
$bdayuser['username'] = format_name($bdayuser['username'], $bdayuser['usergroup'], $bdayuser['displaygroup']);
$bdayuser['profilelink'] = build_profile_link($bdayuser['username'], $bdayuser['uid']);
eval('$bdays .= "' . $templates->get('index_birthdays_birthday', 1, 0) . '";');
++$bdaycount;
$comma = $lang->comma;
}
}
}
if ($hiddencount > 0) {
if ($bdaycount > 0) {
$bdays .= ' - ';
}
$bdays .= "{$hiddencount} {$lang->birthdayhidden}";
}
// If there are one or more birthdays, show them.
if ($bdaycount > 0 || $hiddencount > 0) {
开发者ID:styv300, 项目名称:ToRepublic2.5, 代码行数:31, 代码来源:index.php
示例18: ON
$start = ($mybb->input['page'] - 1) * $limit;
} else {
$start = 0;
$mybb->input['page'] = 1;
}
$query = $db->simple_select('ougc_awards_users au LEFT JOIN ' . TABLE_PREFIX . 'users u ON (u.uid=au.uid)', 'au.*, u.username, u.usergroup, u.displaygroup', 'au.aid=\'' . (int) $award['aid'] . '\'', array('limit_start' => $start, 'limit' => $limit));
if (!$db->num_rows($query)) {
$table->construct_cell('<div align="center">' . $lang->ougc_awards_users_empty . '</div>', array('colspan' => 6));
$table->construct_row();
$table->output($sub_tabs['ougc_awards_users']['description']);
} else {
$query2 = $db->simple_select('ougc_awards_users', 'COUNT(uid) AS users', 'aid=\'' . (int) $award['aid'] . '\'');
$givedscount = (int) $db->fetch_field($query2, 'users');
echo draw_admin_pagination($mybb->input['page'], $limit, $givedscount, $view['url'] . 'index.php?module=user-ougc_awards&action=users&aid=' . $award['aid']);
while ($gived = $db->fetch_array($query)) {
$gived['username'] = format_name(htmlspecialchars_uni($gived['username']), $gived['usergroup'], $gived['displaygroup']);
$table->construct_cell("<a href=\"index.php?module=user-users&action=edit&uid={$gived['uid']}\">{$gived['username']}</a>");
$table->construct_cell(htmlspecialchars_uni($gived['reason']));
$table->construct_cell($lang->sprintf($lang->ougc_awards_users_time, my_date($mybb->settings['dateformat'], intval($gived['date'])), my_date($mybb->settings['timeformat'], intval($gived['date']))), array('class' => 'align_center'));
$table->construct_cell("<a href=\"index.php?module=user-ougc_awards&action=user&aid={$gived['aid']}&uid={$gived['uid']}\">{$lang->ougc_awards_tab_edit}</a>", array('class' => 'align_center'));
$table->construct_row();
}
$table->output($sub_tabs['ougc_awards_users']['description']);
}
$page->output_footer();
} elseif ($mybb->get_input('action') == 'user') {
if (!($award = $awards->get_award($mybb->input['aid']))) {
$awards->admin_redirect($lang->ougc_awards_error_invaliduser, true);
}
$awards->set_url(array('action' => 'user', 'aid' => $award['aid']));
if (!($gived = $awards->get_gived_award($award['aid'], $mybb->get_input('uid', 1)))) {
开发者ID:ambsalinas, 项目名称:anima, 代码行数:31, 代码来源:ougc_awards.php
librespeed/speedtest: Self-hosted Speedtest for HTML5 and more. Easy setup, exam
阅读:1291| 2022-08-30
OpenTeknik LLC OSSN OPEN SOURCE SOCIAL NETWORK v6.3 LTS was discovered to contai
阅读:867| 2022-07-29
avehtari/BDA_m_demos: Bayesian Data Analysis demos for Matlab/Octave
阅读:1205| 2022-08-17
女人怀孕后,为了有一个健康聪明的宝宝,经历各种体检、筛查。其实这些体检和筛查中的
阅读:1002| 2022-11-06
一、电脑软硬件基础知识 1、CPU型号怎么看? CPU是一台电脑的核心,而目前笔记本市场
阅读:802| 2022-07-30
medfreeman/markdown-it-toc-and-anchor: markdown-it plugin to add a toc and ancho
阅读:1404| 2022-08-18
sydney0zq/covid-19-detection: The implementation of A Weakly-supervised Framewor
阅读:519| 2022-08-16
当数据集已处于插入状态时,如何确定数据感知组件字段是否已被修改?我想知道一个字段
阅读:621| 2022-07-18
离中国最远的国家是阿根廷。从太平洋直线计算,即往东线走,北京到阿根廷的布宜诺斯艾
阅读:669| 2022-11-06
A vulnerability has been identified in Mendix Excel Importer Module (Mendix 8 co
阅读:787| 2022-07-29
请发表评论