Version Description
- Resolved possible missing variable bug in grid display code
Download this release
Release Info
Developer | metaphorcreations |
Plugin | Ditty News Ticker |
Version | 2.2.8 |
Comparing to | |
See all releases |
Code changes from version 2.2.7 to 2.2.8
- ditty-news-ticker.php +2 -2
- inc/filters.php +26 -17
- readme.txt +4 -1
ditty-news-ticker.php
CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://dittynewsticker.com/
|
|
5 |
Description: Ditty News Ticker is a multi-functional data display plugin
|
6 |
Text Domain: ditty-news-ticker
|
7 |
Domain Path: languages
|
8 |
-
Version: 2.2.
|
9 |
Author: Metaphor Creations
|
10 |
Author URI: http://www.metaphorcreations.com
|
11 |
Contributors: metaphorcreations
|
@@ -62,7 +62,7 @@ final class Ditty_News_Ticker {
|
|
62 |
|
63 |
// Plugin version
|
64 |
if ( ! defined( 'MTPHR_DNT_VERSION' ) ) {
|
65 |
-
define( 'MTPHR_DNT_VERSION', '2.2.
|
66 |
}
|
67 |
|
68 |
// Plugin Folder Path
|
5 |
Description: Ditty News Ticker is a multi-functional data display plugin
|
6 |
Text Domain: ditty-news-ticker
|
7 |
Domain Path: languages
|
8 |
+
Version: 2.2.8
|
9 |
Author: Metaphor Creations
|
10 |
Author URI: http://www.metaphorcreations.com
|
11 |
Contributors: metaphorcreations
|
62 |
|
63 |
// Plugin version
|
64 |
if ( ! defined( 'MTPHR_DNT_VERSION' ) ) {
|
65 |
+
define( 'MTPHR_DNT_VERSION', '2.2.8' );
|
66 |
}
|
67 |
|
68 |
// Plugin Folder Path
|
inc/filters.php
CHANGED
@@ -30,15 +30,24 @@ add_action( 'init', 'mtphr_dnt_oembed' );
|
|
30 |
|
31 |
|
32 |
/* --------------------------------------------------------- */
|
33 |
-
/* !Make a grid out of the ticks - 2.
|
34 |
/* --------------------------------------------------------- */
|
35 |
|
36 |
function mtphr_dnt_tick_grid( $dnt_ticks, $id, $meta_data ) {
|
37 |
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
|
43 |
$grid_ticks = array();
|
44 |
|
@@ -47,11 +56,11 @@ function mtphr_dnt_tick_grid( $dnt_ticks, $id, $meta_data ) {
|
|
47 |
$row_counter = 0;
|
48 |
|
49 |
$style = 'style="';
|
50 |
-
$style .= ( $_mtphr_dnt_grid_equal_width ) ? 'width:'.(100
|
51 |
-
$style .= ( $_mtphr_dnt_grid_padding > 0 ) ? 'padding:'
|
52 |
$style .= '"';
|
53 |
|
54 |
-
$extra_classes = (
|
55 |
|
56 |
$data = '<table class="mtphr-dnt-grid'.$extra_classes.'">';
|
57 |
$data .= '<tr class="mtphr-dnt-grid-row mtphr-dnt-grid-row-'.($row_counter+1).'">';
|
@@ -60,23 +69,23 @@ function mtphr_dnt_tick_grid( $dnt_ticks, $id, $meta_data ) {
|
|
60 |
foreach( $dnt_ticks as $i=>$tick ) {
|
61 |
|
62 |
// Get the type and tick
|
63 |
-
$type = ( is_array($tick) && isset($tick['type']) ) ? $tick['type'] : $_mtphr_dnt_type;
|
64 |
$tick = ( is_array($tick) && isset($tick['tick']) ) ? $tick['tick'] : $tick;
|
65 |
|
66 |
$data .= '<td class="mtphr-dnt-grid-item mtphr-dnt-grid-item-'.($col_counter+1).' mtphr-dnt-grid-item-'.$type.'" '.$style.'>'.$tick.'</td>';
|
67 |
|
68 |
$col_counter++;
|
69 |
|
70 |
-
if( (($i+1)
|
71 |
|
72 |
$data .= '</tr>';
|
73 |
|
74 |
$row_counter++;
|
75 |
-
if( (($row_counter)
|
76 |
$data .= '</table>';
|
77 |
|
78 |
// Add to the tick array
|
79 |
-
$grid_ticks[] = (
|
80 |
|
81 |
$data = '<table class="mtphr-dnt-grid'.$extra_classes.'">';
|
82 |
$row_counter = 0;
|
@@ -89,20 +98,20 @@ function mtphr_dnt_tick_grid( $dnt_ticks, $id, $meta_data ) {
|
|
89 |
}
|
90 |
|
91 |
// Fill any empty columns
|
92 |
-
$empty_cols = $_mtphr_dnt_grid_cols - $col_counter;
|
93 |
for( $i=0; $i<$empty_cols; $i++ ) {
|
94 |
$data .= '<td class="mtphr-dnt-grid-item mtphr-dnt-grid-item-'.($col_counter+1).'" '.$style.'></td>';
|
95 |
$col_counter++;
|
96 |
}
|
97 |
|
98 |
// Fill any emptry rows
|
99 |
-
if( $_mtphr_dnt_grid_empty_rows ) {
|
100 |
-
$empty_row = $_mtphr_dnt_grid_rows - ($row_counter+1);
|
101 |
for( $i=0; $i<$empty_row; $i++ ) {
|
102 |
$row_counter++;
|
103 |
$col_counter = 0;
|
104 |
$data .= '<tr class="mtphr-dnt-grid-row mtphr-dnt-grid-row-'.($row_counter+1).'">';
|
105 |
-
for( $e=0; $e
|
106 |
$data .= '<td class="mtphr-dnt-grid-item mtphr-dnt-grid-item-'.($col_counter+1).'" '.$style.'></td>';
|
107 |
$col_counter++;
|
108 |
}
|
@@ -114,7 +123,7 @@ function mtphr_dnt_tick_grid( $dnt_ticks, $id, $meta_data ) {
|
|
114 |
$data .= '</table>';
|
115 |
|
116 |
// Add to the tick array
|
117 |
-
$grid_ticks[] = (
|
118 |
|
119 |
return $grid_ticks;
|
120 |
}
|
30 |
|
31 |
|
32 |
/* --------------------------------------------------------- */
|
33 |
+
/* !Make a grid out of the ticks - 2.2.8 */
|
34 |
/* --------------------------------------------------------- */
|
35 |
|
36 |
function mtphr_dnt_tick_grid( $dnt_ticks, $id, $meta_data ) {
|
37 |
|
38 |
+
$defaults = array(
|
39 |
+
'_mtphr_dnt_type' => 0,
|
40 |
+
'_mtphr_dnt_grid' => 0,
|
41 |
+
'_mtphr_dnt_grid_empty_rows' => 0,
|
42 |
+
'_mtphr_dnt_grid_equal_width' => 0,
|
43 |
+
'_mtphr_dnt_grid_cols' => 2,
|
44 |
+
'_mtphr_dnt_grid_rows' => 2,
|
45 |
+
'_mtphr_dnt_grid_padding' => 5,
|
46 |
+
'_mtphr_dnt_grid_remove_padding' => 0,
|
47 |
+
);
|
48 |
+
$args = wp_parse_args( $meta_data, $defaults );
|
49 |
+
|
50 |
+
if( $args['_mtphr_dnt_grid'] ) {
|
51 |
|
52 |
$grid_ticks = array();
|
53 |
|
56 |
$row_counter = 0;
|
57 |
|
58 |
$style = 'style="';
|
59 |
+
$style .= ( $args['_mtphr_dnt_grid_equal_width'] ) ? 'width:'.( 100 / $args['_mtphr_dnt_grid_cols'] ).'%;' : '';
|
60 |
+
$style .= ( intval( $args['_mtphr_dnt_grid_padding'] ) > 0 ) ? 'padding:' . intval( $args['_mtphr_dnt_grid_padding'] ) . 'px;' : '';
|
61 |
$style .= '"';
|
62 |
|
63 |
+
$extra_classes = ( $args['_mtphr_dnt_grid_remove_padding'] ) ? ' mtphr-dnt-grid-remove-padding' : '';
|
64 |
|
65 |
$data = '<table class="mtphr-dnt-grid'.$extra_classes.'">';
|
66 |
$data .= '<tr class="mtphr-dnt-grid-row mtphr-dnt-grid-row-'.($row_counter+1).'">';
|
69 |
foreach( $dnt_ticks as $i=>$tick ) {
|
70 |
|
71 |
// Get the type and tick
|
72 |
+
$type = ( is_array($tick) && isset($tick['type']) ) ? $tick['type'] : $args['_mtphr_dnt_type'];
|
73 |
$tick = ( is_array($tick) && isset($tick['tick']) ) ? $tick['tick'] : $tick;
|
74 |
|
75 |
$data .= '<td class="mtphr-dnt-grid-item mtphr-dnt-grid-item-'.($col_counter+1).' mtphr-dnt-grid-item-'.$type.'" '.$style.'>'.$tick.'</td>';
|
76 |
|
77 |
$col_counter++;
|
78 |
|
79 |
+
if( ( ( $i+1 ) % $args['_mtphr_dnt_grid_cols'] == 0 ) && ( $i < $total-1 ) ) {
|
80 |
|
81 |
$data .= '</tr>';
|
82 |
|
83 |
$row_counter++;
|
84 |
+
if( ( ( $row_counter ) % $args['_mtphr_dnt_grid_rows'] == 0 ) ) {
|
85 |
$data .= '</table>';
|
86 |
|
87 |
// Add to the tick array
|
88 |
+
$grid_ticks[] = ( 'mixed' == $args['_mtphr_dnt_type'] ) ? array( 'type'=>'mixed-grid', 'tick'=>$data ) : $data;
|
89 |
|
90 |
$data = '<table class="mtphr-dnt-grid'.$extra_classes.'">';
|
91 |
$row_counter = 0;
|
98 |
}
|
99 |
|
100 |
// Fill any empty columns
|
101 |
+
$empty_cols = $args['_mtphr_dnt_grid_cols'] - $col_counter;
|
102 |
for( $i=0; $i<$empty_cols; $i++ ) {
|
103 |
$data .= '<td class="mtphr-dnt-grid-item mtphr-dnt-grid-item-'.($col_counter+1).'" '.$style.'></td>';
|
104 |
$col_counter++;
|
105 |
}
|
106 |
|
107 |
// Fill any emptry rows
|
108 |
+
if( $args['_mtphr_dnt_grid_empty_rows'] ) {
|
109 |
+
$empty_row = $args['_mtphr_dnt_grid_rows'] - ( $row_counter + 1 );
|
110 |
for( $i=0; $i<$empty_row; $i++ ) {
|
111 |
$row_counter++;
|
112 |
$col_counter = 0;
|
113 |
$data .= '<tr class="mtphr-dnt-grid-row mtphr-dnt-grid-row-'.($row_counter+1).'">';
|
114 |
+
for( $e=0; $e < $args['_mtphr_dnt_grid_cols']; $e++ ) {
|
115 |
$data .= '<td class="mtphr-dnt-grid-item mtphr-dnt-grid-item-'.($col_counter+1).'" '.$style.'></td>';
|
116 |
$col_counter++;
|
117 |
}
|
123 |
$data .= '</table>';
|
124 |
|
125 |
// Add to the tick array
|
126 |
+
$grid_ticks[] = ( 'mixed' == $args['_mtphr_dnt_type'] ) ? array( 'type'=>'mixed-grid', 'tick'=>$data ) : $data;
|
127 |
|
128 |
return $grid_ticks;
|
129 |
}
|
readme.txt
CHANGED
@@ -72,6 +72,9 @@ The most common cause for an unresponsive ticker (when using scroll or rotate mo
|
|
72 |
|
73 |
== Changelog ==
|
74 |
|
|
|
|
|
|
|
75 |
= 2.2.7 =
|
76 |
* Constant variable bug fix
|
77 |
|
@@ -507,4 +510,4 @@ The most common cause for an unresponsive ticker (when using scroll or rotate mo
|
|
507 |
|
508 |
== Upgrade Notice ==
|
509 |
|
510 |
-
|
72 |
|
73 |
== Changelog ==
|
74 |
|
75 |
+
= 2.2.8 =
|
76 |
+
* Resolved possible missing variable bug in grid display code
|
77 |
+
|
78 |
= 2.2.7 =
|
79 |
* Constant variable bug fix
|
80 |
|
510 |
|
511 |
== Upgrade Notice ==
|
512 |
|
513 |
+
Resolved possible missing variable bug in grid display code
|