'; }I replaced it with:if ( trim($paramsvalues->imagever) == 'Yes' ) { $imver = ' function RefreshImageVer(imgverform) { var randnum = Math.random(); var newverimage = ''.$mosConfig_live_site.'/administrator/components/com_chronocontact/chrono_verification.php?\'+randnum; imgverform.imgver.src=newverimage; } ';}When I try to load the contact form I get the following error:arse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home2/public_html/components/com_chronocontact/chronocontact.php on line 78I am running the latest version of ChronoForm for Joomla! 1.5. I am running Joomla! 1.5 RC3Post edited by: krackerjax, at: 2007/12/03 05:44"> Refresh image validation code - Forums

Forums

Refresh image validation code

krackerjax 03 Dec, 2007
I tried the coding mentioned in http://www.chronoengine.com/component/option,com_easyfaq/task,cat/catid,24/Itemid,38/#faq33.

Firstly, I don't see a file named ChronoForms.php. I have a file named ChronoContact.php. My coding differs slightly from the one on the FAQ, though.

The coding I am supposed to be looking for is:

if ( trim($paramsvalues->imagever) == 'Yes' ) {
  $imver = '<input name="chrono_verification" type="text"
    id="chrono_verification" value="">
  <img src="'.$mosConfig_live_site
            .'/administrator/components/com_chronocontact/chrono_verification.php">';
}


The coding I have (around line 73) is:

if ( trim($paramsvalues->imagever) == 'Yes' ) {
        $imver = '<input name="chrono_verification" type="text" id="chrono_verification" value="">
              <img src="'.JURI::Base()
            .'components/com_chronocontact/chrono_verification.php?imtype='.$paramsvalues->imtype.'">';
    }


I replaced it with:

if ( trim($paramsvalues->imagever) == 'Yes' ) {
  $imver = '<script type="text/javascript">
    function RefreshImageVer(imgverform) {
      var randnum = Math.random();
      var newverimage = ''.$mosConfig_live_site
.'/administrator/components/com_chronocontact/chrono_verification.php?\'+randnum;
 imgverform.imgver.src=newverimage;
    }
  </script>
  <input name="chrono_verification" type="text" 
    id="chrono_verification" value="">
  <img src="'.$mosConfig_live_site
      .'/administrator/components/com_chronocontact/chrono_verification.php" name="imgver" id="imgver">
  <input type="button" value="refresh" 
    onclick="RefreshImageVer(this.form);" />';
}


When I try to load the contact form I get the following error:

arse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home2/public_html/components/com_chronocontact/chronocontact.php on line 78

I am running the latest version of ChronoForm for Joomla! 1.5. I am running Joomla! 1.5 RC3<br><br>Post edited by: krackerjax, at: 2007/12/03 05:44
GreyHead 03 Dec, 2007
Hi krackerjax,

As you've seen, there are two versions of ChronoForms at the moment. v2.3.6 is for Joomla 1.0.x and ChronoForms 2.5RC1 for Joomla 1.5

The 2.3.6 version will probably run on Joomla 1.5 in legacy mode but not as a 'normal' component, the 2.5RC1 version will not run on Joomla 1.0.x

YOu can often tell when code is for one version or the other by looking at the class prefixes. Joomla 1.0.x called things mosSomeName (mos for Mambo OS I guess); and Joomla 1.5 tends to use JSomeName.

In the two code snippets you can see src="'.$mosConfig_live_site . . . in the first and src="'.JURI::Base() . . . in the same place in the second. So the first version is for Joomla 1.0.x and the second for Joomla 1.5

Note that there is one other difference between the two which is the addition of the imtype parameter in a more recent version of ChronoForms (this allows the use of Imageverification without font management).

So the fix you have is for Joomla 1.0.x and you have Joomla 1.5. If we replace the mos names with their J equivalents then hopefully all will be well
if ( trim($paramsvalues->imagever) == 'Yes' ) {
  $imver = '<script type="text/javascript">
    function RefreshImageVer(imgverform) {
      var randnum = Math.random();
      var newverimage = JURI::Base()
.'/administrator/components/com_chronocontact/chrono_verification.php?\'+randnum;
 imgverform.imgver.src=newverimage;
    }
  </script>
  <input name="chrono_verification" type="text" 
    id="chrono_verification" value="">
  <img src="'.JURI::Base()      .'/administrator/components/com_chronocontact/chrono_verification.php" name="imgver" id="imgver">
  <input type="button" value="refresh" 
    onclick="RefreshImageVer(this.form);" />';
}
(I'm not entirely certain of the quotes in here. Let me know if there's still a parsing problem.)

Apologies for the long-winded reply but I'm sure you won't be the last to have this kind of problem with the two versions.

Bob
This topic is locked and no more replies can be posted.