Changeset 952024
- Timestamp:
- 07/21/2014 07:43:06 AM (12 years ago)
- Location:
- wp-subscribe-author/trunk
- Files:
-
- 4 edited
-
classes/Model/wpsa_model.php (modified) (1 diff)
-
classes/wpsa_shortcode.php (modified) (1 diff)
-
readme.txt (modified) (5 diffs)
-
wp-subscribe-author.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-subscribe-author/trunk/classes/Model/wpsa_model.php
r924385 r952024 122 122 } 123 123 124 /* 125 * @method getFavouriteAuthors will extract the favourite author ids of subscriber 126 * @param int $subscriber_id 127 * @since 1.6.5 128 * @return object 129 */ 130 public function getFavouriteAuthors($subscriber_id){ 131 global $wpdb; 132 133 return $authors = $wpdb->get_results($wpdb->prepare( "SELECT author_id FROM $this->tbl_wpsa_subscribe_author WHERE subscriber_id = %d AND status = %s",$subscriber_id,'active')); 124 134 135 } 125 136 126 137 -
wp-subscribe-author/trunk/classes/wpsa_shortcode.php
r873932 r952024 1 <?php 2 3 if (!class_exists('WPSA_Shortcode')) { 4 5 class WPSA_Shortcode{ 6 7 private $wpsamodel = null; 8 9 function __construct(){ 10 11 ## Register shortcodes 12 add_shortcode( 'favourite-author-posts', array(&$this, 'favourite_author_posts_handler' ) ); 13 14 $this->wpsamodel = new Wpsa_Model(); 15 16 } 17 18 public function favourite_author_posts_handler($atts){ 19 20 $html = ''; 21 $user_id = get_current_user_id(); 22 23 if(!empty($user_id)){ 24 25 26 $authors = $this->wpsamodel->getFavouriteAuthors($user_id); 27 28 if(count($authors)){ 29 30 $author_ids = array(); 31 foreach($authors as $author){ 32 $author_ids[] = $author->author_id; 33 } 34 35 $args = array( 'author__in' => $author_ids ); 36 37 38 // the query 39 $author_query = new WP_Query( $args ); ?> 40 41 <?php if ( $author_query->have_posts() ) : ?> 42 43 <?php while ( $author_query->have_posts() ) : $author_query->the_post(); ?> 44 <?php $html .= $this->load_template_part('content','favourite-author-posts'); ?> 45 <?php endwhile; ?> 46 47 <?php wp_reset_postdata(); ?> 48 49 <?php else: ?> 50 <p><?php _e( 'Sorry, no posts found from your favourite authors.' ); ?></p> 51 <?php endif; 52 53 } 54 55 } 56 return $html; 57 } 58 59 60 private function load_template_part($template_name, $part_name=null) { 61 ob_start(); 62 get_template_part($template_name, $part_name); 63 $var = ob_get_contents(); 64 ob_end_clean(); 65 return $var; 66 } 67 68 69 70 } 71 72 73 $wpsa_shortcode =new WPSA_Shortcode(); 74 75 } -
wp-subscribe-author/trunk/readme.txt
r937731 r952024 5 5 Requires at least: 2.8 6 6 Tested up to: 3.9.1 7 Stable tag: 1.6. 17 Stable tag: 1.6.5 8 8 License: GPLv2 9 9 … … 16 16 17 17 Please check the FAQ section. 18 19 Display subscriber favourite author posts using this shortcode **[favourite-author-posts]** - It will work only for logged in subscribers! 18 20 19 21 … … 37 39 38 40 = Can Guest user subcribe author post ? = 39 yep, plugin supports guest user subscription option from verion 1.6 .41 Yes, plugin supports guest user subscription option from verion 1.6 . 40 42 43 = Can I customize the favourite author posts template ? = 44 Yes, we can customize the template. You can create your custom code template on your active theme with the name **content-favourite-author-posts.php**. If you don't create this file, plugin will find the **content.php** from your active 45 wordpress theme. 41 46 42 47 … … 46 51 * Initial release. 47 52 = 1.1 = 48 * english translation support added.53 * English translation support added. 49 54 = 1.5 = 50 55 * Object Oriented Programming style. … … 56 61 = 1.6.1 = 57 62 * Bug fix: ajax loading text added 58 63 = 1.6.5 = 64 * Shortcode added to display subscriber favourite author posts 59 65 60 66 == Upgrade Notice == -
wp-subscribe-author/trunk/wp-subscribe-author.php
r937731 r952024 4 4 Plugin URI: http://wordpress.org/extend/plugins/wp-subscribe-author/ 5 5 Description: Wp Subscribe Author plugin is help subscriber to follow his/her favourite author. Once subscriber starts follow the author, he will get notified all new post of author by email. 6 Version: 1.6. 16 Version: 1.6.5 7 7 Author: Gowri Sankar Ramasamy 8 8 Author URI: http://code-cocktail.in/author/gowrisankar/ … … 13 13 14 14 /* 15 Copyright 201 2Gowri Sankar Ramasamy (email : [email protected])15 Copyright 2014 Gowri Sankar Ramasamy (email : [email protected]) 16 16 17 17 This program is free software; you can redistribute it and/or modify … … 36 36 require_once (dirname(__FILE__) . '/classes/Model/wpsa_model.php'); 37 37 require_once (dirname(__FILE__) . '/classes/wpsa_template.php'); 38 //require_once (dirname(__FILE__) . '/classes/wpsa_shortcode.php');38 require_once (dirname(__FILE__) . '/classes/wpsa_shortcode.php'); 39 39 40 40 require_once (dirname(__FILE__) . '/wpsa-ajax.php'); … … 44 44 define('WPSA_PLUGIN_NAME', plugin_basename(__FILE__)); 45 45 define('WPSA_PLUGIN_DIR', dirname(__FILE__) . DIRECTORY_SEPARATOR); 46 define('WPSA_PLUGIN_VERSION',' 2.0');46 define('WPSA_PLUGIN_VERSION','1.6.5'); 47 47 48 48 if (!class_exists('Wp_Subscribe_Author')) {
Note: See TracChangeset
for help on using the changeset viewer.