Commits

Anonymous committed 0be125b

Added "your groups' blogs" page.

Comments (0)

Files changed (5)

elgg/mod/blog/groups.php

+<?php
+
+	/**
+	 * Elgg blog groups page
+	 * 
+	 * @package ElggBlog
+	 */
+
+	define('everyoneblog','true');
+	// Get the current page's owner
+	$page_owner = page_owner_entity();
+	if ($page_owner === false || is_null($page_owner)) {
+		$page_owner = $_SESSION['user'];
+		set_page_owner($_SESSION['guid']);
+	}
+	if ((!($page_owner instanceof ElggEntity) || !$page_owner->isFriend()) && ($page_owner != $_SESSION['user'])) forward();
+
+	$page_owner_groups =  elgg_get_entities_from_relationship(array('relationship' => 'member', 'relationship_guid' => $page_owner->getGUID(), 'inverse_relationship' => FALSE, 'limit' => 0));
+	$group_guids = array();
+	foreach($page_owner_groups as $group){
+		$group_guids[] = sanitize_int($group->guid);
+	}
+	//$container_guids = get_input('group_guid', $group_guids);
+	$container_guids = $group_guids;
+
+	//set the title
+	$title = elgg_echo('blog:yourgroups');
+	$area2 = elgg_view_title($title);
+		
+	// Get a list of blog posts
+	// note: this does not pass offset because list_user_friends_objects gets it from input
+	$area2 .= elgg_list_entities(array('type'=>'object', 'subtype'=>'blog', 'container_guids'=>$container_guids, 'full_view'=>false));
+	
+	$area3 = elgg_view('sidetagcloud/tagcloud',array('type'=>'object', 'subtype'=>'blog', 'container_guids'=>$container_guids));
+		
+	// Display them in the page
+        $body = elgg_view_layout("two_column_left_sidebar", '', $area1 . $area2, $area3);
+		
+	// Display page
+	page_draw($title, $body);
+		
+?>

elgg/mod/blog/languages/ca.php

 	 'blog:your'  =>  "El teu bloc" , 
 	 'blog:posttitle'  =>  "el bloc de %s: %s" , 
 	 'blog:friends'  =>  "Els blocs de les amistats" , 
+	 'blog:groups' => "Els blocs dels grups" ,
 	 'blog:yourfriends'  =>  "últims blocs de les teves amistats" , 
+	 'blog:yourgroups' => "últims blocs dels teus grups" ,
 	 'blog:everyone'  =>  "Tots els blocs" , 
 	 'blog:newpost'  =>  "Afegir entrada al bloc" , 
 	 'blog:via'  =>  "A través del bloc" , 
 
 add_translation('ca', $catalan); 
 
-?>
+?>

elgg/mod/blog/languages/en.php

 			'blog:your' => "Your blog",
 			'blog:posttitle' => "%s's blog: %s",
 			'blog:friends' => "Friends' blogs",
+			'blog:groups' => "Groups' blogs",
 			'blog:yourfriends' => "Your friends' latest blogs",
+			'blog:yourgroups' => "Your groups' latest blogs",
 			'blog:everyone' => "All site blogs",
 			'blog:newpost' => "New blog post",
 			'blog:via' => "via blog",

elgg/mod/blog/languages/es.php

 	 'blog:your'  =>  "Mi blog" , 
 	 'blog:posttitle'  =>  "Blog de %s: %s" , 
 	 'blog:friends'  =>  "Blogs de tus amigxs" , 
+	 'blog:groups' => "Blogs de tus grupos" ,
 	 'blog:yourfriends'  =>  "Blogs recientes de tus amigxs" , 
+	 'blog:yourgroups' => "Blogs recientes de tus grupos" ,
 	 'blog:everyone'  =>  "Todos los blogs de la red" , 
 	 'blog:read'  =>  "Leer blog" , 
 	 'blog:addpost'  =>  "Escribir una nota en el blog" , 

elgg/mod/blog/start.php

 					if ((page_owner() == $_SESSION['guid'] || !page_owner()) && isloggedin()) {
 						add_submenu_item(elgg_echo('blog:your'),$CONFIG->wwwroot."pg/blog/owner/" . $_SESSION['user']->username);
 						add_submenu_item(elgg_echo('blog:friends'),$CONFIG->wwwroot."pg/blog/friends/" . $_SESSION['user']->username);
+						add_submenu_item(elgg_echo('blog:groups'),$CONFIG->wwwroot."pg/blog/groups/");
 						add_submenu_item(elgg_echo('blog:everyone'),$CONFIG->wwwroot."pg/blog/all/");
 						
 					} else if (page_owner()) {
 					set_input('username', $page[1]);
 					include(dirname(__FILE__) . "/friends.php");
 					break;
+				case "groups":
+					set_input('group_guid', $page[1]);
+					include(dirname(__FILE__) . "/groups.php");
+					break;
 				case "all":
 					include(dirname(__FILE__) . "/everyone.php");
 					break;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.