Ditty News Ticker - Version 1.4.6

Version Description

  • Added plugin activation/de-activation to flush rewrite rules
  • Moved admin files into separate admin directories
  • Set file permissions on fontastic files
Download this release

Release Info

Developer metaphorcreations
Plugin Icon 128x128 Ditty News Ticker
Version 1.4.6
Comparing to
See all releases

Code changes from version 1.4.5 to 1.4.6

assets/css/{codemirror.css → admin/codemirror.css} RENAMED
File without changes
assets/css/{style-admin.css → admin/style.css} RENAMED
File without changes
assets/js/{codemirror.js → admin/codemirror.js} RENAMED
File without changes
assets/js/{css.js → admin/codemirror/css.js} RENAMED
File without changes
assets/js/{script-admin.js → admin/script.js} RENAMED
@@ -156,9 +156,6 @@ jQuery( document ).ready( function($) {
156
  if( $('.mtphr-dnt-advanced-list').length > 0 ) {
157
 
158
  function mtphr_dnt_advanced_handle_toggle( $table ) {
159
-
160
- console.log($table[0]);
161
- console.log($table.find('.mtphr-dnt-list-item').length);
162
 
163
  if( $table.find('.mtphr-dnt-list-item').length > 1 ) {
164
  $table.find('.mtphr-dnt-list-handle').show();
156
  if( $('.mtphr-dnt-advanced-list').length > 0 ) {
157
 
158
  function mtphr_dnt_advanced_handle_toggle( $table ) {
 
 
 
159
 
160
  if( $table.find('.mtphr-dnt-list-item').length > 1 ) {
161
  $table.find('.mtphr-dnt-list-handle').show();
ditty-news-ticker.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Ditty News Ticker
4
  Plugin URI: http://dittynewsticker.com/
5
  Description: Ditty News Ticker is a multi-functional data display plugin
6
- Version: 1.4.5
7
  Author: Metaphor Creations
8
  Author URI: http://www.metaphorcreations.com
9
  License: GPL2
@@ -28,34 +28,31 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28
 
29
 
30
 
31
- /**
32
- * Define constants
33
- *
34
- * @since 1.4.5
35
- */
36
- if ( WP_DEBUG ) {
37
- define ( 'MTPHR_DNT_VERSION', '1.4.5-'.time() );
38
- } else {
39
- define ( 'MTPHR_DNT_VERSION', '1.4.5' );
40
- }
41
  define ( 'MTPHR_DNT_DIR', plugin_dir_path(__FILE__) );
42
  define ( 'MTPHR_DNT_URL', plugins_url().'/ditty-news-ticker' );
43
 
 
 
44
 
45
 
46
 
47
- /**
48
- * Include files
49
- *
50
- * @since 1.4.0
51
- */
52
-
53
  if( is_admin() ) {
54
 
55
  // Load admin code
56
- require_once( MTPHR_DNT_DIR.'includes/meta-boxes.php' );
57
  //require_once( MTPHR_DNT_DIR.'includes/help.php' );
58
- require_once( MTPHR_DNT_DIR.'includes/edit-columns.php' );
 
 
 
59
  }
60
 
61
  // Load the general functions
@@ -71,3 +68,24 @@ require_once( MTPHR_DNT_DIR.'includes/settings.php' );
71
 
72
 
73
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  Plugin Name: Ditty News Ticker
4
  Plugin URI: http://dittynewsticker.com/
5
  Description: Ditty News Ticker is a multi-functional data display plugin
6
+ Version: 1.4.6
7
  Author: Metaphor Creations
8
  Author URI: http://www.metaphorcreations.com
9
  License: GPL2
28
 
29
 
30
 
31
+ /* --------------------------------------------------------- */
32
+ /* !Define constants - 1.4.6 */
33
+ /* --------------------------------------------------------- */
34
+
35
+ define ( 'MTPHR_DNT_VERSION', '1.4.6' );
 
 
 
 
 
36
  define ( 'MTPHR_DNT_DIR', plugin_dir_path(__FILE__) );
37
  define ( 'MTPHR_DNT_URL', plugins_url().'/ditty-news-ticker' );
38
 
39
+ // Uncomment next line only for testing
40
+ //define ( 'MTPHR_DNT_VERSION', '1.4.6-'.time() );
41
 
42
 
43
 
44
+ /* --------------------------------------------------------- */
45
+ /* !Include files - 1.4.6 */
46
+ /* --------------------------------------------------------- */
 
 
 
47
  if( is_admin() ) {
48
 
49
  // Load admin code
50
+ require_once( MTPHR_DNT_DIR.'includes/admin/meta-boxes.php' );
51
  //require_once( MTPHR_DNT_DIR.'includes/help.php' );
52
+ require_once( MTPHR_DNT_DIR.'includes/admin/edit-columns.php' );
53
+ require_once( MTPHR_DNT_DIR.'includes/admin/filters.php' );
54
+ require_once( MTPHR_DNT_DIR.'includes/admin/upgrades.php' );
55
+ require_once( MTPHR_DNT_DIR.'includes/admin/scripts.php' );
56
  }
57
 
58
  // Load the general functions
68
 
69
 
70
 
71
+ /* --------------------------------------------------------- */
72
+ /* !Register the post type & flush the rewrite rules - 1.4.6 */
73
+ /* --------------------------------------------------------- */
74
+
75
+ function mtphr_dnt_activation() {
76
+ mtphr_dnt_posttype();
77
+ flush_rewrite_rules();
78
+ }
79
+ register_activation_hook( __FILE__, 'mtphr_dnt_activation' );
80
+
81
+ /* --------------------------------------------------------- */
82
+ /* !Flush the rewrite rules - 1.4.6 */
83
+ /* --------------------------------------------------------- */
84
+
85
+ function mtphr_dnt_deactivation() {
86
+ flush_rewrite_rules();
87
+ }
88
+ register_deactivation_hook( __FILE__, 'mtphr_dnt_deactivation' );
89
+
90
+
91
+
includes/{edit-columns.php → admin/edit-columns.php} RENAMED
File without changes
includes/admin/filters.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ function mtphr_dnt_plugin_upgrade(){
4
+
5
+ $active_version = get_option( 'mtphr_dnt_active_version', '0' );
6
+
7
+ // Outdated
8
+ if( version_compare($active_version, MTPHR_DNT_VERSION, '<') ) {
9
+
10
+ /*
11
+ // Run specific upgrade routines
12
+ if( version_compare( $active_version, '1.4.6', '<' ) ) {
13
+ mtphr_dnt_upgrade_to_version_1_4_6();
14
+ }
15
+ */
16
+
17
+ update_option( 'mtphr_dnt_active_version', MTPHR_DNT_VERSION );
18
+ }
19
+ }
20
+ //add_action( 'admin_init', 'mtphr_dnt_plugin_upgrade' );
includes/{meta-boxes.php → admin/meta-boxes.php} RENAMED
File without changes
includes/admin/scripts.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /* --------------------------------------------------------- */
4
+ /* !Load the admin scrips - 1.4.6 */
5
+ /* --------------------------------------------------------- */
6
+
7
+ function mtphr_dnt_admin_scripts( $hook ) {
8
+
9
+ global $typenow;
10
+
11
+ if ( $typenow == 'ditty_news_ticker' ) {
12
+
13
+ // Load scipts for the media uploader
14
+ if(function_exists( 'wp_enqueue_media' )){
15
+ wp_enqueue_media();
16
+ } else {
17
+ wp_enqueue_style('thickbox');
18
+ wp_enqueue_script('media-upload');
19
+ wp_enqueue_script('thickbox');
20
+ }
21
+
22
+ // Load the CodeMirror plugin
23
+ wp_register_style( 'codemirror', MTPHR_DNT_URL.'/assets/css/admin/codemirror.css', false, MTPHR_DNT_VERSION );
24
+ wp_enqueue_style( 'codemirror' );
25
+ wp_register_script( 'codemirror', MTPHR_DNT_URL.'/assets/js/admin/codemirror.js', array('jquery'), MTPHR_DNT_VERSION, true );
26
+ wp_enqueue_script( 'codemirror' );
27
+ wp_register_script( 'codemirror-css', MTPHR_DNT_URL.'/assets/js/admin/codemirror/css.js', array('jquery'), MTPHR_DNT_VERSION, true );
28
+ wp_enqueue_script( 'codemirror-css' );
29
+
30
+ // Load the news ticker scripts
31
+ wp_register_script( 'ditty-news-ticker', MTPHR_DNT_URL.'/assets/js/admin/script.js', array( 'jquery','jquery-ui-core','jquery-ui-sortable' ), MTPHR_DNT_VERSION, true );
32
+ wp_enqueue_script( 'ditty-news-ticker' );
33
+ wp_localize_script( 'ditty-news-ticker', 'ditty_news_ticker_vars', array(
34
+ 'security' => wp_create_nonce( 'ditty-news-ticker' )
35
+ )
36
+ );
37
+ }
38
+
39
+ // Load the icon font css
40
+ wp_register_style( 'ditty-news-ticker-font', MTPHR_DNT_URL.'/assets/fontastic/styles.css', false, MTPHR_DNT_VERSION );
41
+ wp_enqueue_style( 'ditty-news-ticker-font' );
42
+
43
+ // Load the plugin css
44
+ wp_register_style( 'ditty-news-ticker', MTPHR_DNT_URL.'/assets/css/admin/style.css', false, MTPHR_DNT_VERSION );
45
+ wp_enqueue_style( 'ditty-news-ticker' );
46
+ }
47
+ add_action( 'admin_enqueue_scripts', 'mtphr_dnt_admin_scripts' );
48
+
includes/admin/upgrades.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php
2
+
3
+ /* No upgrades yet! */
includes/scripts.php CHANGED
@@ -1,98 +1,34 @@
1
  <?php
2
- /**
3
- * Load CSS & jQuery Scripts
4
- *
5
- * @package Ditty News Ticker
6
- */
7
 
 
 
 
8
 
9
-
10
-
11
- add_action( 'admin_enqueue_scripts', 'mtphr_dnt_admin_scripts' );
12
- /**
13
- * Load the metaboxer scripts
14
- *
15
- * @since 1.4.5
16
- */
17
- function mtphr_dnt_admin_scripts( $hook ) {
18
-
19
- global $typenow;
20
-
21
- if ( $typenow == 'ditty_news_ticker' ) {
22
-
23
- // Load scipts for the media uploader
24
- if(function_exists( 'wp_enqueue_media' )){
25
- wp_enqueue_media();
26
- } else {
27
- wp_enqueue_style('thickbox');
28
- wp_enqueue_script('media-upload');
29
- wp_enqueue_script('thickbox');
30
- }
31
-
32
- // Load the CodeMirror plugin
33
- wp_register_style( 'codemirror', MTPHR_DNT_URL.'/assets/css/codemirror.css', false, MTPHR_DNT_VERSION );
34
- wp_enqueue_style( 'codemirror' );
35
- wp_register_script( 'codemirror', MTPHR_DNT_URL.'/assets/js/codemirror.js', array('jquery'), MTPHR_DNT_VERSION, true );
36
- wp_enqueue_script( 'codemirror' );
37
- wp_register_script( 'codemirror-css', MTPHR_DNT_URL.'/assets/js/css.js', array('jquery'), MTPHR_DNT_VERSION, true );
38
- wp_enqueue_script( 'codemirror-css' );
39
-
40
- // Load the news ticker scripts
41
- wp_register_script( 'ditty-news-ticker', MTPHR_DNT_URL.'/assets/js/script-admin.js', array( 'jquery','jquery-ui-core','jquery-ui-sortable' ), MTPHR_DNT_VERSION, true );
42
- wp_enqueue_script( 'ditty-news-ticker' );
43
- wp_localize_script( 'ditty-news-ticker', 'ditty_news_ticker_vars', array(
44
- 'security' => wp_create_nonce( 'ditty-news-ticker' )
45
- )
46
- );
47
- }
48
-
49
- // Load the icon font css
50
- wp_register_style( 'ditty-news-ticker-font', MTPHR_DNT_URL.'/assets/fontastic/styles.css', false, MTPHR_DNT_VERSION );
51
- wp_enqueue_style( 'ditty-news-ticker-font' );
52
-
53
- // Load the plugin css
54
- wp_register_style( 'ditty-news-ticker', MTPHR_DNT_URL.'/assets/css/style-admin.css', false, MTPHR_DNT_VERSION );
55
- wp_enqueue_style( 'ditty-news-ticker' );
56
- }
57
-
58
-
59
-
60
-
61
- add_action( 'wp_enqueue_scripts', 'mtphr_dnt_scripts' );
62
- /**
63
- * Load the front end scripts
64
- *
65
- * @since 1.1.8
66
- */
67
  function mtphr_dnt_scripts() {
68
 
69
  // Load the icon font css
70
  wp_register_style( 'ditty-news-ticker-font', MTPHR_DNT_URL.'/assets/fontastic/styles.css', false, MTPHR_DNT_VERSION );
71
  wp_enqueue_style( 'ditty-news-ticker-font' );
72
 
73
- // Load the css
74
- wp_register_style( 'ditty-news-ticker', MTPHR_DNT_URL.'/assets/css/style.css', false, MTPHR_DNT_VERSION );
75
- wp_enqueue_style( 'ditty-news-ticker' );
76
-
77
  // Register touchSwipe
78
  wp_register_script( 'touchSwipe', MTPHR_DNT_URL.'/assets/js/jquery.touchSwipe.min.js', array('jquery'), MTPHR_DNT_VERSION, true );
79
 
80
  // Register the jQuery easing
81
  wp_register_script( 'jquery-easing', MTPHR_DNT_URL.'/assets/js/jquery.easing.1.3.js', array('jquery'), MTPHR_DNT_VERSION, true );
82
 
83
- // Register the DNT jQuery class
 
 
84
  wp_register_script( 'ditty-news-ticker', MTPHR_DNT_URL.'/assets/js/ditty-news-ticker.js', array('jquery'), MTPHR_DNT_VERSION, true );
85
  }
 
86
 
87
 
88
 
 
 
 
89
 
90
- add_action( 'wp_head', 'mtphr_dnt_custom_css' );
91
- /**
92
- * Add custom css
93
- *
94
- * @since 1.1.5
95
- */
96
  function mtphr_dnt_custom_css() {
97
 
98
  $settings = get_option( 'mtphr_dnt_general_settings' );
@@ -100,16 +36,14 @@ function mtphr_dnt_custom_css() {
100
  echo '<style>'.sanitize_text_field( $settings['css'] ).'</style>';
101
  }
102
  }
 
103
 
104
 
105
 
 
 
 
106
 
107
- add_action( 'wp_footer', 'mtphr_dnt_tickers_init_scripts', 20 );
108
- /**
109
- * Initialize the ticker scriptinos
110
- *
111
- * @since 1.4.3
112
- */
113
  function mtphr_dnt_tickers_init_scripts() {
114
 
115
  global $mtphr_dnt_ticker_scripts;
@@ -162,4 +96,5 @@ function mtphr_dnt_tickers_init_scripts() {
162
  <?php
163
  }
164
  }
 
165
 
1
  <?php
 
 
 
 
 
2
 
3
+ /* --------------------------------------------------------- */
4
+ /* !Load the front end scripts - 1.4.6 */
5
+ /* --------------------------------------------------------- */
6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  function mtphr_dnt_scripts() {
8
 
9
  // Load the icon font css
10
  wp_register_style( 'ditty-news-ticker-font', MTPHR_DNT_URL.'/assets/fontastic/styles.css', false, MTPHR_DNT_VERSION );
11
  wp_enqueue_style( 'ditty-news-ticker-font' );
12
 
 
 
 
 
13
  // Register touchSwipe
14
  wp_register_script( 'touchSwipe', MTPHR_DNT_URL.'/assets/js/jquery.touchSwipe.min.js', array('jquery'), MTPHR_DNT_VERSION, true );
15
 
16
  // Register the jQuery easing
17
  wp_register_script( 'jquery-easing', MTPHR_DNT_URL.'/assets/js/jquery.easing.1.3.js', array('jquery'), MTPHR_DNT_VERSION, true );
18
 
19
+ // Register the Ditty News Ticker scripts
20
+ wp_register_style( 'ditty-news-ticker', MTPHR_DNT_URL.'/assets/css/style.css', false, MTPHR_DNT_VERSION );
21
+ wp_enqueue_style( 'ditty-news-ticker' );
22
  wp_register_script( 'ditty-news-ticker', MTPHR_DNT_URL.'/assets/js/ditty-news-ticker.js', array('jquery'), MTPHR_DNT_VERSION, true );
23
  }
24
+ add_action( 'wp_enqueue_scripts', 'mtphr_dnt_scripts' );
25
 
26
 
27
 
28
+ /* --------------------------------------------------------- */
29
+ /* !Add custom css - 1.1.5 */
30
+ /* --------------------------------------------------------- */
31
 
 
 
 
 
 
 
32
  function mtphr_dnt_custom_css() {
33
 
34
  $settings = get_option( 'mtphr_dnt_general_settings' );
36
  echo '<style>'.sanitize_text_field( $settings['css'] ).'</style>';
37
  }
38
  }
39
+ add_action( 'wp_head', 'mtphr_dnt_custom_css' );
40
 
41
 
42
 
43
+ /* --------------------------------------------------------- */
44
+ /* !Initialize the ticker scripts - 1.4.3 */
45
+ /* --------------------------------------------------------- */
46
 
 
 
 
 
 
 
47
  function mtphr_dnt_tickers_init_scripts() {
48
 
49
  global $mtphr_dnt_ticker_scripts;
96
  <?php
97
  }
98
  }
99
+ add_action( 'wp_footer', 'mtphr_dnt_tickers_init_scripts', 20 );
100
 
readme.txt CHANGED
@@ -54,6 +54,11 @@ Each individual Ticker post has multiple settings to customize.
54
 
55
  == Changelog ==
56
 
 
 
 
 
 
57
  = 1.4.5 =
58
  * Removed metaboxer code & files, which are no longer used
59
  * Merged the metabox list jQuery functionality
@@ -225,4 +230,4 @@ Each individual Ticker post has multiple settings to customize.
225
 
226
  == Upgrade Notice ==
227
 
228
- Metabox updates. Converted image graphics to icon fonts. Added option to add quick edit links to tickers. Added type & mode filters to edit screen.
54
 
55
  == Changelog ==
56
 
57
+ = 1.4.6 =
58
+ * Added plugin activation/de-activation to flush rewrite rules
59
+ * Moved admin files into separate admin directories
60
+ * Set file permissions on fontastic files
61
+
62
  = 1.4.5 =
63
  * Removed metaboxer code & files, which are no longer used
64
  * Merged the metabox list jQuery functionality
230
 
231
  == Upgrade Notice ==
232
 
233
+ Added flush rewrite fules. Directory cleanup. Attempted to set file permissions on fontastic directory.