I've been using Chronoforms V4 for many years ans have used the Barcode generator without any problems under V4. However with the recent change to Joomla 3.5 and the need to upgrade Chronoforms V5 I can't seem to get the custom code provided to work under V5 to generale the barcode.
The custom field php code that worked great under CCV4 follows:
You'll notice I would change the red highlighted code to reflect the correct folder directory for CCV5 (chronoforms5}.
I've made sure the barcode.php was added to the cc5 directory. But when I go to view the form, the
first thing I notice is all the formatting is stripped and the remaining Actions such as captcha and submit buttons are removed and no barcode generated.
I've noticed that under CCV5, the custom code field does not include all the fields that are under CCV4 see attached. Field Name and Field ID are missing under CCV5.
Your assistance is appreciated.
Thanks
The custom field php code that worked great under CCV4 follows:
<?php
if ( !$mainframe->isSite() ) { return; }
/*
function to generate a random alpha-numeric code
using a specified pattern
*
* @param $pattern string
* @return string
*/
function generateIdent($pattern='9999999')
{
$alpha = array("A","B","C","D","E","F","G","H",
"J","K","L","M","N","P","Q","R","S","T","U","V","W",
"X","Y","Z");
$digit = array("1","2","3","4","5","6","7","8","9");
$return = "";
$pattern_array = str_split($pattern, 1);
foreach ( $pattern_array as $v ) {
if ( is_numeric($v) ) {
$return .= $digit[array_rand($digit)];
} elseif ( in_array(strtoupper($v), $alpha) ) {
$return .= $alpha[array_rand($alpha)];
} else {
$return .= " ";
}
}
return $return;
}
?>
<p>Registration ID</p>
<?php
$ident = generateIdent();
echo "<img src='".JURI::base()
."components/com_chronoforms/includes/barcode.php?barcode="
.$ident."&width=320&height=80' />";
?>
You'll notice I would change the red highlighted code to reflect the correct folder directory for CCV5 (chronoforms5}.
I've made sure the barcode.php was added to the cc5 directory. But when I go to view the form, the
first thing I notice is all the formatting is stripped and the remaining Actions such as captcha and submit buttons are removed and no barcode generated.
I've noticed that under CCV5, the custom code field does not include all the fields that are under CCV4 see attached. Field Name and Field ID are missing under CCV5.
Your assistance is appreciated.
Thanks