ChronoEngine Forums
Welcome, Guest
Please Login or Register.    Lost Password?
Re:Insert cf_id into the response email (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Re:Insert cf_id into the response email
#6737
jeffw (User)
Fresh Boarder
Posts: 4
graphgraph
User Offline Click here to see the profile of this user
Re:Insert cf_id into the response email 1 Month, 3 Weeks ago Karma: 0  
Hi Bob, Max,

I realized after I could pass a value from the On Submit code to the autogenerated code, that autogenerate was run last.

So instead I turned off emails in the plugin and send them after the autogenerate code, so I can use the id.

Thanks both for your help!
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#6929
OCS (User)
Fresh Boarder
Posts: 11
graphgraph
User Offline Click here to see the profile of this user
Re:Insert cf_id into the response email 1 Month, 2 Weeks ago Karma: 0  
jeffw wrote:
QUOTE:

So instead I turned off emails in the plugin and send them after the autogenerate code, so I can use the id.

Hi, i'm struggling with the same problem. Can you give example code how did you do it and where to place the code?

Thanks if you can help.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#6930
OCS (User)
Fresh Boarder
Posts: 11
graphgraph
User Offline Click here to see the profile of this user
Re:Insert cf_id into the response email 1 Month, 2 Weeks ago Karma: 0  
jeffw wrote:
QUOTE:

So instead I turned off emails in the plugin and send them after the autogenerate code, so I can use the id.

Hi, i'm struggling with the same problem. Can you give example code how did you do it and where to place the code?

Thanks if you can help.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#6931
jeffw (User)
Fresh Boarder
Posts: 4
graphgraph
User Offline Click here to see the profile of this user
Re:Insert cf_id into the response email 1 Month, 2 Weeks ago Karma: 0  
This worked for me, but it does require making changes to chronocontact.php and I'll repeat what the Autogenerated tab says: "Please don't touch this unless you know what you are doing". Also remember to make a backup of your form and chronocontact.php before making any changes.

What I did was switch the Onsubmit after sending email code to run after the Autogenerate code.

Replace (starting on line 493)
Code:

/** * Run the On-submit 'post e-mail' code if there is any */ if ( !empty($rows[0]->onsubmitcode) ) { eval( "?>".$rows[0]->onsubmitcode ); } /** * Run the SQL query if there is one */ if ( !empty($rows[0]->autogenerated) ) { eval( "?>".$rows[0]->autogenerated ); }
With
Code:

/** * Run the SQL query if there is one */ if ( !empty($rows[0]->autogenerated) ) { eval( "?>".$rows[0]->autogenerated ); } /** * Run the On-submit 'post e-mail' code if there is any */ if ( !empty($rows[0]->onsubmitcode) ) { eval( "?>".$rows[0]->onsubmitcode ); }
Then you can query the cf_id in the Autogenerated code with
Code:

$return_id = $database->insertid();
so it will be available in the Onsubmit code.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#7015
OCS (User)
Fresh Boarder
Posts: 11
graphgraph
User Offline Click here to see the profile of this user
Re:Insert cf_id into the response email 1 Month, 2 Weeks ago Karma: 0  
jeffw wrote:
QUOTE:
Then you can query the cf_id in the Autogenerated code with
Code:

$return_id = $database->insertid();
so it will be available in the Onsubmit code.
Thank you. This helped me a lot!
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#7016
GreyHead (Admin)
Admin
Posts: 2153
graph
User Offline Click here to see the profile of this user
Re:Insert cf_id into the response email 1 Month, 2 Weeks ago Karma: 44  
Hi jeffw & OCS,

You can get the same result without hacking the core code if you add your 'OnSubmit after' code at the bottom of the Autogenerated Code box (after the existing AutoGenerated code). Not perfect but easier than remembering to re-hack the core if you upgrade.

Bob
 
Report to moderator   Logged Logged  
 
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
  The administrator has disabled public write access.
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop


equalheight If you have any questions you can post to our forums and we will be glad to help ASAP

Members Login






Lost Password?
No account yet? Register

2CheckOut.com Inc. (Ohio, USA) is an authorized retailer for
goods and services provided by ChronoEngine.com

ChronoForms License

equalheightTo be able to continue working at this component we decided to get a small profit out of it but at the same time don't force everybody to pay in order to use this great component.

 

 From version 1.5 and up a link at the bottom of everyform created will be placed, saying "joomla professional work", the link will be to us here htttp://www.chronoengine.com, its illegal to remove this link from the source code unless you have a license,

so the license is very simply for the same ChronoForms component without a link, thats all!

This License is for 5 different websites ONLY. 

 

 However, in order to allow everybody to still use the component and even get out of this, the link is inside a div with class : chronoform , use this to hide the link by using different colors or whatever if you really can't pay, but of course the link is still exists at your page source.

 

The license is ONLY 25$ can be bought here :

 

Thank you!

 

ChronoEngine.com Team 

Joomla Templates and Joomla Tutorials