10-Nov-2016, 01:19 PM
This is the community forum. For a developer response use the Client Area.
10-Nov-2016, 10:29 PM
Hi MG2K4,
The place to add your code would be in /upload/frontend/controller/main/form.php in the submit() method. In there you can get the name and email that was posted and do any checks you want to do against your other database.
Yes it'd be best to append the code which sets the user's details to the integration code. It might then look something like this:
The place to add your code would be in /upload/frontend/controller/main/form.php in the submit() method. In there you can get the name and email that was posted and do any checks you want to do against your other database.
Yes it'd be best to append the code which sets the user's details to the integration code. It might then look something like this:
PHP Code:
<?php
if (isset($_SESSION['name'])) {
$cmtx_name = $_SESSION['name'];
$cmtx_email = $_SESSION['email'];
$cmtx_country = $_SESSION['country'];
}
$cmtx_identifier = $id;
$cmtx_reference = $title;
$cmtx_folder = '/comments/';
require($_SERVER['DOCUMENT_ROOT'] . $cmtx_folder . 'frontend/index.php');
?>
In the admin panel, if you go to 'Settings -> Layout -> Form', you can edit each of those three fields and change the 'Filled (Login)' setting to 'Hide'. This way, if you provide the login info, the user will never see those fields. If you don't provide it (i.e. the user is not logged in), the fields will be visible and work like normal.
Also it's worth pointing out about the country that you'll need to match the exact value from the select field for it to work. So in your code if for example you provide the value 'United States' it won't select 'US'. As such, you may need to do a few if statements or a switch statement in your integration code to convert them first. One of the improvements I'm considering is to allow the 3 letter ISO code of the country to be provided as a value so that there isn't this discrepancy of how they're named. Would that help with integrations like yours?
That would be great if you could share some translations. It's something which the project is lacking following the major update.
11-Nov-2016, 10:45 PM
Yep your answer definitely gives me hints to start working on it, thanks !
And will be a pleasure to give you help on this ! As soon as I got it well set up I take care of that
And will be a pleasure to give you help on this ! As soon as I got it well set up I take care of that
« Next Oldest | Next Newest »
Possibly Related Threads…
Thread / Author
Replies
Views
Last Post
Users browsing this thread: 1 Guest(s)