Plugin Directory

Changeset 1084839


Ignore:
Timestamp:
02/08/2015 08:26:12 AM (11 years ago)
Author:
kushsharma
Message:

Added new option to customize plugin.

Location:
kush-micro-news/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • kush-micro-news/trunk/includes/admin.php

    r1053260 r1084839  
    1313
    1414    //check for plugin version and updating default
    15     $d = get_plugin_data( KUSH_MICRO_NEWS_DIR.'index.php');
    16     if($d['Version'] == "1.4.4")//
    17     {
    18         update_option("kush_mn_load_nav_swap","true");
    19     }
     15    // $d = get_plugin_data( KUSH_MICRO_NEWS_DIR.'index.php');
     16    // if($d['Version'] == "1.4.4")//
     17    // {
     18    // update_option("kush_mn_load_nav_swap","true");
     19    // }
    2020
    2121}
     
    2323function micro_news_config_page(){
    2424$what='';
     25//$_POST = array_map('stripslashes_deep', $_POST['myRename']);
    2526if(isset($_POST['valSub']))
    2627{
     
    3435            }
    3536        else
    36             echo _e('<h3>No of post cannot left blank.</h3>');     
     37        {
     38            update_option( "kush_mn_num_news",'5');
     39            echo _e('<h4>Number of post cannot left blank, reverted to default.</h4>');     
     40        }
    3741    }
    3842
     
    5761    if(isset($_POST['myRename']))
    5862    {
     63        $_POST['myRename'] = stripslashes($_POST['myRename']);
     64
    5965        if($_POST['myRename']!='')
    60         {update_option("kush_mn_widget_name",$_POST['myRename']);       
     66        { update_option("kush_mn_widget_name", htmlspecialchars($_POST['myRename']));       
    6167         $what='Changes Saved !';
    6268        }
    63     else
    64         echo _e('<h3>Name cannot be left blank.</h3>');
     69        else
     70        {
     71            update_option("kush_mn_widget_name", 'Micro News');
     72        }
     73       
     74    }
     75
     76    if(isset($_POST['fullStoryText']))
     77    {
     78
     79        $_POST['fullStoryText'] = stripslashes($_POST['fullStoryText']);
     80
     81        if($_POST['fullStoryText']!='')
     82        {update_option("kush_mn_read_story_text", htmlspecialchars($_POST['fullStoryText']));       
     83         $what='Changes Saved !';
     84        }
     85        else
     86        {
     87            update_option("kush_mn_read_story_text",'Read Full story &raquo;');
     88        }
     89       
    6590       
    6691    }
     
    139164            <label for="myRename">Title over news:</label>
    140165            <input type="text" name="myRename" value="<?php echo get_option("kush_mn_widget_name");?>"/>
    141             <h5 style="display:inline-block;margin:0;">(Do not use any special character like inverted commas)</h5>
    142         </div>     
     166            <h5 style="display:inline-block;margin:0;">(Default: Micro News)</h5>
     167        </div>
     168        <div class="options">
     169            <label for="myRename">Full Story Text:</label>
     170            <input type="text" name="fullStoryText" value="<?php echo get_option("kush_mn_read_story_text");?>"/>
     171            <h5 style="display:inline-block;margin:0;">(Default: Read Full story &raquo;)</h5>
     172        </div>         
    143173        <div class="options">           
    144174            <label for="titleColor">Title Color:</label>
  • kush-micro-news/trunk/includes/core.php

    r1053230 r1084839  
    3232
    3333
    34 function kush_micro_news_output($no_of_news=0,$header="true",$limit=0,$onlyNews="false"){
     34function kush_micro_news_output($no_of_news=0, $header="true", $limit=0, $onlyNews="false"){
    3535    //this is responsible for displaying the final output to user site in widgets or anywhere this function is called!
    3636    //$header attribute will decide whether to show Micro News Header or not
     
    4343    $i=0;//counter for multiple colors.
    4444    if($no_of_news==0)
    45         {$no_of_news=get_option( "kush_mn_num_news");}
    46     $showBorder=get_option('kush_mn_show_lborder');
    47     $cleanHov=get_option('kush_mn_show_linkclean');
    48     $widgetName = get_option('kush_mn_widget_name');
     45        {$no_of_news=get_option( "kush_mn_num_news", '5');}
     46    $showBorder=get_option('kush_mn_show_lborder', 'false');
     47    $cleanHov=get_option('kush_mn_show_linkclean', 'false');
     48    $widgetName = get_option('kush_mn_widget_name', 'Micro News');
    4949    $titleColor = get_option('kush_mn_color_title');
    5050    $textColor = get_option('kush_mn_color_text');
    5151    $linkColor = get_option('kush_mn_color_link');
    52     $loadNav = get_option('kush_mn_load_nav');
    53     $loadNavSwap = get_option('kush_mn_load_nav_swap');
    54 
     52    $loadNav = get_option('kush_mn_load_nav','true');
     53    $loadNavSwap = get_option('kush_mn_load_nav_swap','true');
     54    $readStoryText = get_option('kush_mn_read_story_text','Read Full story &raquo;');
     55
     56   
    5557    //way of updating news in navigation
    5658    $navStyle = ($loadNavSwap == 'true') ? 'swap' : 'append';
     
    102104                if($cleanHov!='true')//check if show link color inverted
    103105                    $output_html .='clean';
    104                 $output_html .='"><a href="'.$row->url.'" title="'.$row->name.'" target="_blank" style="color:'.$linkColor.'">Read Full story &raquo;</a></span>';
     106                $output_html .='"><a href="'.$row->url.'" title="'.$row->name.'" target="_blank" style="color:'.$linkColor.'">'.$readStoryText.'</a></span>';
    105107            endif;
    106108
  • kush-micro-news/trunk/index.php

    r1053260 r1084839  
    33Plugin Name: Kush Micro News
    44Description: Spread the news in shortest possible way. Use links to refer data and title to concise it.
    5 Version: 1.5.1
     5Version: 1.5.2
    66Author: Kush Sharma
    77Author Email: thekushsharma@gmail.com
    88Author URI: http://softnuke.com/
    99Plugin URI: https://github.com/kushsharma/micro-news
    10 Last Officially Updated: 24 December 2014
     10Last Officially Updated: 08 Feb 2015
    1111*/
    1212
     
    174174        add_option('kush_mn_load_nav','false');
    175175        add_option('kush_mn_load_nav_swap','true');
    176 
     176        add_option('kush_mn_read_story_text','Read Full story &raquo;');
    177177    }
    178178    kush_mn_install();
  • kush-micro-news/trunk/readme.txt

    r1053260 r1084839  
    55Requires at least: 3.0.1
    66Tested up to: 4.1
    7 Stable tag: 1.5.1
     7Stable tag: 1.5.2
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    8383
    8484== Changelog ==
     85
     86= 1.5.2 =
     87* Added option to change text of "Read Full Story".
    8588
    8689= 1.5.1 =
  • kush-micro-news/trunk/uninstall.php

    r1053230 r1084839  
    1717delete_option('kush_mn_load_nav');
    1818delete_option('kush_mn_load_nav_swap');
     19delete_option('kush_mn_read_story_text');
    1920
    2021global $wpdb;
Note: See TracChangeset for help on using the changeset viewer.