| Project: | ImageCache Profiles |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
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:
<?php
// 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:
<?php
// 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.
<?php
// 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
<?php
// 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.
Comments
#1
Sorry, I find when in node page, $account of node also has '$account->comment', it is the number of comment belonging to this node.
<?php// If viewing a comment
if ($account->cid) {
?>
So I ajust it as
<?php// If viewing a comment
if ($account->comment && empty($account->type)) {
?>
#2
A strang thing:
<?php$account->cid = 0;
print isset($account->cid);
?>
The result is TRUE, but
<?php$account->cid = NULL;
print isset($account->cid);
?>
The result is FALSE
#3
Nothing strange about it: isset
#4
Solution for broken comment previews. My patch makes addition check, which filters out nodes. Please check the patch.
#5
Commited this fix for preview state.
<?php// If viewing a comment
- if ($account->cid) {
+ if (array_key_exists('cid', get_object_vars($account))) {
?>
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
#6
Profile pages continue #493734: Patch for correct behavior with Me module
#7
Nice job!
#8
Automatically closed -- issue fixed for 2 weeks with no activity.