Changeset 2012885
- Timestamp:
- 01/15/2019 07:10:18 PM (7 years ago)
- Location:
- borrufa-widget/trunk
- Files:
-
- 3 edited
-
borrufa_widget.php (modified) (1 diff)
-
borrufa_widget_class.php (modified) (5 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
borrufa-widget/trunk/borrufa_widget.php
r1944881 r2012885 5 5 Description: Mètode senzill per afegir a la barra lateral o al peu del tema, les notícies de les comarques del Pirineu de Lleida, publicades diàriament a La borrufa, compatible per a qualsevol tema WordPress. 6 6 Author: Jordi Soler 7 Version: 1.0. 27 Version: 1.0.3 8 8 Author URI: https://laborrufa.com 9 9 License: GPL2 -
borrufa-widget/trunk/borrufa_widget_class.php
r1944881 r2012885 27 27 $lb_widget_va = isset( $instance['lb_widget_va'] ) ? (bool) $instance['lb_widget_va'] : false; 28 28 $lb_widget_esp = isset( $instance['lb_widget_esp'] ) ? (bool) $instance['lb_widget_esp'] : false; 29 $lb_widget_nat = isset( $instance['lb_widget_nat'] ) ? (bool) $instance['lb_widget_nat'] : false; 29 30 $lb_widget_mis = isset( $instance['lb_widget_mis'] ) ? (bool) $instance['lb_widget_mis'] : false; 30 31 $lb_num = isset( $instance['lb_num'] ) ? absint( $instance['lb_num'] ) : 1; … … 53 54 <p><input class="checkbox" type="checkbox"<?php checked( $lb_widget_esp ); ?> id="<?php echo $this->get_field_id( 'lb_widget_esp' ); ?>" name="<?php echo $this->get_field_name( 'lb_widget_esp' ); ?>" /> 54 55 <label for="<?php echo $this->get_field_id( 'lb_widget_esp' ); ?>"><?php _e( 'Esports' ); ?></label></p> 56 57 <p><input class="checkbox" type="checkbox"<?php checked( $lb_widget_nat ); ?> id="<?php echo $this->get_field_id( 'lb_widget_nat' ); ?>" name="<?php echo $this->get_field_name( 'lb_widget_nat' ); ?>" /> 58 <label for="<?php echo $this->get_field_id( 'lb_widget_nat' ); ?>"><?php _e( 'Natura' ); ?></label></p> 55 59 56 60 <p><input class="checkbox" type="checkbox"<?php checked( $lb_widget_mis ); ?> id="<?php echo $this->get_field_id( 'lb_widget_mis' ); ?>" name="<?php echo $this->get_field_name( 'lb_widget_mis' ); ?>" /> … … 92 96 $instance['lb_widget_va'] = isset( $new_instance['lb_widget_va'] ) ? (bool) $new_instance['lb_widget_va'] : false; 93 97 $instance['lb_widget_esp'] = isset( $new_instance['lb_widget_esp'] ) ? (bool) $new_instance['lb_widget_esp'] : false; 98 $instance['lb_widget_nat'] = isset( $new_instance['lb_widget_nat'] ) ? (bool) $new_instance['lb_widget_nat'] : false; 94 99 $instance['lb_widget_mis'] = isset( $new_instance['lb_widget_mis'] ) ? (bool) $new_instance['lb_widget_mis'] : false; 95 100 $instance['lb_num'] = (int) $new_instance['lb_num']; … … 109 114 $lb_widget_va = isset( $instance['lb_widget_va'] ) ? $instance['lb_widget_va'] : false; 110 115 $lb_widget_esp = isset( $instance['lb_widget_esp'] ) ? $instance['lb_widget_esp'] : false; 116 $lb_widget_nat = isset( $instance['lb_widget_nat'] ) ? $instance['lb_widget_nat'] : false; 111 117 $lb_widget_mis = isset( $instance['lb_widget_mis'] ) ? $instance['lb_widget_mis'] : false; 112 118 $lb_num = ( ! empty( $instance['lb_num'] ) ) ? absint( $instance['lb_num'] ) : 1; … … 220 226 </div> 221 227 <?php endforeach; } } ?> 228 229 <?php if ( $lb_widget_nat) { 230 include_once(ABSPATH . WPINC . '/rss.php'); 231 $rss = fetch_rss('https://laborrufa.com/natura-i-esports/natura/feed/'); 232 $items = $lb_num; 233 $items = array_slice($rss->items, 0, $lb_num); 234 ?> 235 <?php if (!empty($items)) { ?> 236 <br /> 237 <span><b>Natura</b></span> 238 <?php 239 foreach ( $items as $item ) : ?> 240 <div> 241 <br /> 242 <a href='<?php echo $item['link']; ?>' title='<?php echo $item['title']; ?>'<?php if ( $lb_widget_target == 1 ) { ?> target="_blank" <?php } ?>><?php echo $item['title']; ?></a> <?php if ($lb_data){ echo date( 'd/m/Y', strtotime($item['pubdate'])); } ?> <span><?php _e( '[La borrufa | Pirineu comarques]' ); ?></span> 243 </div> 244 <?php endforeach; } } ?> 222 245 223 246 <?php if ( $lb_widget_mis) { -
borrufa-widget/trunk/readme.txt
r1945180 r2012885 4 4 Language: Català 5 5 Requires at least: 4.3 6 Tested up to: 4.7.37 Stable tag: 1.0. 26 Tested up to: 5.0 7 Stable tag: 1.0.3 8 8 9 9 … … 14 14 15 15 16 == Política de Servei Extern ==16 == Política de servei extern == 17 17 18 18 Aquest plugin es un complement basat en un tercer com a servei … … 31 31 32 32 33 == Screenshots ==34 1. Imatge configuració del giny35 2. Lateral on es troben els ginys36 3. Vista de les capçaleres de les notícies en la barra lateral d'un tema37 38 39 33 == Changelog == 40 34 = 1.0.2 = 41 35 * Primera versió del plugin borrufa-widget. 36 = 1.0.3 = 37 * Ampliació d'una nova categoria en les seccions de notícies . 42 38 43 39
Note: See TracChangeset
for help on using the changeset viewer.