Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

[FIXED] Following Plug-In, not showing friends pictures

This discussion is related to the Following addon.
edited February 2011 in Vanilla 2.0 - 2.8
Anyone else have this issue? When I follow someone, it adds them as a friend and I can view the count in my profile. However, is the friend I'm following has an avatar, then is just shows a corrupted img file.

Seems to be missing the correct link to the image. This plugin also does not show the gravitar (from gravitar plug-in). Anyone else having this same issue?


  • RaizeRaize vancouver ✭✭
    I have the same issue, profile pics are broken. The plugin itself is very neat
  • @Raize

    If you have found a fix, please let me know. It's a bit annoying to see broken images on a smooth forum... sticks out like a sore thumb!
  • RaizeRaize vancouver ✭✭
    I haven't found a fix, but I'm sure the next release will work better... it's a neat feature
  • A real nice feature would be to grab each users current FaceBook avatar. Most of our users don't have anything uploaded for a picture :/
  • RaizeRaize vancouver ✭✭
    @mattrl i feel your pain... twitter pic would be better though (same dimensions)
  • The profile thumbnails are broken, looks like the "n" in the encrypted image name is misplaced. Fix please, thanks. ;)
  • I'm having a similar problem, though worse. Even after disabling and uninstalling the plugin all user profile pictures are broken.

    Any ideas on a fix?
  • I also have this problem.
  • edited November 2010
    The fix is actually very easy to implement:

    In plugins/Following/class.followingmodule.php, change:

    <img src="<?php echo Url('uploads'.DS.'n'.$User['Photo'], TRUE); ?>" />


    <img src="<?php echo Url($User['Photo'], TRUE); ?>" />

    ...which removes the "uploads/n" portion of the image url.

    It occurs twice, at lines 62 and 83. I'm not experienced in Vanilla plugin development, but it looks like the plugin expects a relative url based in the uploads folder, but it's actually getting an absolute url from $User['Photo'].
  • andelfandelf New
    edited December 2010
    <?php echo Url('uploads'.DS.ChangeBasename($User['Photo'], 'n%s'), TRUE); ?>
  • Doesn't work for me either, the plugin also doesn't fetch the prefixes like "n"000000001.jpg or "p"000000001.jpg, you get just a 000000001.jpg link.
  • this plugin remains approved despite previous errors, why is that? or is it already fixed?
  • Hello all,
    here is my solution:

    After the foreach in line 58 and 79 add
    $pieces = explode("/", $User['Photo']);
    And replace the
    <img src="<?php echo Url('uploads'.DS.'n'.$User['Photo'], TRUE); ?>" />
    <img src="<?php echo 'uploads'.DS.$pieces[0].DS.'n'.$pieces[1] ?>" />

    So it will look like something like this:
    foreach ($Followees as $User) { $pieces = explode("/", $User['Photo']); ?> <div> <a title="<?php echo $User['Name']; ?>" href="<?php echo Url("profile/{$User['UserID']}/{$User['Name']}", TRUE); ?>"> <img src="<?php echo 'uploads'.DS.$pieces[0].DS.'n'.$pieces[1] ?>" /> </a> </div>

    Don't forget to repeat step for the second foreach in the code.

    PS. There could be better code out there than mine :P
  • Hello all,
    After a small dig...

    In plugins/Following/class.followingmodule.php, replace:
    <img src="<?php echo Url('uploads'.DS.'n'.$User['Photo'], TRUE); ?>" />
    <img src="<?php echo 'uploads'.DS.ChangeBasename($User['Photo'], 'n%s'); ?>" />

    There are two occurrences in the file.
  • tried your code, and double checked the procedure, but sadly no effect :(
  • martianmartian New
    edited February 2011
    Try this:
    <img src="<?php echo Url('uploads/' . ChangeBasename($User['Photo'], 't%s')); ?>" />

    The function ChangeBasename is how applications/dashboard/controllers/class.profilecontroller.php does it
  • I can confirm that works. I'll close this topic. Thanks @martian
This discussion has been closed.