Firstly, I have to admit that this is fantastic module with three different dismensions to display user icon. It really increase the imagination of the page layout. So thanks to the author.
When using this module, I set default user icon demension as 45x45 and comment user icon demension as 30x30. Every thing is ok in the comment page except that when I preview my comment, user icon in the preview of comment block displays as 45x45(default) not 30x30.
Then after checking the script in imagecache_profiles.module, I found this section:
// If viewing a comment
if ($account->cid) {
When a comment is stored in the database it has a cid, but in comment preview page, $account->cid = NULL , but "$account->comment" is always filled.
So I try to change previous section as following:
// If viewing a comment
if ($account->comment) {
It’s done.
Another suggestion in profile page. I set profile user icon as 160x160, because I deem it is just for account portrait in the user profile page.
// If on user profile page
if (arg(0) == 'user' && is_numeric(arg(1))) {
But the above script make every user icon as 160x160(my default user icon is only 45x45), if I display friend list with friend icon in the profile page, it looks a bit strang.
So I changed into this
// If on user profile page
if (arg(0) == 'user' && is_numeric(arg(1)) && isset($account->content)) {
Because in profile page, for instance: I go to user A's profile page, the variable '$account' has '$account->content' when dealing with his portrait.
When I want page to displays A's friend list with user icons, there is no $account->content in the process of dealing with his friends' icons.
Comment | File | Size | Author |
---|---|---|---|
#4 | imagecache_profiles-comment-check.patch | 724 bytes | neochief |
Comments
Comment #1
eric.chenchao CreditAttribution: eric.chenchao commentedSorry, I find when in node page, $account of node also has '$account->comment', it is the number of comment belonging to this node.
So I ajust it as
Comment #2
eric.chenchao CreditAttribution: eric.chenchao commentedA strang thing:
The result is TRUE, but
The result is FALSE
Comment #3
johnhanley CreditAttribution: johnhanley commentedNothing strange about it: isset
Comment #4
neochief CreditAttribution: neochief commentedSolution for broken comment previews. My patch makes addition check, which filters out nodes. Please check the patch.
Comment #5
andypostCommited this fix for preview state.
For compability reasons (with php 4) property_exists() is not used
But this fix brings nothing because $comment object doesn't have $comment->picture property and default picture should be displayed if defined.
About user profile page - it depends on method used to display profile pictures for other elements... I recommend to use views
Comment #6
andypostProfile pages continue #493734: Patch for correct behavior with Me module
Comment #7
eric.chenchao CreditAttribution: eric.chenchao commentedNice job!