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


PHP build_profile_link函数代码示例

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


在下文中一共展示了build_profile_link函数的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: build_attachment_row

function build_attachment_row($attachment, &$table, $use_form = false)
{
    global $mybb, $form;
    $attachment['filename'] = htmlspecialchars_uni($attachment['filename']);
    // Here we do a bit of detection, we want to automatically check for removal any missing attachments and any not assigned to a post uploaded > 24hours ago
    // Check if the attachment exists in the file system
    $checked = false;
    $title = $cell_class = '';
    if (!file_exists(MYBB_ROOT . $mybb->settings['uploadspath'] . "/{$attachment['attachname']}")) {
        $cell_class = "bad_attachment";
        $title = $lang->error_not_found;
        $checked = true;
    } elseif (!$attachment['pid'] && $attachment['dateuploaded'] < TIME_NOW - 60 * 60 * 24 && $attachment['dateuploaded'] != 0) {
        $cell_class = "bad_attachment";
        $title = $lang->error_not_attached;
        $checked = true;
    } else {
        if (!$attachment['tid'] && $attachment['pid']) {
            $cell_class = "bad_attachment";
            $title = $lang->error_does_not_exist;
            $checked = true;
        } else {
            if ($attachment['visible'] == 0) {
                $cell_class = "invisible_attachment";
            }
        }
    }
    if ($cell_class) {
        $cell_class .= " align_center";
    } else {
        $cell_class = "align_center";
    }
    if ($use_form == true && is_object($form)) {
        $table->construct_cell($form->generate_check_box('aids[]', $attachment['aid'], '', array('checked' => $checked)));
    }
    $table->construct_cell(get_attachment_icon(get_extension($attachment['filename'])), array('width' => 1));
    $table->construct_cell("<a href=\"../attachment.php?aid={$attachment['aid']}\" target=\"_blank\">{$attachment['filename']}</a>");
    $table->construct_cell(get_friendly_size($attachment['filesize']), array('class' => $cell_class));
    if ($attachment['user_username']) {
        $attachment['username'] = $attachment['username'];
    }
    $table->construct_cell(build_profile_link($attachment['username'], $attachment['uid'], "_blank"), array("class" => "align_center"));
    $table->construct_cell("<a href=\"../" . get_post_link($attachment['pid']) . "\" target=\"_blank\">" . htmlspecialchars_uni($attachment['subject']) . "</a>", array("class" => "align_center"));
    $table->construct_cell(my_number_format($attachment['downloads']), array("class" => "align_center"));
    if ($attachment['dateuploaded'] > 0) {
        $date = my_date($mybb->settings['dateformat'], $attachment['dateuploaded']) . ", " . my_date($mybb->settings['timeformat'], $attachment['dateuploaded']);
    } else {
        $date = $lang->unknown;
    }
    $table->construct_cell($date, array("class" => "align_center"));
    $table->construct_row();
}
开发者ID:GeorgeLVP,项目名称:mybb,代码行数:52,代码来源:attachments.php

示例3: build_postbit


//.........这里部分代码省略.........
        $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=\"*\" />";
            }
            $post['userstars'] .= "<br />";
开发者ID:slothly,项目名称:mybb,代码行数:67,代码来源:functions_post.php

示例4: nice_time

         $timeremaining = nice_time($remaining, array('short' => 1, 'seconds' => false)) . "";
         if ($remaining < 3600) {
             $timeremaining = "<span style=\"color: red;\">({$timeremaining} {$lang->ban_remaining})</span>";
         } else {
             if ($remaining < 86400) {
                 $timeremaining = "<span style=\"color: maroon;\">({$timeremaining} {$lang->ban_remaining})</span>";
             } else {
                 if ($remaining < 604800) {
                     $timeremaining = "<span style=\"color: green;\">({$timeremaining} {$lang->ban_remaining})</span>";
                 } else {
                     $timeremaining = "({$timeremaining} {$lang->ban_remaining})";
                 }
             }
         }
     }
     $memban['adminuser'] = build_profile_link($memban['adminuser'], $memban['admin']);
     // Display a nice warning to the user
     eval('$bannedbit = "' . $templates->get('member_profile_banned') . '";');
 }
 $adminoptions = '';
 if ($mybb->usergroup['cancp'] == 1 && $mybb->config['hide_admin_links'] != 1) {
     eval("\$adminoptions = \"" . $templates->get("member_profile_adminoptions") . "\";");
 }
 $modoptions = $viewnotes = $editnotes = $editprofile = $banuser = $manageuser = '';
 $can_purge_spammer = purgespammer_show($memprofile['postnum'], $memprofile['usergroup'], $memprofile['uid']);
 if ($mybb->usergroup['canmodcp'] == 1 || $can_purge_spammer) {
     $memprofile['usernotes'] = nl2br(htmlspecialchars_uni($memprofile['usernotes']));
     if (!empty($memprofile['usernotes'])) {
         if (strlen($memprofile['usernotes']) > 100) {
             eval("\$viewnotes = \"" . $templates->get("member_profile_modoptions_viewnotes") . "\";");
             $memprofile['usernotes'] = my_substr($memprofile['usernotes'], 0, 100) . "... {$viewnotes}";
开发者ID:nicopinto,项目名称:fantasitura.com,代码行数:31,代码来源:member.php

示例5: add_breadcrumb

    add_breadcrumb($lang->nav_onlinetoday);
    $plugins->run_hooks("online_today_start");
    $todaycount = 0;
    $stime = TIME_NOW - 60 * 60 * 24;
    $todayrows = '';
    $query = $db->query("\n\t\tSELECT u.*\n\t\tFROM " . TABLE_PREFIX . "users u\n\t\tLEFT JOIN " . TABLE_PREFIX . "usergroups g ON (g.gid=u.usergroup)\n\t\tWHERE u.lastactive > {$stime}\n\t\tORDER BY u.lastactive DESC\n\t");
    while ($online = $db->fetch_array($query)) {
        if ($online['invisible'] != 1 || $mybb->usergroup['canviewwolinvis'] == 1 || $online['uid'] == $mybb->user['uid']) {
            if ($online['invisible'] == 1) {
                $invisiblemark = "*";
            } else {
                $invisiblemark = "";
            }
            $username = $online['username'];
            $username = format_name($username, $online['usergroup'], $online['displaygroup']);
            $online['profilelink'] = build_profile_link($username, $online['uid']);
            $onlinetime = my_date($mybb->settings['timeformat'], $online['lastactive']);
            eval("\$todayrows .= \"" . $templates->get("online_today_row") . "\";");
        }
        ++$todaycount;
    }
    if ($todaycount == 1) {
        $onlinetoday = $lang->member_online_today;
    } else {
        $onlinetoday = $lang->sprintf($lang->members_were_online_today, $todaycount);
    }
    $plugins->run_hooks("online_today_end");
    eval("\$today = \"" . $templates->get("online_today") . "\";");
    output_page($today);
} else {
    $plugins->run_hooks("online_start");
开发者ID:benn0034,项目名称:SHIELDsite2.old,代码行数:31,代码来源:online.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: array

 $banned_cache = array();
 while ($banned = $db->fetch_array($query)) {
     $banned['remaining'] = $banned['lifted'] - TIME_NOW;
     $banned_cache[$banned['remaining'] . $banned['uid']] = $banned;
     unset($banned);
 }
 // Get the banned users
 $bannedusers = '';
 foreach ($banned_cache as $banned) {
     $profile_link = build_profile_link($banned['username'], $banned['uid']);
     // Only show the edit & lift links if current user created ban, or is super mod/admin
     $edit_link = '';
     if ($mybb->user['uid'] == $banned['admin'] || !$banned['adminuser'] || $mybb->usergroup['issupermod'] == 1 || $mybb->usergroup['cancp'] == 1) {
         eval("\$edit_link = \"" . $templates->get("modcp_banning_edit") . "\";");
     }
     $admin_profile = build_profile_link($banned['adminuser'], $banned['admin']);
     $trow = alt_trow();
     if ($banned['reason']) {
         $banned['reason'] = htmlspecialchars_uni($parser->parse_badwords($banned['reason']));
     } else {
         $banned['reason'] = $lang->na;
     }
     if ($banned['lifted'] == 'perm' || $banned['lifted'] == '' || $banned['bantime'] == 'perm' || $banned['bantime'] == '---') {
         $banlength = $lang->permanent;
         $timeremaining = $lang->na;
     } else {
         $banlength = $bantimes[$banned['bantime']];
         $remaining = $banned['remaining'];
         $timeremaining = nice_time($remaining, array('short' => 1, 'seconds' => false)) . "";
         if ($remaining <= 0) {
             $timeremaining = "<span style=\"color: red;\">({$lang->ban_ending_imminently})</span>";
开发者ID:olada,项目名称:mybbintegrator,代码行数:31,代码来源:modcp.php

示例8: while

 $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 {
         $leader = '';
     }
     // Checkbox for user management - only if current user is allowed
     $checkbox = '';
     if ($groupleader['canmanagemembers'] == 1) {
         eval("\$checkbox = \"" . $templates->get("managegroup_user_checkbox") . "\";");
     }
     eval("\$users .= \"" . $templates->get("managegroup_user") . "\";");
 }
 if (!$users) {
     eval("\$users = \"" . $templates->get("managegroup_no_users") . "\";");
 }
开发者ID:mainhan1804,项目名称:xomvanphong,代码行数:31,代码来源:managegroup.php

示例9: my_date

                    $folder_label .= $lang->icon_hot;
                }
                // Is our thread visible?
                if ($thread['visible'] == 0) {
                    $bgcolor = 'trow_shaded';
                }
                if ($thread['closed'] == 1) {
                    $folder .= "lock";
                    $folder_label .= $lang->icon_lock;
                }
                $folder .= "folder";
                $lastpostdate = my_date('relative', $thread['lastpost']);
                $lastposter = $thread['lastposter'];
                $lastposteruid = $thread['lastposteruid'];
                if ($lastposteruid == 0) {
                    $lastposterlink = $lastposter;
                } else {
                    $lastposterlink = build_profile_link($lastposter, $lastposteruid);
                }
                $thread['replies'] = my_number_format($thread['replies']);
                $thread['views'] = my_number_format($thread['views']);
                $thread['author'] = build_profile_link($thread['username'], $thread['uid']);
                eval("\$latest_threads_threads .= \"" . $templates->get("usercp_latest_threads_threads") . "\";");
            }
        }
        eval("\$latest_threads = \"" . $templates->get("usercp_latest_threads") . "\";");
    }
    $plugins->run_hooks("usercp_end");
    eval("\$usercp = \"" . $templates->get("usercp") . "\";");
    output_page($usercp);
}
开发者ID:mainhan1804,项目名称:xomvanphong,代码行数:31,代码来源:usercp.php

示例10: home_action_handler

function home_action_handler($action)
{
    global $page, $db, $lang, $plugins;
    $page->active_module = "home";
    $actions = array('preferences' => array('active' => 'preferences', 'file' => 'preferences.php'), 'credits' => array('active' => 'credits', 'file' => 'credits.php'), 'version_check' => array('active' => 'version_check', 'file' => 'version_check.php'), 'dashboard' => array('active' => 'dashboard', 'file' => 'index.php'));
    if (!isset($actions[$action])) {
        $page->active_action = "dashboard";
    } else {
        $page->active_action = $actions[$action]['active'];
    }
    $actions = $plugins->run_hooks("admin_home_action_handler", $actions);
    if ($page->active_action == "dashboard") {
        // Quick Access
        $sub_menu = array();
        $sub_menu['10'] = array("id" => "add_forum", "title" => $lang->add_new_forum, "link" => "index.php?module=forum-management&action=add");
        $sub_menu['20'] = array("id" => "search", "title" => $lang->search_for_users, "link" => "index.php?module=user-users&action=search");
        $sub_menu['30'] = array("id" => "themes", "title" => $lang->themes, "link" => "index.php?module=style-themes");
        $sub_menu['40'] = array("id" => "templates", "title" => $lang->templates, "link" => "index.php?module=style-templates");
        $sub_menu['50'] = array("id" => "plugins", "title" => $lang->plugins, "link" => "index.php?module=config-plugins");
        $sub_menu['60'] = array("id" => "backupdb", "title" => $lang->database_backups, "link" => "index.php?module=tools-backupdb");
        $sub_menu = $plugins->run_hooks("admin_home_menu_quick_access", $sub_menu);
        $sidebar = new SidebarItem($lang->quick_access);
        $sidebar->add_menu_items($sub_menu, $page->active_action);
        $page->sidebar .= $sidebar->get_markup();
        // Online Administrators in the last 30 minutes
        $timecut = TIME_NOW - 60 * 30;
        $query = $db->simple_select("adminsessions", "uid, ip, useragent", "lastactive > {$timecut}");
        $online_users = "<ul class=\"menu online_admins\">";
        $online_admins = array();
        // If there's only 1 user online, it has to be us.
        if ($db->num_rows($query) == 1) {
            $user = $db->fetch_array($query);
            global $mybb;
            // Are we on a mobile device?
            // Stolen from http://stackoverflow.com/a/10989424
            $user_type = "desktop";
            if (is_mobile($user["useragent"])) {
                $user_type = "mobile";
            }
            $online_admins[$mybb->user['username']] = array("uid" => $mybb->user['uid'], "username" => $mybb->user['username'], "ip" => $user["ip"], "type" => $user_type);
        } else {
            $uid_in = array();
            while ($user = $db->fetch_array($query)) {
                $uid_in[] = $user['uid'];
                $user_type = "desktop";
                if (is_mobile($user['useragent'])) {
                    $user_type = "mobile";
                }
                $online_admins[$user['uid']] = array("ip" => $user['ip'], "type" => $user_type);
            }
            $query = $db->simple_select("users", "uid, username", "uid IN(" . implode(',', $uid_in) . ")", array('order_by' => 'username'));
            while ($user = $db->fetch_array($query)) {
                $online_admins[$user['username']] = array("uid" => $user['uid'], "username" => $user['username'], "ip" => $online_admins[$user['uid']]['ip'], "type" => $online_admins[$user['uid']]['type']);
                unset($online_admins[$user['uid']]);
            }
        }
        $done_users = array();
        asort($online_admins);
        foreach ($online_admins as $user) {
            if (!isset($done_users["{$user['uid']}.{$user['ip']}"])) {
                if ($user['type'] == "mobile") {
                    $class = " class=\"mobile_user\"";
                } else {
                    $class = "";
                }
                $ip_address = my_inet_ntop($db->unescape_binary($user['ip']));
                $online_users .= "<li title=\"{$lang->ipaddress} {$ip_address}\"{$class}>" . build_profile_link($user['username'] . ' (' . $ip_address . ')', $user['uid'], "_blank") . "</li>";
                $done_users["{$user['uid']}.{$user['ip']}"] = 1;
            }
        }
        $online_users .= "</ul>";
        $sidebar = new SidebarItem($lang->online_admins);
        $sidebar->set_contents($online_users);
        $page->sidebar .= $sidebar->get_markup();
    }
    if (isset($actions[$action])) {
        $page->active_action = $actions[$action]['active'];
        return $actions[$action]['file'];
    } else {
        $page->active_action = "dashboard";
        return "index.php";
    }
}
开发者ID:olada,项目名称:mybbintegrator,代码行数:83,代码来源:module_meta.php

示例11: build_forumbits


//.........这里部分代码省略.........
                        if ($mybb->settings['subforumsstatusicons'] == 1) {
                            $lightbulb['folder'] = "mini" . $lightbulb['folder'];
                            eval("\$statusicon = \"" . $templates->get("forumbit_depth3_statusicon", 1, 0) . "\";");
                        }
                        // Fetch the template and append it to the list
                        eval("\$forum_list .= \"" . $templates->get("forumbit_depth3", 1, 0) . "\";");
                        $comma = ', ';
                    }
                    // Have we reached our max visible subforums? put a nice message and break out of the loop
                    ++$donecount;
                    if ($donecount == $mybb->settings['subforumsindex']) {
                        if (subforums_count($fcache[$pid]) > $donecount) {
                            $forum_list .= $comma . $lang->sprintf($lang->more_subforums, subforums_count($fcache[$pid]) - $donecount);
                        }
                    }
                    continue;
                }
            }
            // Forum is a category, set template type
            if ($forum['type'] == 'c') {
                $forumcat = '_cat';
            } else {
                $forumcat = '_forum';
            }
            if ($forum['linkto'] == '') {
                // No posts have been made in this forum - show never text
                if (($lastpost_data['lastpost'] == 0 || $lastpost_data['lastposter'] == '') && $hideinfo != true) {
                    $lastpost = "<div style=\"text-align: center;\">{$lang->lastpost_never}</div>";
                } elseif ($hideinfo != true) {
                    // Format lastpost date and time
                    $lastpost_date = my_date($mybb->settings['dateformat'], $lastpost_data['lastpost']);
                    $lastpost_time = my_date($mybb->settings['timeformat'], $lastpost_data['lastpost']);
                    // Set up the last poster, last post thread id, last post subject and format appropriately
                    $lastpost_profilelink = build_profile_link($lastpost_data['lastposter'], $lastpost_data['lastposteruid']);
                    $lastpost_link = get_thread_link($lastpost_data['lastposttid'], 0, "lastpost");
                    $lastpost_subject = $full_lastpost_subject = $parser->parse_badwords($lastpost_data['lastpostsubject']);
                    if (my_strlen($lastpost_subject) > 25) {
                        $lastpost_subject = my_substr($lastpost_subject, 0, 25) . "...";
                    }
                    $lastpost_subject = htmlspecialchars_uni($lastpost_subject);
                    $full_lastpost_subject = htmlspecialchars_uni($full_lastpost_subject);
                    // Call lastpost template
                    if ($depth != 1) {
                        eval("\$lastpost = \"" . $templates->get("forumbit_depth{$depth}_forum_lastpost") . "\";");
                    }
                }
                if ($mybb->settings['showforumviewing'] != 0 && $forum['viewers'] > 0) {
                    if ($forum['viewers'] == 1) {
                        $forum_viewers_text = $lang->viewing_one;
                    } else {
                        $forum_viewers_text = $lang->sprintf($lang->viewing_multiple, $forum['viewers']);
                    }
                    $forum_viewers_text_plain = $forum_viewers_text;
                    $forum_viewers_text = "<span class=\"smalltext\">{$forum_viewers_text}</span>";
                }
            }
            // If this forum is a link or is password protected and the user isn't authenticated, set lastpost and counters to "-"
            if ($forum['linkto'] != '' || $hideinfo == true) {
                $lastpost = "<div style=\"text-align: center;\">-</div>";
                $posts = "-";
                $threads = "-";
            } else {
                $posts = my_number_format($forum['posts']);
                $threads = my_number_format($forum['threads']);
            }
            // Moderator column is not off
开发者ID:benn0034,项目名称:SHIELDsite2.old,代码行数:67,代码来源:functions_forumlist.php

示例12: array

 $table->construct_header($lang->posted, array("class" => "align_center", "width" => "20%"));
 $table->construct_header($lang->controls, array("class" => "align_center", "colspan" => 3));
 $query = $db->query("\n\t\t\tSELECT a.*, p.subject AS postsubject, p.dateline, p.uid, u.username, t.tid, t.subject AS threadsubject\n\t\t\tFROM  " . TABLE_PREFIX . "attachments a\n\t\t\tLEFT JOIN " . TABLE_PREFIX . "posts p ON (p.pid=a.pid)\n\t\t\tLEFT JOIN " . TABLE_PREFIX . "threads t ON (t.tid=p.tid)\n\t\t\tLEFT JOIN " . TABLE_PREFIX . "users u ON (u.uid=p.uid)\n\t\t\tWHERE a.visible='0'\n\t\t\tORDER BY a.dateuploaded DESC\n\t\t\tLIMIT {$start}, {$per_page}\n\t\t");
 while ($attachment = $db->fetch_array($query)) {
     if (!$attachment['dateuploaded']) {
         $attachment['dateuploaded'] = $attachment['dateline'];
     }
     $attachdate = my_date($mybb->settings['dateformat'], $attachment['dateuploaded']);
     $attachtime = my_date($mybb->settings['timeformat'], $attachment['dateuploaded']);
     $attachment['postsubject'] = htmlspecialchars_uni($attachment['postsubject']);
     $attachment['filename'] = htmlspecialchars_uni($attachment['filename']);
     $attachment['threadsubject'] = htmlspecialchars_uni($attachment['threadsubject']);
     $attachment['filesize'] = get_friendly_size($attachment['filesize']);
     $link = get_post_link($attachment['pid'], $attachment['tid']) . "#pid{$attachment['pid']}";
     $thread_link = get_thread_link($attachment['tid']);
     $profile_link = build_profile_link($attachment['username'], $attachment['uid']);
     $table->construct_cell("<a href=\"../attachment.php?aid={$attachment['aid']}\" target=\"_blank\">{$attachment['filename']}</a> ({$attachment['filesize']})<br /><small class=\"modqueue_meta\">{$lang->post} <a href=\"{$link}\">{$attachment['postsubject']}</a></small>");
     $table->construct_cell($profile_link, array("class" => "align_center"));
     $table->construct_cell("{$attachdate}, {$attachtime}", array("class" => "align_center"));
     $table->construct_cell($form->generate_radio_button("attachments[{$attachment['aid']}]", "ignore", $lang->ignore, array('class' => 'radio_ignore', 'checked' => true)), array("class" => "align_center"));
     $table->construct_cell($form->generate_radio_button("attachments[{$attachment['aid']}]", "delete", $lang->delete, array('class' => 'radio_delete', 'checked' => false)), array("class" => "align_center"));
     $table->construct_cell($form->generate_radio_button("attachments[{$attachment['aid']}]", "approve", $lang->approve, array('class' => 'radio_approve', 'checked' => false)), array("class" => "align_center"));
     $table->construct_row();
 }
 $table->output($lang->attachments_awaiting_moderation);
 echo $all_options;
 echo $pagination;
 $buttons[] = $form->generate_submit_button($lang->perform_action);
 $form->output_submit_wrapper($buttons);
 $form->end();
 $page->output_footer();
开发者ID:benn0034,项目名称:SHIELDsite2.old,代码行数:31,代码来源:moderation_queue.php

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

示例14: array

     }
     $user_usergroup = $groupscache[$event['displaygroup']];
 } else {
     $user_usergroup = $groupscache[1];
 }
 if (!is_array($titles_cache)) {
     // Get user titles (i guess we should improve this, maybe in version3.
     $query = $db->simple_select("usertitles", "*", "", array('order_by' => 'posts', 'order_dir' => 'DESC'));
     while ($usertitle = $db->fetch_array($query)) {
         $titles_cache[$usertitle['posts']] = $usertitle;
     }
     unset($usertitle);
 }
 // Event made by registered user
 if ($event['uid'] > 0 && $event['username']) {
     $event['profilelink'] = build_profile_link(format_name($event['username'], $event['usergroup'], $event['displaygroup']), $event['uid']);
     if (trim($event['usertitle']) != "") {
         $hascustomtitle = 1;
     }
     if ($user_usergroup['usertitle'] != "" && !$hascustomtitle) {
         $event['usertitle'] = $user_usergroup['usertitle'];
     } elseif (is_array($titles_cache) && !$user_usergroup['usertitle']) {
         reset($titles_cache);
         foreach ($titles_cache as $key => $title) {
             if ($event['postnum'] >= $key) {
                 if (!$hascustomtitle) {
                     $event['usertitle'] = $title['title'];
                 }
                 $event['stars'] = $title['stars'];
                 $event['starimage'] = $title['starimage'];
                 break;
开发者ID:GeorgeLVP,项目名称:mybb,代码行数:31,代码来源:calendar.php

示例15: ON

 }
 $icon_cache = $cache->read("posticons");
 $query = $db->query("\n\t\t\tSELECT t.*, t.username AS threadusername, u.username, u.avatar, u.avatardimensions\n\t\t\tFROM " . TABLE_PREFIX . "threads t\n\t\t\tLEFT JOIN " . TABLE_PREFIX . "users u ON (u.uid = t.uid)\n\t\t\tWHERE t.fid IN (" . $announcementsfids . ") AND t.tid IN (0{$tids}) AND t.visible='1' AND t.closed NOT LIKE 'moved|%'\n\t\t\tORDER BY t.dateline DESC\n\t\t\tLIMIT 0, {$numannouncements}");
 while ($announcement = $db->fetch_array($query)) {
     // Make sure we can view this announcement
     if ($forumpermissions[$announcement['fid']]['canview'] == 0 || $forumpermissions[$announcement['fid']]['canviewthreads'] == 0 || $forumpermissions[$announcement['fid']]['canonlyviewownthreads'] == 1 && $announcement['uid'] != $mybb->user['uid']) {
         continue;
     }
     $announcement['message'] = $posts[$announcement['tid']]['message'];
     $announcement['pid'] = $posts[$announcement['tid']]['pid'];
     $announcement['smilieoff'] = $posts[$announcement['tid']]['smilieoff'];
     $announcement['threadlink'] = get_thread_link($announcement['tid']);
     if ($announcement['uid'] == 0) {
         $profilelink = htmlspecialchars_uni($announcement['threadusername']);
     } else {
         $profilelink = build_profile_link($announcement['username'], $announcement['uid']);
     }
     if (!$announcement['username']) {
         $announcement['username'] = $announcement['threadusername'];
     }
     $announcement['subject'] = htmlspecialchars_uni($parser->parse_badwords($announcement['subject']));
     if ($announcement['icon'] > 0 && $icon_cache[$announcement['icon']]) {
         $icon = $icon_cache[$announcement['icon']];
         $icon = "<img src=\"{$icon['path']}\" alt=\"{$icon['name']}\" />";
     } else {
         $icon = "&nbsp;";
     }
     if ($announcement['avatar'] != '') {
         $avatar_dimensions = explode("|", $announcement['avatardimensions']);
         if ($avatar_dimensions[0] && $avatar_dimensions[1]) {
             $avatar_width_height = "width=\"{$avatar_dimensions[0]}\" height=\"{$avatar_dimensions[1]}\"";
开发者ID:dequeues,项目名称:mybb,代码行数:31,代码来源:portal.php


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