get($tag_name, $curr_h_sym . $curr_h_val);
if (strtolower(substr($curr_pinput, 0, 2)) == '0x') {
$curr_hex = substr($curr_pinput, 2);
} elseif (substr($curr_pinput, 0, 1) == '#') {
$curr_hex = substr($curr_pinput, 1);
} else {
$curr_hex = $curr_pinput;
}
if (strspn($curr_hex, "0123456789abcdefABCDEF") == 6 && strlen($curr_hex) == 6) {
$curr_pinput = $curr_h_sym . $curr_hex;
} else {
$curr_pinput = $curr_h_sym . $curr_h_val;
}
return $curr_pinput;
}
}
$paramxml = 'slideShowV2Settings.xml';
$dockHeight = trim($params->get( 'dockHeight', '110' ));
$thumbWidth = trim($params->get( 'thumbWidth', '50' ));
$thumbHeight = trim($params->get( 'thumbHeight', '50' ));
$thumbdistance = trim($params->get( 'thumbdistance', '12' ));
$thumbborder = trim($params->get( 'thumbborder', '1' ));
$dockscalefactor = trim($params->get( 'dockscalefactor', '1.4' ));
$borderbigimage = trim($params->get( 'borderbigimage', '4' ));
$bgcolor = GetHColor($params, 'bgcolor', '2C2C2C');
$dockbgcolor = GetHColor($params, 'dockbgcolor', '111111');
$borderbigimagecolor = GetHColor($params, 'borderbigimagecolor', 'FFFFFF');
if ($params->get('show_arrow', 'yes') == 'yes') {
$showarrow .= 'true';
}else{
$showarrow .= 'false';
}
if ($params->get('show_fullscr', 'yes') == 'yes') {
$showfull .= 'true';
}else{
$showfull .= 'false';
}
if ($params->get('show_desc', 'yes') == 'yes') {
$showdescr .= 'true';
}else{
$showdescr .= 'false';
}
$autoplay = trim($params->get( 'autoplay', '6' ));
if ($params->get('loop', 'yes') == 'yes') {
$loop .= 'true';
}else{
$loop .= 'false';
}
$catppv_id = '';
$xml_param_data .= '
100%
100%
' . trim($dockHeight) .'
slideShowStyles.css
playlist.xml
' . trim($bgcolor) .'
100
' . trim($dockbgcolor) .'
100
0x000000
100
' . trim($thumbWidth) .'
' . trim($thumbHeight) .'
' . trim($thumbdistance) .'
' . trim($thumbborder) .'
0xFFFFFF
100
0x849ef3
100
' . trim($dockscalefactor) .'
false
true
' . trim($borderbigimage) .'
' . trim($borderbigimagecolor) .'
100
' . trim($showarrow) .'
0xFFFFFF
50
' . trim($showdescr) .'
0x000000
50
1.5
' . trim($showfull) .'
' . trim($autoplay) .'
' . trim($loop) .'
_blank
'
;
$module_path = dirname(__FILE__).DS;
$catppv_id .= md5($xml_param_data);
$xml_data_filename = $module_path.$catppv_id.'.xml';
if (!file_exists($xml_data_filename)) {
$xml_prodgallery_file = fopen($xml_data_filename,'w');
fwrite($xml_prodgallery_file, $xml_param_data);
///////// set chmod 0777 for creating .xml file if server is not windows
$os_string = php_uname('s');
$cnt = substr_count($os_string, 'Windows');
if($cnt ==0){
@chmod($xml_data_filename, 0777);
}
fclose($xml_prodgallery_file);
}
copy($module_path . $catppv_id . '.xml', $module_path . $paramxml);
unlink($xml_data_filename);
$bannerWidth = trim($params->get( 'bannerWidth', '100%' ));
$bannerHeight = intval($params->get( 'bannerHeight', 500 ));
$contentxml = 'playlist.xml';
$catppv_id = '';
$module_path = dirname(__FILE__).DS;
$imgdir = trim($params->get('imgdir', '' ));
$thudir = trim($params->get('thudir', '' ));
$imgsrc = trim($params->get('imgsrc', '' ));
$imgsrc_arr = explode("|",$imgsrc);
$imgdesc = trim($params->get('imgdsc', '' ));
$imgdsc_arr = explode("|",$imgdesc);
$xml_data_data .= '';
////////// start : noimage code //////////////
$exist_url = JURI::root();
$server_path = getCurUrl($exist_url);
//////////////////////////////////////////
foreach ($imgsrc_arr as $ik=>$curr_isrc) {
$xml_data_data .= '';
if (false === strpos($curr_isrc, '://')) {
$xml_data_data .= '
' . trim($server_path.$thudir) . '/' . trim($curr_isrc) . '';
$xml_data_data .= ' ' . trim($server_path.$imgdir) . '/' . trim($curr_isrc) . '';
if ($params->get('show_desc', 'yes') == 'yes') {
$xml_data_data .= ''.trim($imgdsc_arr[$ik]).']]>';
}else{
$xml_data_data .= '';
}
}else{
$xml_data_data .= '
' . trim($thudir) . '/' . trim($curr_isrc) . '';
$xml_data_data .= ' ' . trim($imgdir) . '/' . trim($curr_isrc) . '';
if ($params->get('show_desc', 'yes') == 'yes') {
$xml_data_data .= ''.trim($imgdsc_arr[$ik]).']]>';
}else{
$xml_data_data .= '';
}
}
$xml_data_data .= '
';
/////////////////// END ////////////////////////////
}
$xml_data_data .= '
';
$catppv_id .= md5($xml_data_data);
$xml_data_filename = $module_path.$catppv_id.'.xml';
if (!file_exists($xml_data_filename)) {
$xml_prodgallery_file = fopen($xml_data_filename,'w');
fwrite($xml_prodgallery_file, $xml_data_data);
///////// set chmod 0777 for creating .xml file if server is not windows
$os_string = php_uname('s');
$cnt = substr_count($os_string, 'Windows');
if($cnt ==0){
@chmod($xml_data_filename, 0777);
}
fclose($xml_prodgallery_file);
}
copy($module_path . $catppv_id . '.xml', $module_path . $contentxml);
unlink($xml_data_filename);
$exist_url = JURI::root();
$server_path = getCurUrl($exist_url);
/////////////////// HTML begin ////////////////////////////
$filehtml = 'adxmlgalleryok.html';
$htm_data_data .= '
slideShow_v2
';
$module_path = dirname(__FILE__).DS;
$catppv_id .= md5($htm_data_data);
$htm_data_filename = $module_path.$catppv_id.'.html';
if (!file_exists($htm_data_filename)) {
$htm_prodgallery_file = fopen($htm_data_filename,'w');
fwrite($htm_prodgallery_file, $htm_data_data);
///////// set chmod 0777 for creating .xml file if server is not windows
$os_string = php_uname('s');
$cnt = substr_count($os_string, 'Windows');
if($cnt ==0){
@chmod($htm_data_filename, 0777);
}
fclose($htm_prodgallery_file);
}
copy($module_path . $catppv_id . '.html', $module_path . $filehtml);
unlink($htm_data_filename);
?>