示例#1
0
/**
 * Alerts user when someone comments on their forum topic
 *
 * @Param: the id of the topic
 *
 * @author: Joe Hoyle
 * @version 1.0
 **/
function nm_alert_user_wrote_forum_reply($replyID)
{
    $userInfo = wp_get_current_user();
    $post = bb_get_post($replyID);
    $topicAuthor = get_topic_author($post->topic_id);
    $topicAuthor = get_userdatabylogin($topicAuthor);
    if ($post->poster_id != $topicAuthor->ID) {
        $alert = array();
        $alert['content'] = '<a href="' . getProfileLink($post->poster_id) . '" title="View ' . nm_user_public_name($post->poster_id) . 's profile">' . nm_user_public_name($post->poster_id) . '</a> has replied to your forum topic: <a href="' . get_post_link($replyID) . '" title="View ' . get_topic_title($topic_id) . '">' . get_topic_title($topic_id) . '</a>.';
        $alert['type'] = 'forum';
        nm_add_alert($topicAuthor->ID, $alert);
    }
    return $topicID;
}
示例#2
0
><?php 
topic_title();
?>
</h2>
<span id="topic_posts">(<?php 
topic_posts_link();
?>
)</span>
<span id="topic_voices">(<?php 
printf(_n('%s voice', '%s voices', bb_get_topic_voices()), bb_get_topic_voices());
?>
)</span>

<ul class="topicmeta">
	<li><?php 
printf(__('Asked %1$s ago by %2$s'), get_topic_start_time(), get_topic_author());
?>
</li>
<?php 
if (1 < get_topic_posts()) {
    ?>
	<li><?php 
    printf(__('<a href="%1$s">Latest answer</a> from %2$s'), esc_attr(get_topic_last_post_link()), get_topic_last_poster());
    ?>
</li>
<?php 
}
if (bb_is_user_logged_in()) {
    ?>
	<li<?php 
    echo $class;
function topic_author($id = 0)
{
    $topic = get_topic(get_topic_id($id));
    echo apply_filters('topic_author', get_topic_author($id), $topic->topic_poster, $topic->topic_id);
    // $topic->topic_poster = user ID
}
示例#4
0
            } else {
                printf(__('<a href="%1$s">Post</a> on <a href="%2$s">%3$s</a> by %4$s'), esc_attr(add_query_arg('view', 'all', get_post_link())), get_topic_link($bb_post->topic_id), get_topic_title($bb_post->topic_id), get_post_author());
            }
            ?>
			</li>
			<?php 
        } elseif ('topic' == $object['type']) {
            global $topic;
            $topic = $object['data'];
            ?>
			<li>
			<?php 
            if ($topic->topic_poster) {
                printf(__('Topic titled <a href="%1$s">%2$s</a> started by <a href="%3$s">%4$s</a>'), esc_attr(add_query_arg('view', 'all', get_topic_link())), get_topic_title($topic->topic_id), get_user_profile_link($topic->topic_poster), get_topic_author($topic->topic_id));
            } else {
                printf(__('Topic titled <a href="%1$s">%2$s</a> started by %3$s'), esc_attr(add_query_arg('view', 'all', get_topic_link())), get_topic_title($topic->topic_id), get_topic_author($topic->topic_id));
            }
            ?>
			</li>
			<?php 
        }
    }
    remove_filter('get_topic_where', 'bb_no_where');
    ?>
		</ul>
		<?php 
} else {
    ?>
		<p>
			<?php 
    _e('No moderated posts or topics&#8230; you must have very well behaved members.');
示例#5
0
文件: topic.php 项目: billerby/Surdeg
					<div class="info">
						<a href="<?php 
topic_rss_link();
?>
"><img src="<?php 
echo bb_get_active_theme_uri();
?>
image/feed.png" width="16" height="16" alt="Feed"/></a>
					</div>
					
					<h2><?php 
_e('Topic Information', 'guangzhou');
?>
</h2>
					<p><?php 
printf(__('Started %1$s ago by <strong>%2$s</strong>', 'guangzhou'), get_topic_start_time(), get_topic_author());
?>
, with a total of <?php 
topic_posts_link();
?>
.  Follow this topic with
					the <a href="<?php 
topic_rss_link();
?>
">RSS feed</a>.</p>
					
					<?php 
do_action('topicmeta');
?>
				</li>
				<li>
示例#6
0
}
?>
		
		
		<?php 
if (is_topic()) {
    ?>
			<div class="widget">
				<h3>О теме</h3>
	        	<ul>
	            	<li><?php 
    printf('Отправлено %1$s назад', get_topic_start_time(), get_topic_author());
    ?>
</li>
	            	<li><?php 
    printf('%2$s', get_topic_start_time(), get_topic_author());
    ?>
</li>
	            	<li><?php 
    printf('<a href=\\"%1$s\\">Последнее сообщение</a> от %2$s', attribute_escape(get_topic_last_post_link()), get_topic_last_poster());
    ?>
</li>
					<?php 
    if (bb_is_user_logged_in()) {
        $class = 0 === is_user_favorite(bb_get_current_user_info('id')) ? ' class="is-not-favorite"' : '';
        ?>
	            		<li<?php 
        echo $class;
        ?>
 id="favorite-toggle"><?php 
        user_favorites_link();
示例#7
0
            global $bb_post;
            $bb_post = $object['data'];
            ?>
			<li>
<?php 
            printf(__('<a href="%1$s">Post</a> on <a href="%2$s">%3$s</a> by <a href="%4$s">%5$s</a>'), esc_attr(add_query_arg('view', 'all', get_post_link())), get_topic_link($bb_post->topic_id), get_topic_title($bb_post->topic_id), get_user_profile_link($bb_post->poster_id), get_post_author());
            ?>
			</li>
			<?php 
        } elseif ('topic' == $object['type']) {
            global $topic;
            $topic = $object['data'];
            ?>
			<li>
<?php 
            printf(__('Topic titled <a href="%1$s">%2$s</a> started by <a href="%3$s">%4$s</a>'), esc_attr(add_query_arg('view', 'all', get_topic_link())), get_topic_title(), get_user_profile_link($topic->topic_poster), get_topic_author());
            ?>
			</li>
			<?php 
        }
    }
    remove_filter('get_topic_where', 'bb_no_where');
    ?>
		</ul>
		<?php 
} else {
    ?>
		<p>
			<?php 
    _e('No moderated posts or topics&#8230; you must have very well behaved members.');
    ?>
示例#8
0
    foreach ($relevant as $topic) {
        $bb_post = bb_get_first_post($topic);
        ?>
		<li<?php 
        alt_class('relevant');
        ?>
>
			<a class="result" href="<?php 
        post_link();
        ?>
"><?php 
        echo bb_show_topic_context($q, get_topic_title());
        ?>
</a>
			<span class="freshness"><?php 
        printf(__('By <a href="%1$s">%2$s</a> on %3$s'), get_user_profile_link($topic->topic_poster), get_topic_author(), bb_datetime_format_i18n(get_topic_start_time(array('format' => 'timestamp'))));
        ?>
</span>
			<p><?php 
        echo bb_show_context($q, $bb_post->post_text);
        ?>
</p>
		</li>
<?php 
    }
    ?>
	</ol>
</div>
<?php 
}
?>