Sorry,
for this problem i find any issues here but i dont understand it.
I log with Rules the activity from users. Any users has no avatar. Now i will set a default avatar-picture, when user has no avatar
I found this http://drupal.org/node/697866 and http://heartbeat.menhireffect.be/docs/adding-user-avatar-stream but i dont understand this.
I make an own module to override heartbeat_theme_alter
function mymodule_heartbeat_theme_alter(&$messages, HeartbeatAccess $stream) {
foreach ($messages as $key => $message) {
if (empty($message->actor->picture)) {
$message->actor->picture = 'sites/default/files/default.jpg';
}
}
}
This has no effect.
I change the heartbeat-message-row.tpl.php
I put
if (empty($message->actor->picture)) {
$message->actor->picture = 'sites/default/files/default.jpg';
}
in this.
I controlled with devel $message and in $message->actor->picture is the default.jpg-path now but not in picture-field in message->content. There is always not the default-avatar.
I dont understand this. Can anyone help me please?
Sorry for my bad english.
Regards Matthias
Comments
Comment #0.0
Berliner-dupe CreditAttribution: Berliner-dupe commentedb
Comment #0.1
Berliner-dupe CreditAttribution: Berliner-dupe commentedb
Comment #1
Berliner-dupe CreditAttribution: Berliner-dupe commentedhas no effect too.
After this i see over devel the path in $message->variables['@userpicture'] but in $message->message the default-picture will not show.
I dont understand this. Who can help me please?
Comment #2
Berliner-dupe CreditAttribution: Berliner-dupe commentedYou wrote on http://heartbeat.menhireffect.be/docs/adding-user-avatar-stream
By invoking <strong>the api log function</strong>, we can easily implement the value for the avatar.
The Api-Log-Function is "heartbeat_api_log" - over this function i can implement a default-avatar? How is this possible? I ´make it but is has no effect and never i find an example for this!
You wrote
Implementing hook_heartbeat_theme_alter where you can loop through eacy message
I use hook_heartbeat_theme_alter and i override the $myavatar-variable. When i use "devel" the path to the default-picture will be show correct but the picture is not show in the "message->message (!avatar) or message->content varibale/object!!!!!
I overide "message->variables['@avatar'] with the default-path and devel show me the correct path but in the message->message object the default-avatar is not show.
In message->message for !avatar-pattern show only
<div class="picture"> </div>
.Over 7 hours i sit here to solve this problem when a user has no avatar but its not possible.
Comment #3
Berliner-dupe CreditAttribution: Berliner-dupe commentedComment #3.0
Berliner-dupe CreditAttribution: Berliner-dupe commentedb