Plugin Directory

Changeset 916355


Ignore:
Timestamp:
05/18/2014 04:11:50 AM (12 years ago)
Author:
ishimwe
Message:

Update from 1.0 to 1.0.1

Location:
sidebar-post/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sidebar-post/trunk/readme.txt

    r192718 r916355  
    11=== Plugin Name ===
    2 Contributors: Janvier M
     2Contributors: ishimwe,joshuadamour,janvierdesigns
    33Donate link: http://www.wprooms.com/donate
    44Tags: post,sidebar, sidebar post, wordpress, posting, wordpress MU, MU
    5 Requires at least: Wordpress 2.8.1
    6 Tested up to: Wordpress 2.9.1
    7 Stable tag: 1.0
     5Requires at least: Wordpress 3.0
     6Tested up to: Wordpress 3.9.1
     7Stable tag: 1.0.1
    88
    99This plugin allows your visitors (logged in) to submit posts to your site via a simple sidebar widget form.
     
    1414It comes  with a javascript form validation (user can't submit post if some fields are empty), and once the post has been submitted it is saved as a draft.
    1515
    16 You can join/follow the discussion about the plugin on its home page at http://forums.wprooms.com/topic/sidebar-post
     16You can join/follow the discussion about the plugin on its home page at http://www.freelanceresources.net/forums/forum/plugins-and-softwares/sidebar-post/
    1717
    1818== Installation ==
     
    2727== Frequently Asked Questions ==
    2828
    29 Check http://www.wprooms.com
     29Check http://www.freelanceresources.net
    3030
    3131== Screenshots ==
     
    3535
    3636== Changelog ==
    37 1.0
     371.0.1
    3838
    3939== Upgrade Notice ==
  • sidebar-post/trunk/sidebar-posting-options.php

    r192122 r916355  
    66$pagenavi_settings = array('pagenavi_options');
    77?>
    8 
    9 <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>?page=<?php echo plugin_basename(__FILE__); ?>">
    10 <input type="text" name="thank_you" id="thank_you" value="" />
    11 <input type="submit" name="submit" value="Submit" />
    12 </form>
  • sidebar-post/trunk/sidebar_post.php

    r192146 r916355  
    44Plugin URI: http://www.janvierdesigns.com
    55Description: This plugin places a posting form in the sidebar
    6 Version: 1.0
     6Version: 1.0.1
    77Author: Janvier M @ JanvierDesigns
    88Author URI: http://www.janvierdesigns.com
    9 */
    10 
    11 /*  Copyright 2009  JANVIER DESIGNS .COM  (email : janvier@janvierdesigns.com)
     9
    1210
    1311    This program is free software; you can redistribute it and/or modify
     
    2523    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    2624*/
     25// Exit if accessed directly
     26if ( !defined( 'ABSPATH' ) ) exit;
     27function spost_loaded() {
     28    do_action( 'spost_loaded' );
     29}
     30add_action( 'plugins_loaded', 'spost_loaded', 20 );
     31global $shortname;
     32$shortname = "spost_";
     33define('SPOST_VERSION','1.0.1');
     34define('SPOST_DATABASE_VERSION','1.0.1');
     35define('SPOST_BUILD','05172014');
     36define('SOFTWARE_NAME','Sidebar Post');
     37define( 'SPOST_PLUGIN_DIR', WP_PLUGIN_DIR . '/sidebar-post' );
     38define( 'SPOST_PLUGIN_URL', WP_PLUGIN_URL . '/sidebar-post' );
     39
    2740$site_home = get_option('home');
    28 ?>
    29 <?php
     41function spost_loader_activate() {
     42    do_action( 'spost_loader_activate' );
     43}
     44register_activation_hook( 'sidebar-post/sidebar_post.php', 'spost_loader_activate' );
     45
     46function update_db_options(){
     47    update_option("spost_db_version",SPOST_VERSION);
     48    update_option("spost_db_build",SPOST_BUILD);
     49}add_action("spost_loader_activate", "update_db_options");
     50add_action('init', 'spost_theme_setup');
     51function spost_theme_setup(){
     52    load_theme_textdomain('spost', SPOST_PLUGIN_URL . '/languages');
     53}
    3054function curPageName() {
    3155 return substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1);
    3256}
    33 
    34 ?>
    35 <?php function add_validator_js(){
    36 echo "<script type='text/javascript' src='".get_option('home')."/wp-content/plugins/sidebar-post/js/validate.js'></script>";
    37 }
    38 add_action('wp_head', 'add_validator_js');
     57 function spost_script_enqueue_js_css() {
     58
     59      wp_register_script( 'spost-validate', SPOST_PLUGIN_URL . '/js/validate.js');
     60      wp_enqueue_script( 'spost-validate' );
     61    wp_register_style( 'spost',  SPOST_PLUGIN_URL . '/css/spost.css',  array(), '', 'screen' );
     62    wp_enqueue_style( 'spost' );   
     63     
     64     }add_action('wp_enqueue_scripts', 'spost_script_enqueue_js_css');
    3965add_action('wp_head', 'curPageName');
    40 ?>
    41 <?php
    42 function sidebar_post_widget() { if ( is_user_logged_in() ){?>
    43         <?php   global $current_user;
     66
     67function sidebar_post_widget() { if ( is_user_logged_in() ){
     68
     69    global $current_user;
    4470                get_currentuserinfo();
    4571                $user_level=$current_user->user_level . "\n";
     
    5177                $display_name = $current_user->display_name . "\n";
    5278            ?>
    53 <div style="border:thick dotted #A8E500; background: url(<?php echo get_option('home'); ?>/wp-content/plugins/sidebar-posting/images/arrow_form.jpg) no-repeat left">
    54     <form action="<?php echo $site_home;?>/wp-content/plugins/sidebar-post/post_post.php" method="post" onsubmit="return validate_form(this)">
     79<div id="wp_sidebarpost_main">
     80    <form action="" method="post" onsubmit="return validate_form(this)">
     81    <input type="hidden" name="submit-post" value="yes" />
    5582      <p>
    56         <label><strong>Title</strong><br>
     83        <label><strong><?php _e('Yout Post Title','spost'); ?></strong><br>
    5784        <input name="title" type="text" style="width: 90%; background:#EFEFEF" value="">
    5885        </label>
    5986</p>
    6087      <p>
    61         <label> <strong>Content of the post </strong><br>
     88        <label> <strong><?php _e('Content of the post','spost'); ?> </strong><br>
    6289        <textarea name="content" style="width: 90%; background: #EFEFEF"></textarea>
    6390        </label>
    6491        <br>
    65         <label><strong>Category</strong>
     92        <label><strong><?php _e('Category','spost'); ?></strong>
    6693            <?php
    6794                $select = wp_dropdown_categories('show_option_none=Select a category&show_count=1&orderby=name&echo=0');
     
    82109echo '<div style="border:thick dotted #FF0000;"><form action="'.$site_home.'/wp-login.php" method="post">
    83110<input type="hidden" name="redirect_to" value="'.curPageName().'" />
    84 <input type="submit" style="background:url('.$site_home.'/wp-content/plugins/sidebar-post/images/not_logged_in.gif); width: 200px; height: 60px;" name="login" value="" />
     111<input type="submit" style="background:url('.SPOST_PLUGIN_URL.'/images/not_logged_in.gif); width: 200px; height: 60px;" name="login" value="" />
    85112</form>
    86 </div>';} } ?>
    87 <?php
    88 function widget_sidebar_post_widget($args) {
    89   extract($args);
    90   echo $before_widget;
    91   echo $before_title;?>New Post<?php echo $after_title;
    92   sidebar_post_widget();
    93   echo $after_widget;
    94 }
    95 
    96 function sidebar_post_widget_init()
    97 {
    98   register_sidebar_widget(__('NEW POST'), 'widget_sidebar_post_widget');   
    99 }
    100 add_action("plugins_loaded", "sidebar_post_widget_init");
     113</div>';} }
     114
     115class wp_sidebar_post_plugin extends WP_Widget {
     116
     117    // constructor
     118    function wp_sidebar_post_plugin() {
     119        /* ... */
     120        parent::WP_Widget(false, $name = __('Sidebar Post Widget', 'spost') );
     121    }
     122
     123    // widget form creation
     124    function form($instance) {
     125   
     126    // Check values
     127    if( $instance) {
     128         $title = esc_attr($instance['title']);
     129         //$text = esc_attr($instance['text']);
     130         $textarea = esc_textarea($instance['textarea']);
     131    } else {
     132         $title = '';
     133         //$text = '';
     134         $textarea = '';
     135    }
     136    ?>
     137   
     138    <p>
     139    <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Widget Title', 'spost'); ?></label>
     140    <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" />
     141    </p>
     142   
     143    <!--<p>
     144    <label for="<?php echo $this->get_field_id('text'); ?>"><?php _e('Text:', 'spost'); ?></label>
     145    <input class="widefat" id="<?php echo $this->get_field_id('text'); ?>" name="<?php echo $this->get_field_name('text'); ?>" type="text" value="<?php echo $text; ?>" />
     146    </p>-->
     147   
     148    <p>
     149    <label for="<?php echo $this->get_field_id('textarea'); ?>"><?php _e('Posting Instructions:', 'spost'); ?></label>
     150    <textarea class="widefat" id="<?php echo $this->get_field_id('textarea'); ?>" name="<?php echo $this->get_field_name('textarea'); ?>"><?php echo $textarea; ?></textarea>
     151    </p>
     152    <?php
     153    }
     154
     155    // update widget
     156    function update($new_instance, $old_instance) {
     157          $instance = $old_instance;
     158          // Fields
     159          $instance['title'] = strip_tags($new_instance['title']);
     160          $instance['text'] = strip_tags($new_instance['text']);
     161          $instance['textarea'] = $new_instance['textarea'];
     162         return $instance;
     163    }
     164
     165    // display widget
     166    function widget($args, $instance) {
     167       extract( $args );
     168       // these are the widget options
     169       $title = apply_filters('widget_title', $instance['title']);
     170       $text = $instance['text'];
     171       $textarea = $instance['textarea'];
     172       echo $before_widget;
     173       // Display the widget
     174       echo '<div class="widget-text spost_box">';
     175   
     176       // Check if title is set
     177       if ( $title ) {
     178          echo $before_title . $title . $after_title;
     179       }
     180   
     181       // Check if text is set
     182       if( $text ) {
     183          echo '<p class="spost_text">'.$text.'</p>';
     184       }
     185       // Check if textarea is set
     186       if( $textarea ) {
     187         echo '<p class="spost_textarea">'.$textarea.'</p>';
     188       }
     189       sidebar_post_widget();
     190       echo '</div>';
     191       echo $after_widget;
     192    }
     193}
     194
     195// register widget
     196add_action('widgets_init', create_function('', 'return register_widget("wp_sidebar_post_plugin");'));
     197
     198add_action('admin_menu', 'sidebar_posting_menu');
     199
     200function sidebar_posting_menu() {
     201    add_options_page('SidebarPosting', 'Sidebar Post', 'manage_options', 'sidebar-posting', 'sidebar_post_fx');
     202}
     203function sidebar_post_fx(){}
    101204?>
    102 <?php
    103 ### Function: Page Navigation Option Menu
    104 add_action('admin_menu', 'sidebar_posting');
    105 function sidebar_posting() {
    106     if (function_exists('add_options_page')) {
    107         add_options_page(__('SidebarPosting', 'sidebar-post'), __('SidebarPosting', 'sidebar-post'), 'manage_options', 'sidebar-posting/sidebar-posting-options.php') ;
    108     }
    109 }
    110 ?>
Note: See TracChangeset for help on using the changeset viewer.