]*href=(\"??)([^\" >]*?)\\1[^>]*>(.*)<\/a>";
if(preg_match_all("/$regexp/siU", $input, $matches)) {
if (isset($matches[2])) {
$atts['src'] = $matches[2][0];
}
}
}
}
}
extract(shortcode_atts(array('securitykey' => 'not set',
'src' => $options['src'], 'height' => $options['height'], 'width' => $options['width'],
'frameborder' => $options['frameborder'], 'scrolling' => $options['scrolling'],
'marginheight' => $options['marginheight'], 'marginwidth' => $options['marginwidth'],
'transparency' => $options['transparency'], 'content_id' => $options['content_id'],
'content_styles' => $options['content_styles'], 'hide_elements' => $options['hide_elements'],
'class' => $options['class'], 'url_forward_parameter' => $options['url_forward_parameter'],
'id' => $options['id'], 'name' => $options['name'],
'onload' => $options['onload'],
'onload_resize' => $options['onload_resize'],
'onload_scroll_top'=> $options['onload_scroll_top'],
'additional_js'=> $options['additional_js'],
'additional_css'=> $options['additional_css'],
'store_height_in_cookie'=> $options['store_height_in_cookie'],
'additional_height' => $options['additional_height'],
'iframe_content_id' => $options['iframe_content_id'],
'iframe_content_styles' => $options['iframe_content_styles'],
'iframe_hide_elements' => $options['iframe_hide_elements'],
'onload_show_element_only' => $options['onload_show_element_only'],
'include_url' => $options['include_url'],
'include_content' => $options['include_content'],
'include_height' => $options['include_height'],
'include_fade' => $options['include_fade'],
'include_hide_page_until_loaded' => $options['include_hide_page_until_loaded'],
)
, $atts));
} else {
// only the secrity key is read.
extract(shortcode_atts(array('securitykey' => 'not set'), $atts));
}
if (empty ($id)) {
$id = 'advanced_iframe';
}
if (empty ($name)) {
$name = 'advanced_iframe';
}
echo '' . "\n";
echo '' . "\n";
if ($store_height_in_cookie == 'true') {
echo '';
}
if ($additional_height != 0) {
echo '';
}
echo '' . "\n";
if ($options['securitykey'] != $securitykey) {
echo '' . __('An invalid security key was specified. Please use at least the following shortcode:
[advanced_iframe securitykey="<your security key - see settings>"]. Please also check in the html mode that your shortcode does only contain notmal spaces and not a instead.', 'advanced-iframe') . '
';
return;
} else {
// add parameters
if ($url_forward_parameter != '') {
$sep = "&";
if (strpos($src, '?') === false) {
$sep = '?';
}
$parameters = explode(",", $url_forward_parameter);
foreach ($parameters as $parameter) {
$read_param_esc = $this->param($parameter);
if ($read_param_esc != '') {
$src .= $sep . $parameter . "=" . $read_param_esc;
$sep = "&";
}
}
}
$html = '';
if (empty($include_url)) {
if ((!empty($content_id) && !empty($content_styles)) || !empty($hide_elements)) {
// hide elements is called directy in the page to hide elements as fast as quickly
$hidehtml = '';
if (!empty($hide_elements)) {
$hidehtml .= "jQuery('" . esc_html($hide_elements) . "').css('display', 'none');";
}
if (!empty($content_id)) {
$elements = esc_html($content_id); // this field should not have a problem if they are encoded.
$values = esc_html($content_styles); // this field style should not have a problem if they are encoded.
$elementArray = explode("|", $elements);
$valuesArray = explode("|", $values);
if (count($elementArray) != count($valuesArray)) {
echo '' . __('Configuration error: The attributes content_id and content_styles have to have the amount of value sets separated by |.', 'advanced-iframe') . '
';
return;
} else {
for ($x = 0; $x < count($elementArray); ++$x) {
$valuesArrayPairs = explode(";", trim($valuesArray[$x], " ;:"));
for ($y = 0; $y < count($valuesArrayPairs); ++$y) {
$elements = explode(":", $valuesArrayPairs[$y]);
$hidehtml .= "jQuery('" . $elementArray[$x] . "').css('" . $elements[0] . "', '" . $elements[1] . "');";
}
}
}
}
$html .= '';
}
// jQuery("#advanced_iframe").contents().find("#iframe-div").css("border","4px solid blue");
$hideiframehtml = '';
if ((!empty($iframe_content_id) && !empty($iframe_content_styles))|| !empty($iframe_hide_elements)) {
// hide elements is called directy in the page to hide elements as fast as quickly
$hideiframehtml = '';
if (!empty($iframe_hide_elements)) {
$hideiframehtml .= "jQuery('#".$id."').contents().find('" .
esc_html($iframe_hide_elements) . "').css('display', 'none');";
}
if (!empty($iframe_content_id)) {
$elements = esc_html($iframe_content_id); // this field should not have a problem if they are encoded.
$values = esc_html($iframe_content_styles); // this field style should not have a problem if they are encoded.
$elementArray = explode("|", $elements);
$valuesArray = explode("|", $values);
if (count($elementArray) != count($valuesArray)) {
echo '' . __('Configuration error: The attributes iframe_content_id and iframe_content_styles have to have the amount of value sets separated by |.', 'advanced-iframe') . '
';
return;
} else {
for ($x = 0; $x < count($elementArray); ++$x) {
$valuesArrayPairs = explode(";", trim($valuesArray[$x], " ;:"));
for ($y = 0; $y < count($valuesArrayPairs); ++$y) {
$elements = explode(":", $valuesArrayPairs[$y]);
$hideiframehtml .= "jQuery('#".$id."').contents().find('" . $elementArray[$x]
. "').css('" . $elements[0] . "', '" . $elements[1] . "');";
}
}
}
}
if ($hideiframehtml != '') {
$html .= '';
}
}
$html .= "