Plugin Directory

Changeset 1644322


Ignore:
Timestamp:
04/24/2017 08:39:29 PM (9 years ago)
Author:
abjelosevic
Message:

tagging version 1.10

Location:
ab-post-view-counter
Files:
2 edited
3 copied

Legend:

Unmodified
Added
Removed
  • ab-post-view-counter/tags/1.10/ab-post-count-plugin.php

    r1643609 r1644322  
    44   Plugin URI: http://aleksandar.bjelosevic.info/abpvc
    55   Description: A plugin that records post views
    6    Version: 1.0
     6   Version: 1.10
    77   Author: Aleksandar Bjelosevic
    88   Author URI: http://aleksandar.bjelosevic.info
     
    1717   if(!isset($current_views) OR empty($current_views) OR !is_numeric($current_views) ) {
    1818      $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     
    2024   }
    2125   else
    2226   {
    23    $content .= "Broj čitanja: ".$current_views;
     27    if (get_option('ab-post-radio')==1)
     28      {
     29      $content .= "Read count: ".$current_views;
     30      }
    2431   }
    2532
     
    4047
    4148}
    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
     52function ABPostCount_columns_head($defaults) {
     53    $defaults['abpost_view_counter'] = 'Post View Counter';
     54    return $defaults;
     55}
    4456
    4557
     58// SHOW THE POST COUNTER
     59function ABPostCount_columns_content($column_name, $post_ID) {
     60global $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
     72function 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
     79function 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
     89function 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
     108function menu_item()
     109{
     110  add_submenu_page("options-general.php", "Post View Counter", "Post View Counter", "manage_options", "abpvc", "abpostview_page");
     111}
     112
     113add_action("admin_init", "abpostview_settings");
     114add_action("admin_menu", "menu_item");
     115add_action("wp_head", "abpost_add_view");
     116add_filter("the_content", "ab_postview_counter" );
     117add_filter('manage_posts_columns', 'ABPostCount_columns_head');
     118add_action('manage_posts_custom_column', 'ABPostCount_columns_content', 10, 2);
    46119?>
  • ab-post-view-counter/tags/1.10/readme.txt

    r1643652 r1644322  
    22221. Activate the plugin through the 'Plugins' screen in WordPress
    2323
     24= V1.10 =
     25Added admin options i Settings panel,english translation and post view counter in All post screen
     26
    2427= V1.00 =
    2528First simple version of plugin
     29
     30
  • ab-post-view-counter/trunk/ab-post-count-plugin.php

    r1643609 r1644322  
    44   Plugin URI: http://aleksandar.bjelosevic.info/abpvc
    55   Description: A plugin that records post views
    6    Version: 1.0
     6   Version: 1.10
    77   Author: Aleksandar Bjelosevic
    88   Author URI: http://aleksandar.bjelosevic.info
     
    1717   if(!isset($current_views) OR empty($current_views) OR !is_numeric($current_views) ) {
    1818      $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     
    2024   }
    2125   else
    2226   {
    23    $content .= "Broj čitanja: ".$current_views;
     27    if (get_option('ab-post-radio')==1)
     28      {
     29      $content .= "Read count: ".$current_views;
     30      }
    2431   }
    2532
     
    4047
    4148}
    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
     52function ABPostCount_columns_head($defaults) {
     53    $defaults['abpost_view_counter'] = 'Post View Counter';
     54    return $defaults;
     55}
    4456
    4557
     58// SHOW THE POST COUNTER
     59function ABPostCount_columns_content($column_name, $post_ID) {
     60global $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
     72function 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
     79function 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
     89function 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
     108function menu_item()
     109{
     110  add_submenu_page("options-general.php", "Post View Counter", "Post View Counter", "manage_options", "abpvc", "abpostview_page");
     111}
     112
     113add_action("admin_init", "abpostview_settings");
     114add_action("admin_menu", "menu_item");
     115add_action("wp_head", "abpost_add_view");
     116add_filter("the_content", "ab_postview_counter" );
     117add_filter('manage_posts_columns', 'ABPostCount_columns_head');
     118add_action('manage_posts_custom_column', 'ABPostCount_columns_content', 10, 2);
    46119?>
  • ab-post-view-counter/trunk/readme.txt

    r1643652 r1644322  
    22221. Activate the plugin through the 'Plugins' screen in WordPress
    2323
     24= V1.10 =
     25Added admin options i Settings panel,english translation and post view counter in All post screen
     26
    2427= V1.00 =
    2528First simple version of plugin
     29
     30
Note: See TracChangeset for help on using the changeset viewer.