Avatar

Hi,

I downloaded and installed the Avatar plugin. It seems to work but I am not able to display blog images.

I uploaded GIF image from back end and it says “Settings saved.” but no image is displayed there, when I check my blog, it is showing the default image.

I want the bloggers on my site to have a simple option of uploading their own pictures so that it can be shown on the side of their blogs.

Please help!

Thanks

  • drmike
    • DEV MAN’s Mascot

    It’s always a plus when asking for support to include a link so we can see what’s occurring. When talking about avatars, also please let us know what the image is supposed to look like.

    Chances are you’re looking at the avatar cached by your browser. Doing a forced reload (CTRL-F5 with most OSes and browsers) of the page you;re looking at will probably clear it up.

  • thai916
    • WPMU DEV Initiate

    Hi drmike and Andrew,

    thanks for the prompt reponse. Here is the link http://wokar.net/blog/thai

    the tag i used in the sidebar is this => <?php echo get_blog_avatar(1,’128′,’identicon’:wink:; ?>

    i tried forced reload, even cleared the browser cache but no go.

    Yes Andrew I did add the rewrite rule to my .htaccess file

    RewriteRule ^(.*/)?avatar/(.*) wp-content/avatar.php?file=$2 [L]

    wat m i doing wrong?

  • Andrew
    • Champion of Loops

    Hiya,

    <?php echo get_blog_avatar(1,'128','identicon'); ?>

    The ‘1’ you have configured there is telling the function to display the avatar for the main blog (blog id 1). Try something like this:

    <?php echo get_blog_avatar($wpdb->blogid,'128','identicon'); ?>

    Thanks,

    Andrew

  • drmike
    • DEV MAN’s Mascot

    The code is being generated but something is messing it up. If you look at the source, you’ll see the code:

    <img alt='' src='http://wokar.net/blog/avatar/blog-4-128.png' class='avatar avatar-128' height='128' width='128' />

    Note to Andrew: How about putting in the username in the alt there? May be a good idea.

    The problem though is what your server is doing with that url. If you copy and paste the avatar url, your server is placing a trailing slash on the end and wordpress is thinking it’s a page within your site instead of a file to pull directly:

    http://wokar.net/blog/avatar/blog-4-128.png

    Please note your URL bar when you try to pull up that image.

    I’m at a loss on how to fix it though. I have a feeling that something is incorrect in your htaccess file but I’m sure Andrew will know more.

  • Andrew
    • Champion of Loops

    Hiya,

    The doc pretty much summed it up. Something isn’t correct in your .htaccess file. Some FTP clients have a hard time overwriting .htaccess files so try deleting the one on the server and uploading the edited version on your local machine.

    also, is it possible to customize the size of the image? like 250X180??

    Afraid not. There are four different sizes available though: 16, 32, 48, 96, 128

    Note to Andrew: How about putting in the username in the alt there? May be a good idea.

    That would require an additional query.

    Thanks,

    Andrew

  • thai916
    • WPMU DEV Initiate

    I tried by deleting and uploading .htaccess file, still no go

    this is how the content of my .htaccess file looks like

    RewriteEngine On

    RewriteBase /blog/

    #uploaded files

    RewriteRule ^(.*/)?files/$ index.php [L]

    RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*

    RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]

    # add a trailing slash to /wp-admin

    RewriteCond %{REQUEST_URI} ^.*/wp-admin$

    RewriteRule ^(.+)$ $1/ [R=301,L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]

    RewriteCond %{REQUEST_FILENAME} -d

    RewriteRule . – [L]

    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]

    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*.php)$ $2 [L]

    RewriteRule . index.php [L]

    RewriteRule ^(.*/)?avatar/(.*) wp-content/avatar.php?file=$2 [L]

    <IfModule mod_security.c>

    <Files async-upload.php>

    SecFilterEngine Off

    SecFilterScanPOST Off

    </Files>

    </IfModule>

  • thai916
    • WPMU DEV Initiate

    i’m a bit confused.. i noticed there are two .htaccess files. one in the root and another one in the subdirectory where i have installed my wordpress. which one should i edit?

    “Try moving the avatar rewrite rule so it’s under this line:

    RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]”

    i didn’t get it, can you plz explain a bit in detail

    thanks,

  • thai916
    • WPMU DEV Initiate

    OK. now my htaccess file looks like this =>

    RewriteEngine On

    RewriteBase /blog/

    #uploaded files

    RewriteRule ^(.*/)?files/$ index.php [L]

    RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*

    RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]

    # add a trailing slash to /wp-admin

    RewriteCond %{REQUEST_URI} ^.*/wp-admin$

    RewriteRule ^(.+)$ $1/ [R=301,L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]

    RewriteCond %{REQUEST_FILENAME} -d

    RewriteRule . – [L]

    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]

    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*.php)$ $2 [L]

    RewriteRule . index.php [L]

    RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]

    RewriteRule ^(.*/)?avatar/(.*) wp-content/avatar.php?file=$2 [L]

    <IfModule mod_security.c>

    <Files async-upload.php>

    SecFilterEngine Off

    SecFilterScanPOST Off

    </Files>

    </IfModule>

    but still no avatar is displayed. if u want i can even give u my wordpress admin password to you Andrew. would that be required ??

    please help!

  • thai916
    • WPMU DEV Initiate

    Hi Andrew,

    can you be clear on what I exactly need to do? I have pasted whatever is there on my .htaccess file. Can you please point out where the mistake is or WHAT needs to be added WHERE to fix the problem??? I’m sorry but your answers lately are very vague.

    thanks,

    Thai

  • drmike
    • DEV MAN’s Mascot

    You copied the line, not moved it. Please try this:

    RewriteEngine On
    RewriteBase /blog/

    #uploaded files
    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*
    RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]
    RewriteRule ^(.*/)?avatar/(.*) wp-content/avatar.php?file=$2 [L]

    # add a trailing slash to /wp-admin
    RewriteCond %{REQUEST_URI} ^.*/wp-admin$
    RewriteRule ^(.+)$ $1/ [R=301,L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule . - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*.php)$ $2 [L]
    RewriteRule . index.php [L]

    <IfModule mod_security.c>
    <Files async-upload.php>
    SecFilterEngine Off
    SecFilterScanPOST Off
    </Files>
    </IfModule>