Gravatar plugin problem

Gravatar plugin problem

Postby newtech1 on Wed Mar 10, 2010 3:59 am

When I go to Control Centre and click on the link for the gravatar plugin, I get a 500 error and the path in the browser is:
http://www.cmydomain.com/blog/admin.php?op=gravatar

When I go to my error log it states:
PHP Fatal error: Non-static method Glob::Glob() cannot be called statically, assuming $this from incompatible context in /blog/plugins/gravatar/class/avatars/avatars.class.php on line 20

When I go to avatars.class.php line 20, it shows:
$gifImages = Glob::glob( AVATAR_FILE_PATH , '*.gif');

As far as I can tell, any existing gravatars on blogs are working.
newtech1
 
Posts: 593
Joined: Thu Oct 13, 2005 12:02 am
Location: Seattle, WA, USA

Re: Gravatar plugin problem

Postby newtech1 on Thu Mar 11, 2010 10:25 am

OK, I see there is a fix for this.

Replace
Code: Select all
            $gifImages = Glob::glob( AVATAR_FILE_PATH , '*.gif');
            $jpgImages = Glob::glob( AVATAR_FILE_PATH , '*.jpg');


With
Code: Select all
            $glob = new Glob();
            $gifImages = $glob->glob(AVATAR_FILE_PATH , '*.gif');
            $jpgImages = $glob->glob(AVATAR_FILE_PATH , '*.jpg');


Next question
How can I make a different avatar to show up as the default avatar instead of the one that currently shows up as the default? In other words I want it when a user goes to activate this plugin that the checkmark for default avatar is different than the one that it is now.
Richard D'Andrea Dover
http://www.christianblogsites.com
newtech1
 
Posts: 593
Joined: Thu Oct 13, 2005 12:02 am
Location: Seattle, WA, USA

Re: Gravatar plugin problem

Postby jondaley on Sun Mar 14, 2010 9:44 am

Yes, I fixed that a couple months ago, so you can simply download the new version from sourceforge. (you should check for new plugin versions from time to time - in the version checker in the administration, it will tell you if there are new plugins available).
jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch

Re: Gravatar plugin problem

Postby jondaley on Sun Mar 14, 2010 9:47 am

It looks like it uses "default.jpg" by default? I don't use this plugin myself, but it looks like that is set in class/view/plugingravatarconfigview.class.php on the line that says:
if ($default == """) $default = "default.jpg".

I only looked quickly, so there might be another place to look too, but it is something like that.
I'd also check in the global plugin settings, as it looks like you might be able to simply set the default there, and check the box to let the user override the setting.
jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch

Re: Gravatar plugin problem

Postby newtech1 on Mon Mar 15, 2010 12:18 pm

Yes, you can change the default in the global plugin settings but it does not show in the dropdown my image path.jpg, only what comes with the package. This is the case even though I have the following in the plugingravatar.class.php:
Array( "name" => "plugin_gravatar_default", "type" => "list", "options" => Array( "baby.jpg" => "baby.jpg", "bigson.jpg" => "bigson.jpg", "daughter.jpg" => "daughter.jpg", "default.jpg" => "default.jpg", "father.jpg" => "father.jpg", "mother.jpg" => "mother.jpg", "path.jpg" => "path.jpg"

However, in the Conrol Panel Plugin settings, the user can choose whatever images are in my avatars folder.

Something strang just happened,but I now have what I want.
I just went into class/view/plugingravatarconfigview.class.php and changed the default to be path.jpg. Then went into user gravatar plug in settings. Still showed the default.jpg as the checked default.
However, then I went back into admin global plugin settings and path.jpg was suddenly in the dropdown menu. So I chose it, and it is now the default image in the user plugin setting.
Richard D'Andrea Dover
http://www.christianblogsites.com
newtech1
 
Posts: 593
Joined: Thu Oct 13, 2005 12:02 am
Location: Seattle, WA, USA

Re: Gravatar plugin problem

Postby jondaley on Mon Mar 15, 2010 6:40 pm

Hrm, that sounds like a bug, as I don't think it should have shown on the global screen ever, except for the default list that comes with the plugin. Can you open a bug report for it, so I can see why that is happening?
jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch

Re: Gravatar plugin problem

Postby jondaley on Mon Mar 15, 2010 6:41 pm

As for actually fixing the problem you have/had, the plugin could be rewritten to scan the folder just like the control center setting does, so you could open a feature request report for that, but it should be separate from the previous bug report I asked you to create.
jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch

Re: Gravatar plugin problem

Postby newtech1 on Mon Mar 15, 2010 10:23 pm

Hrm, that sounds like a bug, as I don't think it should have shown on the global screen ever, except for the default list that comes with the plugin. Can you open a bug report for it, so I can see why that is happening?

This part is not a bug because the reason that it should up and should have shown up at the beginning is because I added "path.jpg" => "path.jpg" to the default list that comes with the plugin.

Where I would think it is a bug is that if I have added it to the default list in plugingravatar.class.php, then it should up in the global setting dropdown list. However it does not unless you go into class/view/plugingravatarconfigview.class.php and change the default to be path.jpg.

The problem with the above solution is that if you added several images in the default global list, how would you be able to get the rest of them to show up in the global setting?
Richard D'Andrea Dover
http://www.christianblogsites.com
newtech1
 
Posts: 593
Joined: Thu Oct 13, 2005 12:02 am
Location: Seattle, WA, USA

Re: Gravatar plugin problem

Postby jondaley on Wed Mar 17, 2010 12:28 pm

Right, but you aren't understanding how things get added to the global list.
jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch


Return to General Plugin Development

cron