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] some user thumbnails doesn't show up

AoleeAolee Hobbyist & Coder ✭✭
edited February 2011 in Vanilla 2.0 - 2.8
Hi, i would like to ask why some user's thumbnail doesn't show up? image broken but the user's have a picture, and link is working. i noticed image doesn't show for users who haven't posted anything yet.
Tagged:
«1

Comments

  • AoleeAolee Hobbyist & Coder ✭✭
    ok found out that those Photo value in the DB is an external url (e.g. http://graph.facebook.com/812583467/picture) . and it doesn't display the thumbnail in userlist sidebar.
  • AoleeAolee Hobbyist & Coder ✭✭
    edited May 2011
    i think this happens for users who logged in using a facebook account.
    the img src is becoming

    src="uploads/http://ngraph.facebook.com/1105074448/picture"

    for a quick patch, i just changed this line

    from

    Url('uploads/'.ChangeBasename($User->Photo, 'n%s'))

    to

    ((stristr($User->Photo,"http://"))?$User->Photo:Url('uploads/'.ChangeBasename($User->Photo, 'n%s')))

    meaning if there's an HTTP:// found in the photo value use the value directly.

    ******
    edited:

    file to modify is class.userlistmodule.php
  • Aolee, I have this same problem but can you clarify where the file can be found that needs this line to be changed
  • AoleeAolee Hobbyist & Coder ✭✭
    sorry forgot to indicate the filename.

    you can change it on class.userlistmodule.php

    :)
  • Thanks...

    For some reason I didn't receive an E-mail from your last message (May18) to say that you responded, although I didn't create this post, but have commented I would have expected to receive an E-mail. Within my vanilla profile all options are ticked to receive notifications. Checked my junk mail also...

    Is this a known issue....

    I know its not directly linked with this post but noticed this issue as a result.
  • lucluc ✭✭
    You need to bookmark/follow the discussion if you want a notification.
  • ChanuxChanux Admin of Geek.lk ✭✭

    @Aolee i had same problem. now fixed it using your advice. thank you so much.

  • @Aolee Is this plugin able to show the Vanillicon icons? I'm using Vanillicon but this plugin is not able to show the Vanillicon icons. I have already made the modifications suggested by you. Thanks for your help.

  • @Aolee - I looked at your Who's Online plugin and tried to fix this plugin to show Vanillicon icons using the code in Who's Online. I got the icons working, but the icons are different from what I see on user's profile. The icons that I see on the User Profile and Who's Online plugin match perfectly though.

    The icons for Facebook and Google users are showing up fine.

    Any idea what could be wrong?

  • AoleeAolee Hobbyist & Coder ✭✭

    yes i've mod my userlist plugin to display vanillicon, but didn't enable it in my site as most of the pic appearing are vanillicons, i can share my plugin script. but maybe later :)

  • OK, I solved the problem by adding some debug statements. I found that the Vanillicon plugin relies on User Email field in order to generate the Avatars. The Who's Online plugin queries for that field, but User List doesn't. After adding that field to the query, it works!

    Thanks.

  • AoleeAolee Hobbyist & Coder ✭✭

    thats great!

  • AoleeAolee Hobbyist & Coder ✭✭
    edited March 2012

    For other pips, here's the link for the modded UserList.

    http://pinoyau.info/plugins/UserList-vanillicon.zip



    Check out my other Plugins here

  • AoleeAolee Hobbyist & Coder ✭✭

    yes i've mod my userlist plugin to display vanillicon, but didn't enable it in my site as most of the pic appearing are vanillicons, i can share my plugin script. but maybe tomorrow as im really sleepy now. its 2am here in SG :)

  • Thanks Aolee,

    I was just having the same problems with this until I came across this.

  • Can anyone post how to include the vanillicons ? thanks

  • i know where the controls are, the question was how to modify to include the vanillicons not just profile pictures

  • peregrineperegrine MVP
    edited September 2014

    @lxlelinux said:
    i know where the controls are, the question was how to modify to include the vanillicons not just profile pictures

    what version of vanilla 2.0 are you running? and what theme?

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • peregrineperegrine MVP
    edited September 2014

    @lxlelinux

    If you are using vanillicons plugin

    then in userlist plugin

    in class.userlistmodule.php

    change line 16

    from
    $Select='u.UserID, u.Name, u.Photol';

    to
    $Select='u.UserID, u.Name, u.Photo,u.Email';

    and change later in code

    from

     foreach($this->Users->Result() as $User) {
                      ?>
                      <li>
                         <?php
                         if($Photo) {
                             if(!empty($User->Photo)) {
                                echo "<a href=\"".Url('/profile/'.$User->Name)."\"><img src=\"".Url('uploads/'.ChangeBasename($User->Photo, 'p%s'))."\" alt=\"".$User->Name."\" title=\"".$User->Name."\" /></a><br />";
                             } else {
                                echo "<a href=\"".Url('/profile/'.$User->Name)."\"><img src=\"".Url('plugins/UserList/user.png')."\" alt=\"".$User->Name."\" title=\"".$User->Name."\" /></a><br />";
                             }
                         } else {
                            echo UserAnchor($User);
                         }
                         ?>
                      </li>
                      <?php
                      }
    

    to

                       foreach($this->Users->Result() as $User) {
                          ?>
                          <li>
                             <?php
                                    echo UserPhoto($User);
                             ?>
                          </li>
                          <?php
                         }
    

    but you might be better off with a different plugin...

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Sign In or Register to comment.