Changeset 1644322
- Timestamp:
- 04/24/2017 08:39:29 PM (9 years ago)
- Location:
- ab-post-view-counter
- Files:
-
- 2 edited
- 3 copied
-
tags/1.10 (copied) (copied from ab-post-view-counter/trunk)
-
tags/1.10/ab-post-count-plugin.php (copied) (copied from ab-post-view-counter/trunk/ab-post-count-plugin.php) (3 diffs)
-
tags/1.10/readme.txt (copied) (copied from ab-post-view-counter/trunk/readme.txt) (1 diff)
-
trunk/ab-post-count-plugin.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
ab-post-view-counter/tags/1.10/ab-post-count-plugin.php
r1643609 r1644322 4 4 Plugin URI: http://aleksandar.bjelosevic.info/abpvc 5 5 Description: A plugin that records post views 6 Version: 1. 06 Version: 1.10 7 7 Author: Aleksandar Bjelosevic 8 8 Author URI: http://aleksandar.bjelosevic.info … … 17 17 if(!isset($current_views) OR empty($current_views) OR !is_numeric($current_views) ) { 18 18 $current_views = 0; 19 $content .= "Broj čitanja: ".$current_views; 19 if (get_option('ab-post-radio')==1) 20 { 21 $content .= "Read count: ".$current_views; 22 } 23 20 24 } 21 25 else 22 26 { 23 $content .= "Broj čitanja: ".$current_views; 27 if (get_option('ab-post-radio')==1) 28 { 29 $content .= "Read count: ".$current_views; 30 } 24 31 } 25 32 … … 40 47 41 48 } 42 add_action("wp_head", "abpost_add_view"); 43 add_filter( "the_content", "ab_postview_counter" ); 49 50 //Post counter in all post 51 // ADD NEW COLUMN 52 function ABPostCount_columns_head($defaults) { 53 $defaults['abpost_view_counter'] = 'Post View Counter'; 54 return $defaults; 55 } 44 56 45 57 58 // SHOW THE POST COUNTER 59 function ABPostCount_columns_content($column_name, $post_ID) { 60 global $post; 61 if ($column_name == 'abpost_view_counter') { 62 63 $current_views = get_post_meta($post->ID, "ab_postview_views", true); 64 if($current_views =="") {$current_views=0;} 65 echo $current_views; 66 67 } 68 } 69 70 //end post counter 71 72 function abpostview_settings() 73 { 74 add_settings_section("section", "Settings", null, "abpvc"); 75 add_settings_field("ab-post-radio", "Show counter after post?", "abpostview_radio_display", "abpvc", "section"); 76 register_setting("section", "ab-post-radio"); 77 } 78 79 function abpostview_radio_display() 80 { 81 ?> 82 <input type="radio" name="ab-post-radio" value="1" <?php checked(1, get_option('ab-post-radio'), true); ?>>Yes 83 <input type="radio" name="ab-post-radio" value="2" <?php checked(2, get_option('ab-post-radio'), true); ?>>No 84 <?php 85 } 86 87 88 89 function abpostview_page() 90 { 91 ?> 92 <div class="wrap"> 93 <h1>Post View Counter</h1> 94 95 <form method="post" action="options.php"> 96 <?php 97 settings_fields("section"); 98 99 do_settings_sections("abpvc"); 100 101 submit_button(); 102 ?> 103 </form> 104 </div> 105 <?php 106 } 107 108 function menu_item() 109 { 110 add_submenu_page("options-general.php", "Post View Counter", "Post View Counter", "manage_options", "abpvc", "abpostview_page"); 111 } 112 113 add_action("admin_init", "abpostview_settings"); 114 add_action("admin_menu", "menu_item"); 115 add_action("wp_head", "abpost_add_view"); 116 add_filter("the_content", "ab_postview_counter" ); 117 add_filter('manage_posts_columns', 'ABPostCount_columns_head'); 118 add_action('manage_posts_custom_column', 'ABPostCount_columns_content', 10, 2); 46 119 ?> -
ab-post-view-counter/tags/1.10/readme.txt
r1643652 r1644322 22 22 1. Activate the plugin through the 'Plugins' screen in WordPress 23 23 24 = V1.10 = 25 Added admin options i Settings panel,english translation and post view counter in All post screen 26 24 27 = V1.00 = 25 28 First simple version of plugin 29 30 -
ab-post-view-counter/trunk/ab-post-count-plugin.php
r1643609 r1644322 4 4 Plugin URI: http://aleksandar.bjelosevic.info/abpvc 5 5 Description: A plugin that records post views 6 Version: 1. 06 Version: 1.10 7 7 Author: Aleksandar Bjelosevic 8 8 Author URI: http://aleksandar.bjelosevic.info … … 17 17 if(!isset($current_views) OR empty($current_views) OR !is_numeric($current_views) ) { 18 18 $current_views = 0; 19 $content .= "Broj čitanja: ".$current_views; 19 if (get_option('ab-post-radio')==1) 20 { 21 $content .= "Read count: ".$current_views; 22 } 23 20 24 } 21 25 else 22 26 { 23 $content .= "Broj čitanja: ".$current_views; 27 if (get_option('ab-post-radio')==1) 28 { 29 $content .= "Read count: ".$current_views; 30 } 24 31 } 25 32 … … 40 47 41 48 } 42 add_action("wp_head", "abpost_add_view"); 43 add_filter( "the_content", "ab_postview_counter" ); 49 50 //Post counter in all post 51 // ADD NEW COLUMN 52 function ABPostCount_columns_head($defaults) { 53 $defaults['abpost_view_counter'] = 'Post View Counter'; 54 return $defaults; 55 } 44 56 45 57 58 // SHOW THE POST COUNTER 59 function ABPostCount_columns_content($column_name, $post_ID) { 60 global $post; 61 if ($column_name == 'abpost_view_counter') { 62 63 $current_views = get_post_meta($post->ID, "ab_postview_views", true); 64 if($current_views =="") {$current_views=0;} 65 echo $current_views; 66 67 } 68 } 69 70 //end post counter 71 72 function abpostview_settings() 73 { 74 add_settings_section("section", "Settings", null, "abpvc"); 75 add_settings_field("ab-post-radio", "Show counter after post?", "abpostview_radio_display", "abpvc", "section"); 76 register_setting("section", "ab-post-radio"); 77 } 78 79 function abpostview_radio_display() 80 { 81 ?> 82 <input type="radio" name="ab-post-radio" value="1" <?php checked(1, get_option('ab-post-radio'), true); ?>>Yes 83 <input type="radio" name="ab-post-radio" value="2" <?php checked(2, get_option('ab-post-radio'), true); ?>>No 84 <?php 85 } 86 87 88 89 function abpostview_page() 90 { 91 ?> 92 <div class="wrap"> 93 <h1>Post View Counter</h1> 94 95 <form method="post" action="options.php"> 96 <?php 97 settings_fields("section"); 98 99 do_settings_sections("abpvc"); 100 101 submit_button(); 102 ?> 103 </form> 104 </div> 105 <?php 106 } 107 108 function menu_item() 109 { 110 add_submenu_page("options-general.php", "Post View Counter", "Post View Counter", "manage_options", "abpvc", "abpostview_page"); 111 } 112 113 add_action("admin_init", "abpostview_settings"); 114 add_action("admin_menu", "menu_item"); 115 add_action("wp_head", "abpost_add_view"); 116 add_filter("the_content", "ab_postview_counter" ); 117 add_filter('manage_posts_columns', 'ABPostCount_columns_head'); 118 add_action('manage_posts_custom_column', 'ABPostCount_columns_content', 10, 2); 46 119 ?> -
ab-post-view-counter/trunk/readme.txt
r1643652 r1644322 22 22 1. Activate the plugin through the 'Plugins' screen in WordPress 23 23 24 = V1.10 = 25 Added admin options i Settings panel,english translation and post view counter in All post screen 26 24 27 = V1.00 = 25 28 First simple version of plugin 29 30
Note: See TracChangeset
for help on using the changeset viewer.