Changeset 832531
- Timestamp:
- 01/03/2014 10:13:24 PM (12 years ago)
- Location:
- wp-favorite-posts/trunk
- Files:
-
- 5 edited
-
readme.txt (modified) (2 diffs)
-
wp-favorite-posts.php (modified) (11 diffs)
-
wpfp-admin.php (modified) (4 diffs)
-
wpfp-page-template.php (modified) (3 diffs)
-
wpfp-widgets.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-favorite-posts/trunk/readme.txt
r832212 r832531 6 6 Requires at least: 3.5 7 7 Tested up to: 3.8 8 Stable tag: 1.5.8. 28 Stable tag: 1.5.8.4 9 9 10 10 Allows visitors to add favorite posts. This plugin use cookies for saving data so … … 53 53 == Changelog == 54 54 55 = 1.5.8.4 (2014-01-03) = 56 * Replace deprecated functions 57 * Various fixes 58 55 59 = 1.5.8.1 (2013-01-14) = 56 60 * Widgets functions updated -
wp-favorite-posts/trunk/wp-favorite-posts.php
r832212 r832531 4 4 Plugin URI: http://nxsn.com/my-projects/wp-favorite-posts-plugin/ 5 5 Description: Allows users to add favorite posts. This plugin use cookies for saving data so unregistered users can favorite a post. Put <code><?php wpfp_link(); ?></code> where ever you want on a single post. Then create a page which includes that text : <code>[wp-favorite-posts]</code> That's it! 6 Version: 1.5.8. 26 Version: 1.5.8.4 7 7 Author: Huseyin Berberoglu 8 8 Author URI: http://nxsn.com … … 257 257 return true; 258 258 } 259 259 260 function wpfp_do_remove_favorite($post_id) { 260 261 if (!wpfp_check_favorited($post_id)) … … 278 279 } 279 280 endif; 280 //if (is_single()): 281 if (strpos($content,'[wpfp-link]')!== false) { 282 $content = str_replace('[wpfp-link]', wpfp_link(1), $content); 283 } 284 //endif; 281 282 if (strpos($content,'[wpfp-link]')!== false) { 283 $content = str_replace('[wpfp-link]', wpfp_link(1), $content); 284 } 285 285 286 286 if (is_single()) { … … 294 294 } 295 295 add_filter('the_content','wpfp_content_filter'); 296 296 297 function wpfp_shortcode_func() { 297 298 wpfp_list_favorite_posts(); … … 327 328 $wpfp_options['widget_title'] = ''; 328 329 $wpfp_options['widget_limit'] = 5; 330 $wpfp_options['uf_widget_limit'] = 5; 329 331 $wpfp_options['before_image'] = 'star.png'; 330 332 $wpfp_options['custom_before_image'] = ''; … … 340 342 function wpfp_config_page() { 341 343 if ( function_exists('add_submenu_page') ) 342 add_options_page(__(' Favorite Posts'), __('Favorite Posts'), 'manage_options', 'wp-favorite-posts', 'wpfp_config');344 add_options_page(__('WP Favorite Posts'), __('WP Favorite Posts'), 'manage_options', 'wp-favorite-posts', 'wpfp_config'); 343 345 } 344 346 add_action('admin_menu', 'wpfp_config_page'); … … 378 380 function wpfp_get_user_meta($user = "") { 379 381 if (!empty($user)): 380 $userdata = get_user databylogin($user);382 $userdata = get_user_by( 'login', $user ); 381 383 $user_id = $userdata->ID; 382 return get_user meta($user_id, WPFP_META_KEY);384 return get_user_meta($user_id, WPFP_META_KEY, true); 383 385 else: 384 return get_user meta(wpfp_get_user_id(), WPFP_META_KEY);386 return get_user_meta(wpfp_get_user_id(), WPFP_META_KEY, true); 385 387 endif; 386 388 } … … 406 408 407 409 function wpfp_get_user_options($user) { 408 $userdata = get_user databylogin($user);410 $userdata = get_user_by( 'login', $user ); 409 411 $user_id = $userdata->ID; 410 return get_usermeta($user_id, WPFP_USER_OPTION_KEY); 411 } 412 return get_user_meta($user_id, WPFP_USER_OPTION_KEY, true); 413 } 414 412 415 function wpfp_is_user_can_edit() { 413 416 if ($_REQUEST['user']) … … 415 418 return true; 416 419 } 420 417 421 function wpfp_remove_favorite_link($post_id) { 418 422 if (wpfp_is_user_can_edit()) { … … 424 428 } 425 429 } 430 426 431 function wpfp_clear_list_link() { 427 432 if (wpfp_is_user_can_edit()) { … … 432 437 } 433 438 } 439 434 440 function wpfp_cookie_warning() { 435 441 if (!is_user_logged_in() && !isset($_GET['user']) ): -
wp-favorite-posts/trunk/wpfp-admin.php
r645904 r832531 47 47 <?php endif; ?> 48 48 <div class="wrap"> 49 <?php screen_icon(); ?> 50 <h2><?php _e('Favorite Posts Configuration', 'wp-favorite-posts'); ?></h2> 49 <h2><?php _e('WP Favorite Posts Configuration', 'wp-favorite-posts'); ?></h2> 51 50 52 51 <div class="metabox-holder" id="poststuff"> … … 169 168 <th></th> 170 169 <td> 171 <input type="submit" name="submit" class="button " value="<?php _e('Update options »'); ?>" />170 <input type="submit" name="submit" class="button button-primary" value="<?php _e('Update options »'); ?>" /> 172 171 </td> 173 172 </tr> … … 224 223 <th></th> 225 224 <td> 226 <input type="submit" name="submit" class="button " value="<?php _e('Update options »'); ?>" />225 <input type="submit" name="submit" class="button button-primary" value="<?php _e('Update options »'); ?>" /> 227 226 </td> 228 227 </tr> … … 246 245 <tr> 247 246 <td> 248 <input type="submit" name="submit" class="button " value="<?php _e('Update options »'); ?>" />247 <input type="submit" name="submit" class="button button-primary" value="<?php _e('Update options »'); ?>" /> 249 248 </td> 250 249 </tr> -
wp-favorite-posts/trunk/wpfp-page-template.php
r645904 r832531 14 14 15 15 echo "<ul>"; 16 if ($favorite_post_ids) :16 if ($favorite_post_ids) { 17 17 $favorite_post_ids = array_reverse($favorite_post_ids); 18 18 $post_per_page = wpfp_get_option("post_per_page"); … … 33 33 34 34 wp_reset_query(); 35 else: 35 } else { 36 $wpfp_options = wpfp_get_options(); 36 37 echo "<li>"; 37 38 echo $wpfp_options['favorites_empty']; 38 39 echo "</li>"; 39 endif;40 } 40 41 echo "</ul>"; 41 42 … … 43 44 echo "</div>"; 44 45 wpfp_cookie_warning(); 45 ?> -
wp-favorite-posts/trunk/wpfp-widgets.php
r832129 r832531 9 9 $title = empty($options['widget_title']) ? 'Most Favorited Posts' : $options['widget_title']; 10 10 echo $before_widget; 11 echo $before_title 12 . $title 13 . $after_title; 11 echo $before_title . $title . $after_title; 14 12 wpfp_list_most_favorited($limit); 15 13 echo $after_widget; 16 14 } 15 17 16 function wpfp_widget_control() { 18 17 $options = wpfp_get_options(); … … 43 42 <?php 44 43 } 45 wp_register_sidebar_widget('wpfp-most_favorited_posts', 'Most Favorited Posts', 'wpfp_widget_view');46 wp_register_widget_control('wpfp-most_favorited_posts', 'Most Favorited Posts', 'wpfp_widget_control' );44 wp_register_sidebar_widget('wpfp-most_favorited_posts', 'Most Favorited Posts', 'wpfp_widget_view'); 45 wp_register_widget_control('wpfp-most_favorited_posts', 'Most Favorited Posts', 'wpfp_widget_control' ); 47 46 48 47 //*** users favorites widget ***// … … 68 67 echo $after_widget; 69 68 } 69 70 70 function wpfp_users_favorites_widget_control() { 71 71 $options = wpfp_get_options(); … … 94 94 wp_register_sidebar_widget('wpfp-users_favorites','User\'s Favorites', 'wpfp_users_favorites_widget_view'); 95 95 wp_register_widget_control('wpfp-users_favorites','User\'s Favorites', 'wpfp_users_favorites_widget_control' ); 96 97 96 } 98 97 add_action('widgets_init', 'wpfp_widget_init');
Note: See TracChangeset
for help on using the changeset viewer.