548 Posts
joomleb
6 years ago
9
Topic

Hi guys, 

as we know, enabling the SEBLOD User Bridge plugin, each time a User is created/modified (in case the bridge is activated in a second moment), an Article will also be added automatically, and both will be linked. A profile URL will be created for the "Article" (we can manage it through the "Default Title" plugin option that define how the profile article will be titled).


Now, I need to define a Registration process like:

1 - Guests can Register to the site with joomla default basic fields: Username / Name / password (using the SEBLOD User Registration form, but also doing it with Joomla Registration form should not create any problem)... and they become "Registered"

2 - Registered, playing with field restrictions, can complete Registration adding more informations and uploading a pdf. When the pdf is read and confirmed they become "Confirmed"

3 - Confirmed can buy a Subscription and they become "Member Club"

4 - When They are "Member Club" new empty fields will appear on their Profile, always playing with field restrictions, and they'll can complete again their profile. At this moment, only this one, the User Bridge will be activated and the Article and its profile URL will be created (as defined). Please, How to have it working ? Is the "Access" field plugin the case (Joomla! User Object Plug-in for SEBLOD) ?


Many Thanks for help and support

Get a Book for SEBLOD
1283 Posts
Bucklash
6 years ago
1
Level 1

Hi

One idea might be to not bother with bridge plugin

When conditions are met, show a button  that will (using afterstore)

update #_cck_core.pkb with id of associated article id.

ie if ($field['add_bridge']->form == 1)

{

... update table

}

This way you would be in full control of the article, it's category etc. 

Just an idea....

548 Posts
joomleb
6 years ago
0
Level 2

Hi Bucklash, 

many thanks for your reply, but I'm not a programmer, so I cannot fully understand your suggestion. Please, Can you explain me a little bit more detailed ?

As far as I know the User Bridge plugin creates and associates a joomla Article and its profile URL for each user as as defined by the plugin.

Practically I'm looking for a way to activate the User Bridge plugin only for a Joomla Group (following ACL permissions), only when users paid a subscription.

4229 Posts
Kadministrator
6 years ago
6
Level 1

Hi Joomlaeb, 

I'm afraid Bucklash is right - you need a coder to do this for you, don't think there is way to solve this with core Seblod only.

548 Posts
joomleb
6 years ago
5
Level 2

Hi Klas,

thanks for your reply, as far as I understand from your answer, there is no ways to activate the User Bridge plugin only for a Joomla Group (following ACL permissions). Am I right ?

I ask you and to all members here, Do you think would be a good "Pull Request" new feature to add at the User Bridge plugin ?

Then, yes, I'm agree I need a coder, but this doesn't mean I cannot understand and day by day try to improve my abilty on use Seblod.

Bucklash (thanks) suggested:

- When conditions are met = Ok, the usergroup for ex. - using Joomla! ACL Pack (3 plug-ins)

- show a button that will (using afterstore) - create content dinamically using code

- update #_cck_core.pkb with id of associated article id

   A - What is the "#_cck_core.pkb" table ?

   B - "with id of associated article id" = this mean the article has yet been created, when ?

   C - another work of the User Bridge plugin is to create the Article profile URL, in this case, When it will be created ?

1283 Posts
Bucklash
6 years ago
4
Level 3

Hi Joomleb

Might get a chance to add an example later. it in the meantime (and from memory):

A - What is the "#_cck_core.pkb" table ?

Seblod has the table #__cck_core

When you create content using seblod, an entry is created in here. The id in #__cck_core is the cck::453 number you see in articles etc

One of its columns is pk: this is the id of the content

One of its columns is pkb: this is the id of the article being used as a bridge

So....

you have to create your content ie user, and then ...

... you create an article, ...

... and then grab that article's id and update the content ie user in #__cck_core.pkb

B - "with id of associated article id" = this mean the article has yet been created, when ?

No, you have to create it

C - another work of the User Bridge plugin is to create the Article profile URL, in this case, When it will be created ? No idea about that.  

548 Posts
joomleb
6 years ago
3
Level 4

Hi Bucklash, 

many thanks for explanations, too appreciated. So, recapitulating:

- When conditions are met = Ok, the usergroup for ex. - using Joomla! ACL Pack (3 plug-ins)

- show a button that will (using afterstore) - create content dinamically using code

- update #_cck_core.pkb "with id of associated article id" = this mean the article has yet been created, when ? No, you have to create it.

But, automatically create an "Article" for each user and its customized Article profile URL is the SEBLOD User Bridge plugin work. How? When created, associate the Article ID as you explaned.

Am I missing anything ?


Not being a programmer, I countinue to suppose that implement a "Joomla Group (following ACL permissions)" field to the User Bridge plugin is the most simple solution and useful for all user. In that way a new feature is added to the plugin: when enabled, it will be activated (it will begin to run) only from that usergroup/ACL...

I'd like to hear from you opinions, suggestions etc.

1283 Posts
Bucklash
6 years ago
2
Level 5

Hi

The way I imagine it is to create bridge your self. Do not use the USER Bridge plugin.

1

In afterstore get $config['pk'] of what ever it is you are saving (not the bridged article).

($config['pk'] only exists once you have saved for the first time)

We need this to use later

2

Create Article using afterstore

// Create the instance.
$newData = new JCckContentJoomla_Article;


// Populate the instance
$addData = $newData->create(

// Content Type
'some_content_type',

// Joomla Table ie #__content
array('title' => 'some_title', etc...),

// Seblod 'Local' Table i.e. specific to content type ie #__cck_store_form_some_content_type
array('some_db_column' => $config['storages']['#__cck_store_form_some_content_type']['some_db_column'], etc...),

// Seblod 'Global' Table i.e. specific to object ie #__cck_store_item_content
array('some_global_db_column' => $config['storages']['#__cck_store_item_content']['some_global_db_column'], etc...)
)


<br>

3

Get it's id using Selecting_data_using_JDatabase

4

Update #__cck_core.pkb with id retrieved from step 3 where pk = pk from step 1 using Inserting,_Updating_and_Removing_data_using_JDatabase

// Create an object for the record we are going to update.
$object = new stdClass();

// Must be a valid primary key value.
$object->id = $config['pk'];
$object->pkb = $idFromTheArticleYouCreated;

// Update their details in the users table using id as the primary key.
$result = JFactory::getDbo()->updateObject('#__cck_core', $object, 'id');

This way you create the bridge exactly when you want to, and with control over the category etc...

Does that help?

548 Posts
joomleb
3 years ago
1
Level 6

Hi Bucklash,
after 3 years I'm again here because all the workarounds are not enough and this your solution promise to be the best.

1 - I'm not a real developer, Please, Can you help with a more detailed step by step Tutorial here ?

2 - This GitHub to do ticket seems is working on the same feature, maybe Can you help there ? 

1283 Posts
Bucklash
3 years ago
0
Level 7

Hi Joomleb

Don’t mind helping, can do over a skype chat if helps.

That said, I am not doing web stuff anymore so might be a bit rusty.

Get a Book for SEBLOD