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


PHP my_date函数代码示例

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


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

示例1: xthreads_search_result

function xthreads_search_result(&$data, $tplname)
{
    global $threadfields, $threadfield_cache, $forumcache, $mybb;
    // need to set these variables before doing threadfields stuff!
    $data['threaddate'] = my_date($mybb->settings['dateformat'], $data['dateline']);
    $data['threadtime'] = my_date($mybb->settings['timeformat'], $data['dateline']);
    xthreads_set_threadforum_urlvars('thread', $data['tid']);
    xthreads_set_threadforum_urlvars('forum', $data['fid']);
    if (!empty($threadfield_cache)) {
        // make threadfields array
        $threadfields = array();
        // clear previous threadfields
        if ($GLOBALS['thread_ids']) {
            $tidlist =& $GLOBALS['thread_ids'];
        } elseif ($GLOBALS['tids']) {
            $tidlist =& $GLOBALS['tids'];
        } else {
            $tidlist = '';
        }
        foreach ($threadfield_cache as $k => &$v) {
            if ($v['forums'] && strpos(',' . $v['forums'] . ',', ',' . $data['fid'] . ',') === false) {
                continue;
            }
            xthreads_get_xta_cache($v, $tidlist);
            $threadfields[$k] =& $data['xthreads_' . $k];
            xthreads_sanitize_disp($threadfields[$k], $v, $data['username'] !== '' ? $data['username'] : $data['userusername']);
        }
    }
    // template hack
    xthreads_portalsearch_cache_hack($GLOBALS['forum_tpl_prefixes'][$data['fid']], $tplname);
}
开发者ID:sammykumar,项目名称:TheVRForums,代码行数:31,代码来源:xt_mischooks.php

示例2: mycode_parse_post_quotes

 /**
  * Parses quotes with post id and/or dateline.
  *
  * @param string The message to be parsed
  * @param string The username to be parsed
  * @param boolean Are we formatting as text?
  * @return string The parsed message.
  */
 function mycode_parse_post_quotes($message, $username, $text_only = false)
 {
     global $lang, $templates, $theme, $mybb;
     $linkback = $date = "";
     $message = trim($message);
     $message = preg_replace("#(^<br(\\s?)(\\/?)>|<br(\\s?)(\\/?)>\$)#i", "", $message);
     if (!$message) {
         return '';
     }
     $message = str_replace('\\"', '"', $message);
     $username = str_replace('\\"', '"', $username) . "'";
     $delete_quote = true;
     preg_match("#pid=(?:&quot;|\"|')?([0-9]+)[\"']?(?:&quot;|\"|')?#i", $username, $match);
     if (intval($match[1])) {
         $pid = intval($match[1]);
         $url = $mybb->settings['bburl'] . "/" . get_post_link($pid) . "#pid{$pid}";
         if (defined("IN_ARCHIVE")) {
             $linkback = " <a href=\"{$url}\">[ -> ]</a>";
         } else {
             eval("\$linkback = \" " . $templates->get("postbit_gotopost", 1, 0) . "\";");
         }
         $username = preg_replace("#(?:&quot;|\"|')? pid=(?:&quot;|\"|')?[0-9]+[\"']?(?:&quot;|\"|')?#i", '', $username);
         $delete_quote = false;
     }
     unset($match);
     preg_match("#dateline=(?:&quot;|\"|')?([0-9]+)(?:&quot;|\"|')?#i", $username, $match);
     if (intval($match[1])) {
         $dateline = intval($match[1]);
         if ($match[1] < TIME_NOW) {
             $postdate = my_date($mybb->settings['dateformat'], intval($match[1]));
             $posttime = my_date($mybb->settings['timeformat'], intval($match[1]));
             $date = " ({$postdate} {$posttime})";
         }
         $username = preg_replace("#(?:&quot;|\"|')? dateline=(?:&quot;|\"|')?[0-9]+(?:&quot;|\"|')?#i", '', $username);
         $delete_quote = false;
     }
     if ($delete_quote) {
         $username = my_substr($username, 0, my_strlen($username) - 1);
     }
     if ($text_only) {
         return "\n" . htmlspecialchars_uni($username) . " {$lang->wrote}{$date}\n--\n{$message}\n--\n";
     } else {
         $span = "";
         if (!$delete_quote) {
             $span = "<span>{$date}</span>";
         }
         $username = preg_replace('/^\\\'/is', '', $username);
         $userinfo = tt_get_user_id_by_name($username);
         if (!empty($userinfo)) {
             $uid = $userinfo['uid'];
         }
         return "[quote " . (isset($uid) ? "uid={$uid} " : '') . (!empty($username) ? "name=\"{$username}\" " : '') . (isset($pid) ? "post={$pid} " : '') . (isset($dateline) ? "timestamp={$dateline}" : '') . "]{$message}[/quote]\n";
     }
 }
开发者ID:dthiago,项目名称:tapatalk-mybb,代码行数:62,代码来源:parser.php

示例3: dbListEvents

function dbListEvents($db)
{
    echo "*List of currently open events:*\n\n";
    $result = $db->query('SELECT events.*, IFNULL(SUM(attendees.attendee_num),0) AS attendee_num FROM events LEFT JOIN attendees ON events.id = attendees.event_id GROUP BY events.id ORDER BY `event_time` ASC');
    foreach ($result as $r) {
        echo '*' . $r['event_name'] . '* @ *' . my_date($r['event_time']) . '* by *' . $r['event_owner'] . '* (*' . $r['attendee_num'] . '*)';
        if ($r['event_rsvp'] != NULL) {
            echo ' (RSVP: ' . my_date($r['event_rsvp']) . ')';
        }
        if ($r['event_note'] != NULL) {
            echo ' ' . $r['event_note'];
        }
        echo "\n\n";
    }
}
开发者ID:anderskvist,项目名称:slack-simple-sign-up,代码行数:15,代码来源:database.inc.php

示例4: 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;
     $stdClass = new stdClass();
     $timestamp = "";
     if (isset($mybb->input["timestamp"])) {
         $timestamp = (string) $mybb->input["timestamp"];
     }
     $ty = 1;
     if (isset($mybb->input["ty"]) && in_array($mybb->input["ty"], array("0", "1"))) {
         $ty = (int) $mybb->input["ty"];
     }
     $stdClass->date = my_date($mybb->settings['dateformat'], $timestamp, "", $ty);
     $stdClass->time = my_date($mybb->settings['timeformat'], $timestamp, "", $ty);
     $stdClass->timestamp = $timestamp;
     return $stdClass;
 }
开发者ID:Shade-,项目名称:MyBB-RESTful-API-System,代码行数:20,代码来源:dateapi.class.php

示例5: get_user

    if ($errors) {
        $page->output_inline_error($errors);
    }
    if ($mybb->input['uid'] && !$mybb->input['username']) {
        $user = get_user($mybb->input['uid']);
        $mybb->input['username'] = $user['username'];
    }
    $form_container = new FormContainer($lang->ban_a_user);
    $form_container->output_row($lang->ban_username, $lang->autocomplete_enabled, $form->generate_text_box('username', $mybb->input['username'], array('id' => 'username')), 'username');
    $form_container->output_row($lang->ban_reason, "", $form->generate_text_box('reason', $mybb->input['reason'], array('id' => 'reason')), 'reason');
    if (count($banned_groups) > 1) {
        $form_container->output_row($lang->ban_group, $lang->add_ban_group_desc, $form->generate_select_box('usergroup', $banned_groups, $mybb->input['usergroup'], array('id' => 'usergroup')), 'usergroup');
    }
    foreach ($ban_times as $time => $period) {
        if ($time != "---") {
            $friendly_time = my_date("D, jS M Y @ g:ia", ban_date2timestamp($time));
            $period = "{$period} ({$friendly_time})";
        }
        $length_list[$time] = $period;
    }
    $form_container->output_row($lang->ban_time, "", $form->generate_select_box('bantime', $length_list, $mybb->input['bantime'], array('id' => 'bantime')), 'bantime');
    $form_container->end();
    // Autocompletion for usernames
    echo '
	<script type="text/javascript" src="../jscripts/autocomplete.js?ver=140"></script>
	<script type="text/javascript">
	<!--
		new autoComplete("username", "../xmlhttp.php?action=get_users", {valueSpan: "username"});
	// -->
	</script>';
    $buttons[] = $form->generate_submit_button($lang->ban_user);
开发者ID:Nidrax,项目名称:ppm-1.6,代码行数:31,代码来源:banning.php

示例6: buildtree

/**
 * Build a navigation tree for threaded display.
 *
 * @param unknown_type $replyto
 * @param unknown_type $indent
 * @return unknown
 */
function buildtree($replyto = "0", $indent = "0")
{
    global $tree, $mybb, $theme, $mybb, $pid, $tid, $templates, $parser;
    if ($indent) {
        $indentsize = 13 * $indent;
    } else {
        $indentsize = 0;
    }
    ++$indent;
    if (is_array($tree[$replyto])) {
        foreach ($tree[$replyto] as $key => $post) {
            $postdate = my_date($mybb->settings['dateformat'], $post['dateline']);
            $posttime = my_date($mybb->settings['timeformat'], $post['dateline']);
            $post['subject'] = htmlspecialchars_uni($parser->parse_badwords($post['subject']));
            if (!$post['subject']) {
                $post['subject'] = "[" . $lang->no_subject . "]";
            }
            $post['profilelink'] = build_profile_link($post['username'], $post['uid']);
            if ($mybb->input['pid'] == $post['pid']) {
                eval("\$posts .= \"" . $templates->get("showthread_threaded_bitactive") . "\";");
            } else {
                eval("\$posts .= \"" . $templates->get("showthread_threaded_bit") . "\";");
            }
            if ($tree[$post['pid']]) {
                $posts .= buildtree($post['pid'], $indent);
            }
        }
        --$indent;
    }
    return $posts;
}
开发者ID:ThinhNguyenVB,项目名称:Gradient-Studios-Website,代码行数:38,代码来源:showthread.php

示例7: update_birthdays

 function update_birthdays()
 {
     global $db;
     $birthdays = array();
     // Get today, yesturday, and tomorrow's time (for different timezones)
     $bdaytime = TIME_NOW;
     $bdaydate = my_date("j-n", $bdaytime, '', 0);
     $bdaydatetomorrow = my_date("j-n", $bdaytime + 86400, '', 0);
     $bdaydateyesterday = my_date("j-n", $bdaytime - 86400, '', 0);
     $query = $db->simple_select("users", "uid, username, usergroup, displaygroup, birthday, birthdayprivacy", "birthday LIKE '{$bdaydate}-%' OR birthday LIKE '{$bdaydateyesterday}-%' OR birthday LIKE '{$bdaydatetomorrow}-%'");
     while ($bday = $db->fetch_array($query)) {
         // Pop off the year from the birthday because we don't need it.
         $bday['bday'] = explode('-', $bday['birthday']);
         array_pop($bday['bday']);
         $bday['bday'] = implode('-', $bday['bday']);
         if ($bday['birthdayprivacy'] != 'all') {
             ++$birthdays[$bday['bday']]['hiddencount'];
             continue;
         }
         // We don't need any excess caleries in the cache
         unset($bday['birthdayprivacy']);
         $birthdays[$bday['bday']]['users'][] = $bday;
     }
     $this->update("birthdays", $birthdays);
 }
开发者ID:GeorgeLVP,项目名称:mybb,代码行数:25,代码来源:class_datacache.php

示例8: akismet_admin


//.........这里部分代码省略.........
    }
    if ($mybb->input['delete'] && $mybb->request_method == "post") {
        $deletepost = $mybb->input['akismet'];
        if (empty($deletepost)) {
            flash_message($lang->error_deletepost, 'error');
            admin_redirect("index.php?module=forum-akismet");
        }
        $posts_in = '';
        $comma = '';
        foreach ($deletepost as $key => $val) {
            $posts_in .= $comma . intval($key);
            $comma = ',';
        }
        $query = $db->simple_select("posts", "pid, tid", "pid IN ({$posts_in}) AND replyto = '0'");
        while ($post = $db->fetch_array($query)) {
            $threadp[$post['pid']] = $post['tid'];
        }
        if (!is_array($threadp)) {
            $threadp = array();
        }
        require_once MYBB_ROOT . "inc/functions_upload.php";
        foreach ($deletepost as $pid => $val) {
            if (array_key_exists($pid, $threadp)) {
                $db->delete_query("posts", "pid IN ({$posts_in})");
                $db->delete_query("attachments", "pid IN ({$posts_in})");
                // Get thread info
                $query = $db->simple_select("threads", "poll", "tid='" . $threadp[$pid] . "'");
                $poll = $db->fetch_field($query, 'poll');
                // Delete threads, redirects, favorites, polls, and poll votes
                $db->delete_query("threads", "tid='" . $threadp[$pid] . "'");
                $db->delete_query("threads", "closed='moved|" . $threadp[$pid] . "'");
                $db->delete_query("threadsubscriptions", "tid='" . $threadp[$pid] . "'");
                $db->delete_query("polls", "tid='" . $threadp[$pid] . "'");
                $db->delete_query("pollvotes", "pid='{$poll}'");
            }
            // Remove attachments
            remove_attachments($pid);
            // Delete the post
            $db->delete_query("posts", "pid='{$pid}'");
        }
        // Log admin action
        log_admin_action();
        flash_message($lang->success_spam_deleted, 'success');
        admin_redirect("index.php?module=forum-akismet");
    }
    if (!$mybb->input['action']) {
        require MYBB_ROOT . "inc/class_parser.php";
        $parser = new postParser();
        $page->output_header($lang->akismet);
        $form = new Form("index.php?module=forum-akismet", "post");
        $table = new Table();
        $table->construct_header($form->generate_check_box("checkall", 1, '', array('class' => 'checkall')), array('width' => '5%'));
        $table->construct_header("Title / Username / Post", array('class' => 'align_center'));
        $mybb->input['page'] = intval($mybb->input['page']);
        if ($mybb->input['page'] > 0) {
            $start = $mybb->input['page'] * 20;
        } else {
            $start = 0;
        }
        $query = $db->simple_select("posts", "COUNT(pid) as spam", "visible = '-4'");
        $total_rows = $db->fetch_field($query, 'spam');
        if ($start > $total_rows) {
            $start = $total_rows - 20;
        }
        if ($start < 0) {
            $start = 0;
        }
        $query = $db->simple_select("posts", "*", "visible = '-4'", array('limit_start' => $start, 'limit' => '20', 'order_by' => 'dateline', 'order_dir' => 'desc'));
        while ($post = $db->fetch_array($query)) {
            if ($post['uid'] != 0) {
                $username = "<a href=\"../" . str_replace("{uid}", $post['uid'], PROFILE_URL) . "\" target=\"_blank\">" . format_name($post['username'], $post['usergroup'], $post['displaygroup']) . "</a>";
            } else {
                $username = $post['username'];
            }
            $table->construct_cell($form->generate_check_box("akismet[{$post['pid']}]", 1, ''));
            $table->construct_cell("<span style=\"float: right;\">{$lang->username} {$username}</span> <span style=\"float: left;\">{$lang->title}: " . htmlspecialchars_uni($post['subject']) . " <strong>(" . my_date($mybb->settings['dateformat'], $post['dateline']) . ", " . my_date($mybb->settings['timeformat'], $post['dateline']) . ")</strong></span>");
            $table->construct_row();
            $parser_options = array("allow_html" => 0, "allow_mycode" => 0, "allow_smilies" => 0, "allow_imgcode" => 0, "me_username" => $post['username'], "filter_badwords" => 1);
            $post['message'] = $parser->parse_message($post['message'], $parser_options);
            $table->construct_cell($post['message'], array("colspan" => 2));
            $table->construct_row();
        }
        $num_rows = $table->num_rows();
        if ($num_rows == 0) {
            $table->construct_cell($lang->no_spam_found, array("class" => "align_center", "colspan" => 2));
            $table->construct_row();
        }
        $table->output($lang->detected_spam_messages);
        echo "<br />" . draw_admin_pagination($mybb->input['page'], 20, $total_rows, "index.php?module=forum-akismet&amp;page={page}");
        $buttons[] = $form->generate_submit_button($lang->unmark_selected, array('name' => 'unmark'));
        $buttons[] = $form->generate_submit_button($lang->deleted_selected, array('name' => 'delete'));
        if ($num_rows > 0) {
            $buttons[] = $form->generate_submit_button($lang->delete_all, array('name' => 'delete_all', 'onclick' => "return confirm('{$lang->confirm_spam_deletion}');"));
        }
        $form->output_submit_wrapper($buttons);
        $form->end();
        $page->output_footer();
    }
    exit;
}
开发者ID:ThinhNguyenVB,项目名称:Gradient-Studios-Website,代码行数:101,代码来源:akismet.php

示例9: implode

 }
 $pidin = implode(",", $pidin);
 // Fetch attachments
 $query = $db->simple_select("attachments", "*", "pid IN ({$pidin})");
 while ($attachment = $db->fetch_array($query)) {
     $attachcache[$attachment['pid']][$attachment['aid']] = $attachment;
 }
 $query = $db->query("\n\t\t\tSELECT p.*, u.username AS userusername\n\t\t\tFROM " . TABLE_PREFIX . "posts p\n\t\t\tLEFT JOIN " . TABLE_PREFIX . "users u ON (p.uid=u.uid)\n\t\t\tWHERE pid IN ({$pidin})\n\t\t\tORDER BY dateline DESC\n\t\t");
 $postsdone = 0;
 $altbg = "trow1";
 $reviewbits = '';
 while ($post = $db->fetch_array($query)) {
     if ($post['userusername']) {
         $post['username'] = $post['userusername'];
     }
     $reviewpostdate = my_date('relative', $post['dateline']);
     $parser_options = array("allow_html" => $forum['allowhtml'], "allow_mycode" => $forum['allowmycode'], "allow_smilies" => $forum['allowsmilies'], "allow_imgcode" => $forum['allowimgcode'], "allow_videocode" => $forum['allowvideocode'], "me_username" => $post['username'], "filter_badwords" => 1);
     if ($post['smilieoff'] == 1) {
         $parser_options['allow_smilies'] = 0;
     }
     if ($mybb->user['showimages'] != 1 && $mybb->user['uid'] != 0 || $mybb->settings['guestimages'] != 1 && $mybb->user['uid'] == 0) {
         $parser_options['allow_imgcode'] = 0;
     }
     if ($mybb->user['showvideos'] != 1 && $mybb->user['uid'] != 0 || $mybb->settings['guestvideos'] != 1 && $mybb->user['uid'] == 0) {
         $parser_options['allow_videocode'] = 0;
     }
     if ($post['visible'] != 1) {
         $altbg = "trow_shaded";
     }
     $post['message'] = $parser->parse_message($post['message'], $parser_options);
     get_post_attachments($post['pid'], $post);
开发者ID:mainhan1804,项目名称:xomvanphong,代码行数:31,代码来源:newreply.php

示例10: str_replace

         }
         if ($message['icon'] > 0 && $icon_cache[$message['icon']]) {
             $icon = $icon_cache[$message['icon']];
             $icon['path'] = str_replace("{theme}", $theme['imgdir'], $icon['path']);
             $icon['path'] = htmlspecialchars_uni($icon['path']);
             $icon['name'] = htmlspecialchars_uni($icon['name']);
             eval("\$icon = \"" . $templates->get("private_messagebit_icon") . "\";");
         } else {
             $icon = '&#009;';
         }
         if (!trim($message['subject'])) {
             $message['subject'] = $lang->pm_no_subject;
         }
         $message['subject'] = htmlspecialchars_uni($parser->parse_badwords($message['subject']));
         if ($message['folder'] != "3") {
             $senddate = my_date('relative', $message['dateline']);
         } else {
             $senddate = $lang->not_sent;
         }
         $plugins->run_hooks("private_message");
         eval("\$messagelist .= \"" . $templates->get("private_messagebit") . "\";");
     }
 } else {
     eval("\$messagelist .= \"" . $templates->get("private_nomessages") . "\";");
 }
 $pmspacebar = '';
 if ($mybb->usergroup['pmquota'] != '0' && $mybb->usergroup['cancp'] != 1) {
     $query = $db->simple_select("privatemessages", "COUNT(*) AS total", "uid='" . $mybb->user['uid'] . "'");
     $pmscount = $db->fetch_array($query);
     if ($pmscount['total'] == 0) {
         $spaceused = 0;
开发者ID:mainhan1804,项目名称:xomvanphong,代码行数:31,代码来源:private.php

示例11: build_users_view


//.........这里部分代码省略.........
                break;
            case "numposts":
                $view['sortby'] = "postnum";
                break;
            case "warninglevel":
                $view['sortby'] = "warningpoints";
                break;
            default:
                $view['sortby'] = "username";
        }
        if ($view['sortorder'] != "desc") {
            $view['sortorder'] = "asc";
        }
        $usergroups = $cache->read("usergroups");
        // Fetch matching users
        $query = $db->query("\n\t\t\tSELECT u.*\n\t\t\tFROM " . TABLE_PREFIX . "users u\n\t\t\tWHERE {$search_sql}\n\t\t\tORDER BY {$view['sortby']} {$view['sortorder']}\n\t\t\tLIMIT {$start}, {$view['perpage']}\n\t\t");
        $users = '';
        while ($user = $db->fetch_array($query)) {
            $comma = $groups_list = '';
            $user['view']['username'] = "<a href=\"index.php?module=user-users&amp;action=edit&amp;uid={$user['uid']}\">" . format_name($user['username'], $user['usergroup'], $user['displaygroup']) . "</a>";
            $user['view']['usergroup'] = htmlspecialchars_uni($usergroups[$user['usergroup']]['title']);
            if ($user['additionalgroups']) {
                $additional_groups = explode(",", $user['additionalgroups']);
                foreach ($additional_groups as $group) {
                    $groups_list .= $comma . htmlspecialchars_uni($usergroups[$group]['title']);
                    $comma = $lang->comma;
                }
            }
            if (!$groups_list) {
                $groups_list = $lang->none;
            }
            $user['view']['additionalgroups'] = "<small>{$groups_list}</small>";
            $user['view']['email'] = "<a href=\"mailto:" . htmlspecialchars_uni($user['email']) . "\">" . htmlspecialchars_uni($user['email']) . "</a>";
            $user['view']['regdate'] = my_date($mybb->settings['dateformat'], $user['regdate']) . ", " . my_date($mybb->settings['timeformat'], $user['regdate']);
            $user['view']['lastactive'] = my_date($mybb->settings['dateformat'], $user['lastactive']) . ", " . my_date($mybb->settings['timeformat'], $user['lastactive']);
            // Build popup menu
            $popup = new PopupMenu("user_{$user['uid']}", $lang->options);
            $popup->add_item($lang->edit_profile_and_settings, "index.php?module=user-users&amp;action=edit&amp;uid={$user['uid']}");
            $popup->add_item($lang->ban_user, "index.php?module=user-banning&amp;uid={$user['uid']}#username");
            if ($user['usergroup'] == 5) {
                if ($user['coppauser']) {
                    $popup->add_item($lang->approve_coppa_user, "index.php?module=user-users&amp;action=activate_user&amp;uid={$user['uid']}&amp;my_post_key={$mybb->post_code}{$from_bit}");
                } else {
                    $popup->add_item($lang->approve_user, "index.php?module=user-users&amp;action=activate_user&amp;uid={$user['uid']}&amp;my_post_key={$mybb->post_code}{$from_bit}");
                }
            }
            $popup->add_item($lang->delete_user, "index.php?module=user-users&amp;action=delete&amp;uid={$user['uid']}&amp;my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '{$lang->user_deletion_confirmation}')");
            $popup->add_item($lang->show_referred_users, "index.php?module=user-users&amp;action=referrers&amp;uid={$user['uid']}");
            $popup->add_item($lang->show_ip_addresses, "index.php?module=user-users&amp;action=ipaddresses&amp;uid={$user['uid']}");
            $popup->add_item($lang->show_attachments, "index.php?module=forum-attachments&amp;results=1&amp;username=" . urlencode(htmlspecialchars_uni($user['username'])));
            $user['view']['controls'] = $popup->fetch();
            // Fetch the reputation for this user
            if ($usergroups[$user['usergroup']]['usereputationsystem'] == 1 && $mybb->settings['enablereputation'] == 1) {
                $user['view']['reputation'] = get_reputation($user['reputation']);
            } else {
                $reputation = "-";
            }
            if ($mybb->settings['enablewarningsystem'] != 0 && $usergroups[$user['usergroup']]['canreceivewarnings'] != 0) {
                $warning_level = round($user['warningpoints'] / $mybb->settings['maxwarningpoints'] * 100);
                if ($warning_level > 100) {
                    $warning_level = 100;
                }
                $user['view']['warninglevel'] = get_colored_warning_level($warning_level);
            }
            if ($user['avatar'] && !stristr($user['avatar'], 'http://')) {
                $user['avatar'] = "../{$user['avatar']}";
开发者ID:GeorgeLVP,项目名称:mybb,代码行数:67,代码来源:users.php

示例12: my_date

     $date_issued = my_date($mybb->settings['dateformat'], $warning['dateline']) . ", " . my_date($mybb->settings['timeformat'], $warning['dateline']);
     if ($warning['type_title']) {
         $warning_type = $warning['type_title'];
     } else {
         $warning_type = $warning['title'];
     }
     $warning_type = htmlspecialchars_uni($warning_type);
     if ($warning['points'] > 0) {
         $warning['points'] = "+{$warning['points']}";
     }
     $points = $lang->sprintf($lang->warning_points, $warning['points']);
     if ($warning['expired'] != 1) {
         if ($warning['expires'] == 0) {
             $expires = $lang->never;
         } else {
             $expires = my_date($mybb->settings['dateformat'], $warning['expires']) . ", " . my_date($mybb->settings['timeformat'], $warning['expires']);
         }
     } else {
         if ($warning['daterevoked']) {
             $expires = $lang->warning_revoked;
         } else {
             if ($warning['expires']) {
                 $expires = $lang->already_expired;
             }
         }
     }
     $alt_bg = alt_trow();
     $plugins->run_hooks("warnings_warning");
     eval("\$warnings .= \"" . $templates->get("warnings_warning") . "\";");
 }
 if (!$warnings) {
开发者ID:GeorgeLVP,项目名称:mybb,代码行数:31,代码来源:warnings.php

示例13: multipage

 $perpage = (int) $mybb->settings['membersperpage'];
 if ($perpage < 1) {
     $perpage = 20;
 }
 $page = $mybb->get_input('page', MyBB::INPUT_INT);
 if ($page && $page > 0) {
     $start = ($page - 1) * $perpage;
 } else {
     $start = 0;
     $page = 1;
 }
 $multipage = multipage($numusers, $perpage, $page, "managegroup.php?gid=" . $gid);
 $users = "";
 while ($user = $db->fetch_array($query)) {
     $altbg = alt_trow();
     $regdate = my_date('relative', $user['regdate']);
     $post = $user;
     $sendpm = $email = '';
     if ($mybb->settings['enablepms'] == 1 && $post['receivepms'] != 0 && $mybb->usergroup['cansendpms'] == 1 && my_strpos("," . $post['ignorelist'] . ",", "," . $mybb->user['uid'] . ",") === false) {
         eval("\$sendpm = \"" . $templates->get("postbit_pm") . "\";");
     }
     if ($user['hideemail'] != 1) {
         eval("\$email = \"" . $templates->get("postbit_email") . "\";");
     } else {
         $email = '';
     }
     $user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']);
     $user['profilelink'] = build_profile_link($user['username'], $user['uid']);
     if (in_array($user['uid'], $leaders_array)) {
         $leader = $lang->leader;
     } else {
开发者ID:mainhan1804,项目名称:xomvanphong,代码行数:31,代码来源:managegroup.php

示例14: draw_admin_pagination

     $pagination = draw_admin_pagination($page, $per_page, $num_requests, "index.php?module=user-groups&amp;action=join_requests&gid={$group['gid']}");
     echo $pagination;
 }
 $form = new Form("index.php?module=user-groups&amp;action=join_requests&gid={$group['gid']}", "post");
 $table = new Table();
 $table->construct_header($form->generate_check_box("checkall", 1, "", array('class' => 'checkall')), array('width' => 1));
 $table->construct_header($lang->users);
 $table->construct_header($lang->reason);
 $table->construct_header($lang->date_requested, array("class" => 'align_center', "width" => 200));
 $table->construct_header($lang->controls, array("class" => "align_center", "width" => 200));
 $query = $db->query("\n\t\tSELECT j.*, u.username\n\t\tFROM " . TABLE_PREFIX . "joinrequests j\n\t\tINNER JOIN " . TABLE_PREFIX . "users u ON (u.uid=j.uid)\n\t\tWHERE j.gid='{$group['gid']}'\n\t\tORDER BY dateline ASC\n\t\tLIMIT {$start}, {$per_page}\n\t");
 while ($request = $db->fetch_array($query)) {
     $table->construct_cell($form->generate_check_box("users[]", $request['uid'], ""));
     $table->construct_cell("<strong>" . build_profile_link($request['username'], $request['uid'], "_blank") . "</strong>");
     $table->construct_cell(htmlspecialchars_uni($request['reason']));
     $table->construct_cell(my_date('relative', $request['dateline']), array('class' => 'align_center'));
     $popup = new PopupMenu("join_{$request['rid']}", $lang->options);
     $popup->add_item($lang->approve, "index.php?module=user-groups&action=approve_join_request&amp;rid={$request['rid']}&amp;my_post_key={$mybb->post_code}");
     $popup->add_item($lang->deny, "index.php?module=user-groups&action=deny_join_request&amp;rid={$request['rid']}&amp;my_post_key={$mybb->post_code}");
     $table->construct_cell($popup->fetch(), array('class' => "align_center"));
     $table->construct_row();
 }
 if ($table->num_rows() == 0) {
     $table->construct_cell($lang->no_join_requests, array("colspan" => 6));
     $table->construct_row();
 }
 $table->output($lang->join_requests_for . ' ' . htmlspecialchars_uni($group['title']));
 echo $pagination;
 $buttons[] = $form->generate_submit_button($lang->approve_selected_requests, array('name' => 'approve'));
 $buttons[] = $form->generate_submit_button($lang->deny_selected_requests, array('name' => 'deny'));
 $form->output_submit_wrapper($buttons);
开发者ID:mainhan1804,项目名称:xomvanphong,代码行数:31,代码来源:groups.php

示例15: 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


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