332 Posts
Kenneth
9 years ago
3
Topic

Hi,

I'm looking to run some PHP on a form submit. I want the PHP to pick up some of the details from the form.

Is there a field or native way of doing this?

Get a Book for SEBLOD
9 years ago
0
Level 1

Hi Kenneth,

Thank you for your post.

To implement what you described in your post you can use "before store" or "after store" fields included in the "code pack" package in the seblod market.

Regards,
Mehdi

332 Posts
Kenneth
9 years ago
0
Level 1

Thank you!

If it's allright, I've got a follow up question.

I want to create a AcyMailing list on submit of the Seblod form, using AcyMailings API.

The code:

$newlist = new stdClass();
$newlist->name = 'Your list name';
$newlist->description = 'Your list description'; //this parameter is optional
 
if(!include_once(rtrim(JPATH_ADMINISTRATOR,DS).DS.'components'.DS.'com_acymailing'.DS.'helpers'.DS.'helper.php')){
 echo 'This code can not work without the AcyMailing Component';
 return false;
 }
 
$listClass = acymailing_get('class.list');
$listid = $listClass->save($newlist); //This function will create the list and return the ID of the created list

So, seeing that the end $listid will be returned from AcyMailing, and I need to use this ID later to make sure that users signing up through Seblod gets added to the correct list: Is it before store I should use?

9 years ago
0
Level 1

Hello Kenneth,

when creating content, the difference between Beforestore and afterstore is in the variable $config :

  • Beforestore :  $config['pk'] = 0
  • Afterstore : $config['pk'] = id of the content stored

If you need to link the content stored with other contents in other tables you must use the afterstore.

Regards.

Lionel

Get a VIP membership