Plugin

Archived
Forum
(read-only)

Commenters

ExpressionEngine 1.x, ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From Laisvunas

     

Display commenters Avatars?

General

Ryan Vosburg
Ryan Vosburg

I am setting up a top commenters section on a project of mine and would just like to pull the commenters usernames and avatars. Is this possible with this plugin?

Laisvunas
# 1
Developer
Laisvunas

Hi Ryan,

A good idea!

I realeased version 1.7 of Commenters plugin. In it I added three variables which can be used inside {commenters_author}{/commenters_author} variable pair:

1) commenters_author_avatar_url - outputs URL to the avatar image associated with the comment’s author. Typically used as such:

{if commenters_author_avatar_url}<img  src="{commenters_author_avatar_url}" width="{commenters_author_avatar_width}" height="{commenters_author_avatar_height}" alt="{commenters_author_screen_name}'s avatar" />{/if} 

2) commenters_author_avatar_width - outputs width of the avatar image associated with the comment’s author.

3) commenters_author_avatar_height - outputs height of the avatar image associated with the comment’s author.

Using these variables you should be able to achieve what you need.

Ryan Vosburg
# 2
Ryan Vosburg

Thanks for the reply. Works perfect for my needs
I am however occasionally getting these errors…

A PHP Error was encountered

Severity
Notice

Message
unserialize() [function.unserialize]Error at offset 0 of 2452 bytes

Filename
commenters/pi.commenters.php

Line Number
477 

is there a place to enter serial possibly? Couldn’t find anywhere

Laisvunas
# 3
Developer
Laisvunas

Hi Ryan,

Try the version 1.7.1 and tell me if something goes wrong.

Ryan Vosburg
# 4
Ryan Vosburg

That fixes the issue but brings up another…

Avatars are no longer displaying!

Laisvunas
# 5
Developer
Laisvunas

Hi Ryan,

Try the version 1.7.2.

It’s unknown what’s causing this issue. Probably something wrong is with exp_sites database table. If this fix will not work the dump file of exp_sites table will be needed.

Laisvunas
# 6
Developer
Laisvunas

Rather try the version 1.7.3 - found a new idea what might not working.

Ryan Vosburg
# 7
Ryan Vosburg

Since switching site from domain.com/staging to domain.com I am getting this php error.. switch back to /staging and it goes away. Using 1.7.3

A PHP Error was encountered

Severity
Notice

Message
Undefined offset0

Filename
commenters/pi.commenters.php

Line Number
752 
Laisvunas
# 8
Developer
Laisvunas

Hi Ryan,

Please, post URL of the page which outputs this PHP error.

Ryan Vosburg
# 9
Ryan Vosburg

http://bit.ly/jbfm0E vs http://bit.ly/oqJSJu

Ryan Vosburg
# 10
Ryan Vosburg

any update on this. Site is planned to go live Monday and want to have this feature at launch!

Laisvunas
# 11
Developer
Laisvunas

Hi Ryan,

I fixed this issue. Install the version 1.7.4 and tell me if something goes wrong.

Ryan Vosburg
# 12
Ryan Vosburg

Confirmed!

Ryan Vosburg
# 13
Ryan Vosburg

Laisvunas what about {url_as_author} and {url} for showing profiles of members?

Something like {commenters_author_url} would do the trick ;)

Laisvunas
# 14
Developer
Laisvunas

Hi Ryan,

If you need to display links to ExpressionEngine Forum module’s member profiles, then you don’t need a new variable.

ExpressionEngine Forum module’s member profiles has URLs formed as this:

http://mysite.com/forums/member/789/ 

where the last segment is member_id. You can easily form such URLs this way:

{site_url}forums/member/{commenters_author_id}