Fork me on GitHub

V4bJournal etc  Bottom

  • I recently implemented the v4bJournal and a pretty nifty code it is too.

    However I have just received a request to add avatars to the output (list of last 20 entries). I was wondering if anyone has tried this and how easy it might be. Also wondering if there is an off the peg library code that could be pasted in and modified to do this- knowing nothing at all about PHP I have largely used modules "as is" though I am confident enough with the HTML side of this and getting my output to look how I wish I couldnt for the life of me begin to figure out how to grab a members avatar to stick on the screen

    Any help would be appreciated. Thank you

    herman
  • Quote

    I recently implemented the v4bJournal and a pretty nifty code it is too.


    Thank you :P

    Quote

    However I have just received a request to add avatars to the output (list of last 20 entries)


    All you want to do is show the personal avatar next to the username in the "Last 20" list? That should be easy to do ... give me a little while and I'll get back to you. If you don't hear from me within a few days (lets say by Monday), then this means that life interrupted me (or my thoughts); in that case just reply to this thread to get my attention again wink

    Greetings
    --> R
  • OK, try the following: in the file v4bJournal/inc/display_journal_list.inc on line 136, just after

    Code

    $output->TableRowStart();

    add the following:

    Code

    $uservars = pnUserGetVars ($journal['owner_uid']);
    $avatar   = $uservars['pn_user_avatar'];
    if ($avatar)
       $avatar = "images/avatar/$avatar";
    else
        $avatar = 'v4bJournal/img/spacer.gif';

    $output->Text('<td align="left" valign="middle" bgcolor="'.$bc1.'">');
    $output->Text("<img src='$avatar' width='15' height='15'>");
    $output->TableColEnd();


    If you want to full sized avatar, just remove the 'width' and 'height' tags from the img tag.

    You'll also have to add another column on the list header, right around line 63; this should be trivial ...

    Please try this and let me know if it works for you ...

    Greetings
    --> R

This list is based on users active over the last 60 minutes.