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


PHP get_forum_name函数代码示例

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


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

示例1: bb_forum_form

function bb_forum_form($forum_id = 0)
{
    $forum_id = (int) $forum_id;
    if ($forum_id && !($forum = bb_get_forum($forum_id))) {
        return;
    }
    $forum_name = '';
    $forum_slug = '';
    $forum_description = '';
    $forum_position = '';
    if ($forum_id) {
        $forum_name = get_forum_name($forum_id);
        $forum_slug = apply_filters('editable_slug', $forum->forum_slug);
        $forum_description = get_forum_description($forum_id);
        $forum_position = get_forum_position($forum_id);
        $legend = __('Edit Forum');
        $submit = __('Save Changes');
        $action = 'update';
    } else {
        $legend = __('Add Forum');
        $submit = __('Add Forum');
        $action = 'add';
    }
    $forum_options = array('forum_name' => array('title' => __('Name'), 'value' => $forum_name), 'forum_slug' => array('title' => __('Slug'), 'value' => $forum_slug), 'forum_desc' => array('title' => __('Description'), 'value' => $forum_description, 'class' => 'long'), 'forum_parent' => array('title' => __('Parent'), 'type' => 'select', 'options' => bb_get_forum_dropdown(array('cut_branch' => $forum_id, 'id' => 'forum_parent', 'none' => true, 'selected' => $forum_id ? get_forum_parent($forum_id) : 0, 'disable_categories' => 0, 'options_only' => true))), 'forum_order' => array('title' => __('Position'), 'value' => $forum_position, 'class' => 'short'), 'forum_is_category' => array('title' => __('Category'), 'type' => 'checkbox', 'options' => array(1 => array('label' => __('Make this forum a category'), 'value' => bb_get_forum_is_category($forum_id))), 'note' => __('Categories are forums where new topics cannot be created. Categories usually contain a group of sub-forums.')));
    if (!$forum_id) {
        unset($forum_options['forum_slug']);
        unset($forum_options['forum_order']);
    }
    ?>
<form class="settings" method="post" id="<?php 
    echo $action;
    ?>
-forum" action="<?php 
    bb_uri('bb-admin/bb-forum.php', null, BB_URI_CONTEXT_FORM_ACTION + BB_URI_CONTEXT_BB_ADMIN);
    ?>
" class="add:forum-list: forum-form">
	<fieldset>
		<legend><?php 
    echo $legend;
    ?>
</legend>
<?php 
    foreach ($forum_options as $option => $args) {
        bb_option_form_element($option, $args);
    }
    ?>
		<fieldset class="submit">
<?php 
    if ($forum_id) {
        ?>
			<input type="hidden" name="forum_id" value="<?php 
        echo $forum_id;
        ?>
" />
<?php 
    }
    ?>
			<?php 
    bb_nonce_field('order-forums', 'order-nonce');
    ?>
			<?php 
    bb_nonce_field($action . '-forum');
    ?>
			<input type="hidden" name="action" value="<?php 
    echo $action;
    ?>
" />
			<input class="submit" type="submit" name="submit" value="<?php 
    echo $submit;
    ?>
" />
		</fieldset>
	</fieldset>
</form>
<?php 
}
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:76,代码来源:functions.bb-admin.php

示例2: add_filter

add_filter('post_edit_uri', 'bb_make_link_view_all');
$post_query = new BB_Query_Form('post', array('post_status' => 'normal', 'count' => true, 'per_page' => 20));
$bb_posts =& $post_query->results;
$total = $post_query->found_rows;
?>

<div class="wrap">

<h2><?php 
_e('Posts');
$h2_search = $post_query->get('post_text');
$h2_forum = $post_query->get('forum_id');
$h2_tag = $post_query->get('tag_id');
$h2_author = $post_query->get('post_author_id');
$h2_search = $h2_search ? ' ' . sprintf(__('containing &#8220;%s&#8221;'), esc_html($h2_search)) : '';
$h2_forum = $h2_forum ? ' ' . sprintf(__('in &#8220;%s&#8221;'), get_forum_name($h2_forum)) : '';
$h2_tag = $h2_tag ? ' ' . sprintf(__('with tag &#8220;%s&#8221;'), esc_html(bb_get_tag_name($h2_tag))) : '';
$h2_author = $h2_author ? ' ' . sprintf(__('by %s'), esc_html(get_user_name($h2_author))) : '';
if ($ip_available) {
    $h2_ip = $post_query->get('poster_ip');
    $h2_ip = $h2_ip ? ' ' . sprintf(__('from IP address %s'), esc_html($h2_ip)) : '';
} else {
    $h2_ip = '';
}
if ($h2_search || $h2_forum || $h2_tag || $h2_author || $h2_ip) {
    echo '<span class="subtitle">';
    printf(__('%1$s%2$s%3$s%4$s%5$s'), $h2_search, $h2_forum, $h2_tag, $h2_author, $h2_ip);
    echo '</span>';
}
?>
</h2>
开发者ID:laiello,项目名称:cartonbank,代码行数:31,代码来源:posts.php

示例3: queryDB

            /* Decrement count of posts in forums table */
            $sql = "UPDATE %sforums SET num_posts=num_posts-1, last_post=last_post WHERE forum_id=%d";
            $result = queryDB($sql, array(TABLE_PREFIX, $fid));
        }
        if ($ppid) {
            $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
            header('Location: view.php?fid=' . $fid . SEP . 'pid=' . $ppid);
            exit;
        } else {
            $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
            header('Location: index.php?fid=' . $fid);
            exit;
        }
    }
}
$_pages['mods/_standard/forums/forum/index.php?fid=' . $fid]['title'] = get_forum_name($fid);
$_pages['mods/_standard/forums/forum/index.php?fid=' . $fid]['parent'] = 'forum/list.php';
$_pages['mods/_standard/forums/forum/index.php?fid=' . $fid]['children'] = array('mods/_standard/forums/forum/new_thread.php?fid=' . $fid);
$_pages['mods/_standard/forums/forum/new_thread.php?fid=' . $fid]['title_var'] = 'new_thread';
$_pages['mods/_standard/forums/forum/new_thread.php?fid=' . $fid]['parent'] = 'mods/_standard/forums/forum/index.php?fid=' . $fid;
$_pages['mods/_standard/forums/forum/view.php']['title'] = $post_row['subject'];
$_pages['mods/_standard/forums/forum/view.php']['parent'] = 'forum/index.php?fid=' . $fid;
$_pages['mods/_standard/forums/forum/delete_thread.php']['title_var'] = 'delete_post';
$_pages['mods/_standard/forums/forum/delete_thread.php']['parent'] = 'mods/_standard/forums/forum/index.php?fid=' . $fid;
$_pages['mods/_standard/forums/forum/delete_thread.php']['children'] = array();
require AT_INCLUDE_PATH . 'header.inc.php';
$sql = "SELECT * from %sforums_threads WHERE post_id = %d";
$row = queryDB($sql, array(TABLE_PREFIX, $pid), TRUE);
$title = AT_print($row['subject'], 'forums_threads.subject');
$hidden_vars['fid'] = $_GET['fid'];
$hidden_vars['pid'] = $_GET['pid'];
开发者ID:genaromendezl,项目名称:ATutor,代码行数:31,代码来源:delete_thread.php

示例4: queryDB

 }
 $sql = "UPDATE %sforums_threads SET num_comments=num_comments+1, last_comment='%s', date=date WHERE post_id=%d";
 $result = queryDB($sql, array(TABLE_PREFIX, $now, $_POST['parent_id']));
 if ($subscriber_email_list) {
     require AT_INCLUDE_PATH . 'classes/phpmailer/atutormailer.class.php';
     if ($_POST['parent_name'] == '') {
         $_POST['parent_name'] = $_POST['subject'];
     }
     $_POST['parent_name'] = urldecode($_POST['parent_name']);
     foreach ($subscriber_email_list as $subscriber) {
         $mail = new ATutorMailer();
         $mail->AddAddress($subscriber['email'], get_display_name($subscriber['member_id']));
         $body = _AT('forum_new_submsg', $_SESSION['course_title'], get_forum_name($_POST['fid']), $_POST['parent_name'], AT_BASE_HREF . 'mods/_standard/forums/forum/view.php?fid=' . $_POST['fid'] . SEP . 'pid=' . $_POST['parent_id']);
         $body .= "\n----------------------------------------------\n";
         $body .= _AT('course') . ': ' . $_SESSION['course_title'] . "\n";
         $body .= _AT('forum') . ': ' . get_forum_name($_POST['fid']) . "\n";
         $body .= _AT('thread') . ': ' . $_POST['parent_name'] . "\n";
         $body .= _AT('posted_by') . ": " . get_display_name($_SESSION['member_id']) . "\n";
         $body .= $_POST['body'] . "\n";
         $mail->FromName = $_config['site_name'];
         $mail->From = $_config['contact_email'];
         $mail->Subject = _AT('thread_notify1') . ': ' . $_POST['parent_name'];
         $mail->Body = $body;
         if (!$mail->Send()) {
             $msg->addError('SENDING_ERROR');
         }
         unset($mail);
     }
 }
 if ($_REQUEST['subscribe']) {
     if ($_POST['parent_id'] != 0) {
开发者ID:zort77,项目名称:ATutor,代码行数:31,代码来源:new_thread.php

示例5: bb_get_forum_bread_crumb

function bb_get_forum_bread_crumb($args = '')
{
    $defaults = array('forum_id' => 0, 'separator' => ' &raquo; ', 'class' => null);
    $args = wp_parse_args($args, $defaults);
    extract($args, EXTR_SKIP);
    $trail = '';
    $trail_forum = bb_get_forum(get_forum_id($forum_id));
    if ($class) {
        $class = ' class="' . $class . '"';
    }
    $current_trail_forum_id = $trail_forum->forum_id;
    while ($trail_forum && $trail_forum->forum_id > 0) {
        $crumb = $separator;
        if ($current_trail_forum_id != $trail_forum->forum_id || !bb_is_forum()) {
            $crumb .= '<a' . $class . ' href="' . get_forum_link($trail_forum->forum_id) . '">';
        } elseif ($class) {
            $crumb .= '<span' . $class . '>';
        }
        $crumb .= get_forum_name($trail_forum->forum_id);
        if ($current_trail_forum_id != $trail_forum->forum_id || !bb_is_forum()) {
            $crumb .= '</a>';
        } elseif ($class) {
            $crumb .= '</span>';
        }
        $trail = $crumb . $trail;
        $trail_forum = bb_get_forum($trail_forum->forum_parent);
    }
    return apply_filters('bb_get_forum_bread_crumb', $trail, $forum_id);
}
开发者ID:abc2mit,项目名称:abc2mit.github.io,代码行数:29,代码来源:functions.bb-template.php

示例6: if

	exit;
}

// set default thread display order to ascending
if (!isset($_SESSION['thread_order']))
{
	$_SESSION['thread_order'] = 'a';
}
else if (isset($_GET['order']))
{
	$_SESSION['thread_order'] = $_GET['order'];
}

$forum_info = get_forum($fid);

$_pages[url_rewrite('mods/_standard/forums/forum/index.php?fid='.$fid)]['title']    = get_forum_name($fid);
$_pages[url_rewrite('mods/_standard/forums/forum/index.php?fid='.$fid)]['parent']   = 'mods/_standard/forums/forum/list.php';
$_pages[url_rewrite('mods/_standard/forums/forum/index.php?fid='.$fid)]['children'] = array(url_rewrite('mods/_standard/forums/forum/new_thread.php?fid='.$fid), 'search.php?search_within[]=forums');

$_pages[url_rewrite('mods/_standard/forums/forum/new_thread.php?fid='.$fid)]['title_var'] = 'new_thread';
$_pages[url_rewrite('mods/_standard/forums/forum/new_thread.php?fid='.$fid)]['parent']    = url_rewrite('mods/_standard/forums/forum/index.php?fid='.$fid);

$_pages['mods/_standard/forums/forum/view.php']['parent'] = url_rewrite('mods/_standard/forums/forum/index.php?fid='.$fid);
$_pages['search.php?search_within[]=forums']['title_var'] = 'search';
$_pages['search.php?search_within[]=forums']['parent']    = url_rewrite('mods/_standard/forums/forum/index.php');

if ($_REQUEST['reply']) {
	$onload = 'document.form.subject.focus();';
}

$pid = intval($_GET['pid']);
开发者ID:radiocontrolled,项目名称:ATutor,代码行数:31,代码来源:view.php

示例7: array

     if (!($topics = get_latest_topics($feed_id))) {
         die;
     }
     $posts = array();
     foreach ($topics as $topic) {
         $posts[] = bb_get_first_post($topic->topic_id);
     }
     $title = esc_html(sprintf(__('%1$s &raquo; Forum: %2$s - Recent Topics'), bb_get_option('name'), get_forum_name($feed_id)));
     $link = get_forum_link($feed_id);
     $link_self = bb_get_forum_topics_rss_link($feed_id);
     break;
 case 'forum-posts':
     if (!($posts = bb_get_latest_forum_posts($feed_id))) {
         die;
     }
     $title = esc_html(sprintf(__('%1$s &raquo; Forum: %2$s - Recent Posts'), bb_get_option('name'), get_forum_name($feed_id)));
     $link = get_forum_link($feed_id);
     $link_self = bb_get_forum_posts_rss_link($feed_id);
     break;
     // Get just the first post from the latest topics
 // Get just the first post from the latest topics
 case 'all-topics':
     if (!($topics = get_latest_topics())) {
         die;
     }
     $posts = array();
     foreach ($topics as $topic) {
         $posts[] = bb_get_first_post($topic->topic_id);
     }
     $title = esc_html(sprintf(__('%1$s &raquo; Recent Topics'), bb_get_option('name')));
     $link = bb_get_uri();
开发者ID:abc2mit,项目名称:abc2mit.github.io,代码行数:31,代码来源:rss.php

示例8: mysql_query

            exit;
        }
        // else:
        /* Decrement count for number of posts and topics*/
        $sql = "UPDATE " . TABLE_PREFIX . "forums SET num_posts=num_posts-1-" . $row['num_comments'] . ", num_topics=num_topics-1, last_post=last_post WHERE forum_id={$_REQUEST['fid']}";
        $result = mysql_query($sql, $db);
        $sql = "UPDATE " . TABLE_PREFIX . "forums SET num_posts=num_posts+1+" . $row['num_comments'] . ", num_topics=num_topics+1, last_post=last_post WHERE forum_id={$_REQUEST['new_fid']}";
        $result = mysql_query($sql, $db);
        $sql = "UPDATE " . TABLE_PREFIX . "forums_threads SET forum_id={$_REQUEST['new_fid']}, last_comment=last_comment, date=date WHERE (parent_id={$_REQUEST['pid']} OR post_id={$_REQUEST['pid']}) AND forum_id={$_REQUEST['fid']}";
        $result = mysql_query($sql, $db);
        $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
        header('Location: index.php?fid=' . $_REQUEST['fid']);
        exit;
    }
}
$_pages['mods/_standard/forums/forum/index.php?fid=' . $_REQUEST['fid']]['title'] = get_forum_name($_REQUEST['fid']);
$_pages['mods/_standard/forums/forum/index.php?fid=' . $_REQUEST['fid']]['parent'] = 'mods/_standard/forums/forum/list.php';
$_pages['mods/_standard/forums/forum/index.php?fid=' . $_REQUEST['fid']]['children'] = array('mods/_standard/forums/forum/move_thread.php');
$_pages['mods/_standard/forums/forum/move_thread.php']['title_var'] = 'move_thread';
$_pages['mods/_standard/forums/forum/move_thread.php']['parent'] = 'mods/_standard/forums/forum/index.php?fid=' . $_REQUEST['fid'];
$_pages['mods/_standard/forums/forum/move_thread.php']['children'] = array();
require AT_INCLUDE_PATH . 'header.inc.php';
?>
<form method="post" action="<?php 
echo $_SERVER['PHP_SELF'];
?>
">
<input type="hidden" name="fid" value="<?php 
echo $_REQUEST['fid'];
?>
" />
开发者ID:vicentborja,项目名称:ATutor,代码行数:31,代码来源:move_thread.php

示例9: mysql_query

			}
		}
		$sql = "UPDATE ".TABLE_PREFIX."forums_threads SET num_comments=num_comments+1, last_comment='$now', date=date WHERE post_id=$_POST[parent_id]";
		$result = mysql_query($sql, $db);

		if ($subscriber_email_list) {
			require(AT_INCLUDE_PATH . 'classes/phpmailer/atutormailer.class.php');

			if ($_POST['parent_name'] == ''){
				$_POST['parent_name'] = $_POST['subject'];
			}
			$_POST['parent_name'] = urldecode($_POST['parent_name']);
			foreach ($subscriber_email_list as $subscriber){
				$mail = new ATutorMailer;
				$mail->AddAddress($subscriber['email'], get_display_name($subscriber['member_id']));
				$body = _AT('forum_new_submsg', $_SESSION['course_title'],  get_forum_name($_POST['fid']), $_POST['parent_name'],  AT_BASE_HREF.'mods/_standard/forums/forum/view.php?fid='.$_POST['fid'].SEP.'pid='.$_POST['parent_id']);
				$body .= "\n----------------------------------------------\n";
				$body .= _AT('posted_by').": ".get_display_name($_SESSION['member_id'])."\n";
				$body .= $_POST['body']."\n";
				$mail->FromName = $_config['site_name'];
				$mail->From     = $_config['contact_email'];
				$mail->Subject = _AT('thread_notify1');
				$mail->Body    = $body;

				if(!$mail->Send()) {
					$msg->addError('SENDING_ERROR');
				}

				unset($mail);
			}
		}
开发者ID:radiocontrolled,项目名称:ATutor,代码行数:31,代码来源:new_thread.php

示例10: breadcrumbs

 function breadcrumbs()
 {
     $page = '';
     if (bb_get_location() == 'login-page') {
         $page = __('Log in', 'guangzhou');
     } elseif (is_forum()) {
         $page = get_forum_name();
     } elseif (is_bb_tags() && get_tag_name() != '') {
         $page = '<a href="' . bb_get_tag_page_link() . '">' . __('Tags') . '</a> &raquo; ' . get_tag_name();
     } elseif (is_topic()) {
         if (get_forum_name()) {
             $page = '<a href="' . get_forum_link() . '">' . get_forum_name() . '</a>';
         }
     }
     if ($page) {
         $page = '| ' . $page;
     }
     return '<a href="' . bb_get_option('uri') . '">' . bb_get_option('name') . '</a> ' . $page;
 }
开发者ID:billerby,项目名称:Surdeg,代码行数:19,代码来源:functions.php


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