Recent Topics

1 Aug 10, 2014 17:03    

Hi friends,
I use b2evolution 4.1.7 and i want to know how can i get link to user posts?
how can i see al the posts of some user in my blog system?

thanks

2 Aug 13, 2014 17:45

Hello @denis012:

If you upgrade to the latest stable version 5.0.9 (I strongly encourage you to update your site), besides new features and security enhancements, you will be able to see a list like this: http://forums.b2evolution.net/?disp=useritems&user_ID=8808.

However, in your current version, as explained here: http://b2evolution.net/man/url-params, by adding ?author=user_ID to your URL, the regular list of posts will be filtered to show only those posts that have been written by that user.

Regards!

3 Aug 13, 2014 23:59

Great! you helped me! its worked great.
can you tell me if can i get the number of posts by user?

4 Aug 15, 2014 10:00

Yes, there is a method in your version that may show you how many posts belong to the user. However, you will get the total count in the whole site, no matter in which blog they posted or what status have those posts at this moment.

Again, upgrade your site is a better idea than hack it, but this steps might help you:

1. Copy the file /skins/_user.disp.php to the skin folder that you want. If you need this change to take effect in all the skins, then just do not copy and edit the file as it.
2. Go to the line 103 of the mentioned file and insert the following block:


	$total_num_posts = $User->get_num_posts();

	if( $total_num_posts > 0 )
	{ // Make a link to page with user's posts
		$total_num_posts = '<a href="'.url_add_param( $Blog->gen_blogurl(), 'author='.$User->ID ).'"><b>'.$total_num_posts.'</b></a>';
	}
	else
	{
		$total_num_posts = '<b>'.$total_num_posts.'</b>';
	}

	$ProfileForm->info( T_('Number of posts'), $total_num_posts );

Now, the posts count will be shown in the user's profile and also a link to the filtered list that I mentioned in my previous comment.

5 Aug 15, 2014 11:17

Thanks you a lot!
i have another issue if can you helped me
how can i get the avatar in the _user.disp.php bigger?
i got this code
echo $User->get_avatar_imgtag( 'fit-160x160' );
when i change the 160X160 its does it smaller

6 Aug 15, 2014 14:58

The default line that I used to take the screenshot above was:


echo $User->get_avatar_imgtag( 'fit-640x480', 'rightmargin' );

Please note that there are three types of adjustments for the thumbnails: fit, crop and crop-top. They should be specified with the size that you want to show. The default available combinations are listed in this page: http://b2evolution.net/man/_advanced-php, and they also will depend on the size of the original image. For example: if the original image is 178x178px and you set fit-640x480, the displayed image will be 178x178px.

7 Aug 15, 2014 15:00

Thanks you a lot! you really helped me :]


Form is loading...