<?xml version="1.0" encoding="UTF-8"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>bbPress support forums Topic: "My Threads" - User Specific Views</title>
<link>http://bbpress.org/forums/</link>
<description>bbPress support forums Topic: "My Threads" - User Specific Views</description>
<language>en</language>
<pubDate>Mon, 13 Oct 2008 12:55:58 +0000</pubDate>

<item>
<title>_ck_ on ""My Threads" - User Specific Views"</title>
<link>http://bbpress.org/forums/topic/my-threads-user-specific-views#post-10067</link>
<pubDate>Wed, 08 Aug 2007 18:34:14 +0000</pubDate>
<dc:creator>_ck_</dc:creator>
<guid isPermaLink="false">10067@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;I believe I have figured out how to trick the new trunk alpha version to handle non-query and special views thanks to Sam Bauers.&#60;/p&#62;
&#60;p&#62;I look forward to releasing in a day or so a trunk compatible version of &#34;my views&#34; along with my experimental &#34;list installed plugins&#34; (a public view of your bbpress plugins in use) and &#34;all available bbpress plugins&#34; (based on Sam's powerful plugin browser class).
&#60;/p&#62;</description>
</item>
<item>
<title>_ck_ on ""My Threads" - User Specific Views"</title>
<link>http://bbpress.org/forums/topic/my-threads-user-specific-views#post-9832</link>
<pubDate>Fri, 03 Aug 2007 08:15:29 +0000</pubDate>
<dc:creator>_ck_</dc:creator>
<guid isPermaLink="false">9832@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;Yeah, actually - don't use move-it until I have more time to work on it. It doesn't update the db in all the places it really should and can leave things in a weird state.&#60;/p&#62;
&#60;p&#62;I'll definitely add that feature to move-it (create a new topic from a reply). Will give it more work after I get the polls plugin a bit more stable this week.
&#60;/p&#62;</description>
</item>
<item>
<title>HowToGeek on ""My Threads" - User Specific Views"</title>
<link>http://bbpress.org/forums/topic/my-threads-user-specific-views#post-9825</link>
<pubDate>Fri, 03 Aug 2007 03:58:56 +0000</pubDate>
<dc:creator>HowToGeek</dc:creator>
<guid isPermaLink="false">9825@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;I haven't tried the trunk yet either... I just opened my forum a week ago and I'm trying to keep up with all the traffic and add the most important missing features.&#60;/p&#62;
&#60;p&#62;The one thing that is very frustrating is that administration and moderation in bbPress is not only virtually non-existent, but it's not even all in one place. If I want to delete a user, I can't do it from the admin panel, I have to go to their profile instead... annoying.&#60;/p&#62;
&#60;p&#62;I want a plugin that lets me take a reply post and turn it into a new topic. That's a sorely lacking feature. Your move-it plugin almost fits the bill, but I have to create a new topic first, and then move the post, and then delete my original post in the new topic, or just make it say &#34;look below, moving post into topic&#34;.
&#60;/p&#62;</description>
</item>
<item>
<title>_ck_ on ""My Threads" - User Specific Views"</title>
<link>http://bbpress.org/forums/topic/my-threads-user-specific-views#post-9824</link>
<pubDate>Fri, 03 Aug 2007 03:45:16 +0000</pubDate>
<dc:creator>_ck_</dc:creator>
<guid isPermaLink="false">9824@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;Just out of concerned curiosity, what other plugins have you found that don't support the trunk?&#60;/p&#62;
&#60;p&#62;I suppose I am going to have to break down and setup a testing account with the trunk this weekend or so.&#60;/p&#62;
&#60;p&#62;We need a developer plugin that injects a bunch of fake new users and fake messages for testing.
&#60;/p&#62;</description>
</item>
<item>
<title>HowToGeek on ""My Threads" - User Specific Views"</title>
<link>http://bbpress.org/forums/topic/my-threads-user-specific-views#post-9713</link>
<pubDate>Wed, 01 Aug 2007 14:20:13 +0000</pubDate>
<dc:creator>HowToGeek</dc:creator>
<guid isPermaLink="false">9713@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;I might end up helping you with that... I'd like to upgrade but a bunch of the plugins I'm using don't support the trunk.
&#60;/p&#62;</description>
</item>
<item>
<title>_ck_ on ""My Threads" - User Specific Views"</title>
<link>http://bbpress.org/forums/topic/my-threads-user-specific-views#post-9706</link>
<pubDate>Wed, 01 Aug 2007 11:00:24 +0000</pubDate>
<dc:creator>_ck_</dc:creator>
<guid isPermaLink="false">9706@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;Good point HowToGeek. The array keys could also be manipulated without having to put back in the topic descriptions too. I could extend the plugin to let the user determine views order.&#60;/p&#62;
&#60;p&#62;Sigh, unfortunately all this will be useless in a month or so. I still don't have the vaguest clue how to convert my routines to the trunk's new methods.
&#60;/p&#62;</description>
</item>
<item>
<title>mazdakam on ""My Threads" - User Specific Views"</title>
<link>http://bbpress.org/forums/topic/my-threads-user-specific-views#post-9687</link>
<pubDate>Tue, 31 Jul 2007 22:55:49 +0000</pubDate>
<dc:creator>mazdakam</dc:creator>
<guid isPermaLink="false">9687@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;great job
&#60;/p&#62;</description>
</item>
<item>
<title>HowToGeek on ""My Threads" - User Specific Views"</title>
<link>http://bbpress.org/forums/topic/my-threads-user-specific-views#post-9601</link>
<pubDate>Mon, 30 Jul 2007 16:45:56 +0000</pubDate>
<dc:creator>HowToGeek</dc:creator>
<guid isPermaLink="false">9601@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;Just thought I'd throw this out there... if you want to put the two new views first in the list, you can first unset the existing view, and then re-set it below where you add the new views.&#60;/p&#62;
&#60;p&#62;&#60;code&#62;&#60;br /&#62;
        unset($views['no-replies']);&#60;br /&#62;
        if (bb_is_user_logged_in()) {&#60;br /&#62;
        $views['my-topics'] = &#34;Topics I've Started&#34;;&#60;br /&#62;
        $views['my-posts'] = &#34;Topics I've Participated In&#34;;&#60;br /&#62;
        }&#60;br /&#62;
        $views['no-replies'] = &#34;Topics with no replies&#34;;&#60;br /&#62;
&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;You can also rename the view that way if you want.
&#60;/p&#62;</description>
</item>
<item>
<title>HowToGeek on ""My Threads" - User Specific Views"</title>
<link>http://bbpress.org/forums/topic/my-threads-user-specific-views#post-9596</link>
<pubDate>Mon, 30 Jul 2007 14:49:22 +0000</pubDate>
<dc:creator>HowToGeek</dc:creator>
<guid isPermaLink="false">9596@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;Sweet, the plugin works for me!&#60;/p&#62;
&#60;p&#62;Thanks a ton!
&#60;/p&#62;</description>
</item>
<item>
<title>_ck_ on ""My Threads" - User Specific Views"</title>
<link>http://bbpress.org/forums/topic/my-threads-user-specific-views#post-9592</link>
<pubDate>Mon, 30 Jul 2007 08:41:11 +0000</pubDate>
<dc:creator>_ck_</dc:creator>
<guid isPermaLink="false">9592@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;For anyone running 0.8.2.x I bundled this as a proper plugin with some of my other &#34;views&#34; tricks:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://ckon.wordpress.com/2007/07/30/new-plugin-my-views-for-bbpress/&#34; rel=&#34;nofollow&#34;&#62;http://ckon.wordpress.com/2007/07/30/new-plugin-my-views-for-bbpress/&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;optional: install bb-topic-views for the other extra views
&#60;/p&#62;</description>
</item>
<item>
<title>_ck_ on ""My Threads" - User Specific Views"</title>
<link>http://bbpress.org/forums/topic/my-threads-user-specific-views#post-9591</link>
<pubDate>Mon, 30 Jul 2007 08:03:05 +0000</pubDate>
<dc:creator>_ck_</dc:creator>
<guid isPermaLink="false">9591@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;Er, wait a minute. This new view registation method takes away massive potential from views.&#60;/p&#62;
&#60;p&#62;For example you can't manipulate the data before and/or after the BB_QUERY.&#60;/p&#62;
&#60;p&#62;Here's how I find &#34;most viewed&#34; and &#34;least viewed&#34; topics and create new views for them. How the heck is this even remotely possible with the new method? The new method also takes away all natural mysql query methods, making things much more complicated and easier to make mistakes on query configuration.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;function most_views( $view ) {
global $bbdb, $topics, $view_count;
if ($view==&#38;#39;most-views&#38;#39;)  {$sort=&#38;quot;DESC&#38;quot;;}
if ($view==&#38;#39;least-views&#38;#39;)  {$sort=&#38;quot;ASC&#38;quot;;}
if ($view==&#38;#39;least-views&#38;#39; &#124;&#124; $view==&#38;#39;most-views&#38;#39;)  {
$limit = bb_get_option(&#38;#39;page_topics&#38;#39;);
$where = apply_filters(&#38;#39;get_latest_topics_where&#38;#39;,&#38;#39;&#38;#39;);
$most_views = $bbdb-&#38;gt;get_results(&#38;quot;SELECT topic_id FROM $bbdb-&#38;gt;topicmeta WHERE meta_key=&#38;#39;views&#38;#39; ORDER BY cast(meta_value as UNSIGNED) $sort LIMIT $limit&#38;quot;);
foreach (array_keys($most_views) as $i) {$trans[$most_views[$i]-&#38;gt;topic_id] =&#38;#38; $most_views[$i];} $ids = join(&#38;#39;,&#38;#39;, array_keys($trans));
$topics =&#38;quot;SELECT * FROM $bbdb-&#38;gt;topics WHERE topic_status=0 AND topic_id IN ($ids) $where ORDER BY FIELD(topic_id, $ids)&#38;quot;;
$topics = $bbdb-&#38;gt;get_results($topics);
$view_count  = count($topics);
$topics = bb_append_meta( $topics, &#38;#39;topic&#38;#39; );
}}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;.&#60;br /&#62;
Absolutely no way to do that purely though BB_QUERY, at least to my limited knowledge. You'd have to hook BB_QUERY and check for what it's doing on every call and that's nasty.
&#60;/p&#62;</description>
</item>
<item>
<title>_ck_ on ""My Threads" - User Specific Views"</title>
<link>http://bbpress.org/forums/topic/my-threads-user-specific-views#post-9588</link>
<pubDate>Mon, 30 Jul 2007 07:42:09 +0000</pubDate>
<dc:creator>_ck_</dc:creator>
<guid isPermaLink="false">9588@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;Sigh, I guess I'll tempt fate and install the latest trunk. Though I know it's going to instantly break half a dozen plugins or more, so I need to do that when I have a full night to dedicate to it.&#60;/p&#62;
&#60;p&#62;I really like &#34;views&#34; and keep thinking of more helpful ones I can create that drill down through the data.&#60;/p&#62;
&#60;p&#62;&#60;em&#62;You should enquire about the development priorities and directions on the bbPress dev list though, you may get more joy there.&#60;/em&#62;&#60;/p&#62;
&#60;p&#62;I find it somewhat hilarious that a *forum* development team uses a mailing list for group communications. The year 2000 called - it wants it's static email posts back!
&#60;/p&#62;</description>
</item>
<item>
<title>sambauers on ""My Threads" - User Specific Views"</title>
<link>http://bbpress.org/forums/topic/my-threads-user-specific-views#post-9564</link>
<pubDate>Sun, 29 Jul 2007 15:53:19 +0000</pubDate>
<dc:creator>sambauers</dc:creator>
<guid isPermaLink="false">9564@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;I usually fix the bugs I find and then the trunk catches up with me a day or two later after I submit a patch....   ; )
&#60;/p&#62;</description>
</item>
<item>
<title>fel64 on ""My Threads" - User Specific Views"</title>
<link>http://bbpress.org/forums/topic/my-threads-user-specific-views#post-9563</link>
<pubDate>Sun, 29 Jul 2007 15:09:48 +0000</pubDate>
<dc:creator>fel64</dc:creator>
<guid isPermaLink="false">9563@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;Never had a problem. There's occasionally a bug in it but I've never noticed it and it was invariably fixed within a day or two. It's fine running it.
&#60;/p&#62;</description>
</item>
<item>
<title>HowToGeek on ""My Threads" - User Specific Views"</title>
<link>http://bbpress.org/forums/topic/my-threads-user-specific-views#post-9561</link>
<pubDate>Sun, 29 Jul 2007 13:48:09 +0000</pubDate>
<dc:creator>HowToGeek</dc:creator>
<guid isPermaLink="false">9561@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;Using standard 0.8.2.1 release... wasn't sure how stable the trunk is.
&#60;/p&#62;</description>
</item>
<item>
<title>sambauers on ""My Threads" - User Specific Views"</title>
<link>http://bbpress.org/forums/topic/my-threads-user-specific-views#post-9560</link>
<pubDate>Sun, 29 Jul 2007 13:46:58 +0000</pubDate>
<dc:creator>sambauers</dc:creator>
<guid isPermaLink="false">9560@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;&#38;gt; Any idea what I could be doing wrong here?&#60;/p&#62;
&#60;p&#62;Are you using the latest trunk or the standard 0.8.2.1 release?&#60;/p&#62;
&#60;p&#62;Latest trunk won't work with the above code.
&#60;/p&#62;</description>
</item>
<item>
<title>sambauers on ""My Threads" - User Specific Views"</title>
<link>http://bbpress.org/forums/topic/my-threads-user-specific-views#post-9559</link>
<pubDate>Sun, 29 Jul 2007 13:44:30 +0000</pubDate>
<dc:creator>sambauers</dc:creator>
<guid isPermaLink="false">9559@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;mdawaffe has committed to try and bring the point releases closer together. I believe there are no hard targets set, but it should be better than last time. I would estimate that 0.8.3 will be out within a month, but that is just an estimate. mdawaffe gets pulled from bbPress all the time to do other things.&#60;/p&#62;
&#60;p&#62;I can't talk with authority about the XML-RPC features being added, but they will potentially open up a whole heap of options for people wanting to connect their forums with other forums and blogs. You should enquire about the development priorities and directions on the bbPress dev list though, you may get more joy there.
&#60;/p&#62;</description>
</item>
<item>
<title>HowToGeek on ""My Threads" - User Specific Views"</title>
<link>http://bbpress.org/forums/topic/my-threads-user-specific-views#post-9558</link>
<pubDate>Sun, 29 Jul 2007 13:33:37 +0000</pubDate>
<dc:creator>HowToGeek</dc:creator>
<guid isPermaLink="false">9558@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;I activated this plugin, but when I click on the link for &#34;topics i've started&#34;, all I get is a white page... looking at a sql trace, it doesn't appear to be running the code at all.&#60;/p&#62;
&#60;p&#62;Any idea what I could be doing wrong here?
&#60;/p&#62;</description>
</item>
<item>
<title>HowToGeek on ""My Threads" - User Specific Views"</title>
<link>http://bbpress.org/forums/topic/my-threads-user-specific-views#post-9556</link>
<pubDate>Sun, 29 Jul 2007 13:28:36 +0000</pubDate>
<dc:creator>HowToGeek</dc:creator>
<guid isPermaLink="false">9556@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;I just noticed you said something about cache?   Is the cache working in the current bbPress release?
&#60;/p&#62;</description>
</item>
<item>
<title>_ck_ on ""My Threads" - User Specific Views"</title>
<link>http://bbpress.org/forums/topic/my-threads-user-specific-views#post-9552</link>
<pubDate>Sun, 29 Jul 2007 13:11:25 +0000</pubDate>
<dc:creator>_ck_</dc:creator>
<guid isPermaLink="false">9552@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;Forgive my ignorance but how long realistically would it be before the current trunk become the stable/released? Are we talking a few weeks or more like several months?&#60;/p&#62;
&#60;p&#62;Looking at the milestone history, it was five months between 0.8.1 and 0.8.2 but only a month between previous releases. Is that &#34;XML-RPC&#34; coding going to hold everything back  until it's done? (I'd seriously love to read why a ping mechanism is believed to be so important and the working model envisioned).
&#60;/p&#62;</description>
</item>
<item>
<title>sambauers on ""My Threads" - User Specific Views"</title>
<link>http://bbpress.org/forums/topic/my-threads-user-specific-views#post-9546</link>
<pubDate>Sun, 29 Jul 2007 12:12:38 +0000</pubDate>
<dc:creator>sambauers</dc:creator>
<guid isPermaLink="false">9546@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;&#38;gt; is there a method way to delete a view&#60;/p&#62;
&#60;p&#62;In current trunk...&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;bb_deregister_view( $view )&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>_ck_ on ""My Threads" - User Specific Views"</title>
<link>http://bbpress.org/forums/topic/my-threads-user-specific-views#post-9544</link>
<pubDate>Sun, 29 Jul 2007 11:38:25 +0000</pubDate>
<dc:creator>_ck_</dc:creator>
<guid isPermaLink="false">9544@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;Sam, is there a method way to delete a view&#60;br /&#62;
or do I have to just hack and unset the $views['view'] directly?
&#60;/p&#62;</description>
</item>
<item>
<title>_ck_ on ""My Threads" - User Specific Views"</title>
<link>http://bbpress.org/forums/topic/my-threads-user-specific-views#post-9543</link>
<pubDate>Sun, 29 Jul 2007 11:35:12 +0000</pubDate>
<dc:creator>_ck_</dc:creator>
<guid isPermaLink="false">9543@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;Ugh. So that breaks a view things I've done.&#60;/p&#62;
&#60;p&#62;I'm waiting for an addition to the plugin svn and I'll just update there at this point.  I also missed checking if the user is logged in, now fixed.&#60;/p&#62;
&#60;p&#62;I don't run the newest trunk so I don't have a way to test. Looks like I'll have to setup a test account and install it again.&#60;/p&#62;
&#60;p&#62;and I just put the finishes on a nice dropdown view box too... :-(&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;function views_dropdown() {
$views_dropdown=&#38;#39;&#38;lt;form name=&#38;quot;views_dropdown&#38;quot; id=&#38;quot;views_dropdown&#38;quot;&#38;gt;
&#38;lt;select  size=1  name=&#38;quot;views_dropdown_select&#38;quot; onchange=&#38;quot;if (this.selectedIndex != 0) {location=this.options[this.selectedIndex].value;}}&#38;quot;&#38;gt;
&#38;lt;option value=&#38;quot;#&#38;quot;&#38;gt;SHOW ME --------------&#38;gt; &#38;lt;/option&#38;gt;&#38;#39;;
$views=get_views(); foreach ($views as $view =&#38;gt; $title ) {
$views_dropdown.=&#38;#39;&#38;lt;option value=&#38;quot;&#38;#39;.get_view_link($view).&#38;#39;&#38;quot;&#38;gt;&#38;#39;.$views[$view].&#38;#39;&#38;lt;/option&#38;gt;&#38;#39;;
}
$views_dropdown.=&#38;#39;&#38;lt;/select&#38;gt;&#38;lt;/form&#38;gt;&#38;#39;; echo $views_dropdown;
}&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>sambauers on ""My Threads" - User Specific Views"</title>
<link>http://bbpress.org/forums/topic/my-threads-user-specific-views#post-9542</link>
<pubDate>Sun, 29 Jul 2007 11:30:59 +0000</pubDate>
<dc:creator>sambauers</dc:creator>
<guid isPermaLink="false">9542@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;You should be aware that views are registered differently in the latest versions in trunk. Views are now constructed using the BB_Query class.&#60;/p&#62;
&#60;p&#62;See the latest Support Forum plugin for a way to use both the new and old, although it is wrapped in a Class in there so the basic idea is:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;if (is_callable(&#38;#39;bb_register_view&#38;#39;)) { // Build 876+
    $query = &#38;lt;SOME ARRAY ACCEPTABLE TO BB_QUERY&#38;gt;;
    bb_register_view(&#38;#39;myview&#38;#39;, __(&#38;#39;My view name&#38;#39;), $query);
} else { // Build 214-875
    add_filter(&#38;#39;bb_views&#38;#39;, &#38;#39;my_addView&#38;#39;);
    add_action(&#38;#39;bb_custom_view&#38;#39;, &#38;#39;my_processView&#38;#39;);
}&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>_ck_ on ""My Threads" - User Specific Views"</title>
<link>http://bbpress.org/forums/topic/my-threads-user-specific-views#post-9535</link>
<pubDate>Sun, 29 Jul 2007 08:49:22 +0000</pubDate>
<dc:creator>_ck_</dc:creator>
<guid isPermaLink="false">9535@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;Wow I was making it too complicated! Try this...&#60;br /&#62;
I managed to use internal functions but there's a catch with get_recent_user_replies in that all topic data is not attached properly so I have to run through get_topic to pull all the cache data out again (the only proper way to do it without peeking in the cache directly)&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php
/*
Plugin Name: my views
Description:  views for a user&#38;#39;s topics started and other participated topics
Plugin URI:
Author:
Version: 0.01
*/ 

function my_views_filter( $views ) {
	global $views;
	$views[&#38;#39;my-topics&#38;#39;] = &#38;quot;Topics I&#38;#39;ve Started&#38;quot;;
	$views[&#38;#39;my-posts&#38;#39;] = &#38;quot;Topics I&#38;#39;ve Participated In&#38;quot;;
	return $views;
}
add_filter(&#38;#39;bb_views&#38;#39;, &#38;#39;my_views_filter&#38;#39;);

function my_views_action( $view ) {
global $bbdb, $topics, $view_count; $user_id=bb_get_current_user_info( &#38;#39;id&#38;#39; );
if ($view==&#38;#39;my-topics&#38;#39;)  {$topics=get_recent_user_threads($user_id); $view_count  = count($topics);}
if ($view==&#38;#39;my-posts&#38;#39;)   {
$posts=get_recent_user_replies($user_id);   $topics=&#38;quot;&#38;quot;;
foreach ($posts as $post) {$topics[]=get_topic($post-&#38;gt;topic_id );}
$topics=bb_append_meta( $topics, &#38;#39;topic&#38;#39; );
$view_count  = count($topics);}
}
add_action( &#38;#39;bb_custom_view&#38;#39;, &#38;#39;my_views_action&#38;#39; );

if (!function_exists(bb_get_view_title)) {
function bb_get_view_title($title) {
if (is_view()) {$title =  get_view_name(). &#38;#39; &#38;amp;laquo; &#38;#39; . bb_get_option( &#38;#39;name&#38;#39; ); }
return $title;
}
add_filter( &#38;#39;bb_get_title&#38;#39;, &#38;#39;bb_get_view_title&#38;#39; );
}

?&#38;gt;&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>_ck_ on ""My Threads" - User Specific Views"</title>
<link>http://bbpress.org/forums/topic/my-threads-user-specific-views#post-9532</link>
<pubDate>Sun, 29 Jul 2007 07:43:40 +0000</pubDate>
<dc:creator>_ck_</dc:creator>
<guid isPermaLink="false">9532@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;will have this working within an hour
&#60;/p&#62;</description>
</item>
<item>
<title>_ck_ on ""My Threads" - User Specific Views"</title>
<link>http://bbpress.org/forums/topic/my-threads-user-specific-views#post-9531</link>
<pubDate>Sun, 29 Jul 2007 07:20:50 +0000</pubDate>
<dc:creator>_ck_</dc:creator>
<guid isPermaLink="false">9531@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;I haven't seen them (doesn't mean it doesnt exist) but I've figured out  the framework on how to build and attach a view if you'd like to copy  my homework :D&#60;/p&#62;
&#60;p&#62;This is the code I whipped up for &#34;most-views&#34; and &#34;least-views&#34; (which requires the view count plugin to be installed (and inserting the views column in view.php)&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;function most_views_views( $views ) {
	global $views;
	$views[&#38;#39;most-views&#38;#39;] = &#38;#39;Topics with the most views&#38;#39;;
	return $views;
}
add_filter(&#38;#39;bb_views&#38;#39;, &#38;#39;most_views_views&#38;#39;);

function least_views_views( $views ) {
	global $views;
	$views[&#38;#39;least-views&#38;#39;] = &#38;#39;Topics with the least views&#38;#39;;
	return $views;
}
add_filter(&#38;#39;bb_views&#38;#39;, &#38;#39;least_views_views&#38;#39;);

function most_views( $view ) {
global $bbdb, $topics, $view_count;
if ($view==&#38;#39;most-views&#38;#39;)  {$sort=&#38;quot;DESC&#38;quot;;}
if ($view==&#38;#39;least-views&#38;#39;)  {$sort=&#38;quot;ASC&#38;quot;;}
if ($view==&#38;#39;least-views&#38;#39; &#124;&#124; $view==&#38;#39;most-views&#38;#39;)  {
$limit = bb_get_option(&#38;#39;page_topics&#38;#39;);
$where = apply_filters(&#38;#39;get_latest_topics_where&#38;#39;,&#38;#39;&#38;#39;);
$most_views = $bbdb-&#38;gt;get_results(&#38;quot;SELECT topic_id FROM $bbdb-&#38;gt;topicmeta WHERE meta_key=&#38;#39;views&#38;#39; ORDER BY cast(meta_value as UNSIGNED) $sort LIMIT $limit&#38;quot;);
foreach (array_keys($most_views) as $i) {$trans[$most_views[$i]-&#38;gt;topic_id] =&#38;#38; $most_views[$i];} $ids = join(&#38;#39;,&#38;#39;, array_keys($trans));
$topics =&#38;quot;SELECT * FROM $bbdb-&#38;gt;topics WHERE topic_status=0 AND topic_id IN ($ids) $where ORDER BY FIELD(topic_id, $ids)&#38;quot;;
$topics = $bbdb-&#38;gt;get_results($topics);
$view_count  = count($topics);
$topics = bb_append_meta( $topics, &#38;#39;topic&#38;#39; );
}
else {do_action( &#38;#39;bb_custom_view&#38;#39;, $view );}
}
add_action( &#38;#39;bb_custom_view&#38;#39;, &#38;#39;most_views&#38;#39; );&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;As you can see a new view requires both 1. an action 2. a filter&#60;/p&#62;
&#60;p&#62;Easy once you've seen it, but try figuring it out from scratch!&#60;/p&#62;
&#60;p&#62;This bit adds the title to view pages (missing by default in bbpress)&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;function bb_get_view_title($title) {
if (is_view()) {$title =  get_view_name(). &#38;#39; &#38;amp;laquo; &#38;#39; . bb_get_option( &#38;#39;name&#38;#39; ); }
return $title;
}
add_filter( &#38;#39;bb_get_title&#38;#39;, &#38;#39;bb_get_view_title&#38;#39; );&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>HowToGeek on ""My Threads" - User Specific Views"</title>
<link>http://bbpress.org/forums/topic/my-threads-user-specific-views#post-9530</link>
<pubDate>Sun, 29 Jul 2007 06:21:40 +0000</pubDate>
<dc:creator>HowToGeek</dc:creator>
<guid isPermaLink="false">9530@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;I'd like to be able to offer two views for the users, which would work similarly to the &#34;Threads with no tags&#34; views at the bottom of the screen.&#60;/p&#62;
&#60;p&#62;1) Threads I've started&#60;br /&#62;
2) Threads I've commented on&#60;/p&#62;
&#60;p&#62;Are there already plugins for these views, or do I need to make my own?
&#60;/p&#62;</description>
</item>

</channel>
</rss>
