Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-03-15 07:31:12

Andrew
Plugin Author
Registered: 2004-02-23
Posts: 730

[plugin] [ORPHAN] ajw_favatar

This plugin requires Textpattern 1.0RC3 revision 180 or later

( <em>revs 142 thru 179 can make it work with a one-line hack </em>)

With all that craze wbout avatars and the like, I figured I’d baaaah like the rest of the sheep & plunk down a plugin now that per-comment data is available.

Summary

This plugin allows for display of favatars (favicon avatars) in comments and is intended to be used within your default comment form. The output is a complete image tag; if no image is found or some problem occurs, no image tag is output.

Download latest version: ajw_favatar (v0.2)

Read Documentation

Attributes

  • class (optional)
  • alt (optional)
  • format (optional)
  • usecache (optional, but recommended)
    • cachedir (optional)
    • cachetime (optional)

Examples

<txp:ajw_favatar class="favatar" usecache="1" cachedir="/images" />

Fresh result:
<img src="http://compooter.org/favicon.ico" class="favatar" />

Cached result:
<img src="/images/c4f840fc0614fbad08c0b1f4944728b1.ico" class="favatar" />

<txp:ajw_favatar class="favatar" usecache="1" format="html" />

Fresh result:
<img src="http://compooter.org/favicon.ico">

Cached result:
<img src="/images/cache/c4f840fc0614fbad08c0b1f4944728b1.ico">

Last edited by Andrew (2007-01-03 03:53:05)

Offline

#2 2005-03-16 14:25:58

rob_roy
Archived Plugin Author
Registered: 2005-02-28
Posts: 18

Re: [plugin] [ORPHAN] ajw_favatar

Hrm. Things don’t seem to actually be working for me. I’ve done some testing, and it seems to be using the most recent icon for every comment, rather than the icon that goes with each comment.

You can see a sample at http://auto.nomo.us/article/take-the-f-no-not-that-one. I’m using RC3, rev227 I think. Definately newer than 180.

Diagnostics look like this:

Textpattern version: 1.0rc3
Document root: /home/nomo/public_html/auto
$path_to_site: /home/nomo/public_html/auto
Textpattern path: /home/nomo/public_html/auto/textpattern
Permanent link mode: section_title
Temp folder: /tmp
Site URL: auto.nomo.us
PHP version: 4.3.10
Register globals: 1
Magic quotes: 1/0
Locale: en_US.UTF-8
Server: Apache/1.3.33 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 PHP/4.3.10 FrontPage/5.0.2.2635 mod_ssl/2.8.22 OpenSSL/0.9.7a
Apache version: Apache/1.3.33 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 PHP/4.3.10 FrontPage/5.0.2.2635 mod_ssl/2.8.22 OpenSSL/0.9.7a

Offline

#3 2005-03-16 14:27:01

rob_roy
Archived Plugin Author
Registered: 2005-02-28
Posts: 18

Re: [plugin] [ORPHAN] ajw_favatar

Oh, and my comments form is super simple, it looks like this:

<pre>
<p>
<txp:ajw_favatar class=“alignleft” usecache=“1” cachedir=”/images” cachetime=“604800” /> <txp:comment_name /> <txp:comment_time /> <txp:comment_permlink>#</txp:comment_permlink><br /> <txp:message />
</p>
<pre>

Last edited by rob_roy (2005-03-16 14:27:33)

Offline

#4 2005-03-16 16:21:38

ChrisJ
Member
From: Vienna, Austria
Registered: 2004-03-30
Posts: 54
Website

Re: [plugin] [ORPHAN] ajw_favatar

Works great for me and maybe I’ll use it after upgrading my site to TXP 1.0 when it comes out. Thanks, Andrew!

Offline

#5 2005-03-16 16:29:16

Andrew
Plugin Author
Registered: 2004-02-23
Posts: 730

Re: [plugin] [ORPHAN] ajw_favatar

Something tells me this one’s going to be tough to debug… Can anyone else confirm similar behavior? I’ve installed it on three sites without problems – two using php5 & one using php4.

Last edited by Andrew (2005-03-16 16:34:17)

Offline

#6 2005-03-16 17:40:57

Andrew
Plugin Author
Registered: 2004-02-23
Posts: 730

Re: [plugin] [ORPHAN] ajw_favatar

rob_roy, just to make sure – can you turn on error checking? (or alternatively download zem_debug to see if the plugin is throwing anything)

Offline

#7 2005-03-16 17:56:45

rob_roy
Archived Plugin Author
Registered: 2005-02-28
Posts: 18

Re: [plugin] [ORPHAN] ajw_favatar

The errors zem_debug reports are:

Error 8 Undefined index: PATH_INFO in sgb_url_checkpath(), /home/nomo/public_html/auto/textpattern/publish.php(711) : eval()’d code line 878
Error 8 Undefined variable: styleclass in beginning(), /home/nomo/public_html/auto/textpattern/publish.php(711) : eval()’d code line 716
Error 8 Undefined variable: styleclass in beginning(), /home/nomo/public_html/auto/textpattern/publish.php(711) : eval()’d code line 716
Error 8 Undefined variable: styleclass in beginning(), /home/nomo/public_html/auto/textpattern/publish.php(711) : eval()’d code line 716
Error 8 Undefined variable: styleclass in beginning(), /home/nomo/public_html/auto/textpattern/publish.php(711) : eval()’d code line 716
Error 8 Undefined variable: styleclass in beginning(), /home/nomo/public_html/auto/textpattern/publish.php(711) : eval()’d code line 716

That’s SGB_url_handler and PFA_beginning. I’ve tried turning off everything except AJW_favatar and ZEM_debug, and I still get the same behaviour, favatars are all the last one on the list.

Offline

#8 2005-03-16 22:42:54

Andrew
Plugin Author
Registered: 2004-02-23
Posts: 730

Re: [plugin] [ORPHAN] ajw_favatar

rob_roy, what you describe would be exactly what would occur if $thiscomment was not being parsed for each comment. I need you to check your comments.php file to see if it’s really updated and the $temp = parse($temp); line has been added.

Last edited by Andrew (2005-03-17 04:23:45)

Offline

#9 2005-03-17 18:30:56

rob_roy
Archived Plugin Author
Registered: 2005-02-28
Posts: 18

Re: [plugin] [ORPHAN] ajw_favatar

Weird. I swear I had updated to a very recent revision. I wonder if I somehow missed comment.php? Oh well, I’ve learned how to use subversion since then, so it shouldn’t be a problem anymore.

Thanks for the help, and sorry for the stupid mistake.

Offline

#10 2005-03-17 18:39:09

Andrew
Plugin Author
Registered: 2004-02-23
Posts: 730

Re: [plugin] [ORPHAN] ajw_favatar

No problem at all!

Offline

#11 2005-03-24 18:34:24

Andrew
Plugin Author
Registered: 2004-02-23
Posts: 730

Re: [plugin] [ORPHAN] ajw_favatar

A request for help:

I’ve noticed that from time to time my site will have trouble loading if the host of a commenter’s website is on the fritz. Obviously it has to do with the request for the favicon hanging up, but I haven’t been able to debug how to prevent it from happening. It seems to me that the set timeout and check for “timed out” should be enough, but i’m not sure.

This is, however, one of those problems (like you car occasionally not starting) that you can only really debug if it’s occurring at the moment you’re testing. And since you have no control over other webhosts, it makes it a little bit of a rogue ship. But if anyone has any ideas off the top of their head, lemme know.

Offline

#12 2005-03-25 03:04:26

Andrew
Plugin Author
Registered: 2004-02-23
Posts: 730

Re: [plugin] [ORPHAN] ajw_favatar

small update to v0.2 – just added alt attribute

Offline

Board footer

Powered by FluxBB