Page 1 of 1

Modify UserProfiles

Posted: Wed Feb 20, 2008 9:42 am
by Linus
Hi,
I´ve got problems finding the best way to modify the userprofiles-plugin.

What I want is to have all the users(authors) of one group shown on a page (like index.php?serendipity[subpage]=userprofiles does) - but with all the values that a user has entered in the profile(address, hobbies,...).

My plan is to combine this with a accordion from mootools:
http://nimax.homelinux.org/bretsch/sere ... erprofiles
(select Herren1 from the box on the left and hit "Los").

I´m not able to select the properties from the profiles with the sql statement that fetches the users from a group, because the statement contains a "group by" clause.
I´m searching for an easier way to solve this problem without changing the database table. One row for every user with the all his properties as columns, instead of saving every property alone).

Maybe someone got a better idea...
Thanks in Advance
Andi

Re: Modify UserProfiles

Posted: Wed Feb 20, 2008 1:03 pm
by garvinhicking
Hi!

Hm, the normalization of the DB is not really meant for such a single query; you'll need to fetch the properties of each user with one large SQL query, and then use PHP to combine it with the list of authors?

You will definitely need to patch the PHP code of the plugin to achieve that, but it should be possible. I'm lacking some time right now to check this, if you still have problems with this on the weekend I can have another look :)

Regards,
Garvin

Posted: Wed Feb 20, 2008 1:21 pm
by Linus
Hi Garvin,
thanks for your answer.
I´ve got it already up and running ;)
Still needs a lot of work but I solved the problem without changes to the db.

Thanks to everybody working on serendipity, pushing it forward and delivering such a great piece of software. It´s always a pleasure for me to work with s9y. :D
DANKE!

Posted: Wed Feb 20, 2008 2:03 pm
by garvinhicking
Hi!

And what was the exact solution! Tell me! :-)

Best regards,
Garvin

Posted: Wed Feb 20, 2008 3:42 pm
by Linus
Mmh I set up a new sql statement memberinfos saved as array and passed it via smarty to the tpl - hey I'm no virgin in Smarty anymore ;)
Then i added a new foreach in the tpl and voila it works. I had problems sorting the properties with smarty, so i added a number to the properties and sorted the sql statement- very dirty (brrrr) but works....