Changeset 645904
- Timestamp:
- 12/29/2012 09:44:14 PM (13 years ago)
- Location:
- wp-favorite-posts/trunk
- Files:
-
- 4 edited
-
readme.txt (modified) (3 diffs)
-
wp-favorite-posts.php (modified) (12 diffs)
-
wpfp-admin.php (modified) (4 diffs)
-
wpfp-page-template.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-favorite-posts/trunk/readme.txt
r470954 r645904 1 1 === WP Favorite Posts === 2 2 Contributors: Huseyin Berberoglu 3 Donate link: http ://nxsn.com.com/my-projects/wp-favorite-posts-plugin3 Donate link: https://www.paypal.com/uk/cgi-bin/webscr?cmd=_flow&SESSION=SB_pK-MmCNOvFQw3MHe2u0wBC4xEM4SEK6nFEnyZfN-3mFY-Rpc1JFyhA2W&dispatch=5885d80a13c0db1f8e263663d3faee8d0b7e678a25d883d0fa72c947f193f8fd 4 4 Tags: favorite posts, favorite, favourite, posts, favorites, 5 5 wp-favorite-posts, reading list, post list, post lists, lists 6 6 Requires at least: 2.0.2 7 Tested up to: 3. 2.18 Stable tag: 1.5. 67 Tested up to: 3.5 8 Stable tag: 1.5.7 9 9 10 10 Allows visitors to add favorite posts. This plugin use cookies for saving data so … … 29 29 Rejected URIs". 30 30 31 See [more details about 32 plugin](http://nxsn.com/my-projects/wp-favorite-posts/) 31 See [more details about plugin](http://nxsn.com/projects/wp-favorite-posts/) 33 32 34 33 == Installation == … … 51 50 52 51 == Changelog == 53 = 1.5.6 = 54 2011-12-04 55 * BUGFIX: Fixed user's favorites widget post limit bug, it works from now. 56 * NEW FEATURE: Added "Reset Statistic Data" option to admin page. You can remove all statistic data by clicking this link. 57 * NEW FEATURE: Added sorting, last added posts will be shown first. 58 * FIX: Changed WP_PLUGIN_URL --> plugins_url() 52 = 1.5.7 (2012-12-29) = 53 * Automatic show option added to settings screen. You can configure to show "add/remove favorite" link before or after post content. 54 * Pagination added to default user's favorite posts template. Also you can configure favorite post per page number from settings screen. 55 * deprecated methods fixed. 59 56 60 = 1.5.5 = 61 2011-11-23 62 * BUGFIX: related with 1.5.4 63 64 = 1.5.4 = 65 2011-11-23 66 * BUGFIX: Thanks to @spectrus http://wordpress.org/support/topic/plugin-wp-favorite-posts-major-bug-getting-user-favourites?replies=1#post-2465141 67 68 = 1.5.3 = 69 2011-11-23 70 * NEW FEATURE: Added don't load js/css file option. If you don't 71 want to load wp favorite post's js/css file, use these options. 72 73 = 1.5.2 = 74 2010-12-27 75 * FIX: Change the user's favorites wigdet title bug fixed. 57 = 1.5.6 (2011-12-04) = 58 * BUGFIX: Fixed user's favorites widget post limit bug, it works from now. 59 * NEW FEATURE: Added "Reset Statistic Data" option to admin page. You can remove all statistic data by clicking this link. 60 * NEW FEATURE: Added sorting, last added posts will be shown first. 61 * FIX: Changed WP_PLUGIN_URL --> plugins_url() 76 62 77 = 1.5.1 = 78 2010-06-04 79 * Little JS fix. Thanks to Heather Wallace. 63 = 1.5.5 (2011-11-23) = 64 * BUGFIX: related with 1.5.4 80 65 81 = 1.4.3.2 = 82 2010-04-23 83 * Show only published posts on most favorited posts widget 66 = 1.5.4 (2011-11-23) = 67 * BUGFIX: Thanks to @spectrus http://wordpress.org/support/topic/plugin-wp-favorite-posts-major-bug-getting-user-favourites?replies=1#post-2465141 68 69 = 1.5.3 (2011-11-23) = 70 * NEW FEATURE: Added don't load js/css file option. If you don't want to load wp favorite post's js/css file, use these options. 71 72 = 1.5.2 (2010-12-27) = 73 * FIX: Change the user's favorites wigdet title bug fixed. 74 75 = 1.5.1 (2010-06-04) = 76 * Little JS fix. Thanks to Heather Wallace. 77 78 = 1.4.3.2 (2010-04-23) = 79 * Show only published posts on most favorited posts widget 84 80 85 81 = 1.4.3 = 86 82 2010-04-13 87 * Admin can write html codes to label settings (on admin page)88 * Added "wpfp_link_html" and "wpfp_remove_favorite_link" filters.83 * Admin can write html codes to label settings (on admin page) 84 * Added "wpfp_link_html" and "wpfp_remove_favorite_link" filters. 89 85 90 86 = 1.4.3 = 91 87 2010-04-09 92 * Fix: same remove link for all posts on index93 * better wpfp.js: remove li which on favorites page.88 * Fix: same remove link for all posts on index 89 * better wpfp.js: remove li which on favorites page. 94 90 95 = 1.4.1 =96 2010-04-05 97 * code refactor, add do_action for add and remove to list (#225575) 98 * update admin page 91 = 1.4.1 (2010-04-05) = 92 * code refactor, add do_action for add and remove to list (#225575) 93 * update admin page 94 * Fix plugin path, fixes image loading problems (#222902) 99 95 100 2010-03-29 101 * Fix plugin path, fixes image loading problems (#222902) 96 = 1.4 (2010-03-20) = 97 * Override page template if wpfp-page-template.php exists on template directory. 98 * Add [wp-favorite-posts] shortcode. Use shortcode instead of {{wp-favorite-posts}} 102 99 103 = 1.4 = 104 2010-03-20 105 * Override page template if wpfp-page-template.php exists on template 106 directory. 107 * Add [wp-favorite-posts] shortcode. Use shortcode instead of 108 {{wp-favorite-posts}} 100 = 1.3.5 (2010-03-17) = 101 * Fix meta key issue. 109 102 110 = 1.3.5 = 111 2010-03-17 112 * Fix meta key issue. 103 = 1.3.4 (2010-03-16) = 104 * Fix wpfp-span issue 113 105 114 = 1.3.4 = 115 2010-03-16 116 * Fix wpfp-span issue 106 = 1.3.3 (2010-03-16) = 107 * Fixed regression: if javascript doesn't work change to non-ajax mode. 108 This fixes 'only text' pages. 109 * If user logged in don't show cookie warning at "your favorites" page. 110 * Added "show remove link" and "show add link" options. 111 You can show remove link when someone add a favorite. 112 Similary You can show add link when someone remove a favorite. 117 113 118 = 1.3.3 = 119 2010-03-16 120 * Fixed regression: if javascript doesn't work change to non-ajax mode. 121 This fixes 'only text' pages. 114 = 1.3.1 (2009-06-10) = 115 * Added Before Link Image feature. 116 * Refactor code and imporve DRY 117 * Fixed bug: Most favorite list's string sorting problem 2 > 11 118 * Fixed bug: Clear link not updating post's favorited count 122 119 123 2010-02-15 124 * If user logged in don't show cookie warning at "your favorites" page. 125 * Added "show remove link" and "show add link" options. 126 You can show remove link when someone add a favorite. 127 Similary You can show add link when someone remove a favorite. 120 = 1.3 (2009-05-31) = 121 * Fixed bug: Plugin was working wrong in pages with links includes # character. 122 * Added template tag for Most Favorite Posts. There was already a widget for this. 128 123 129 = 1.3.1 = 130 2009-06-10 131 * Added Before Link Image feature. 132 * Refactor code and imporve DRY 133 * Fixed bug: Most favorite list's string sorting problem 2 > 11 134 * Fixed bug: Clear link not updating post's favorited count 124 = 1.2.1 (2009-05-14) = 125 * Added "Most Favorited Posts" widget. 126 * Added "buy me a beer" section to admin page. 127 * Added favorite statistic feature. 135 128 136 = 1.3 = 137 2009-05-31 138 * Fixed bug: Plugin was working wrong in pages with links includes # character. 139 * Added template tag for Most Favorite Posts. There was already a widget for this. 129 = 1.2 (2009-04-26) = 130 * Added database integration. 131 - If a user logged in then favorites data will save to database instead of cookies. 132 - If user not logged in data will save to cookies. 133 * Added "only registered users can favorite" option. 140 134 141 = 1.2.1 = 142 2009-05-14 143 * Added "Most Favorited Posts" widget. 135 = 1.1.7 (2009-03-10) = 136 * Fixed duplicate loading image problem 137 * Added [wpfp-link] feature; 138 You can show favorite link only in preferred posts with writing 139 [wpfp-link] to the post content. 144 140 145 2009-04-30 146 * Added "buy me a beer" section to admin page. 147 * Added favorite statistic feature. 141 = 1.1.6 (2009-03-05)= 142 * Fixed ajax problem. 148 143 149 = 1.2 = 150 2009-04-26 151 * Added database integration. 152 - If a user logged in then favorites data will save to database instead of cookies. 153 - If user not logged in data will save to cookies. 154 * Added "only registered users can favorite" option. 144 = 1.1.5 (2009-03-02)= 145 * Added rel="nofollow" to links. 146 * Favorite posts title language problem solved. 147 * ajax.js file renamed to wpfp.js 148 * Use XHTML valid links. 149 * Use class instead of id for html elements. 150 * Use more unique function names. All functions starts with wpfp. 155 151 156 = 1.1.7 = 157 2009-03-10 158 * Fixed duplicate loading image problem 159 * Added [wpfp-link] feature; 160 You can show favorite link only in preferred posts with writing 161 [wpfp-link] to the post content. 152 = 1.2.1 (2009-05-14) = 153 * Added "Most Favorited Posts" widget. 154 * Added "buy me a beer" section to admin page. 155 * Added favorite statistic feature. 162 156 163 = 1.1.6 = 164 2009-03-05 165 * Fixed ajax problem. 157 = 1.2 (2009-04-26)= 158 * Added database integration. 159 - If a user logged in then favorites data will save to database instead of cookies. 160 - If user not logged in data will save to cookies. 161 * Added "only registered users can favorite" option. 166 162 167 = 1.1. 5=168 2009-03-02 169 * Added rel="nofollow" to links. 170 * Favorite posts title language problem solved. 171 * ajax.js file renamed to wpfp.js 163 = 1.1.7 (2009-03-10)= 164 * Fixed duplicate loading image problem 165 * Added [wpfp-link] feature; 166 You can show favorite link only in preferred posts with writing 167 [wpfp-link] to the post content. 172 168 173 2009-03-02 174 * Use XHTML valid links. 175 * Use class instead of id for html elements. 176 * Use more unique function names. All functions starts with wpfp. 169 = 1.1.6 (2009-03-05)= 170 * Fixed ajax problem. 177 171 178 = 1.2.1 = 179 2009-05-14 180 * Added "Most Favorited Posts" widget. 172 = 1.1.5 (2009-03-02)= 173 * Added rel="nofollow" to links. 174 * Favorite posts title language problem solved. 175 * ajax.js file renamed to wpfp.js 176 * Use XHTML valid links. 177 * Use class instead of id for html elements. 178 * Use more unique function names. All functions starts with wpfp. 181 179 182 2009-04-30 183 * Added "buy me a beer" section to admin page.184 * Added favorite statistic feature.180 = 1.1.4 (2009-02-24) = 181 * Use permalinks favorite links. 182 * Users can remove a single favorite post from favorite posts page. 185 183 186 = 1.2 = 187 2009-04-26 188 * Added database integration. 189 - If a user logged in then favorites data will save to database instead of cookies. 190 - If user not logged in data will save to cookies. 191 * Added "only registered users can favorite" option. 184 = 1.1.3 (2009-02-24) = 185 * Clear Favorites now works. 186 * Favorite list is xhtml valid now. 192 187 193 = 1.1.7 = 194 2009-03-10 195 * Fixed duplicate loading image problem 196 * Added [wpfp-link] feature; 197 You can show favorite link only in preferred posts with writing 198 [wpfp-link] to the post content. 188 = 1.1.2 (2009-02-24) = 189 * Save button fixed which in options page. 199 190 200 = 1.1.6 = 201 2009-03-05 202 * Fixed ajax problem. 191 = 1.1.1 (2009-02-24) = 192 * Cleared wrong code. 203 193 204 = 1.1.5 = 205 2009-03-02 206 * Added rel="nofollow" to links. 207 * Favorite posts title language problem solved. 208 * ajax.js file renamed to wpfp.js 194 = 1.1 (2009-02-24) = 195 * Fixed permalink problem. Now works with all types of permalink. 209 196 210 2009-03-02 211 * Use XHTML valid links. 212 * Use class instead of id for html elements. 213 * Use more unique function names. All functions starts with wpfp. 214 215 = 1.1.4 = 216 2009-02-24 217 * Use permalinks favorite links. 218 * Users can remove a single favorite post from favorite posts page. 219 220 = 1.1.3 = 221 2009-02-24 222 * Clear Favorites now works. 223 * Favorite list is xhtml valid now. 224 225 = 1.1.2 = 226 2009-02-24 227 * Save button fixed which in options page. 228 229 = 1.1.1 = 230 2009-02-24 231 * Cleared wrong code. 232 233 = 1.1 = 234 2009-02-24 235 * Fixed permalink problem. Now works with all types of permalink. 236 237 = 1.0 = 238 2009-02-23 239 * First Release of WP-Favorite Posts 197 = 1.0 (2009-02-23) = 198 * First Release of WP-Favorite Posts -
wp-favorite-posts/trunk/wp-favorite-posts.php
r470954 r645904 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. 66 Version: 1.5.7 7 7 Author: Huseyin Berberoglu 8 8 Author URI: http://nxsn.com … … 37 37 38 38 function wp_favorite_posts() { 39 $wpfp_options = wpfp_get_options();40 41 39 if (isset($_REQUEST['wpfpaction'])): 42 40 global $ajax_mode; … … 55 53 56 54 function wpfp_add_favorite($post_id = "") { 57 $wpfp_options = wpfp_get_options();58 55 if ( empty($post_id) ) $post_id = $_REQUEST['postid']; 59 56 if (wpfp_get_option('opt_only_registered') && !is_user_logged_in() ) … … 83 80 84 81 function wpfp_remove_favorite($post_id = "") { 85 $wpfp_options = wpfp_get_options();86 82 if (empty($post_id)) $post_id = $_REQUEST['postid']; 87 83 if (wpfp_do_remove_favorite($post_id)) { … … 100 96 } 101 97 } 102 else return false; ;98 else return false; 103 99 } 104 100 … … 113 109 114 110 function wpfp_add_to_usermeta($post_id) { 115 $wpfp_favorites = array();116 111 $wpfp_favorites = wpfp_get_user_meta(); 117 112 $wpfp_favorites[] = $post_id; … … 139 134 $post_id = $post->ID; 140 135 extract($args); 136 $str = ""; 141 137 if ($show_span) 142 138 $str = "<span class='wpfp-span'>"; 143 139 $str .= wpfp_before_link_img(); 144 140 $str .= wpfp_loading_img(); 145 $wpfp_options = wpfp_get_options();146 141 if ($action == "remove"): 147 142 $str .= wpfp_link_html($post_id, wpfp_get_option('remove_favorite'), "remove"); … … 187 182 $user = $_REQUEST['user']; 188 183 extract($args); 189 $wpfp_options = wpfp_get_options();184 global $favorite_post_ids; 190 185 if (!empty($user)): 191 186 if (!wpfp_is_user_favlist_public($user)): … … 257 252 } 258 253 endif; 259 if (!delete_user meta(wpfp_get_user_id(), WPFP_META_KEY)) {254 if (!delete_user_meta(wpfp_get_user_id(), WPFP_META_KEY)) { 260 255 return false; 261 256 } … … 281 276 if (is_page()): 282 277 if (strpos($content,'{{wp-favorite-posts}}')!== false) { 283 returnstr_replace('{{wp-favorite-posts}}', wpfp_list_favorite_posts(), $content);284 } 285 endif; 286 #if (is_single()):278 $content = str_replace('{{wp-favorite-posts}}', wpfp_list_favorite_posts(), $content); 279 } 280 endif; 281 //if (is_single()): 287 282 if (strpos($content,'[wpfp-link]')!== false) { 288 return str_replace('[wpfp-link]', wpfp_link(1), $content); 289 } 290 #endif; 283 $content = str_replace('[wpfp-link]', wpfp_link(1), $content); 284 } 285 //endif; 286 287 if (is_single()) { 288 if (wpfp_get_option('autoshow') == 'before') { 289 $content = wpfp_link(1) . $content; 290 } else if (wpfp_get_option('autoshow') == 'after') { 291 $content .= wpfp_link(1); 292 } 293 } 291 294 return $content; 292 295 } 293 add_filter('the_content','wpfp_content_filter' ,7);296 add_filter('the_content','wpfp_content_filter'); 294 297 function wpfp_shortcode_func() { 295 298 wpfp_list_favorite_posts(); … … 329 332 $wpfp_options['dont_load_js_file'] = 0; 330 333 $wpfp_options['dont_load_css_file'] = 0; 334 $wpfp_options['post_per_page'] = 20; 331 335 add_option('wpfp_options', $wpfp_options, 'Favorite Posts Options'); 332 336 } … … 393 397 return setcookie("wp-favorite-posts[$post_id]", $str, $expire, "/"); 394 398 } 399 395 400 function wpfp_is_user_favlist_public($user) { 396 401 $user_opts = wpfp_get_user_options($user); -
wp-favorite-posts/trunk/wpfp-admin.php
r470944 r645904 22 22 $wpfp_options['dont_load_js_file'] = htmlspecialchars($_POST['dont_load_js_file']); 23 23 $wpfp_options['dont_load_css_file'] = htmlspecialchars($_POST['dont_load_css_file']); 24 $wpfp_options['autoshow'] = htmlspecialchars($_POST['autoshow']); 25 $wpfp_options['post_per_page'] = htmlspecialchars($_POST['post_per_page']); 24 26 25 27 update_option('wpfp_options', $wpfp_options); … … 90 92 <tr> 91 93 <th><?php _e("Only <strong>registered users</strong> can favorite", "wp-favorite-posts") ?></th><td><input type="checkbox" name="opt_only_registered" value="1" <?php if (stripslashes($wpfp_options['opt_only_registered']) == "1") echo "checked='checked'"; ?> /></td> 94 </tr> 95 96 <tr> 97 <th><?php _e("Auto show favorite link", "wp-favorite-posts") ?></th> 98 <td> 99 <select name="autoshow"> 100 <option value="custom" <?php if ($wpfp_options['autoshow'] == 'custom') echo "selected='selected'" ?>>Custom</option> 101 <option value="after" <?php if ($wpfp_options['autoshow'] == 'after') echo "selected='selected'" ?>>After post</option> 102 <option value="before" <?php if ($wpfp_options['autoshow'] == 'before') echo "selected='selected'" ?>>Before post</option> 103 </select> 104 (Custom: insert <strong><?php wpfp_link() ?></strong> wherever you want to show favorite link) 105 </td> 92 106 </tr> 93 107 … … 124 138 125 139 <tr> 140 <th><?php _e("Favorite post per page", "wp-favorite-posts") ?></th> 141 <td> 142 <input type="text" name="post_per_page" size="2" value="<?php echo stripslashes($wpfp_options['post_per_page']); ?>" /> * This only works with default favorite post list page (wpfp-page-template.php). 143 </td> 144 </tr> 145 <tr> 126 146 <th><?php _e("Most favorited posts statics", "wp-favorite-posts") ?>*</th> 127 147 <td> … … 157 177 </div> 158 178 159 160 161 162 179 <div class="postbox"> 163 180 <div title="" class="handlediv"> -
wp-favorite-posts/trunk/wpfp-page-template.php
r470947 r645904 16 16 if ($favorite_post_ids): 17 17 $favorite_post_ids = array_reverse($favorite_post_ids); 18 foreach ($favorite_post_ids as $post_id) { 19 $p = get_post($post_id); 20 echo "<li>"; 21 echo "<a href='".get_permalink($post_id)."' title='". $p->post_title ."'>" . $p->post_title . "</a> "; 22 wpfp_remove_favorite_link($post_id); 18 $post_per_page = wpfp_get_option("post_per_page"); 19 $page = intval(get_query_var('paged')); 20 query_posts(array('post__in' => $favorite_post_ids, 'posts_per_page'=> $post_per_page, 'orderby' => 'post__in', 'paged' => $page)); 21 while ( have_posts() ) : the_post(); 22 echo "<li><a href='".get_permalink()."' title='". get_the_title() ."'>" . get_the_title() . "</a> "; 23 wpfp_remove_favorite_link(get_the_ID()); 23 24 echo "</li>"; 24 } 25 endwhile; 26 27 echo '<div class="navigation">'; 28 if(function_exists('wp_pagenavi')) { wp_pagenavi(); } else { ?> 29 <div class="alignleft"><?php next_posts_link( __( '← Previous Entries', 'buddypress' ) ) ?></div> 30 <div class="alignright"><?php previous_posts_link( __( 'Next Entries →', 'buddypress' ) ) ?></div> 31 <?php } 32 echo '</div>'; 33 34 wp_reset_query(); 25 35 else: 26 36 echo "<li>"; … … 29 39 endif; 30 40 echo "</ul>"; 31 wpfp_clear_list_link(); 41 42 echo '<p>'.wpfp_clear_list_link().'</p>'; 32 43 echo "</div>"; 33 44 wpfp_cookie_warning();
Note: See TracChangeset
for help on using the changeset viewer.