Skip to:
Content
Pages
Categories
Search
Top
Bottom

Need help with homepage Widgets for logged-in users

  • Avatar of dashik
    dashik
    Participant

    @dashik

    Ok, so I have four blocks available for widgets on the “logged-in” version of our homepage.

    Since the “admin” is the one assigned the main blog account — the widgets work fine as long as i’m logged in as admin and I’m adding widgets through that account. But that doesn’t really do me any good for what I’m trying to do.

    What I’d like to do is instead of the homepage relying on the information fed in from the admin blog’s widget settings — I want it to pull from the LOGGED-IN USER’S settings.

    So, every logged in user would see something different depending on their widget settings.

    I have a weather widget, for example, that pulls data from accuweather.com. Inside that widget is a zip code field. So I want this homepage widget to pull the zip code from whoever is logged in’s widget settings.

    This is what the blocks look like:

    http://i.imgur.com/jj3w2.gif

    Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Avatar of r-a-y
    r-a-y
    Moderator

    @r-a-y

    You’d have to manually call the widget in question and call the ZIP code from the xprofile field of the logged-in user.

    You wouldn’t be able to set this from the WP backend.

    Avatar of dashik
    dashik
    Participant

    @dashik

    The zip code isn’t coming from their xprofile field….it’s coming straight from the widget settings.

    The weather widget example…that’s just a hacked default widget i repurposed/renamed. I think it had one option text field (max members) which i just renamed to zip code.

    Again, it works beautifully logged in as admin but not otherwise.

    WPMU out of the box (rightfully so) pulls widgets on a blog-to-blog basis.

    What I’m looking for in this instance is for WPMU to pull these widgets on a per logged-in-user basis.

    Hope that makes sense :)

    Avatar of r-a-y
    r-a-y
    Moderator

    @r-a-y

    Like I said, you’d need to create an xprofile field called “Zip Code”.

    And then you’ll need to manually call the weather widget using the manual WP widget function call (i forget what this is at the moment) and pass the logged-in user’s “Zip Code” (provided they have filled it in). You can definitely pass arguments / settings to widgets manually.

    I’d imagine you would create an xprofile field named “Zip Code”, otherwise how else are you going to grab the logged-in user’s zip code?

    Avatar of dashik
    dashik
    Participant

    @dashik

    ohhhh, i see what you’re saying. that could actually work! not 100% ideal but i think i could make it work. good idea :)

    thanks!

    Avatar of dashik
    dashik
    Participant

    @dashik

    how do i call an xprofile field inside of bp-core-widgets.php? i’m guessing that falls outside the profile loop right?

    i’ve tried various methods but no luck yet.

    Avatar of stwc
    stwc
    Participant

    @stwc

    I use a plugin called widget logic that allows some sophisticated conditional display of widget stuff. You might find that it helps you in getting this work…

Viewing 6 replies - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.