Recent Topics

1 Jul 16, 2008 12:43    

My b2evolution Version: Not Entered

Hi,
Ive installed just installed this, and love it so far. Ive done a search, but am currently wading through 20 odd pages of posts, so i thought Id post to see if someone comes up with a quick answer.

Im trying to make a private blog. Ive added the line to _basic_config.php to ensure users login. this is ok.
Then after the user logs in they are directed to a default blog, and then what i would like is a list alike "Same owner's blog list" but a list of blogs that the user is a member of. Is this possible? or can someone point me in the right direction?

Thanks

2 Jul 23, 2008 12:24

<?
**
 * This file implements the xyz Widget class.
 *
 * This file is part of the evoCore framework - {@link http://evocore.net/}
 * See also {@link http://sourceforge.net/projects/evocms/}.
 *
 * @copyright (c)2003-2008 by Francois PLANQUE - {@link http://fplanque.net/}
 *
 * {@internal License choice
 * - If you have received this file as part of a package, please find the license.txt file in
 *   the same folder or the closest folder above for complete license terms.
 * - If you have received this file individually (e-g: from http://evocms.cvs.sourceforge.net/)
 *   then you must choose one of the following licenses before using the file:
 *   - GNU General Public License 2 (GPL) - http://www.opensource.org/licenses/gpl-license.php
 *   - Mozilla Public License 1.1 (MPL) - http://www.opensource.org/licenses/mozilla1.1.php
 * }}
 *
 * @package evocore
 *
 * {@internal Below is a list of authors who have contributed to design/coding of this file: }}
 * @author fplanque: Francois PLANQUE.
 *
 * @version $Id: _colls_list_owner.widget.php,v 1.2 2008/01/21 09:35:37 fplanque Exp $
 */
if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );

load_class( 'widgets/model/_widget.class.php' );
/**
 * ComponentWidget Class
 *
 * A ComponentWidget is a displayable entity that can be placed into a Container on a web page.
 *
 * @package evocore
 */
class colls_list_owner_Widget extends ComponentWidget
{
	/**
	 * Constructor
	 */
	function colls_list_owner_Widget( $db_row = NULL )
	{
		// Call parent constructor:
		parent::ComponentWidget( $db_row, 'core', 'colls_list_owner' );
	}

	/**
	 * Get name of widget
	 */
	function get_name()
	{
		return T_('Members blog list');
	}

  /**
	 * Get short description
	 */
	function get_desc()
	{
		return T_('Display list of all blogs that the user is a member of.');
	}


	/**
	 * Display the widget!
	 *
	 * @param array MUST contain at least the basic display params
	 */
	function display( $params )
	{
		$this->init_display( $params );

		$this->disp_coll_list( 'owner' );

		return true;
	}
}

?>

Ive found the widget, how can i ammend this code to show just the blogs that the member has the rights to?

3 Jul 23, 2008 16:28

Hi Pilly. I missed this one else I would have replied. Such is life eh?

What you seek is technically possible BUT has not been done to the best of my knowledge. So like "public blog list" has everything that is public, "same owners list" has stuff you own, but you seek a "is member of" bloglist. Cool idea.

hmmm... just thinking a bit, but that would mean a visitor who is not a member of any blog would have no bloglist to play with, or would you use both widgets. Would it be cool if the "all public blogs" bloglist had a way to highlight the fact that this is a blog you can post in? Like maybe with a style sheet thingie to bold it or something?

Anyway yeah it's possible but yeah it hasn't been done yet. Sorry :(

4 Jul 23, 2008 16:30

Hi,
thanks for replying.
im using this software as a private blog, so every user has to login and therefore got some sort of user rights.
ive been looking at the wiki but not comming up with much. Even if i use the sample widget in the wiki i cant get it to show up in the widget list.

5 Jul 23, 2008 16:37

I think you can set posting status to default to "protected" and use the permissions settings to disable bloggers from posting "published". This would mean that only bloggers who are members of a blog will see the posts.

Methinks that'll get you where you want to be?

6 Jul 23, 2008 16:39


1.	in conf/_admin.php 
		$default_post_status = 'protected';
	
2. in conf/_basic_config.php  (at top)
		$login_required = true;

Ive already done this in order to make everything private etc. Just could do with a guiding hand to get this to work.

7 Jul 23, 2008 16:43

Posting "protected" will give you what you want. People will not be able to access content in a blog they are not a member of.

8 Jul 23, 2008 16:49

ok, i understand that, but how do i display only the blogs that they are allowed to view then?

9 Jul 23, 2008 16:54

Answering to your first post...
In the widget you specified edit this function

   /**
    * Display the widget!
    *
    * @param array MUST contain at least the basic display params
    */
   function display( $params )
   {
      $this->init_display( $params );

      $this->disp_coll_list( 'member' );

      return true;
   } 

Then edit inc/widgets/model/_widget.class.php line 643

if( $filter == 'owner' )
{	// Load blogs of same owner
	$blog_array = $BlogCache->load_owner_blogs( $Blog->owner_user_ID, 'ID' );
}
elseif( $filter == 'member' )
{	// Load blogs a user has permissions for
	$blog_array = $BlogCache->load_user_blogs();
}
else
{	// Load all public blogs
	$blog_array = $BlogCache->load_public( 'ID' );
}

Not tested ;)

10 Jul 23, 2008 16:55

awesome I'll test it now, i did have a problem getting the widget to display in the widget list. any ideas where they go?

11 Jul 23, 2008 17:01

i did have a problem getting the widget to display in the widget list. any ideas where they go?

I have no such problem, just install this widget like all other.

12 Jul 23, 2008 17:08

ive renamed the widget to _colls_list_member.widget.php and uploaded to the inc/widgets/widgets/ dir and the class file to its relevant directory, but when i click install i cannot see the widget to install?

13 Jul 23, 2008 17:10

You don't have to rename the widget. Just edit what I wrote, that's it.

15 Aug 28, 2008 14:11

- And what if one is using the very nice "Sorted Public bloglist" ? In other words: What could I write (in the plugins/_sorted_bloglist.plugin.php ?) that would give the same very nice effect as:

PHP:
if( $filter == 'owner' )
{ // Load blogs of same owner
$blog_array = $BlogCache->load_owner_blogs( $Blog->owner_user_ID, 'ID' );
}
elseif( $filter == 'member' )
{ // Load blogs a user has permissions for
$blog_array = $BlogCache->load_user_blogs();
}
else
{ // Load all public blogs
$blog_array = $BlogCache->load_public( 'ID' );
}

- in inc/widgets/model/_widget.class.php line 643 for the "Public blog list" ?

16 Aug 28, 2008 18:30

In the current version of the Public Bloglist plugin the member part is implemented. So each user will only 'see' the blogs he is subscribed to. In the development version of the plugin I'm half way enabling 'Owner Blogs' as an option. I just didn't think one would be interested in that but I'll finish this part tonight.

Not again that disabling from view in the Sorted Public Bloglist does not hide blogs to the world.

Good luck

18 Sep 01, 2008 10:38

Thanks for answering me so patiently, even if the same question had already been asked (and answered) in other posts :-/

I installed the new version 0.9, but something must be wrong, since I keep getting the error message:

Fatal error: Call to undefined function: get_member_blogs() in ...plugins/sorted_bloglist_plugin/_sorted_bloglist.plugin.php on line 300

-when checking the "Show Member blogs" for showing "public blogs *plus* hidden blogs where a user is 'Member' of".

If you or somebody else can assure me that "_sorted bloglist.plugin.php" is working perfectly as it is, I'd appreciate a clue of what else could be wrong in my case ?

PS: When following the instructions for "Public blogs" above, everything seems to work perfectly


Form is loading...