Changeset 1649763
- Timestamp:
- 05/02/2017 03:35:05 PM (9 years ago)
- Location:
- live-widget-luftdaten
- Files:
-
- 3 added
- 2 edited
-
tags/1.2.0 (added)
-
tags/1.2.0/live-widget-luftdaten.php (added)
-
tags/1.2.0/readme.txt (added)
-
trunk/live-widget-luftdaten.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
live-widget-luftdaten/trunk/live-widget-luftdaten.php
r1649150 r1649763 4 4 Plugin URI: http://www.bleeptrack.de/feinstaub-widget/ 5 5 Description: Plugin with widget to show live data from a luftdaten.info sensor 6 Version: 1. 1.06 Version: 1.2.0 7 7 Author: Bleeptrack 8 8 Author URI: http://www.bleeptrack.de/ … … 387 387 388 388 $name=$values->value_type; 389 if (!array_key_exists($name, $instance)) {389 //if (!array_key_exists($name, $instance)) { 390 390 $this->items[$name]=$name; 391 }391 //} 392 392 393 393 } … … 423 423 424 424 425 ///shortcodes 426 427 // [feinstaublive title="Titel" sensorIDs="260,262"] 428 function feinstaublive($atts) { 429 430 $widget_name = "LuftdatenWidget"; 431 432 if(isset($atts['title'])){ 433 $title = $atts['title']; 434 }else{ 435 $title = "Feinstaub Live Info"; 436 } 437 438 439 $attr = array( 440 'title' => $title, 441 ); 442 443 if(isset($atts['sensorids'])){ 444 $comma_separated = explode(",", $atts['sensorids'] ); 445 446 foreach ($comma_separated as $value) { 447 $attr[trim($value)] = new Sensor( trim($value) ); 448 } 449 450 } 451 452 453 ob_start(); 454 the_widget($widget_name,$attr); 455 $output = ob_get_contents(); 456 ob_end_clean(); 457 return $output; 458 459 } 460 add_shortcode('feinstaublive','feinstaublive'); 461 462 function feinstaubampel($atts) { 463 464 $widget_name = "LuftdatenAmpel"; 465 466 if(isset($atts['title'])){ 467 $title = $atts['title']; 468 }else{ 469 $title = "Feinstaubampel"; 470 } 471 472 473 $attr = array( 474 'title' => $title, 475 ); 476 477 if(isset($atts['sensorids'])){ 478 $comma_separated = explode(",", $atts['sensorids'] ); 479 480 foreach ($comma_separated as $value) { 481 $attr[trim($value)] = new Sensor( trim($value) ); 482 } 483 484 } 485 486 487 ob_start(); 488 the_widget($widget_name,$attr); 489 $output = ob_get_contents(); 490 ob_end_clean(); 491 return $output; 492 493 } 494 add_shortcode('feinstaubampel','feinstaubampel'); 495 496 425 497 ?> -
live-widget-luftdaten/trunk/readme.txt
r1649153 r1649763 3 3 Tags: widget,civic tech,live 4 4 Tested up to: 4.7.4 5 Stable tag: 1. 1.05 Stable tag: 1.2.0 6 6 Requires at least: 3.0 7 7 … … 12 12 Choose a Widget title and provide a sensor ID. After saving this information, you can customize 13 13 the text shown for each sensor value. 14 15 Widgets can be used with shortcodes, too! Examples: 16 [feinstaublive title="Titel" sensorIDs="260,262"] 17 [feinstaubampel title="Titel" sensorIDs="260"] 14 18 15 19 Thank you for testing: networx,alexschnapper! … … 23 27 = 1.1 = 24 28 *new Widget: colorful widget for showing the current PM values. Turns red if over EU threshold. 29 30 = 1.2 = 31 *new Shortcodes: widgets can now be used with shortcodes. See description
Note: See TracChangeset
for help on using the changeset viewer.