Changeset 916355
- Timestamp:
- 05/18/2014 04:11:50 AM (12 years ago)
- Location:
- sidebar-post/trunk
- Files:
-
- 3 edited
-
readme.txt (modified) (4 diffs)
-
sidebar-posting-options.php (modified) (1 diff)
-
sidebar_post.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sidebar-post/trunk/readme.txt
r192718 r916355 1 1 === Plugin Name === 2 Contributors: Janvier M2 Contributors: ishimwe,joshuadamour,janvierdesigns 3 3 Donate link: http://www.wprooms.com/donate 4 4 Tags: post,sidebar, sidebar post, wordpress, posting, wordpress MU, MU 5 Requires at least: Wordpress 2.8.16 Tested up to: Wordpress 2.9.17 Stable tag: 1.0 5 Requires at least: Wordpress 3.0 6 Tested up to: Wordpress 3.9.1 7 Stable tag: 1.0.1 8 8 9 9 This plugin allows your visitors (logged in) to submit posts to your site via a simple sidebar widget form. … … 14 14 It 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. 15 15 16 You can join/follow the discussion about the plugin on its home page at http:// forums.wprooms.com/topic/sidebar-post16 You can join/follow the discussion about the plugin on its home page at http://www.freelanceresources.net/forums/forum/plugins-and-softwares/sidebar-post/ 17 17 18 18 == Installation == … … 27 27 == Frequently Asked Questions == 28 28 29 Check http://www. wprooms.com29 Check http://www.freelanceresources.net 30 30 31 31 == Screenshots == … … 35 35 36 36 == Changelog == 37 1.0 37 1.0.1 38 38 39 39 == Upgrade Notice == -
sidebar-post/trunk/sidebar-posting-options.php
r192122 r916355 6 6 $pagenavi_settings = array('pagenavi_options'); 7 7 ?> 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 4 4 Plugin URI: http://www.janvierdesigns.com 5 5 Description: This plugin places a posting form in the sidebar 6 Version: 1.0 6 Version: 1.0.1 7 7 Author: Janvier M @ JanvierDesigns 8 8 Author URI: http://www.janvierdesigns.com 9 */ 10 11 /* Copyright 2009 JANVIER DESIGNS .COM (email : janvier@janvierdesigns.com) 9 12 10 13 11 This program is free software; you can redistribute it and/or modify … … 25 23 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 26 24 */ 25 // Exit if accessed directly 26 if ( !defined( 'ABSPATH' ) ) exit; 27 function spost_loaded() { 28 do_action( 'spost_loaded' ); 29 } 30 add_action( 'plugins_loaded', 'spost_loaded', 20 ); 31 global $shortname; 32 $shortname = "spost_"; 33 define('SPOST_VERSION','1.0.1'); 34 define('SPOST_DATABASE_VERSION','1.0.1'); 35 define('SPOST_BUILD','05172014'); 36 define('SOFTWARE_NAME','Sidebar Post'); 37 define( 'SPOST_PLUGIN_DIR', WP_PLUGIN_DIR . '/sidebar-post' ); 38 define( 'SPOST_PLUGIN_URL', WP_PLUGIN_URL . '/sidebar-post' ); 39 27 40 $site_home = get_option('home'); 28 ?> 29 <?php 41 function spost_loader_activate() { 42 do_action( 'spost_loader_activate' ); 43 } 44 register_activation_hook( 'sidebar-post/sidebar_post.php', 'spost_loader_activate' ); 45 46 function 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"); 50 add_action('init', 'spost_theme_setup'); 51 function spost_theme_setup(){ 52 load_theme_textdomain('spost', SPOST_PLUGIN_URL . '/languages'); 53 } 30 54 function curPageName() { 31 55 return substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1); 32 56 } 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'); 39 65 add_action('wp_head', 'curPageName'); 40 ?> 41 <?php 42 function sidebar_post_widget() { if ( is_user_logged_in() ){?> 43 <?phpglobal $current_user;66 67 function sidebar_post_widget() { if ( is_user_logged_in() ){ 68 69 global $current_user; 44 70 get_currentuserinfo(); 45 71 $user_level=$current_user->user_level . "\n"; … … 51 77 $display_name = $current_user->display_name . "\n"; 52 78 ?> 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" /> 55 82 <p> 56 <label><strong> Title</strong><br>83 <label><strong><?php _e('Yout Post Title','spost'); ?></strong><br> 57 84 <input name="title" type="text" style="width: 90%; background:#EFEFEF" value=""> 58 85 </label> 59 86 </p> 60 87 <p> 61 <label> <strong> Content of the post</strong><br>88 <label> <strong><?php _e('Content of the post','spost'); ?> </strong><br> 62 89 <textarea name="content" style="width: 90%; background: #EFEFEF"></textarea> 63 90 </label> 64 91 <br> 65 <label><strong> Category</strong>92 <label><strong><?php _e('Category','spost'); ?></strong> 66 93 <?php 67 94 $select = wp_dropdown_categories('show_option_none=Select a category&show_count=1&orderby=name&echo=0'); … … 82 109 echo '<div style="border:thick dotted #FF0000;"><form action="'.$site_home.'/wp-login.php" method="post"> 83 110 <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="" /> 85 112 </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 115 class 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 196 add_action('widgets_init', create_function('', 'return register_widget("wp_sidebar_post_plugin");')); 197 198 add_action('admin_menu', 'sidebar_posting_menu'); 199 200 function sidebar_posting_menu() { 201 add_options_page('SidebarPosting', 'Sidebar Post', 'manage_options', 'sidebar-posting', 'sidebar_post_fx'); 202 } 203 function sidebar_post_fx(){} 101 204 ?> 102 <?php103 ### Function: Page Navigation Option Menu104 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.