| 1 |
<?php |
| 2 |
/** |
| 3 |
* @author Hans Matzen |
| 4 |
* @copyright 2009 |
| 5 |
* @since 2.4 |
| 6 |
* @description wp-forecast using wordpress shortcode for more features |
| 7 |
* @Docs http://codex.wordpress.org/Shortcode_API |
| 8 |
*/ |
| 9 |
|
| 10 |
if (!function_exists('wpforecast')) |
| 11 |
{ |
| 12 |
function wpforecast($atts) |
| 13 |
{ |
| 14 |
// parameter einlesen |
| 15 |
if ( is_array($atts) ) |
| 16 |
extract($atts); |
| 17 |
|
| 18 |
if ($id == '') |
| 19 |
$id='A'; |
| 20 |
|
| 21 |
// iframe tag zusammen bauen |
| 22 |
$res='<iframe class="wpf-iframe" src="'.get_settings('siteurl'). |
| 23 |
'/wp-content/plugins/wp-forecast/wp-forecast-show.php?wpfcid='. |
| 24 |
$id.'&header=1'; |
| 25 |
|
| 26 |
// falls eine sprache angegeben wurde haengen wir sie hinten dran |
| 27 |
if ($lang != '') |
| 28 |
$res .= '&lang='.$lang; |
| 29 |
|
| 30 |
$res .= '" '; |
| 31 |
|
| 32 |
// falls eine breite angegeben wurde haengen wir sie hinten dran |
| 33 |
if ($width != '') |
| 34 |
$res .= "width='$width' "; |
| 35 |
|
| 36 |
// falls eine sprache angegeben wurde haengen wir sie hinten dran |
| 37 |
if ($height != '') |
| 38 |
$res .= "height='$height' "; |
| 39 |
|
| 40 |
$res .='>'.__("wp-forecast shortcode: This browser does not support iframes.","wp-forecast_".$lang).'</iframe>'; |
| 41 |
|
| 42 |
return $res; |
| 43 |
} |
| 44 |
} |
| 45 |
// shortcode bei wp anmelden |
| 46 |
if (function_exists('add_shortcode')) |
| 47 |
add_shortcode('wpforecast','wpforecast'); |
| 48 |
|
| 49 |
?> |