Forums

Chronoform with acajoom

dasinfomedia 08 May, 2009
Hi There,
I am trying to bridge acajoom with chronoform. I have tried all the solution available here on this forum including the curl plugin as this seems the url problem.

I have the check list of newsletters in my form which is like this.
<input id="strRequestList[]" name="strRequestList[]" value="1" type="checkbox">

<input id="strRequestList[]" name="strRequestList[]" value="2" type="checkbox">

<input id="strRequestList[]" name="strRequestList[]" value="3" type="checkbox">


Now if more then one checkboxes selected I want to retain those values in array and I am passing that variable like this

index.php?option=com_acajoom&act=subscribe&name=$name&email=$email&listid=strRequestList[]


But appaently user doesn't get signed up for any newsletter with the above code whereas if I use "hardcode" like this
index.php?option=com_acajoom&act=subscribe&name=$name&email=$email&listid=1,2,3


user does get signed up.

Basically I want the dynamic values passing in to the acajoom sign up url.

Thanks
Max_admin 10 May, 2009
Hi dasinfomedia,

replace :
strRequestList[]

by
implode(",", JRequest::getVar('strRequestList'))


in the URL so it looks like:

"index.php?option=com_acajoom&act=subscribe&name=$name&email=$email&listid=".implode(",", JRequest::getVar('strRequestList'));


I added the extra quotes which you need to use at this PHP line!

Cheers
MAx
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
dasinfomedia 18 May, 2009
Thanks for the reply,

Although its still not working. I think we can not use double quotes" as we are having the url in the FORM URL tab and not in the FORM CODE tab.

I do have email checkbox checked in general settings.
I have tried to include the following code in both on submit-before sending email and on submit -after sending email.
$list=implode(",", JRequest::getVar('strRequestList'));

I am using the above $list variable in the FORM URL like this
index.php?option=com_acajoom&act=subscribe&name=$name&email=$email&listid=$list

Can you please help us out quickly.
Max_admin 19 May, 2009
Hi dasinfomedia,

any URLs with PHP code need to go in the onSubmit box! please follow the post made by adrien with username acajoom here, I think this is the code which needs to go in the onSubmit after email box:


<?php
$MyForm->setFormData('redirecturl', "index.php?option=com_acajoom&act=subscribe&name=$name&email=$email&listid=".implode(",", JRequest::getVar('strRequestList')););
?>


Cheers
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
dasinfomedia 21 May, 2009
Max,

I really appreciate your help. Unfortunately I have tried on submit after email for few times but I had no luck with it. This is the code I am using as per your instruction and I am getting the blank page.

<?php
    // Get the ChronoForms data
    $MyForm =&CFChronoForm::getInstance();

    // Get the base url
    $uri_base =&JURI::base();

    // Create a new url object
    $uri =&JURI::getInstance( $uri_base );

    // Set the parameters for the Acajoom subscription
    $params = array(
        'option' => 'com_acajoom',
        'act' => 'subscribe',
        'listid' => 1,//I am using this for testing only I would need checkbox values
        'name' => JRequest::getVar('name'),
        'email' => JRequest::getVar('email'),
        'receive_html' => 1,
        'redirectlink' => $MyForm->formparams->redirecturl
        );
    $query = $uri->buildQuery( $params );
    $uri->setQuery( $query );

    // Set the new ChronoForms ReDirect URL
    $MyForm->setFormData( "index.php?option=com_acajoom&act=subscribe", $uri->toString() );
    ?>


Thanks in advance
Max_admin 21 May, 2009
Hi dasinfomedia,

Please backup and remove all your code and just use my snippet here:
http://www.chronoengine.com/forums/posting.php?mode=reply&f=2&t=14258#pr32690

then let me know what happens, your code has some bugs and longer than needed to test it and find if its working or not, it should simply work with the 1 line I posted, this has been confirmed working by one of the acajoom team members before!

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
dasinfomedia 22 May, 2009
Hi MAX,

We are using the snippet suggested by you and it still goes to the blank page. This is the page

http://69.89.27.250/~healthqo/index.php?option=com_chronocontact&chronoformname=test

Here is the code

<?php
$email = JRequest::getVar('email', '', 'post');
$name = JRequest::getVar('name', '', 'post');
$MyForm->setFormData('redirecturl', "index.php?option=com_acajoom&act=subscribe&name=$name&email=$email&listid=".implode(",", JRequest::getVar('strRequestList')););
?>


Thanks
Max_admin 24 May, 2009
Ok, looks like there was a typo, I removed a semi colon, please set your code to be:
    <?php
    $email = JRequest::getVar('email', '', 'post');
    $name = JRequest::getVar('name', '', 'post');
    $MyForm->setFormData('redirecturl', "index.php?option=com_acajoom&act=subscribe&name=$name&email=$email&listid=".implode(",", JRequest::getVar('strRequestList')));
    ?>


let me know!

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Max_admin 25 May, 2009
Hi,

your Chronoforms version is outdated, which version do you have installed ? I think the code will not work if you have any version before RC4.11, I suggest getting RC5!

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
dasinfomedia 30 May, 2009
Thanks for all your support.
With the latest release candidate I have managed to solve my problem.
This topic is locked and no more replies can be posted.