This discussion is related to the
Following addon.
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?
1 • •
Comments
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •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!
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Any ideas on a fix?
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •In plugins/Following/class.followingmodule.php, change:
<img src="<?php echo Url('uploads'.DS.'n'.$User['Photo'], TRUE); ?>" />to
<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'].
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
1 • Off Topic Insightful 1Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
1 • Off Topic Insightful Awesome LOL •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); ?>" />with:
<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
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •After a small dig...
In plugins/Following/class.followingmodule.php, replace:
<img src="<?php echo Url('uploads'.DS.'n'.$User['Photo'], TRUE); ?>" />with:
<img src="<?php echo 'uploads'.DS.ChangeBasename($User['Photo'], 'n%s'); ?>" />There are two occurrences in the file.
- Spam
- Abuse
- Troll
1 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •<img src="<?php echo Url('uploads/' . ChangeBasename($User['Photo'], 't%s')); ?>" />The function ChangeBasename is how applications/dashboard/controllers/class.profilecontroller.php does it
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •