WordPress.org

Ready to get started?Download WordPress

Forums

BadgeOS Community Add-on
Badge OS earned user achievements widget (34 posts)

  1. sassafrascal
    Member
    Posted 10 months ago #

    I am using badgeOS on a multisite which seems tobe functioning fine.

    But the user achievement widget does not show the images on my side bar... just the badge name with a space for the image.

    When testing the widget on one of the subdirectories I noticed it made the correct amount of lists but the lists are empty. No image or text.

    Does anyone know how to correct this?

    http://wordpress.org/extend/plugins/badgeos-community-add-on/

  2. Michael Beckwith
    Member
    Plugin Author

    Posted 10 months ago #

    Do you have a link to the live site(s) that I could see quick? It'll help me debug a little bit.

  3. sassafrascal
    Member
    Posted 10 months ago #

    Yes sure - and thanks for the quick response.

    Here is the main site with the widget on the side bar - http://gloconj.com/blog/featured/tara-kristen-lipinski/

    Here is the subdirectory with the widget on the side bar -
    http://gloconj.com/directory/

    Since nothing shows if you're not logged in and awarded badges I have added two links showing screenshots below of my logged in view of the BadgeOS widget with two badges to my name.

    Screenshots
    Main Site Screenshot- http://gloconj.com/images/main_error.jpg

    Sub Site Screenshot- http://gloconj.com/images/dir_error.jpg

  4. Michael Beckwith
    Member
    Plugin Author

    Posted 10 months ago #

    Not an immediate answer, but I'm checking the widget for earned achievements and I shouldn't be seeing the outter < ul > from the output. I'm definitely not logged in, but it's showing anyway. However, related to the issue, it's not showing any < li > items which should be pulling the current logged in user's achievements.
    Checking on some things, stand by

  5. Michael Beckwith
    Member
    Plugin Author

    Posted 10 months ago #

    I know I said standby, but I wanted to check if you managed to find a solution first. If not, then I'll get back to trying to find a solution for this.

    If you did solve it, it'd be awesome if you shared how, if you know for sure.

  6. Michael Beckwith
    Member
    Plugin Author

    Posted 10 months ago #

    After looking a bit more closely at the widget code provided, it must be something with a broken image path, but I can't confirm quite yet on your site. I'll have to set up a MU instance on my own to give it a go there if I must.

  7. sassafrascal
    Member
    Posted 10 months ago #

    After messing with it a bit more I can see that it's not "seeing" the badges from the other sites but it does make space for it. I agree there could be a broken image path but it's odd that the text is gone as well and in the back end.

    I have two badges one on the main site and another on the subsite

    Main site - "New Member badge"
    Subsite - "Reviewer badge"

    Below is a pictogram, lol. that may shed more light.
    http://gloconj.com/images/error_admin.jpg

    BTW - it seems that it shows the title for the badges even when not signed in, as you mentioned. When I take the title out of the widget it closes the space and does not show anything.

  8. Michael Beckwith
    Member
    Plugin Author

    Posted 10 months ago #

    The reason why the titles show up is because the widget wasn't written to hide that part for non-logged in users.

    Are you familiar with view-source and your browser, and how to find this sidebar area in it? I'd like to see the logged-in output for the areas if you could.

  9. Michael Beckwith
    Member
    Plugin Author

    Posted 10 months ago #

    Another question, on these sites in the screenshots that are showing nothing. Are the missing badges from the MU site in question? or are they from a different site in the network?

    I'm starting to wonder if the issue is the Multisite and the widget not accommodating for the fact, thus it doesn't have anything to display. With the backend missing images, it may not have the right url path for the image.

    If I'm right above, then we'll want to get bugs filed on GitHub so we can get them taken care of.

  10. sassafrascal
    Member
    Posted 10 months ago #

    I would agree with the backend missing images if it were not also missing the text of the badge name.

    I don't believe it's a widget issue because the admin panel reflects the same error happening on the front end. If the main site admin area is not showing the subdirectory badge it shows as a blank spot on the front end... or if the subsite admin area is not showing the main site badge it shows as a blank spot on the subsite.

    I believe it is absolutely a multisite issue but I don't understand why it registers on my subdirectory that my main site has a badge but will not show it and vice versa.

    I don't know what you mean by a "different" site in the network.

    I have a Multisite Network as follows...
    > Main site of the network - gloconj.com
    >>/subdirectory of the network - gloconj.com/directory

    Both are in the same network... Badge OS is recognizing them in the netwok - but they are just showing up blank for badges earned on separate sites within the network.

    I really appreciate that you are taking the time to help me with this... thank you!

    This is the code for the main site

    <div class="widget"><ul class="widget-achievements-listing"><li id="widget-achievements-listing-item-2441"  class="widget-achievements-listing-item has-thumb"><a style="margin-top: -0px;" class="badgeos-item-thumb" href="http://gloconj.com/blog/badge/new-member-badge/"><img class="wp-post-image" width="0" height="0" style="display:none;visibility:hidden;" data-cfsrc="http://i1.wp.com/gloconj.com/wp-content/uploads/2013/05/new_member_badge.gif?fit=50%2C50"><noscript><img class="wp-post-image" width="0" height="0" src="http://i1.wp.com/gloconj.com/wp-content/uploads/2013/05/new_member_badge.gif?fit=50%2C50"></noscript></a><a class="widget-badgeos-item-title widget-badgeos-item-title" href="http://gloconj.com/blog/badge/new-member-badge/">New Member Badge</a></li><li id="widget-achievements-listing-item-4360"  class="widget-achievements-listing-item"><a class="widget-badgeos-item-title widget-badgeos-item-title" href=""></a></li></ul><!-- widget-achievements-listing --></div>

    This is the code for the sub directory

    <div id="sidebar">
    <div class="widget"><h3><span>My Badges</span></h3><ul class="widget-achievements-listing"><li id="widget-achievements-listing-item-2441"  class="widget-achievements-listing-item"><a class="widget-badgeos-item-title widget-badgeos-item-title" href=""></a></li><li id="widget-achievements-listing-item-4360"  class="widget-achievements-listing-item has-thumb"><a style="margin-top: -25px;" class="badgeos-item-thumb" href="http://gloconj.com/directory/badge/reviewer/"><img class="wp-post-image" width="50" height="50" style="display:none;visibility:hidden;" data-cfsrc="http://gloconj.com/directory/wp-content/uploads/sites/8/2013/06/sample.jpg"><noscript><img class="wp-post-image" width="50" height="50" src="http://gloconj.com/directory/wp-content/uploads/sites/8/2013/06/sample.jpg"></noscript></a><a class="widget-badgeos-item-title widget-badgeos-item-title" href="http://gloconj.com/directory/badge/reviewer/">Reviewer</a></li></ul><!-- widget-achievements-listing --></div>
  11. Michael Beckwith
    Member
    Plugin Author

    Posted 10 months ago #

    Yes, you have the main site gloconj.com and when you were in the network admin, at gloconj.com/wp-admin/network/sites.php, you added a 2ndary site in "/directory/"

    There is going to be a WP-Admin area for the main site at gloconj.com/wp-admin, and then there's one for the "/directory/" site. That's what I mean by different sites. For a user in question, were they awarded a badge in gloconj.com/directory/ that they don't see when at gloconj.com ? or vice versa?

    From you:
    "Both are in the same network... Badge OS is recognizing them in the netwok - but they are just showing up blank for badges earned on separate sites within the network."

    Sounds exactly like what I said above.

    Anywho.

    This part looks suspect though:

    <img class="wp-post-image" width="50" height="50" style="display:none;visibility:hidden;" data-cfsrc="http://gloconj.com/directory/wp-content/uploads/sites/8/2013/06/sample.jpg">
    <noscript>
    	<img class="wp-post-image" width="50" height="50" src="http://gloconj.com/directory/wp-content/uploads/sites/8/2013/06/sample.jpg">
    </noscript>

    I am not sure where the data-cfsrc attribute is coming from, nor the inline styles for display:none and visibility:hidden. I have scraped the source code for possible locations of that in output but haven't found them. Do you know if those are somehow provided by a different plugin? I know the 2 inline styles would definitely play a key role in not showing them to people.

    As an aside, I filed an enhancement ticket on GitHub for network wide widgets for badge display. We'll see if they make it into a future release, if indeed the widgets aren't well suited for multiple sites in a network.

  12. sassafrascal
    Member
    Posted 10 months ago #

    I use cloudflare to speed up my network and it seems someone had this same suspicious code on their site that may be coming from Cloudflares image optimization... yet I do not see an answer for it on the forum.

    http://xenforo.com/community/threads/what-is-cloudflare-how-does-it-help-webmasters.11105/page-29

    Hopefully GitHub Ticket can shed more light on the situation.

    I will pause cloudflare at some point today and see what happens.

  13. sassafrascal
    Member
    Posted 10 months ago #

    I turned off all image optimization with cloudflare then took a look at the source again - the suspect code is gone but the issue is still there.

  14. Michael Beckwith
    Member
    Plugin Author

    Posted 10 months ago #

    even the css parts are gone? because from everything i can tell, the img tags are showing up and not leading to dead end urls.

  15. sassafrascal
    Member
    Posted 10 months ago #

    Yes the CSS was gone as well.

    Do you happen to have a link to the Ticket you started on GitHub? Or know if there has been a response?

  16. Michael Beckwith
    Member
    Plugin Author

    Posted 10 months ago #

    Here's the github ticket https://github.com/opencredit/badgeos/issues/49

    Like I said, it's more feature request than fix for the issue. I'm still trying to figure that part out.

    I'll reply with some more questions in a little bit.

  17. Michael Beckwith
    Member
    Plugin Author

    Posted 10 months ago #

    Hoping you have a dev server for this next bit, where needed.

    If you do have a dev site that you can do this on, great, otherwise i have a workaround.

    Open up the includes/widgets/earned-user-achievements-widget.php file in the badgeos plugin folder. Scroll down to about line 57, right after this bit of code:

    $achievements = badgeos_get_user_achievements();

    Once past that, add

    print_r($achievements);

    to line 57, save, and refresh a page that should be showing the widget. If you could paste any array output that shows up, that'd be awesome. It'll help make sure we're getting badges to display, as well as what data should display.

  18. sassafrascal
    Member
    Posted 10 months ago #

    Just tried it out - our site is low key enough to test on for now.

    here is an image of the outcome on the front end - http://gloconj.com/images/badge_view.jpg

    Here is the view on the main site - bottom of side bar
    http://gloconj.com/blog/featured/roscoe-lee-browne/

    Here is the view on the subdirectory.
    http://gloconj.com/directory/

    Here is the output for the Main Site

    My Badges</h5>Array
    (
        [0] => stdClass Object
            (
                [ID] => 2441
                [post_type] => badge
                [date_earned] => 1370867723
            )
    
        [1] => stdClass Object
            (
                [ID] => 4360
                [post_type] => badge
                [date_earned] => 1371240069
            )
    
    )
    <ul class="widget-achievements-listing"><li id="widget-achievements-listing-item-2441"  class="widget-achievements-listing-item has-thumb"><a style="margin-top: -23px;" class="badgeos-item-thumb" href="http://gloconj.com/blog/badge/new-member-badge/"><img class="wp-post-image" width="50" height="47" style="display:none;visibility:hidden;" data-cfsrc="http://gloconj.com/wp-content/uploads/2013/05/new_member_badge-100x94.gif"><noscript><img class="wp-post-image" width="50" height="47" src="http://gloconj.com/wp-content/uploads/2013/05/new_member_badge-100x94.gif"></noscript></a><a class="widget-badgeos-item-title widget-badgeos-item-title" href="http://gloconj.com/blog/badge/new-member-badge/">New Member Badge</a></li><li id="widget-achievements-listing-item-4360"  class="widget-achievements-listing-item"><a class="widget-badgeos-item-title widget-badgeos-item-title" href=""></a></li></ul><!-- widget-achievements-listing --></div>
    						<div class="clear"><!-- --></div>
    						<div class="fl w50p">
    							<div class="side-l">
    
    							</div>
    						</div>
    
    						<div class="fr w50p">
    							<div class="side-r">
    
    							</div>
    						</div>
    						<div class="clear"><!-- --></div>

    I apologize if the sites are slow... I have all caching and cloudflare turned off for development.

  19. sassafrascal
    Member
    Posted 10 months ago #

    Image optimization with cloudflare was still turned on so you will see the code you saw before. I have only turned off their caching.

    I'll turn IO off now for more testing.

  20. Michael Beckwith
    Member
    Plugin Author

    Posted 10 months ago #

    Understandable with any lag.

    Regarding the output, it's a bit as I expected.

    The main site output that you pasted above SHOULD be showing something. Based on the screenshot provided, it currently is? I see images/text for "Reviewer" badge and "New Member" badge.

    However, any areas that have array() and nothing more, there's no data to show, which would be why it's not showing at all. The code is receiving an empty array to loop through.

    This brings me back to my theory that the MU Network is a primary cause of this issue. the badgeos_get_user_achievements() function line isn't pulling in any achievements except the ones in it's current site, not across all of them.

  21. sassafrascal
    Member
    Posted 10 months ago #

    hmmm... I wonder is there away to at least have it so it only shows the current site badges with out a big blank spot for the other sites badges.

    That way I can at least say - these are your badges for this particular site?

  22. Michael Beckwith
    Member
    Plugin Author

    Posted 10 months ago #

    I have an idea for that, give me a little bit of time to do it up a bit later.

  23. sassafrascal
    Member
    Posted 10 months ago #

    No problem - thanks for all of your help!

  24. Michael Beckwith
    Member
    Plugin Author

    Posted 10 months ago #

    Ok. Question that will ultimately shape what I provide next, based on the 2nd to last reply from you.

    If there are no badges to display for the user in the current site, do you want to display a message like "No badges yet, let's go earn some" or something lie that? Or would you prefer to hide the entire widget output if there's no badges to display?

  25. sassafrascal
    Member
    Posted 10 months ago #

    Oh definelty let's go earn some, that would be awesome!

  26. Michael Beckwith
    Member
    Plugin Author

    Posted 10 months ago #

    OK, this first part is going to be safe to do, as it was a change earlier that will go into a future release. In your plugin copy's includes/widgets/earned-user-achievements-widget.php file, go to the line that says

    if ( is_array( $achievements ) ) {

    and change it to

    if ( is_array( $achievements ) && ! empty( $achievements ) ) {

    This will prevent everything inside it from displaying to the screen if there are no achievements to loop through.

    This next part is wholly up to you, as there is no guarantee the developers will add anything like it in a future release and even less guarantee that it'd match what you have. However, if you want to add a message if there is nothing to display, you'll want to change line 107, which is a } and right before the } else { that is part of the "is user logged in" if statement. So instead of } you'd have your own like below.

    } else {
        _e( 'You do not have any badges yet, lets go earn some.', 'badgeos' );
    }

    Feel free to customize the text however you want. Remember this is wholly up to you and would need to be restored after future updates if the BadgeOS team doesn't do something similar to replace.

  27. sassafrascal
    Member
    Posted 10 months ago #

    Cool thanks, I will make the changes. Thanks again for all the help. Loving badge OS!

  28. sassafrascal
    Member
    Posted 10 months ago #

    I made the change for the empty achievements but it's still showing a blank spot from the other sites in the network on the widget.

    I have BadgeOS network activated. To solve the problem I decided to activate it on each site itself rather than network wide. But when I did that "Community Add-on" plugin stopped working. I reinstalled it new and it's still not working unless badge OS is network activated.

    Any idea's?

  29. sassafrascal
    Member
    Posted 10 months ago #

    Oh and - I noticed that when I put two shortcodes on the same page only one works.

    For example if I put

    [badgeos_achievements_list type=badge]

    [badgeos_achievements_list type= achievements]

    only badge will show up.

    also if I click on new members badge it takes me to a 404 page.
    http://gloconj.com/badges-achievements/

    Should this be a new thread?

  30. Michael Beckwith
    Member
    Plugin Author

    Posted 10 months ago #

    Yeah, lets get a new thread started for the last message.

Reply »

You must log in to post.

About this Plugin

About this Topic

Tags