Changeset 1296
- Timestamp:
- 08/19/08 09:32:32 (3 months ago)
- Files:
-
- my-views/trunk/my-views-started-participated-topics.php (modified) (4 diffs)
- my-views/trunk/my-views.php (modified) (4 diffs)
- my-views/trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
my-views/trunk/my-views-started-participated-topics.php
r998 r1296 6 6 Author: _ck_ 7 7 Author URI: http://bbShowcase.org 8 Version: 0.1. 18 Version: 0.1.2 9 9 */ 10 10 11 11 if (is_callable('bb_register_view')) { // Build 876+ alpha trunk 12 12 13 function my_views_add_started_participated_topics() { 13 function my_views_add_started_participated_topics() { 14 14 $query = array('append_meta'=>false,'sticky'=>false); // attempt to short-circuit bb_query 15 15 bb_register_view("latest-discussions","Latest Discussions", $query); 16 16 if (bb_is_user_logged_in()) { 17 if (function_exists('unread_posts_init') ) {bb_register_view("new-posts","Topics with new posts",$query);} 17 18 bb_register_view("my-topics","Topics I've Started",$query); 18 bb_register_view("my-posts","Topics I've Participated In",$query); 19 bb_register_view("my-posts","Topics I've Participated In",$query); 19 20 } 20 21 } … … 27 28 $views['latest-discussions'] = "Latest Discussions"; 28 29 if (bb_is_user_logged_in()) { 30 if (function_exists('unread_posts_init') ) {$views['new-posts'] = "Topics with new posts";} 29 31 $views['my-topics'] = "Topics I've Started"; 30 32 $views['my-posts'] = "Topics I've Participated In"; … … 39 41 $user_id=bb_get_current_user_info( 'id' ); 40 42 41 if ($view=='latest-discussions' || ($user_id && ($view=='my-topics' || $view=='my-posts' ))) {43 if ($view=='latest-discussions' || ($user_id && ($view=='my-topics' || $view=='my-posts' || $view=='new-posts'))) { 42 44 // $topics=get_recent_user_threads($user_id); $view_count = count($topics); 43 45 $limit = bb_get_option('page_topics'); … … 58 60 $where = $where." AND topic_id IN ($ids) "; 59 61 } 62 63 elseif ($view=='new-posts') { 64 global $up_last_login, $up_read_topics, $up_read_posts; 65 $where= $where." AND topic_time>'".gmdate("Y-m-d H:i:s",$up_last_login-86400*2)."' "; // go back 48 hours just to give them something if empty 66 if (isset($up_read_posts) && is_array($up_read_posts)) { 67 $where.=" AND topic_id IN {".implode(',',$up_read_topics)."} AND topic_last_post_id NOT IN {".implode(',',$up_read_posts)."} "; 68 } 69 } 60 70 } 61 71 $query = " FROM $bbdb->topics $where "; my-views/trunk/my-views.php
r998 r1296 6 6 Author: _ck_ 7 7 Author URI: http://bbShowcase.org 8 Version: 0.1.1 9 10 History 11 0.03 : first public release, for 0.8.2.x only 12 0.04 : now trunk compatibility 13 0.05 : breakup of view modules into seperate, optional plugins 14 0.06 : available/installed plugins improvements (totals, sorting) 15 0.07 : additional modules (statistics, available themes) Statistics is not finished yet and Themes requires bbPress Theme Switcher 16 0.08 : bug fix for passthrough adding views to 0.8.2.x , optional header & footer for internal views, optional .my_views_header class 17 0.09 : pagination (multi-page) support added for versions >0.8.3 & add label "pages: " (or any text) to list of pages 18 0.091 : quick fix for removing duplicated/misplaced stickies & incorrect sorting orders 19 20 To Do: 21 admin interface 22 deal with stickies confusing view results 23 rename views 24 make table sort optional 25 translation ability 26 27 Features: 28 ability to change view list order 29 remove any view 30 label list of pages with "pages: " or any custom text 31 8 Version: 0.1.2 9 10 License: CC-GNU-GPL http://creativecommons.org/licenses/GPL/2.0/ 11 12 Donate: http://amazon.com/paypage/P2FBORKDEFQIVM 32 13 */ 33 14 … … 38 19 39 20 $my_views['prefered_order']=array( // force views to list in the order that you desire 40 "latest-discussions","no-replies","untagged","my-topics","my-posts"," most-views","most-posts","least-views","least-posts","support-forum-no",21 "latest-discussions","no-replies","untagged","my-topics","my-posts","new-posts","most-views","most-posts","least-views","least-posts","support-forum-no", 41 22 "installed-plugins","available-plugins","installed-themes","available-themes","statistics" 42 23 ); … … 298 279 299 280 function ts_sort_recursive_comma(a,b) { 281 try { 300 282 aa = parseInt(ts_getInnerText(a.cells[SORT_COLUMN_INDEX]).replace(/[^0-9]/g,'')); 301 283 if (isNaN(aa)) aa = 0; … … 303 285 if (isNaN(bb)) bb = 0; 304 286 return aa - bb; 287 } catch(dummy) {return 0;} 305 288 } 306 289 my-views/trunk/readme.txt
r998 r1296 3 3 Contributors: _ck_ 4 4 Requires at least: 0.8.2 5 Tested up to: trunk alpha 10755 Tested up to: 0.9.0.2 6 6 Stable tag: trunk 7 7 Donate link: http://amazon.com/paypage/P2FBORKDEFQIVM … … 103 103 * fix for improper WHERE filter use to peacefully co-exist with Hidden Forums plugin 104 104 105 Version 0.1.2 (2008-08-19) 105 106 107 * additional view: "Topics with new posts" (requires Unread Posts plugin by _ck_ ) Part of "started-participated" view. 108 109 == To Do == 110 111 * admin interface 112 113 * deal with stickies confusing view results 114 115 * rename views 116 117 * make table sort optional 118 119 * translation ability 120 121
