Changeset 1600
- Timestamp:
- 06/09/08 07:43:03 (5 months ago)
- Files:
-
- devel/mod/blog/lib/weblogs_friends_view.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
devel/mod/blog/lib/weblogs_friends_view.php
r1540 r1600 16 16 $friends = run("friends:get",array($page_owner)); 17 17 18 if (!empty($friends)) { 18 19 19 $where2 = "weblog IN (" ; 20 $first=true; 21 // Uncoment the following lines if you want to see your own post in the friends list 22 //$where2 .= $page_owner; 23 //$first=false; 20 $where2 = "weblog IN (" ; 21 $first=true; 22 23 // Uncoment the following lines if you want to see your own post in the friends list 24 //$where2 .= $page_owner; 25 //$first=false; 24 26 25 if (!empty($friends)) {26 27 foreach($friends as $friend) { 27 28 if (!$first) { … … 31 32 $first=false; 32 33 } 34 $where2 .= ")"; 35 36 } 37 else { 38 $where2 = ''; 33 39 } 34 $where2 .= ")";35 40 36 41 //Getting the field from the context extension … … 75 80 // $posts = $_SESSION['friends_posts_cache']->data; 76 81 error_log('('.$where1.') AND ('.$where2.') '.$where3); 77 $posts = get_records_select('weblog_posts','('.$where1.') AND ('.$where2.') '.$where3,null,'posted DESC','*',$weblog_offset,POSTS_PER_PAGE); 78 $numberofposts = count_records_select('weblog_posts','('.$where1.') AND ('.$where2.') ' .$where3); 79 if (!empty($posts)) { 82 83 $posts = array(); 84 $numberofposts = array(); 85 86 if (!empty($friends)) { 87 $posts = get_records_select('weblog_posts','('.$where1.') AND ('.$where2.') '.$where3,null,'posted DESC','*',$weblog_offset,POSTS_PER_PAGE); 88 $numberofposts = count_records_select('weblog_posts','('.$where1.') AND ('.$where2.') ' .$where3); 89 } 90 // Don't update this if you don't have any friends 91 if (!empty($friends) && !empty($posts)) { 80 92 81 93 $lasttime = ""; … … 124 136 else{ 125 137 $type =(isset($extraType))?$extraType:$extensionContext; 126 $run_result = "<p>".sprintf(__gettext("Your friends currently don't have any %s"), strtolower($type))."</p>"; 138 139 if (empty($friends)) { 140 141 $run_result = "<p>".sprintf(__gettext("You don't currently have any friends."))."</p>"; 142 } 143 else { 144 145 $run_result = "<p>".sprintf(__gettext("Your friends currently don't have any blog posts."))."</p>"; 146 } 127 147 } 128 148 ?>
