Results 1 to 8 of 8

Thread: List of user with BIO information and new custom extra fields

  1. #1
    Design & Development carlo75's Avatar
    Join Date
    Oct 2009
    Location
    Italy - Perugia
    Posts
    510
    Thanks
    62
    Thanked 106 Times in 59 Posts

    Default List of user with BIO information and new custom extra fields

    Hi to all,
    I would like to do a new page with a list of some users and their BIO information and a couple of new custom extra fields by the profile, like name and website.

    According to the documentation of HotaruCMS, creating new fields it's really simple, but I've some problems to pull out these information in this page...

    Any ideas on that?
    Thanks in advance, regards.

  2. #2
    Senior Member
    Join Date
    Jun 2011
    Posts
    122
    Thanks
    5
    Thanked 16 Times in 10 Posts

    Default

    Hi

    There is somewhere in the forum a topic from Nick about creating a memberlist, but I could not find it. With this documentation it was easy to make a custom memberlist.

    Is your memberlist a extra php file in the theme directory, also no plugin? If so, you have to create the the userbase object. I did it this way:

    Code:
      $userbase = new UserBase($h);
            $userbase->getUserBasic($h, $id);
            $profile = $userbase->getProfileSettingsData($h, 'user_profile');
    And then you should be able to access the new profile data like this:

    $profile['abc']

    (abc is the extra field you have defined in your profile files)

    Hope this was helpful? I am no php or hotaru expert, so without warranty

    Edit: I found it:

    http://forums.hotarucms.org/showthre...ql+TABLE_USERS

  3. #3
    Design & Development carlo75's Avatar
    Join Date
    Oct 2009
    Location
    Italy - Perugia
    Posts
    510
    Thanks
    62
    Thanked 106 Times in 59 Posts

    Default

    Hi hotaruuser thnaks for your reply,
    I'll try to manage your information, but seems doesn't work for my new theme.

    My goal is to show a custom extra profile field, website, near the name of users in User Ranking sidebar widget. I've already created the new field, but I don't know how to pull out this one, in the rank list.

  4. #4
    Senior Member
    Join Date
    Jun 2011
    Posts
    122
    Thanks
    5
    Thanked 16 Times in 10 Posts

    Default

    If its a widget, then its in a plugin, so creating the user object should not be necessary, as far as I know.

    Hmm, so you have to access the data another way.

    I had it previously like this:

    Code:
    $profile = $h->currentUser->getProfileSettingsData($h, 'user_profile');
    Then you had the $profile['abc'] variable, but, this is for the currentUser, also user viewing the page, so you need to change the part of the code, maybe by ID or something?

    Hope it helps

  5. #5
    Design & Development carlo75's Avatar
    Join Date
    Oct 2009
    Location
    Italy - Perugia
    Posts
    510
    Thanks
    62
    Thanked 106 Times in 59 Posts

    Default

    But $h->currentUser retrieve your profile informations (?)

  6. #6
    Senior Member
    Join Date
    Jun 2011
    Posts
    122
    Thanks
    5
    Thanked 16 Times in 10 Posts

    Default

    As I said, you have to find another function, not currentUser. Somehow the function getProfileSettingsData should know, which data it should retreive. Unfortunatedly, this function has no explaining in the documentation.

    I found this one, should help:

    http://forums.hotarucms.org/showthre...nalytics/page3

    There this function is called like this:

    Code:
    $profile = $h->getProfileSettingsData('user_profile', $h->post->author);
    Maybe you can just instead of $h->post->author give the $id used in the code of user_rankings.php

  7. #7
    Design & Development carlo75's Avatar
    Join Date
    Oct 2009
    Location
    Italy - Perugia
    Posts
    510
    Thanks
    62
    Thanked 106 Times in 59 Posts

    Default

    Sure I've read so quickly.
    I'll try to find it: I've already find $id but I receive an error for undeclared variable... really strange

  8. #8
    Senior Member
    Join Date
    Jun 2011
    Location
    Thailand
    Posts
    294
    Thanks
    0
    Thanked 70 Times in 64 Posts

    Default

    You can use TABLE_USERMETA table to save custom user fields. Analyse stop spam plugin to see how Nick used it.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Extra Profile Fields Visible only to registered/logged in users
    By angolanmade in forum How-To and Troubleshooting
    Replies: 4
    Last Post: 02-09-2011, 05:53 PM
  2. Profile Extra Fields Usage Problem
    By sachingk in forum How-To and Troubleshooting
    Replies: 2
    Last Post: 11-14-2010, 02:48 AM
  3. Extra Profile Fields Not Saving
    By angolanmade in forum How-To and Troubleshooting
    Replies: 20
    Last Post: 04-14-2010, 03:19 AM
  4. [Docs] Adding Extra Profile Fields
    By Nick in forum Design and Layout
    Replies: 1
    Last Post: 03-15-2010, 03:00 PM
  5. [Docs] Adding Extra Post Information
    By Nick in forum Developing Plugins
    Replies: 0
    Last Post: 01-11-2010, 10:56 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •