Field plugins

12 years 2 months ago #44759 by mikko
CB with field plugins. The attached zip file contains patched files and an example of a field plugin. The files should replace the CB files with the same name.

This patch enables creating of additional field types as plugins.

A field plugin extends class cbFieldHandler and implements 3 methods
-getFieldValue for displaying field value on profile
-getFieldEntry for displaying field edit on profile edit
-prepareFieldDataSave to prepare user input for saving to database.

The patch is around 30-40 lines of code, if excluding comments and empty lines. No changes to DB required.

-Mikko

Attachment cb_fileld_plugins.zip not found

Attachments:
12 years 2 months ago #44760 by beat
Thanks Mikko,

Will look at this as just discussed off-forum :)

Beat - Community Builder Team Member

Before posting on forums: Read FAQ thoroughly -- Help us spend more time coding by helping others in this forum, many thanks :)
CB links: Our membership - CBSubs - Templates - Hosting - Forge - Send me a Private Message (PM) only for private/confidential info
12 years 2 months ago #44761 by mikko
OK, cool. I will probably post a couple of changes to the userslist SQL to this same thread.

-Mikko
12 years 2 months ago #45323 by kmharper
I need something that allows the CB registration page to operate as a GET rather than a POST form.

Mikko, does your plugin do this?

In other words, I'd like the following URL...

[code:1]index.php?option=com_comprofiler&task=registers&firstname=Joe[/code:1]

...would pre-fill the "First" name field with the value "Joe".

If that's not what your plugin does, can you tell me if this is something that might be feasible to do in CB?
12 years 2 months ago #45441 by beat
It's not very recommended to use GETs... against spambots...

In addition, we have anti-spamming/anti-spoofing in the POST, which would need to be disabled.... :(

You would need to change the function in comprofiler.php to do that.

Beat - Community Builder Team Member

Before posting on forums: Read FAQ thoroughly -- Help us spend more time coding by helping others in this forum, many thanks :)
CB links: Our membership - CBSubs - Templates - Hosting - Forge - Send me a Private Message (PM) only for private/confidential info
10 years 4 months ago #104939 by unknonw
Hi Mikko,

cb_fileld_plugins.zip is for CB 1.2 right? I have replaced your files and it appears me a blank page when I choose CommunityBuilder from Components menu.

In fact I want to build a CB Plugin which will handle the Country & the Flags of the countries; The way I think there are 2 possibilities:
  • creating a new filed type [drop down list | single-select + image tag - best example which I can give you is http://demo.cubecart.com/cc4/ ; make sure you visit that url with Firefox -]. Check the left side of the site at language selection.
  • the second option could be a CB Plugin using 2 fields [at least]; [drop-down single-select & image field type {read-only} ]

I have all the Countries flags & the structure of the MySQL table [which I think its good, but I'm not sure for that].

Could you please help me to start it? A little help from an J 1.5 and CB expert will be grateful.

Thank you B)

Post edited by: unknonw, at: 2009/07/15 00:10
Moderators: beatnantkrileon
Time to create page: 0.430 seconds
Facebook Twitter Google LinkedIn