本文整理汇总了PHP中get_forum_link函数的典型用法代码示例。如果您正苦于以下问题:PHP get_forum_link函数的具体用法?PHP get_forum_link怎么用?PHP get_forum_link使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_forum_link函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: spamalyser_build_post_path
function spamalyser_build_post_path(&$logitem)
{
global $lang, $forums, $mybb;
$bburl = htmlspecialchars_uni($mybb->settings['bburl'] . '/');
$subject = htmlspecialchars_uni($logitem['subject']);
if ($logitem['real_pid']) {
$subject = '<a href="' . $bburl . get_post_link($logitem['pid'], $logitem['tid']) . '#pid' . $logitem['pid'] . '" target="_blank">' . $subject . '</a>';
}
if ($logitem['threadsubject']) {
if ($logitem['real_tid']) {
$subject = '<a href="' . $bburl . get_thread_link($logitem['tid']) . '" target="_blank">' . htmlspecialchars_uni($logitem['threadsubject']) . '</a> » ' . $subject;
} else {
$subject = htmlspecialchars_uni($logitem['threadsubject']) . ' » ' . $subject;
}
}
if (empty($forums)) {
$forums = $GLOBALS['cache']->read('forums');
}
if ($forums[$logitem['fid']]) {
$subject = '<a href="' . $bburl . get_forum_link($logitem['fid']) . '" target="_blank">' . $forums[$logitem['fid']]['name'] . '</a> » ' . $subject;
}
// new/edit icons
if ($logitem['event'] == 0) {
$subject = '<img src="spamalyser_img/post_new.gif" title="' . $lang->icon_new_thread_post . '" alt="' . $lang->icon_alt_new_thread_post . '" style="margin-right: 0.5em; font-size: smaller; vertical-align: middle;" />' . $subject;
} elseif ($logitem['event'] == 2) {
$subject = '<img src="spamalyser_img/post_merge.gif" title="' . $lang->icon_merge_post . '" alt="' . $lang->icon_alt_merge_post . '" style="margin-right: 0.5em; font-size: smaller; vertical-align: middle;" />' . $subject;
} else {
$subject = '<img src="spamalyser_img/post_edit.gif" title="' . $lang->icon_edit_thread_post . '" alt="' . $lang->icon_alt_edit_thread_post . '" style="margin-right: 0.5em; font-size: smaller; vertical-align: middle;" />' . $subject;
}
return $subject;
}
开发者ID:andarms,项目名称:python-gaming.com,代码行数:31,代码来源:spamalyserlog.php
示例2: reportthread_dopost
function reportthread_dopost()
{
require_once MYBB_ROOT . "inc/datahandlers/post.php";
global $db, $mybb;
if (intval($mybb->settings['rtt_enabled']) == 1 || preg_replace("/[^a-z]/i", "", $mybb->settings['rtt_enabled']) == "yes") {
if ($mybb->input['type'] == 'post') {
$title = "Reported Post By ";
$post = get_post($mybb->input['pid']);
$thread = get_thread($post['tid']);
$forum = get_forum($thread['fid']);
$tlink = get_thread_link($thread['tid']);
$flink = get_forum_link($thread['fid']);
$reason = $mybb->input['reason'];
if ($reason === 'other') {
$reason = $mybb->input['comment'];
}
$post_data = $mybb->user['username'] . " has reported a post.\r\n\r\nOriginal Thread: [url=" . $mybb->settings['bburl'] . "/{$tlink}]" . $thread['subject'] . "[/url]\r\nForum: [url=" . $mybb->settings['bburl'] . "/{$flink}]" . $forum['name'] . "[/url]\r\n\r\nReason Given:\r\n[quote=\"" . $mybb->user['username'] . "\" dateline=\"" . time() . "\"]" . $reason . "[/quote]\r\n\r\nPost Content:\r\n[quote=\"" . $post['username'] . "\" pid=\"" . $post['pid'] . "\" dateline=\"" . $post['dateline'] . "\"]" . $post['message'] . "[/quote]";
} else {
if ($mybb->input['type'] == 'reputation') {
$title = "Reported Reputation By ";
$rep = get_reputation_point($mybb->input['pid']);
$giver = get_user($rep['adduid']);
$reason = $mybb->input['reason'];
if ($reason === 'other') {
$reason = $mybb->input['comment'];
}
$post_data = $mybb->user['username'] . " has reported a reputation point.\r\n\r\nReason Given:\r\n[quote=\"" . $mybb->user['username'] . "\" dateline=\"" . time() . "\"]" . $reason . "[/quote]\r\n\r\nReputation comment:\r\n[quote=\"" . $giver['username'] . "\" dateline=\"" . $rep['dateline'] . "\"]" . $rep['comments'] . "[/quote]";
}
}
$new_thread = array("fid" => $mybb->settings['rtt_fid'], "prefix" => 0, "subject" => $title . $mybb->user['username'], "icon" => 0, "uid" => $mybb->user['uid'], "username" => $mybb->user['username'], "message" => $post_data, "ipaddress" => get_ip(), "posthash" => md5($mybb->user['uid'] . random_str()));
$posthandler = new PostDataHandler("insert");
$posthandler->action = "thread";
$posthandler->set_data($new_thread);
if ($posthandler->validate_thread()) {
$thread_info = $posthandler->insert_thread();
}
}
}
开发者ID:ateista-pl,项目名称:forum,代码行数:38,代码来源:reportthread.php
示例3: akismet_redirect_forum
function akismet_redirect_forum()
{
global $isspam, $url, $lang, $fid, $mybb;
if ($isspam && $mybb->settings['akismetswitch'] == 1) {
$lang->load("akismet", false, true);
$url = get_forum_link($fid);
error("<div align=\"center\">" . $lang->redirect_newthread . "<br /><br />" . $lang->sprintf($lang->redirect_return_forum, $url) . "</div>", $lang->akismet_error);
}
}
开发者ID:ThinhNguyenVB,项目名称:Gradient-Studios-Website,代码行数:9,代码来源:akismet.php
示例4: while
$modlogresults = '';
while ($logitem = $db->fetch_array($query)) {
$information = '';
$logitem['action'] = htmlspecialchars_uni($logitem['action']);
$log_date = my_date('relative', $logitem['dateline']);
$trow = alt_trow();
$username = format_name($logitem['username'], $logitem['usergroup'], $logitem['displaygroup']);
$logitem['profilelink'] = build_profile_link($username, $logitem['uid']);
$logitem['ipaddress'] = my_inet_ntop($db->unescape_binary($logitem['ipaddress']));
if ($logitem['tsubject']) {
$logitem['tsubject'] = htmlspecialchars_uni($logitem['tsubject']);
$logitem['thread'] = get_thread_link($logitem['tid']);
eval("\$information .= \"" . $templates->get("modcp_modlogs_result_thread") . "\";");
}
if ($logitem['fname']) {
$logitem['forum'] = get_forum_link($logitem['fid']);
eval("\$information .= \"" . $templates->get("modcp_modlogs_result_forum") . "\";");
}
if ($logitem['psubject']) {
$logitem['psubject'] = htmlspecialchars_uni($logitem['psubject']);
$logitem['post'] = get_post_link($logitem['pid']);
eval("\$information .= \"" . $templates->get("modcp_modlogs_result_post") . "\";");
}
// Edited a user or managed announcement?
if (!$logitem['tsubject'] || !$logitem['fname'] || !$logitem['psubject']) {
$data = my_unserialize($logitem['data']);
if ($data['uid']) {
$information = $lang->sprintf($lang->edited_user_info, htmlspecialchars_uni($data['username']), get_profile_link($data['uid']));
}
if ($data['aid']) {
$data['subject'] = htmlspecialchars_uni($data['subject']);
开发者ID:olada,项目名称:mybbintegrator,代码行数:31,代码来源:modcp.php
示例5: build_friendly_wol_location
//.........这里部分代码省略.........
}
break;
// calendar.php functions
// calendar.php functions
case "calendar":
$location_name = $lang->viewing_calendar;
break;
case "calendar_event":
if (!empty($events[$user_activity['eid']])) {
$location_name = $lang->sprintf($lang->viewing_event2, get_event_link($user_activity['eid']), $events[$user_activity['eid']]);
} else {
$location_name = $lang->viewing_event;
}
break;
case "calendar_addevent":
$location_name = $lang->adding_event;
break;
case "calendar_editevent":
$location_name = $lang->editing_event;
break;
case "contact":
$location_name = $lang->viewing_contact_us;
break;
// editpost.php functions
// editpost.php functions
case "editpost":
$location_name = $lang->editing_post;
break;
// forumdisplay.php functions
// forumdisplay.php functions
case "forumdisplay":
if (!empty($forums[$user_activity['fid']])) {
if ($forums_linkto[$user_activity['fid']]) {
$location_name = $lang->sprintf($lang->forum_redirect_to, get_forum_link($user_activity['fid']), $forums[$user_activity['fid']]);
} else {
$location_name = $lang->sprintf($lang->viewing_forum2, get_forum_link($user_activity['fid']), $forums[$user_activity['fid']]);
}
} else {
$location_name = $lang->viewing_forum;
}
break;
// index.php functions
// index.php functions
case "index":
$location_name = $lang->sprintf($lang->viewing_index, $mybb->settings['bbname']);
break;
// managegroup.php functions
// managegroup.php functions
case "managegroup":
$location_name = $lang->managing_group;
break;
// member.php functions
// member.php functions
case "member_activate":
$location_name = $lang->activating_account;
break;
case "member_profile":
if (!empty($usernames[$user_activity['uid']])) {
$location_name = $lang->sprintf($lang->viewing_profile2, get_profile_link($user_activity['uid']), $usernames[$user_activity['uid']]);
} else {
$location_name = $lang->viewing_profile;
}
break;
case "member_register":
$location_name = $lang->registering;
break;
开发者ID:olada,项目名称:mybbintegrator,代码行数:67,代码来源:functions_online.php
示例6: bb_repermalink
function bb_repermalink()
{
global $page;
$location = bb_get_location();
$uri = $_SERVER['REQUEST_URI'];
if (isset($_GET['id'])) {
$id = $_GET['id'];
} else {
$id = bb_get_path();
}
$_original_id = $id;
do_action('pre_permalink', $id);
$id = apply_filters('bb_repermalink', $id);
switch ($location) {
case 'front-page':
$path = null;
$querystring = null;
if ($page > 1) {
if (bb_get_option('mod_rewrite')) {
$path = 'page/' . $page;
} else {
$querystring = array('page' => $page);
}
}
$permalink = bb_get_uri($path, $querystring, BB_URI_CONTEXT_HEADER);
$issue_404 = true;
break;
case 'forum-page':
if (empty($id)) {
$permalink = bb_get_uri(null, null, BB_URI_CONTEXT_HEADER);
break;
}
global $forum_id, $forum;
$forum = bb_get_forum($id);
$forum_id = $forum->forum_id;
$permalink = get_forum_link($forum->forum_id, $page);
break;
case 'topic-edit-page':
case 'topic-page':
if (empty($id)) {
$permalink = bb_get_uri(null, null, BB_URI_CONTEXT_HEADER);
break;
}
global $topic_id, $topic;
$topic = get_topic($id);
$topic_id = $topic->topic_id;
$permalink = get_topic_link($topic->topic_id, $page);
break;
case 'profile-page':
// This handles the admin side of the profile as well.
global $user_id, $user, $profile_hooks, $self;
if (isset($_GET['id'])) {
$id = $_GET['id'];
} elseif (isset($_GET['username'])) {
$id = $_GET['username'];
} else {
$id = bb_get_path();
}
$_original_id = $id;
if (!$id) {
$user = bb_get_current_user();
// Attempt to go to the current users profile
} else {
if (bb_get_option('mod_rewrite') === 'slugs') {
if (!($user = bb_get_user_by_nicename($id))) {
$user = bb_get_user($id);
}
} else {
if (!($user = bb_get_user($id))) {
$user = bb_get_user_by_nicename($id);
}
}
}
if (!$user || 1 == $user->user_status && !bb_current_user_can('moderate')) {
bb_die(__('User not found.'), '', 404);
}
$user_id = $user->ID;
bb_global_profile_menu_structure();
$valid = false;
if ($tab = isset($_GET['tab']) ? $_GET['tab'] : bb_get_path(2)) {
foreach ($profile_hooks as $valid_tab => $valid_file) {
if ($tab == $valid_tab) {
$valid = true;
$self = $valid_file;
}
}
}
if ($valid) {
$permalink = get_profile_tab_link($user->ID, $tab, $page);
} else {
$permalink = get_user_profile_link($user->ID, $page);
unset($self, $tab);
}
break;
case 'favorites-page':
$permalink = get_favorites_link();
break;
case 'tag-page':
// It's not an integer and tags.php pulls double duty.
$id = isset($_GET['tag']) ? $_GET['tag'] : false;
//.........这里部分代码省略.........
开发者ID:nxtclass,项目名称:NXTClass,代码行数:101,代码来源:functions.bb-core.php
示例7: build_forum_breadcrumb
$useronly = "";
if ($forumpermissions['canonlyviewownthreads'] == 1) {
$useronly = "AND uid={$mybb->user['uid']}";
}
// Paginate this forum
$query = $db->simple_select("threads", "COUNT(tid) AS threads", "fid='{$id}' AND visible='1' {$useronly}");
$threadcount = $db->fetch_field($query, "threads");
// Build the navigation
build_forum_breadcrumb($forum['fid'], 1);
// No threads and not a category? Error!
if (($threadcount < 1 || $forumpermissions['canviewthreads'] != 1) && $forum['type'] != 'c') {
archive_header(strip_tags($forum['name']), $forum['name'], $mybb->settings['bburl'] . "/" . get_forum_link($id, $page) . "");
archive_error($lang->error_nothreads);
}
// Build the archive header.
archive_header(strip_tags($forum['name']), $forum['name'], $mybb->settings['bburl'] . "/" . get_forum_link($id, $page), 1);
$plugins->run_hooks("archive_forum_start");
if (!$mybb->settings['threadsperpage'] || (int) $mybb->settings['threadsperpage'] < 1) {
$mybb->settings['threadsperpage'] = 20;
}
$perpage = $mybb->settings['threadsperpage'];
$pages = ceil($threadcount / $perpage);
if ($page > $pages) {
$page = 1;
}
if ($page > 0) {
$start = ($page - 1) * $perpage;
} else {
$start = 0;
$page = 1;
}
开发者ID:GeorgeLVP,项目名称:mybb,代码行数:31,代码来源:index.php
示例8: bb_get_new_topic_link
/**
* bb_get_new_topic_link() - Get the link to the form for a new topic
*
* @since 1.0
* @param mixed The arguments for this function.
* @return string The link to the new topic form
*/
function bb_get_new_topic_link($args = null)
{
$defaults = array('text' => __('Add New »'), 'forum' => 0, 'tag' => '');
if ($args && is_string($args) && false === strpos($args, '=')) {
$args = array('text' => $args);
}
$args = wp_parse_args($args, $defaults);
extract($args, EXTR_SKIP);
if ($forum && ($forum = bb_get_forum($forum))) {
$url = get_forum_link($forum->forum_id) . '#postform';
} elseif ($tag && ($tag = bb_get_tag($tag))) {
$url = bb_get_tag_link($tag->tag) . '#postform';
} elseif (bb_is_forum()) {
global $forum;
$url = get_forum_link($forum->forum_id) . '#postform';
} elseif (bb_is_tag()) {
global $tag;
$url = bb_get_tag_link($tag) . '#postform';
} elseif (bb_is_topic()) {
$url = get_forum_link() . '#postform';
} elseif (bb_is_front()) {
$url = bb_get_uri(null, array('new' => 1));
}
if (!bb_is_user_logged_in()) {
$url = bb_get_uri('bb-login.php', array('re' => $url), BB_URI_CONTEXT_A_HREF + BB_URI_CONTEXT_BB_USER_FORMS);
} elseif (bb_is_forum() || bb_is_topic()) {
if (!bb_current_user_can('write_topic', get_forum_id())) {
return;
}
} else {
if (!bb_current_user_can('write_topics')) {
return;
}
}
if ($url = esc_attr(apply_filters('new_topic_url', $url, $args))) {
return '<a href="' . $url . '" class="new-topic">' . $text . '</a>' . "\n";
}
}
开发者ID:abc2mit,项目名称:abc2mit.github.io,代码行数:45,代码来源:functions.bb-template.php
示例9: implode
$groups_in = implode(",", array_keys($usergroups));
$users_in = implode(",", array_keys($moderators));
if (!$groups_in) {
$groups_in = 0;
}
if (!$users_in) {
$users_in = 0;
}
$forum_permissions = forum_permissions();
$query = $db->simple_select("users", "uid, username, displaygroup, usergroup, ignorelist, hideemail, receivepms", "displaygroup IN ({$groups_in}) OR (displaygroup='0' AND usergroup IN ({$groups_in})) OR uid IN ({$users_in})", array('order_by' => 'username'));
while ($user = $db->fetch_array($query)) {
// If this user is a moderator
if (isset($moderators[$user['uid']])) {
foreach ($moderators[$user['uid']] as $forum) {
if ($forum_permissions[$forum['fid']]['canview'] == 1) {
$forum_url = get_forum_link($forum['fid']);
eval("\$forumlist .= \"" . $templates->get("showteam_moderators_forum") . "\";");
}
}
$user['forumlist'] = $forumlist;
$forumlist = '';
$usergroups[6]['user_list'][$user['uid']] = $user;
}
if ($user['displaygroup'] == '6' || $user['usergroup'] == '6') {
$usergroups[6]['user_list'][$user['uid']] = $user;
}
// Are they also in another group which is being shown on the list?
if ($user['displaygroup'] != 0) {
$group = $user['displaygroup'];
} else {
$group = $user['usergroup'];
开发者ID:benn0034,项目名称:SHIELDsite2.old,代码行数:31,代码来源:showteam.php
示例10: array
}
$interval = (int) $mybb->settings['statscachetime'] * 60860;
if (!$statistics || TIME_NOW - $interval > $statistics['time'] || $mybb->settings['statscachetime'] == 0) {
$cache->update_statistics();
$statistics = $cache->read('statistics');
}
// Top forum
$query = $db->simple_select('forums', 'fid, name, threads, posts', "type='f'{$fidnot}", array('order_by' => 'posts', 'order_dir' => 'DESC', 'limit' => 1));
$forum = $db->fetch_array($query);
if (empty($forum['fid'])) {
$topforum = $lang->none;
$topforumposts = $lang->no;
$topforumthreads = $lang->no;
} else {
$forum['name'] = htmlspecialchars_uni(strip_tags($forum['name']));
$topforum = '<a href="' . get_forum_link($forum['fid']) . "\">{$forum['name']}</a>";
$topforumposts = $forum['posts'];
$topforumthreads = $forum['threads'];
}
// Top referrer defined for the templates even if we don't use it
$top_referrer = '';
if ($mybb->settings['statstopreferrer'] == 1 && isset($statistics['top_referrer']['uid'])) {
// Only show this if we have anything more the 0 referrals
if ($statistics['top_referrer']['referrals'] > 0) {
$toprefuser = build_profile_link($statistics['top_referrer']['username'], $statistics['top_referrer']['uid']);
$top_referrer = $lang->sprintf($lang->top_referrer, $toprefuser, my_number_format($statistics['top_referrer']['referrals']));
}
}
// Today's top poster
if (!isset($statistics['top_poster']['uid'])) {
$topposter = $lang->nobody;
开发者ID:GODEXTREME,项目名称:UO-PHP-Files,代码行数:31,代码来源:stats.php
示例11: ps_GetNewestPosts
//.........这里部分代码省略.........
if ($newest_threads['dateline'] && $newest_threads['truid'] == $mybb->user['uid']) {
if ($newest_threads['lastpost'] > $newest_threads['dateline']) {
$lightbulb['folder'] = "on";
}
} else {
if ($newest_threads['lastpost'] > $mybb->user['lastvisit']) {
$lightbulb['folder'] = "on";
}
}
}
$dateformat = $mybb->settings['ps_date_format'];
if ($active_cells['Date']) {
$isty = ps_GetTY($mybb->settings['ps_date_format_ty'], $newest_threads['lastpost'], $offset = "", $ty = 1);
if ($isty) {
// Relative Time:
if (TIME_NOW - $newest_threads['lastpost'] < 43200) {
$datetime = my_date('relative', $newest_threads['lastpost'], NULL, 1);
} else {
$dateformat = preg_replace('#' . $mybb->settings['ps_date_format_ty'] . '#', "vvv", $dateformat);
$datetime = my_date($dateformat, $newest_threads['lastpost'], NULL, 1);
$datetime = preg_replace('#vvv#', $isty, $datetime);
}
} else {
$datetime = my_date($dateformat, $newest_threads['lastpost'], NULL, 1);
}
}
if ($active_cells['Latest_posts']) {
$parsed_subject = $parser->parse_badwords($newest_threads['subject']);
$subject = htmlspecialchars_uni(ps_SubjectLength($plainprefix . $parsed_subject));
$subject = $styledprefix . my_substr($subject, my_strlen($plainprefix));
$subject_long = $plainprefix . htmlspecialchars_uni($parsed_subject);
$threadlink = $mybb->settings['bburl'] . '/' . get_thread_link($tid, NULL, "lastpost");
eval("\$readstate_icon = \"" . $templates->get("prostats_readstate_icon") . "\";");
eval("\$newestposts_specialchar = \"" . $templates->get("prostats_newestposts_specialchar") . "\";");
}
if ($active_cells['Starter']) {
$username = ps_FormatNameDb($fuid, htmlspecialchars_uni($newest_threads['username']));
$profilelink = $mybb->settings['bburl'] . '/' . get_profile_link($fuid);
}
if ($active_cells['Last_sender']) {
$lastposter_uname = ps_FormatNameDb($newest_threads['lastposteruid'], htmlspecialchars_uni($newest_threads['lastposter']));
$lastposter_profile = $mybb->settings['bburl'] . '/' . get_profile_link($newest_threads['lastposteruid']);
}
if ($active_cells['Forum']) {
$forumlink = get_forum_link($fid);
$forumname_long = $parser->parse_badwords(strip_tags($newest_threads['name']));
$forumname = htmlspecialchars_uni(ps_SubjectLength($forumname_long, NULL, true));
}
for ($i = 1; $i <= $colspan; ++$i) {
switch ($cell_order[$i]) {
case "Latest_posts":
eval("\$newestposts_cols .= \"" . $templates->get("prostats_newestposts_latest_posts") . "\";");
break;
case "Date":
eval("\$newestposts_cols .= \"" . $templates->get("prostats_newestposts_date") . "\";");
break;
case "Starter":
eval("\$newestposts_cols .= \"" . $templates->get("prostats_newestposts_starter") . "\";");
break;
case "Last_sender":
eval("\$newestposts_cols .= \"" . $templates->get("prostats_newestposts_last_sender") . "\";");
break;
case "Forum":
eval("\$newestposts_cols .= \"" . $templates->get("prostats_newestposts_forum") . "\";");
break;
default:
NULL;
}
}
eval("\$newestposts_row .= \"" . $templates->get("prostats_newestposts_row") . "\";");
if ($feed) {
$feeditem[$loop_counter]['tid'] = $tid;
$feeditem[$loop_counter]['fuid'] = $fuid;
$feeditem[$loop_counter]['fid'] = $fid;
$feeditem[$loop_counter]['bulb'] = $lightbulb['folder'];
$feeditem[$loop_counter]['lasttime'] = $newest_threads['lastpost'];
$feeditem[$loop_counter]['datetime'] = $datetime;
if ($active_cells['Latest_posts']) {
$feeditem[$loop_counter]['subject'] = $subject;
$feeditem[$loop_counter]['subject_long'] = $subject_long;
}
if ($active_cells['Starter']) {
$feeditem[$loop_counter]['username'] = htmlspecialchars_uni($newest_threads['username']);
$feeditem[$loop_counter]['username_formed'] = $username;
}
if ($active_cells['Last_sender']) {
$feeditem[$loop_counter]['lastposter_uid'] = $newest_threads['lastposteruid'];
$feeditem[$loop_counter]['lastposter_uname'] = htmlspecialchars_uni($newest_threads['lastposter']);
$feeditem[$loop_counter]['lastposter_uname_formed'] = $lastposter_uname;
}
if ($active_cells['Forum']) {
$feeditem[$loop_counter]['forumname'] = $forumname;
$feeditem[$loop_counter]['forumname_long'] = $forumname_long;
}
}
++$loop_counter;
}
eval("\$newestposts = \"" . $templates->get("prostats_newestposts") . "\";");
return $newestposts;
}
开发者ID:Sama34,项目名称:ProStats,代码行数:101,代码来源:prostats.php
示例12: getForumStaff
/**
* Return members of the board with administrative function
* Taken from /showteam.php
*
* @return array
*/
function getForumStaff()
{
$this->lang->load('showteam');
$usergroups = array();
$moderators = array();
$users = array();
// Fetch the list of groups which are to be shown on the page
$query = $this->db->simple_select("usergroups", "gid, title, usertitle", "showforumteam=1", array('order_by' => 'disporder'));
while ($usergroup = $this->db->fetch_array($query)) {
$usergroups[$usergroup['gid']] = $usergroup;
}
if (empty($usergroups)) {
return $this->lang->error_noteamstoshow;
}
// Fetch specific forum moderator details
if ($usergroups[6]['gid']) {
$query = $this->db->query("\n\t\t\t\tSELECT m.*, f.name\n\t\t\t\tFROM " . TABLE_PREFIX . "moderators m\n\t\t\t\tLEFT JOIN " . TABLE_PREFIX . "users u ON (u.uid=m.uid)\n\t\t\t\tLEFT JOIN " . TABLE_PREFIX . "forums f ON (f.fid=m.fid)\n\t\t\t\tWHERE f.active = 1\n\t\t\t\tORDER BY u.username\n\t\t\t");
while ($moderator = $this->db->fetch_array($query)) {
$moderators[$moderator['uid']][] = $moderator;
}
}
// Now query the users of those specific groups
$groups_in = implode(",", array_keys($usergroups));
$users_in = implode(",", array_keys($moderators));
if (!$groups_in) {
$groups_in = 0;
}
if (!$users_in) {
$users_in = 0;
}
$forum_permissions = forum_permissions();
$query = $this->db->simple_select("users", "uid, username, displaygroup, usergroup, ignorelist, hideemail, receivepms", "displaygroup IN ({$groups_in}) OR (displaygroup='0' AND usergroup IN ({$groups_in})) OR uid IN ({$users_in})", array('order_by' => 'username'));
while ($user = $this->db->fetch_array($query)) {
// If this user is a moderator
if (isset($moderators[$user['uid']])) {
foreach ($moderators[$user['uid']] as $forum) {
if ($forum_permissions[$forum['fid']]['canview'] == 1) {
$forum_url = get_forum_link($forum['fid']);
}
}
$usergroups[6]['user_list'][$user['uid']] = $user;
}
if ($user['displaygroup'] == '6' || $user['usergroup'] == '6') {
$usergroups[6]['user_list'][$user['uid']] = $user;
}
// Are they also in another group which is being shown on the list?
if ($user['displaygroup'] != 0) {
$group = $user['displaygroup'];
} else {
$group = $user['usergroup'];
}
if ($usergroups[$group] && $group != 6) {
$usergroups[$group]['user_list'][$user['uid']] = $user;
}
}
return $usergroups;
}
开发者ID:NoiSek,项目名称:ArFlux,代码行数:63,代码来源:class.MyBBIntegrator.php
示例13: build_forum_breadcrumb
/**
* Build the forum breadcrumb nagiation (the navigation to a specific forum including all parent forums)
*
* @param int The forum ID to build the navigation for
* @param array The multipage drop down array of information
*/
function build_forum_breadcrumb($fid, $multipage = array())
{
global $pforumcache, $currentitem, $forum_cache, $navbits, $lang, $base_url, $archiveurl;
if (!$pforumcache) {
if (!is_array($forum_cache)) {
cache_forums();
}
foreach ($forum_cache as $key => $val) {
$pforumcache[$val['fid']][$val['pid']] = $val;
}
}
if (is_array($pforumcache[$fid])) {
foreach ($pforumcache[$fid] as $key => $forumnav) {
if ($fid == $forumnav['fid']) {
if (!empty($pforumcache[$forumnav['pid']])) {
build_forum_breadcrumb($forumnav['pid']);
}
$navsize = count($navbits);
// Convert & to &
$navbits[$navsize]['name'] = preg_replace("#&(?!\\#[0-9]+;)#si", "&", $forumnav['name']);
if (defined("IN_ARCHIVE")) {
// Set up link to forum in breadcrumb.
if ($pforumcache[$fid][$forumnav['pid']]['type'] == 'f' || $pforumcache[$fid][$forumnav['pid']]['type'] == 'c') {
$navbits[$navsize]['url'] = "{$base_url}forum-" . $forumnav['fid'] . ".html";
} else {
$navbits[$navsize]['url'] = $archiveurl . "/index.php";
}
} elseif (!empty($multipage)) {
$navbits[$navsize]['url'] = get_forum_link($forumnav['fid'], $multipage['current_page']);
$navbits[$navsize]['multipage'] = $multipage;
$navbits[$navsize]['multipage']['url'] = str_replace('{fid}', $forumnav['fid'], FORUM_URL_PAGED);
} else {
$navbits[$navsize]['url'] = get_forum_link($forumnav['fid']);
}
}
}
}
return 1;
}
开发者ID:khanfusiion,项目名称:mybb,代码行数:45,代码来源:functions.php
示例14: get_forum_link
}
$sortsel['rating'] = '';
// Needs to be initialized in order to speed-up things. Fixes #2031
$sortsel[$mybb->input['sortby']] = ' selected="selected"';
// Pick the right string to join the sort URL
if ($mybb->seo_support == true) {
$string = "?";
} else {
$string = "&";
}
// Are we viewing a specific page?
$mybb->input['page'] = $mybb->get_input('page', MyBB::INPUT_INT);
if ($mybb->input['page'] > 1) {
$sorturl = get_forum_link($fid, $mybb->input['page']) . $string . "datecut={$datecut}&prefix={$tprefix}";
} else {
$sorturl = get_forum_link($fid) . $string . "datecut={$datecut}&prefix={$tprefix}";
}
eval("\$orderarrow['{$sortby}'] = \"" . $templates->get("forumdisplay_orderarrow") . "\";");
$threadcount = 0;
$useronly = $tuseronly = "";
if (isset($fpermissions['canonlyviewownthreads']) && $fpermissions['canonlyviewownthreads'] == 1) {
$useronly = "AND uid={$mybb->user['uid']}";
$tuseronly = "AND t.uid={$mybb->user['uid']}";
}
if ($fpermissions['canviewthreads'] != 0) {
// How many posts are there?
if ($datecut > 0 && $datecut != 9999 || isset($fpermissions['canonlyviewownthreads']) && $fpermissions['canonlyviewownthreads'] == 1) {
$query = $db->simple_select("threads", "COUNT(tid) AS threads", "fid = '{$fid}' {$useronly} {$visibleonly} {$datecutsql} {$prefixsql}");
$threadcount = $db->fetch_field($query, "threads");
} else {
$query = $db->simple_select("forums", "threads, unapprovedthreads, deletedthreads", "fid = '{$fid}'", array('limit' => 1));
开发者ID:mainhan1804,项目名称:xomvanphong,代码行数:31,代码来源:forumdisplay.php
示例15: intval
$mybb->input['action'] = "editpost";
} else {
$postinfo = $posthandler->update_post();
$visible = $postinfo['visible'];
$first_post = $postinfo['first_post'];
// Help keep our attachments table clean.
$db->delete_query("attachments", "filename='' OR filesize<1");
// Did the user choose to post a poll? Redirect them to the poll posting page.
if ($mybb->input['postpoll'] && $forumpermissions['canpostpolls']) {
$url = "polls.php?action=newpoll&tid={$tid}&polloptions=" . intval($mybb->input['numpolloptions']);
$lang->redirect_postedited = $lang->redirect_postedited_poll;
} else {
if ($visible == 0 && $first_post && !is_moderator($fid, "", $mybb->user['uid'])) {
// Moderated post
$lang->redirect_postedited .= $lang->redirect_thread_moderation;
$url = get_forum_link($fid);
} else {
if ($visible == 0 && !is_moderator($fid, "", $mybb->user['uid'])) {
$lang->redirect_postedited .= $lang->redirect_post_moderation;
$url = get_thread_link($tid);
} else {
$lang->redirect_postedited .= $lang->redirect_postedited_redirect;
$url = get_post_link($pid, $tid) . "#pid{$pid}";
}
}
}
$plugins->run_hooks("editpost_do_editpost_end");
redirect($url, $lang->redirect_postedited);
}
}
if (!$mybb->input['action'] || $mybb->input['action'] == "editpost") {
开发者ID:slothly,项目名称:mybb,代码行数:31,代码来源:editpost.php
示例16: Form
$form = new Form("index.php?module=forum/moderation_queue", "post");
$table = new Table();
$table->construct_header($lang->subject);
$table->construct_header($lang->author, array("class" => "align_center", "width" => "20%"));
$table->construct_header($lang->posted, array("class" => "align_center", "width" => "20%"));
$query = $db->query("\n\t\t\tSELECT p.pid, p.subject, p.message, t.subject AS threadsubject, t.tid, u.username, p.uid, t.fid\n\t\t\tFROM " . TABLE_PREFIX . "posts p\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 p.visible='0' AND t.firstpost != p.pid\n\t\t\tORDER BY p.dateline DESC\n\t\t\tLIMIT {$start}, {$per_page}\n\t\t");
while ($post = $db->fetch_array($query)) {
$altbg = alt_trow();
$post['threadsubject'] = htmlspecialchars_uni($post['threadsubject']);
$post['subject'] = htmlspecialchars_uni($post['subject']);
if (!$post['subject']) {
$post['subject'] = $lang->re . " " . $post['threadsubject'];
}
$post['postlink'] = get_post_link($post['pid'], $post['tid']);
$post['threadlink'] = get_thread_link($post['tid']);
$post['forumlink'] = get_forum_link($post['fid']);
$forum_name = $forum_cache[$post['fid']]['name'];
$postdate = my_date($mybb->settings['dateformat'], $post['dateline']);
$posttime = my_date($mybb->settings['timeformat'], $post['dateline']);
$profile_link = build_profile_link($post['username'], $post['uid']);
$post['message'] = nl2br(htmlspecialchars_uni($post['message']));
$table->construct_cell("<a href=\"../{$post['postlink']}#pid{$post['pid']}\">{$post['subject']}</a>");
$table->construct_cell($profile_link, array("class" => "align_center"));
$table->construct_cell("{$postdate}, {$posttime}", array("class" => "align_center"));
$table->construct_row();
$controls = "<div class=\"modqueue_controls\">\n";
$controls .= $form->generate_radio_button("posts[{$post['pid']}]", "ignore", $lang->ignore, array('class' => 'radio_ignore', 'checked' => true)) . " ";
$controls .= $form->generate_radio_button("posts[{$post['pid']}]", "delete", $lang->delete, array('class' => 'radio_delete', 'checked' => false)) . " ";
$controls .= $form->generate_radio_button("posts[{$post['pid']}]", "approve", $lang->approve, array('class' => 'radio_approve', 'checked' => false));
$controls .= "</div>";
$thread = "<strong>{$lang->thread} <a href=\"../{$post['threadlink']}\">{$post['threadsubject']}</a></strong>";
开发者ID:benn0034,项目名称:SHIELDsite2.old,代码行数:31,代码来源:moderation_queue.php
示例17: build_forumbits
/**
* Build a list of forum bits.
*
* @param int The parent forum to fetch the child forums for (0 assumes all)
* @param int The depth to return forums with.
* @return array Array of information regarding the child forums of this parent forum
*/
function build_forumbits($pid = 0, $depth = 1)
{
global $fcache, $moderatorcache, $forumpermissions, $theme, $mybb, $templates, $bgcolor, $collapsed, $lang, $showdepth, $plugins, $parser, $forum_viewers;
$forum_listing = '';
// If no forums exist with this parent, do nothing
if (!is_array($fcache[$pid])) {
return;
}
// Foreach of the forums in this parent
foreach ($fcache[$pid] as $parent) {
foreach ($parent as $forum) {
$forums = $subforums = $sub_forums = '';
$lastpost_data = '';
$counters = '';
$forum_viewers_text = '';
$forum_viewers_text_plain = '';
// Get the permissions for this forum
$permissions = $forumpermissions[$forum['fid']];
// If this user doesnt have permission to view this forum and we're hiding private forums, skip this forum
if ($permissions['canview'] != 1 && $mybb->settings['hideprivateforums'] == 1) {
continue;
}
$plugins->run_hooks_by_ref("build_forumbits_forum", $forum);
// Build the link to this forum
$forum_url = get_forum_link($forum['fid']);
// This forum has a password, and the user isn't authenticated with it - hide post information
$hideinfo = false;
$showlockicon = 0;
if ($permissions['canviewthreads'] != 1) {
$hideinfo = true;
}
if ($forum['password'] != '' && $mybb->cookies['forumpass'][$forum['fid']] != md5($mybb->user['uid'] . $forum['password'])) {
$hideinfo = true;
$showlockicon = 1;
}
$lastpost_data = array("lastpost" => $forum['lastpost'], "lastpostsubject" => $forum['lastpostsubje
|
请发表评论