Wedge way to add Profile Field

CerealGuy

  • Posts: 343
Wedge way to add Profile Field
« on October 3rd, 2014, 03:23 PM »
In the moment im working on a plugin which should show how many likes the user recieved and gave on his Profile.
In the invitemod plugin i did it with add_js, but thats in my opinion not a really good way. Wouldnt it a good thing to have some 'custom_field' hook?
Or is there another better way?

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: Wedge way to add Profile Field
« Reply #1, on October 4th, 2014, 09:41 AM »
Still have no idea what this is about lol. I'll focus on plugins once 1.0 is out I guess..?

Anyway I should tell you that the feature in working on is precisely a rewrite of the like feature. I felt that since likes were an exclusive feature of Wedge and that elk now ships a 1.0 with the same feature (although not a good a ours: P), Wedge needs to retain its crown.

So... It will change eventually.

CerealGuy

  • Posts: 343
Re: Wedge way to add Profile Field
« Reply #2, on October 4th, 2014, 05:40 PM »
Focusing on Plugins is a good idea. Did some stuff with showing posts like http://wedge.org/profile/?area=showposts;sa=messages and it was a mess. Needed to copy nearly everything of showPosts(), which is a bit useless and could be done nicer. By the way it was for the same plugin :D

I feel like there are some hooks missing which could be quite important and are perhaps a reason why there are so less 3rd party developer on wedge.

Perhaps someone is interested in it: https://github.com/C3realGuy/we_CountLikes

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: Wedge way to add Profile Field
« Reply #3, on October 7th, 2014, 01:52 AM »
Where should this hook be added..?

Also, FYI, it's "received", not "recieved". ;) (see your README and plugin-info.xml files!)

CerealGuy

  • Posts: 343
Re: Wedge way to add Profile Field
« Reply #4, on October 7th, 2014, 07:21 PM »
In the moment i have it at the end of the loadCustomFields function in Profile.php.
Code: [Select]
call_hook('custom_fields', array($memID, $area, &$context['custom_fields']));

It's working, but needs a check for $area, otherwise it gets displayed in modify profile and on registration?! which would cause trouble. Also i didnt got fixed the privacy stuff for those fields. Privacy doesnt know those fields and throws errors.

Thanks for the FIY, helps me alot :cool: