当前位置: 首页>>代码示例>>PHP>>正文


PHP my_number_format函数代码示例

本文整理汇总了PHP中my_number_format函数的典型用法代码示例。如果您正苦于以下问题:PHP my_number_format函数的具体用法?PHP my_number_format怎么用?PHP my_number_format使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了my_number_format函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: usercp_menu_misc

/**
 * Constructs the usercp misc menu.
 *
 */
function usercp_menu_misc()
{
    global $db, $mybb, $templates, $theme, $usercpmenu, $lang, $collapsed, $collapsedimg;
    $draftstart = $draftend = $draftcount = '';
    $query = $db->simple_select("posts", "COUNT(*) AS draftcount", "visible='-2' AND uid='" . $mybb->user['uid'] . "'");
    $count = $db->fetch_array($query);
    if ($count['draftcount'] > 0) {
        $draftstart = "<strong>";
        $draftend = "</strong>";
        $draftcount = "(" . my_number_format($count['draftcount']) . ")";
    }
    $profile_link = get_profile_link($mybb->user['uid']);
    eval("\$usercpmenu .= \"" . $templates->get("usercp_nav_misc") . "\";");
}
开发者ID:ThinhNguyenVB,项目名称:Gradient-Studios-Website,代码行数:18,代码来源:functions_user.php

示例3: build_user_view_card

function build_user_view_card($user, $view, &$i)
{
    global $user_view_fields;
    ++$i;
    if ($i == 3) {
        $i = 1;
    }
    // Loop through fields user wants to show
    foreach ($view['fields'] as $field) {
        if (!$user_view_fields[$field]) {
            continue;
        }
        $view_field = $user_view_fields[$field];
        // Special conditions for avatar
        if ($field == "avatar") {
            $avatar = $user['view']['avatar'];
        } else {
            if ($field == "controls") {
                $controls = $user['view']['controls'];
            } else {
                if ($field != "username") {
                    if (isset($user['view'][$field])) {
                        $value = $user['view'][$field];
                    } else {
                        $value = $user[$field];
                    }
                    if ($field == "postnum") {
                        $value = my_number_format($value);
                    }
                    $user_details[] = "<strong>{$view_field['title']}:</strong> {$value}";
                }
            }
        }
    }
    // Floated to the left or right?
    if ($i == 1) {
        $float = "left";
    } else {
        $float = "right";
    }
    // And build the final card
    $card = "<fieldset id=\"uid_{$user['uid']}\" style=\"width: 47%; float: {$float};\">\n";
    $card .= "<legend><input type=\"checkbox\" class=\"checkbox\" name=\"inlinemod_{$user['uid']}\" id=\"inlinemod_{$user['uid']}\" value=\"1\" onclick=\"\$('uid_{$user['uid']}').toggleClassName('inline_selected');\" /> {$user['view']['username']}</legend>\n";
    if ($avatar) {
        $card .= "<div class=\"user_avatar\">{$avatar}</div>\n";
    }
    if ($user_details) {
        $card .= "<div class=\"user_details\">" . implode("<br />", $user_details) . "</div>\n";
    }
    if ($controls) {
        $card .= "<div class=\"float_right\" style=\"padding: 4px;\">{$controls}</div>\n";
    }
    $card .= "</fieldset>";
    return $card;
}
开发者ID:GeorgeLVP,项目名称:mybb,代码行数:55,代码来源:users.php

示例4: redirect

    redirect("private.php", $lang->redirect_pmfoldersupdated);
}
if ($mybb->input['action'] == "empty") {
    if ($mybb->user['totalpms'] == 0) {
        error($lang->error_nopms);
    }
    $plugins->run_hooks("private_empty_start");
    $foldersexploded = explode("\$%%\$", $mybb->user['pmfolders']);
    $folderlist = '';
    foreach ($foldersexploded as $key => $folders) {
        $folderinfo = explode("**", $folders, 2);
        $fid = $folderinfo[0];
        $foldername = get_pm_folder_name($fid, $folderinfo[1]);
        $query = $db->simple_select("privatemessages", "COUNT(*) AS pmsinfolder", " folder='{$fid}' AND uid='" . $mybb->user['uid'] . "'");
        $thing = $db->fetch_array($query);
        $foldercount = my_number_format($thing['pmsinfolder']);
        eval("\$folderlist .= \"" . $templates->get("private_empty_folder") . "\";");
    }
    $plugins->run_hooks("private_empty_end");
    eval("\$folders = \"" . $templates->get("private_empty") . "\";");
    output_page($folders);
}
if ($mybb->input['action'] == "do_empty" && $mybb->request_method == "post") {
    // Verify incoming POST request
    verify_post_check($mybb->get_input('my_post_key'));
    $plugins->run_hooks("private_do_empty_start");
    $emptyq = '';
    $mybb->input['empty'] = $mybb->get_input('empty', MyBB::INPUT_ARRAY);
    $keepunreadq = '';
    if ($mybb->get_input('keepunread', MyBB::INPUT_INT) == 1) {
        $keepunreadq = " AND status!='0'";
开发者ID:mainhan1804,项目名称:xomvanphong,代码行数:31,代码来源:private.php

示例5: array

     if ($nummodqueuethreads > 0 || $mybb->usergroup['issupermod'] == 1) {
         $query = $db->simple_select("threads", "COUNT(tid) AS unapprovedthreads", "visible='0' {$flist_queue_threads}");
         $unapproved_threads = $db->fetch_field($query, "unapprovedthreads");
         if ($unapproved_threads > 0) {
             $query = $db->simple_select("threads", "tid, subject, uid, username, dateline", "visible='0' {$flist_queue_threads}", array('order_by' => 'dateline', 'order_dir' => 'DESC', 'limit' => 1));
             $thread = $db->fetch_array($query);
             $thread['date'] = my_date('relative', $thread['dateline']);
             $thread['profilelink'] = build_profile_link($thread['username'], $thread['uid']);
             $thread['link'] = get_thread_link($thread['tid']);
             $thread['subject'] = $thread['fullsubject'] = $parser->parse_badwords($thread['subject']);
             if (my_strlen($thread['subject']) > 25) {
                 $post['subject'] = my_substr($thread['subject'], 0, 25) . "...";
             }
             $thread['subject'] = htmlspecialchars_uni($thread['subject']);
             $thread['fullsubject'] = htmlspecialchars_uni($thread['fullsubject']);
             $unapproved_threads = my_number_format($unapproved_threads);
             eval("\$latest_thread = \"" . $templates->get("modcp_lastthread") . "\";");
         } else {
             eval("\$latest_thread = \"" . $templates->get("modcp_awaitingmoderation_none") . "\";");
         }
         eval("\$awaitingthreads = \"" . $templates->get("modcp_awaitingthreads") . "\";");
     }
     if (!empty($awaitingattachments) || !empty($awaitingposts) || !empty($awaitingthreads)) {
         eval("\$awaitingmoderation = \"" . $templates->get("modcp_awaitingmoderation") . "\";");
     }
 }
 $latestfivemodactions = '';
 if (($nummodlogs > 0 || $mybb->usergroup['issupermod'] == 1) && $mybb->usergroup['canviewmodlogs'] == 1) {
     $where = '';
     if ($tflist_modlog) {
         $where = "WHERE (t.fid <> 0 {$tflist_modlog}) OR (!l.fid)";
开发者ID:olada,项目名称:mybbintegrator,代码行数:31,代码来源:modcp.php

示例6: htmlspecialchars_uni

 }
 $join_requests = '';
 if ($joinrequests[$usergroup['gid']] > 1 && $usergroup['type'] == 4) {
     $join_requests = " <small><a href=\"index.php?module=user-groups&amp;action=join_requests&amp;gid={$usergroup['gid']}\"><span style=\"color: red;\">({$joinrequests[$usergroup['gid']]} {$lang->outstanding_join_request})</span></a></small>";
 } else {
     if ($joinrequests[$usergroup['gid']] == 1 && $usergroup['type'] == 4) {
         $join_requests = " <small><a href=\"index.php?module=user-groups&amp;action=join_requests&amp;gid={$usergroup['gid']}\"><span style=\"color: red;\">({$joinrequests[$usergroup['gid']]} {$lang->outstanding_join_request})</span></a></small>";
     }
 }
 $form_container->output_cell("<div class=\"float_right\">{$icon}</div><div><strong><a href=\"index.php?module=user-groups&amp;action=edit&amp;gid={$usergroup['gid']}\">" . htmlspecialchars_uni($usergroup['title']) . "</a></strong>{$join_requests}<br /><small>" . htmlspecialchars_uni($usergroup['description']) . "{$leaders_list}</small></div>");
 if (!$primaryusers[$usergroup['gid']]) {
     $primaryusers[$usergroup['gid']] = 0;
 }
 $numusers = $primaryusers[$usergroup['gid']];
 $numusers += $secondaryusers[$usergroup['gid']];
 $form_container->output_cell(my_number_format($numusers), array("class" => "align_center"));
 if ($usergroup['showforumteam'] == 1) {
     $form_container->output_cell("<input type=\"text\" name=\"disporder[{$usergroup['gid']}]\" value=\"{$usergroup['disporder']}\" class=\"text_input align_center\" style=\"width: 80%;\" />", array("class" => "align_center"));
 } else {
     $form_container->output_cell("&nbsp;", array("class" => "align_center"));
 }
 $popup = new PopupMenu("usergroup_{$usergroup['gid']}", $lang->options);
 $popup->add_item($lang->edit_group, "index.php?module=user-groups&amp;action=edit&amp;gid={$usergroup['gid']}");
 $popup->add_item($lang->list_users, "index.php?module=user-users&amp;action=search&amp;results=1&amp;conditions[usergroup]={$usergroup['gid']}");
 if ($joinrequests[$usergroup['gid']] > 0 && $usergroup['type'] == 4) {
     $popup->add_item($lang->join_requests, "index.php?module=user-groups&amp;action=join_requests&amp;gid={$usergroup['gid']}");
 }
 $popup->add_item($lang->group_leaders, "index.php?module=user-groups&amp;action=leaders&amp;gid={$usergroup['gid']}");
 if ($usergroup['type'] > 1) {
     $popup->add_item($lang->delete_group, "index.php?module=user-groups&amp;action=delete&amp;gid={$usergroup['gid']}&amp;my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_group_deletion}')");
 }
开发者ID:mainhan1804,项目名称:xomvanphong,代码行数:31,代码来源:groups.php

示例7: build_user_view_table

/**
 * @param array $user
 * @param array $view
 * @param DefaultTable $table
 */
function build_user_view_table($user, $view, &$table)
{
    global $user_view_fields;
    foreach ($view['fields'] as $field) {
        if (!$user_view_fields[$field]) {
            continue;
        }
        $view_field = $user_view_fields[$field];
        $field_options = array();
        if ($view_field['align']) {
            $field_options['class'] = "align_" . $view_field['align'];
        }
        if ($user['view'][$field]) {
            $value = $user['view'][$field];
        } else {
            $value = $user[$field];
        }
        if ($field == "postnum") {
            $value = my_number_format($user[$field]);
        }
        $table->construct_cell($value, $field_options);
    }
    $table->construct_cell("<input type=\"checkbox\" class=\"checkbox\" name=\"inlinemod_{$user['uid']}\" id=\"inlinemod_{$user['uid']}\" value=\"1\" onclick=\"\$('#uid_{$user['uid']}').toggleClass('inline_selected');\" />");
    $table->construct_row();
}
开发者ID:mainhan1804,项目名称:xomvanphong,代码行数:30,代码来源:users.php

示例8: elseif

 // Format the user's 'total' reputation
 if ($user['reputation'] < 0) {
     $total_class = "_minus";
 } elseif ($user['reputation'] > 0) {
     $total_class = "_plus";
 } else {
     $total_class = "_neutral";
 }
 // Figure out how many reps have come from posts / 'general'
 // Posts
 $query = $db->simple_select("reputation", "COUNT(rid) AS rep_posts", "uid = '" . $user['uid'] . "' AND pid > 0");
 $rep_post_count = $db->fetch_field($query, "rep_posts");
 $rep_posts = my_number_format($rep_post_count);
 // General
 // We count how many reps in total, then subtract the reps from posts
 $rep_members = my_number_format($total_reputation - $rep_post_count);
 // Is negative reputation disabled? If so, tell the user
 if ($mybb->settings['negrep'] == 0) {
     $neg_rep_info = $lang->neg_rep_disabled;
 }
 if ($mybb->settings['posrep'] == 0) {
     $pos_rep_info = $lang->pos_rep_disabled;
 }
 if ($mybb->settings['neurep'] == 0) {
     $neu_rep_info = $lang->neu_rep_disabled;
 }
 $perpage = (int) $mybb->settings['repsperpage'];
 if ($perpage < 1) {
     $perpage = 15;
 }
 // Check if we're browsing a specific page of results
开发者ID:styv300,项目名称:ToRepublic2.5,代码行数:31,代码来源:reputation.php

示例9: array

 }
 if ($session->ipaddress == $data['ip'] || $mybb->user['regip'] == $data['ip'] || $mybb->user['lastip'] == $data['ip']) {
     $isyou = "(You)";
 } else {
     $isyou = "";
 }
 if (isset($mybb->input['page']) && $mybb->input['page'] !== 1) {
     $num = $mybb->input['page'] * 10;
 } else {
     $num = 0;
 }
 $i = ++$number + $num;
 $table->construct_cell("<strong>" . $i . "</strong>", array('width' => '1%'));
 $table->construct_cell("<a href=\"index.php?module=cloudflare-whois&amp;action=lookup&amp;server=" . $data['ip'] . "\" target=\"_blank\">" . $data['ip'] . "</a> " . $isyou, array('width' => '25%'));
 $table->construct_cell($data['classification'], array('width' => '25%'));
 $table->construct_cell(my_number_format($data['hits']), array('width' => '25%'));
 if (function_exists('geoip_record_by_name')) {
     $ip_record = @geoip_record_by_name($data['ip']);
     if ($ip_record) {
         $ipaddress_location = null;
         if ($ip_record['city']) {
             $ipaddress_location .= htmlspecialchars_uni($ip_record['city']) . $lang->comma . ' ';
         }
         $ipaddress_location .= htmlspecialchars_uni($ip_record['country_name']);
         $table->construct_cell('<a href="https://maps.google.com/maps?q=' . urlencode($ipaddress_location) . '" target="_blank">' . $ipaddress_location . '</a>', array('width' => '25%'));
     } else {
         $table->construct_cell('N/A', array('width' => '25%'));
     }
 }
 if ($mybb->settings['cloudflare_showdns'] == "1") {
     $table->construct_cell(gethostbyaddr($data['ip']), array('width' => '25%'));
开发者ID:EspialWires,项目名称:MyBB-CloudFlare-Manager,代码行数:31,代码来源:cloudflare_recent_visitors.php

示例10: COUNT

    $query = $db->query("\n\t\tSELECT COUNT(p.pid) AS posts, p.username AS postusername, u.uid, u.username, u.usergroup, u.displaygroup\n\t\tFROM " . TABLE_PREFIX . "posts p\n\t\tLEFT JOIN " . TABLE_PREFIX . "users u ON (u.uid=p.uid)\n\t\tWHERE tid='" . $tid . "' AND {$show_posts}\n\t\tGROUP BY u.uid, p.username, u.uid, u.username, u.usergroup, u.displaygroup\n\t\t" . $sortsql . "\n\t");
    while ($poster = $db->fetch_array($query)) {
        if ($poster['username'] == '') {
            $poster['username'] = $poster['postusername'];
        }
        $poster_name = format_name($poster['username'], $poster['usergroup'], $poster['displaygroup']);
        if ($poster['uid']) {
            $onclick = "opener.location.href='" . get_profile_link($poster['uid']) . "'; return false;";
        }
        $profile_link = build_profile_link($poster_name, $poster['uid'], '_blank', $onclick);
        $numposts += $poster['posts'];
        eval("\$whoposted .= \"" . $templates->get("misc_whoposted_poster") . "\";");
        $altbg = alt_trow();
    }
    $numposts = my_number_format($numposts);
    $poster['posts'] = my_number_format($poster['posts']);
    eval("\$whop = \"" . $templates->get("misc_whoposted", 1, 0) . "\";");
    echo $whop;
    exit;
} elseif ($mybb->input['action'] == "smilies") {
    $smilies = '';
    if (!empty($mybb->input['popup']) && !empty($mybb->input['editor'])) {
        // make small popup list of smilies
        $editor = preg_replace('#([^a-zA-Z0-9_-]+)#', '', $mybb->get_input('editor'));
        $e = 1;
        $class = "trow1";
        $smilies = "<tr>";
        $smilies_cache = $cache->read("smilies");
        if (is_array($smilies_cache)) {
            $extra_class = ' smilie_pointer';
            foreach ($smilies_cache as $smilie) {
开发者ID:olada,项目名称:mybbintegrator,代码行数:31,代码来源:misc.php

示例11: htmlspecialchars_uni

        // Show avatar
        if ($user['avatar'] != '') {
            $user['avatar'] = htmlspecialchars_uni($user['avatar']);
            $avatar_dimensions = explode("|", $user['avatardimensions']);
            if ($avatar_dimensions[0] && $avatar_dimensions[1]) {
                list($max_width, $max_height) = explode("x", my_strtolower($mybb->settings['memberlistmaxavatarsize']));
                if ($avatar_dimensions[0] > $max_width || $avatar_dimensions[1] > $max_height) {
                    require_once MYBB_ROOT . "inc/functions_image.php";
                    $scaled_dimensions = scale_image($avatar_dimensions[0], $avatar_dimensions[1], $max_width, $max_height);
                    $avatar_width_height = "width=\"{$scaled_dimensions['width']}\" height=\"{$scaled_dimensions['height']}\"";
                } else {
                    $avatar_width_height = "width=\"{$avatar_dimensions[0]}\" height=\"{$avatar_dimensions[1]}\"";
                }
            }
            eval("\$user['avatar'] = \"" . $templates->get("memberlist_user_avatar") . "\";");
        } else {
            $user['avatar'] = "";
        }
        $user['regdate'] = my_date($mybb->settings['dateformat'], $user['regdate']) . ", " . my_date($mybb->settings['timeformat'], $user['regdate']);
        $user['lastvisit'] = my_date($mybb->settings['dateformat'], $user['lastactive']) . ", " . my_date($mybb->settings['timeformat'], $user['lastactive']);
        $user['postnum'] = my_number_format($user['postnum']);
        eval("\$users .= \"" . $templates->get("memberlist_user") . "\";");
    }
    // Do we have no results?
    if (!$users) {
        $users = "<tr>\n<td colspan=\"" . $colspan . "\" align=\"center\" class=\"trow1\">{$lang->error_no_members}</td>\n</tr>";
    }
    $plugins->run_hooks("memberlist_end");
    eval("\$memberlist = \"" . $templates->get("memberlist") . "\";");
    output_page($memberlist);
}
开发者ID:GeorgeLVP,项目名称:mybb,代码行数:31,代码来源:memberlist.php

示例12: generate_growth_string

function generate_growth_string($number)
{
    global $lang, $cp_style;
    if ($number === null) {
        return "";
    }
    $number = (int) $number;
    $friendly_number = my_number_format(abs($number));
    if ($number > 0) {
        $growth_string = "(<img src=\"./styles/{$cp_style}/images/icons/increase.png\" alt=\"{$lang->increase}\" title=\"{$lang->increase}\" style=\"vertical-align: middle; margin-top: -2px;\" /> {$friendly_number})";
    } elseif ($number == 0) {
        $growth_string = "(<img src=\"./styles/{$cp_style}/images/icons/no_change.png\" alt=\"{$lang->no_change}\" title=\"{$lang->no_change}\" style=\"vertical-align: middle; margin-top: -2px;\" /> {$friendly_number})";
    } else {
        $growth_string = "(<img src=\"./styles/{$cp_style}/images/icons/decrease.png\" alt=\"{$lang->decrease}\" title=\"{$lang->decrease}\" style=\"vertical-align: middle; margin-top: -2px;\" /> {$friendly_number})";
    }
    return $growth_string;
}
开发者ID:olada,项目名称:mybbintegrator,代码行数:17,代码来源:statistics.php

示例13: get_user_info_func


//.........这里部分代码省略.........
                $lang->tyl_total_tyls_rcvd = $lang->tyl_total_thanks_rcvd;
            }
        }
        $daysreg = (TIME_NOW - $memprofile['regdate']) / (24 * 3600);
        $tylpd = $memprofile['tyl_unumtyls'] / $daysreg;
        $tylpd = round($tylpd, 2);
        if ($tylpd > $memprofile['tyl_unumtyls']) {
            $tylpd = $memprofile['tyl_unumtyls'];
        }
        $tylrcvpd = $memprofile['tyl_unumrcvtyls'] / $daysreg;
        $tylrcvpd = round($tylrcvpd, 2);
        if ($tylrcvpd > $memprofile['tyl_unumrcvtyls']) {
            $tylrcvpd = $memprofile['tyl_unumrcvtyls'];
        }
        // Get total tyl and percentage
        $options = array("limit" => 1);
        $query = $db->simple_select($prefix . "stats", "*", "title='total'", $options);
        $total = $db->fetch_array($query);
        if ($total['value'] == 0) {
            $percent = "0";
            $percent_rcv = "0";
        } else {
            $percent = $memprofile['tyl_unumtyls'] * 100 / $total['value'];
            $percent = round($percent, 2);
            $percent_rcv = $memprofile['tyl_unumrcvtyls'] * 100 / $total['value'];
            $percent_rcv = round($percent_rcv, 2);
        }
        if ($percent > 100) {
            $percent = 100;
        }
        if ($percent_rcv > 100) {
            $percent_rcv = 100;
        }
        $memprofile['tyl_unumtyls'] = my_number_format($memprofile['tyl_unumtyls']);
        $memprofile['tyl_unumrcvtyls'] = my_number_format($memprofile['tyl_unumrcvtyls']);
        $tylpd_percent_total = $lang->sprintf($lang->tyl_tylpd_percent_total, my_number_format($tylpd), $tyl_thankslikes_given, $percent);
        $tylrcvpd_percent_total = $lang->sprintf($lang->tyl_tylpd_percent_total, my_number_format($tylrcvpd), $tyl_thankslikes_rcvd, $percent_rcv);
        addCustomField($lang->tyl_total_tyls_given, "{$memprofile['tyl_unumtyls']} ({$tylpd_percent_total})", $custom_fields_list);
        addCustomField($lang->tyl_total_tyls_rcvd, "{$memprofile['tyl_unumrcvtyls']} ({$tylrcvpd_percent_total})", $custom_fields_list);
    }
    if ($memprofile['timeonline'] > 0) {
        $timeonline = nice_time($memprofile['timeonline']);
        addCustomField($lang->timeonline, $timeonline, $custom_fields_list);
    }
    if ($mybb->settings['usereferrals'] == 1 && $memprofile['referrals'] > 0) {
        addCustomField($lang->members_referred, $memprofile['referrals'], $custom_fields_list);
    }
    if ($memperms['usereputationsystem'] == 1 && $displaygroup['usereputationsystem'] == 1 && $mybb->settings['enablereputation'] == 1 && ($mybb->settings['posrep'] || $mybb->settings['neurep'] || $mybb->settings['negrep'])) {
        addCustomField($lang->reputation, $memprofile['reputation'], $custom_fields_list);
    }
    if ($mybb->settings['enablewarningsystem'] != 0 && $memperms['canreceivewarnings'] != 0 && ($mybb->usergroup['canwarnusers'] != 0 || $mybb->user['uid'] == $memprofile['uid'] && $mybb->settings['canviewownwarning'] != 0)) {
        $warning_level = round($memprofile['warningpoints'] / $mybb->settings['maxwarningpoints'] * 100);
        if ($warning_level > 100) {
            $warning_level = 100;
        }
        addCustomField($lang->warning_level, $warning_level . '%', $custom_fields_list);
    }
    if ($memprofile['website']) {
        $memprofile['website'] = htmlspecialchars_uni($memprofile['website']);
        addCustomField($lang->homepage, $memprofile['website'], $custom_fields_list);
    }
    if ($memprofile['icq']) {
        addCustomField($lang->icq_number, $memprofile['icq'], $custom_fields_list);
    }
    if ($memprofile['aim']) {
        addCustomField($lang->aim_screenname, $memprofile['aim'], $custom_fields_list);
开发者ID:dthiago,项目名称:tapatalk-mybb,代码行数:67,代码来源:get_user_info.php

示例14: ceil

                 $progress = ceil($email['sentcount'] / $email['totalcount'] * 100);
                 if ($progress > 100) {
                     $progress = 100;
                 }
                 $status = "{$lang->delivering} ({$progress}%)";
             }
         }
     }
     $table->construct_cell($status, array("class" => "align_center"));
     if ($email['status'] != 0) {
         $delivery_date = my_date($mybb->settings['dateformat'], $email['senddate']);
     } else {
         $delivery_date = $lang->na;
     }
     $table->construct_cell($delivery_date, array("class" => "align_center"));
     $table->construct_cell(my_number_format($email['totalcount']), array("class" => "align_center"));
     if (TIME_NOW >= $email['senddate'] && $email['status'] > 1) {
         $table->construct_cell("<a href=\"index.php?module=user-mass_mail&amp;action=cancel&amp;mid={$email['mid']}&amp;my_post_key={$mybb->post_code}\" onclick=\"return AdminCP.deleteConfirmation(this, '{$lang->mass_mail_cancel_confirmation}')\">{$lang->cancel}</a>", array("width" => 100, "colspan" => 2, "class" => "align_center"));
     } else {
         $table->construct_cell("<a href=\"index.php?module=user-mass_mail&amp;action=edit&amp;mid={$email['mid']}\">{$lang->edit}</a>", array("width" => 100, "class" => "align_center"));
         $table->construct_cell("<a href=\"index.php?module=user-mass_mail&amp;action=delete&amp;mid={$email['mid']}&amp;my_post_key={$mybb->post_code}\" onclick=\"return AdminCP.deleteConfirmation(this, '{$lang->mass_mail_deletion_confirmation}')\">{$lang->delete}</a>", array("width" => 100, "class" => "align_center"));
     }
     $table->construct_row();
 }
 if ($table->num_rows() == 0) {
     $table->construct_cell($lang->no_unsent_messages, array('colspan' => 6));
     $table->construct_row();
     $no_results = true;
 }
 $table->output($lang->mass_mail_queue);
 $page->output_footer();
开发者ID:Nidrax,项目名称:ppm-1.6,代码行数:31,代码来源:mass_mail.php

示例15: get_forum_unapproved

/**
 * Fetch the number of unapproved posts, formatted, from a forum
 *
 * @param array Array of information about the forum
 * @return array Array containing formatted string for posts and string for threads
 */
function get_forum_unapproved($forum)
{
    global $lang;
    $unapproved_threads = $unapproved_posts = '';
    // If the user is a moderator we need to fetch the count
    if (is_moderator($forum['fid'])) {
        // Forum has one or more unaproved posts, format language string accordingly
        if ($forum['unapprovedposts']) {
            if ($forum['unapprovedposts'] > 1) {
                $unapproved_posts_count = $lang->sprintf($lang->forum_unapproved_posts_count, $forum['unapprovedposts']);
            } else {
                $unapproved_posts_count = $lang->sprintf($lang->forum_unapproved_post_count, 1);
            }
            $unapproved_posts = " <span title=\"{$unapproved_posts_count}\">(" . my_number_format($forum['unapprovedposts']) . ")</span>";
        }
        // Forum has one or more unapproved threads, format language string accordingly
        if ($forum['unapprovedthreads']) {
            if ($forum['unapprovedthreads'] > 1) {
                $unapproved_threads_count = $lang->sprintf($lang->forum_unapproved_threads_count, $forum['unapprovedthreads']);
            } else {
                $unapproved_threads_count = $lang->sprintf($lang->forum_unapproved_thread_count, 1);
            }
            $unapproved_threads = " <span title=\"{$unapproved_threads_count}\">(" . my_number_format($forum['unapprovedthreads']) . ")</span>";
        }
    }
    return array("unapproved_posts" => $unapproved_posts, "unapproved_threads" => $unapproved_threads);
}
开发者ID:benn0034,项目名称:SHIELDsite2.old,代码行数:33,代码来源:functions_forumlist.php


注:本文中的my_number_format函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。