Plugin Directory

Changeset 645904


Ignore:
Timestamp:
12/29/2012 09:44:14 PM (13 years ago)
Author:
hberberoglu
Message:

wpfp 1.5.7

Location:
wp-favorite-posts/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • wp-favorite-posts/trunk/readme.txt

    r470954 r645904  
    11=== WP Favorite Posts ===
    22Contributors: Huseyin Berberoglu
    3 Donate link: http://nxsn.com.com/my-projects/wp-favorite-posts-plugin
     3Donate link: https://www.paypal.com/uk/cgi-bin/webscr?cmd=_flow&SESSION=SB_pK-MmCNOvFQw3MHe2u0wBC4xEM4SEK6nFEnyZfN-3mFY-Rpc1JFyhA2W&dispatch=5885d80a13c0db1f8e263663d3faee8d0b7e678a25d883d0fa72c947f193f8fd
    44Tags: favorite posts, favorite, favourite, posts, favorites,
    55wp-favorite-posts, reading list, post list, post lists, lists
    66Requires at least: 2.0.2
    7 Tested up to: 3.2.1
    8 Stable tag: 1.5.6
     7Tested up to: 3.5
     8Stable tag: 1.5.7
    99
    1010Allows visitors to add favorite posts. This plugin use cookies for saving data so
     
    2929Rejected URIs".
    3030
    31 See [more details about
    32 plugin](http://nxsn.com/my-projects/wp-favorite-posts/)
     31See [more details about plugin](http://nxsn.com/projects/wp-favorite-posts/)
    3332
    3433== Installation ==
     
    5150
    5251== 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.
    5956
    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()
    7662
    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
    8065
    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
    8480
    8581= 1.4.3 =
    86822010-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.
    8985
    9086= 1.4.3 =
    91872010-04-09
    92     * Fix: same remove link for all posts on index
    93     * 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.
    9490
    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)
    9995
    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}}
    10299
    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.
    109102
    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
    113105
    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.
     108This 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.
     111You can show remove link when someone add a favorite.
     112Similary You can show add link when someone remove a favorite.
    117113
    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
    122119
    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.
    128123
    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.
    135128
    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.
    140134
    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;
     138You can show favorite link only in preferred posts with writing
     139[wpfp-link] to the post content.
    144140
    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.
    148143
    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.
    155151
    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.
    162156
    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.
    166162
    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;
     166You can show favorite link only in preferred posts with writing
     167[wpfp-link] to the post content.
    172168
    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.
    177171
    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.
    181179
    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.
    185183
    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.
    192187
    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.
    199190
    200 = 1.1.6 =
    201 2009-03-05
    202     * Fixed ajax problem.
     191= 1.1.1 (2009-02-24) =
     192* Cleared wrong code.
    203193
    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.
    209196
    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  
    44Plugin URI: http://nxsn.com/my-projects/wp-favorite-posts-plugin/
    55Description: Allows users to add favorite posts. This plugin use cookies for saving data so unregistered users can favorite a post. Put <code>&lt;?php wpfp_link(); ?&gt;</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.6
     6Version: 1.5.7
    77Author: Huseyin Berberoglu
    88Author URI: http://nxsn.com
     
    3737
    3838function wp_favorite_posts() {
    39     $wpfp_options = wpfp_get_options();
    40 
    4139    if (isset($_REQUEST['wpfpaction'])):
    4240        global $ajax_mode;
     
    5553
    5654function wpfp_add_favorite($post_id = "") {
    57     $wpfp_options = wpfp_get_options();
    5855    if ( empty($post_id) ) $post_id = $_REQUEST['postid'];
    5956    if (wpfp_get_option('opt_only_registered') && !is_user_logged_in() )
     
    8380
    8481function wpfp_remove_favorite($post_id = "") {
    85     $wpfp_options = wpfp_get_options();
    8682    if (empty($post_id)) $post_id = $_REQUEST['postid'];
    8783    if (wpfp_do_remove_favorite($post_id)) {
     
    10096        }
    10197    }
    102     else return false;;
     98    else return false;
    10399}
    104100
     
    113109
    114110function wpfp_add_to_usermeta($post_id) {
    115     $wpfp_favorites = array();
    116111    $wpfp_favorites = wpfp_get_user_meta();
    117112    $wpfp_favorites[] = $post_id;
     
    139134    $post_id = $post->ID;
    140135    extract($args);
     136    $str = "";
    141137    if ($show_span)
    142138        $str = "<span class='wpfp-span'>";
    143139    $str .= wpfp_before_link_img();
    144140    $str .= wpfp_loading_img();
    145     $wpfp_options = wpfp_get_options();
    146141    if ($action == "remove"):
    147142        $str .= wpfp_link_html($post_id, wpfp_get_option('remove_favorite'), "remove");
     
    187182    $user = $_REQUEST['user'];
    188183    extract($args);
    189     $wpfp_options = wpfp_get_options();
     184    global $favorite_post_ids;
    190185    if (!empty($user)):
    191186        if (!wpfp_is_user_favlist_public($user)):
     
    257252            }
    258253        endif;
    259         if (!delete_usermeta(wpfp_get_user_id(), WPFP_META_KEY)) {
     254        if (!delete_user_meta(wpfp_get_user_id(), WPFP_META_KEY)) {
    260255            return false;
    261256        }
     
    281276    if (is_page()):
    282277        if (strpos($content,'{{wp-favorite-posts}}')!== false) {
    283             return str_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()):
    287282        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    }
    291294    return $content;
    292295}
    293 add_filter('the_content','wpfp_content_filter',7);
     296add_filter('the_content','wpfp_content_filter');
    294297function wpfp_shortcode_func() {
    295298    wpfp_list_favorite_posts();
     
    329332    $wpfp_options['dont_load_js_file'] = 0;
    330333    $wpfp_options['dont_load_css_file'] = 0;
     334    $wpfp_options['post_per_page'] = 20;
    331335    add_option('wpfp_options', $wpfp_options, 'Favorite Posts Options');
    332336}
     
    393397    return setcookie("wp-favorite-posts[$post_id]", $str, $expire, "/");
    394398}
     399
    395400function wpfp_is_user_favlist_public($user) {
    396401    $user_opts = wpfp_get_user_options($user);
  • wp-favorite-posts/trunk/wpfp-admin.php

    r470944 r645904  
    2222    $wpfp_options['dont_load_js_file'] = htmlspecialchars($_POST['dont_load_js_file']);
    2323    $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']);
    2426
    2527    update_option('wpfp_options', $wpfp_options);
     
    9092            <tr>
    9193                <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>&lt;?php wpfp_link() ?&gt;</strong> wherever you want to show favorite link)
     105                </td>
    92106            </tr>
    93107
     
    124138
    125139            <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>
    126146                <th><?php _e("Most favorited posts statics", "wp-favorite-posts") ?>*</th>
    127147                <td>
     
    157177</div>
    158178
    159 
    160 
    161 
    162179<div class="postbox">
    163180    <div title="" class="handlediv">
  • wp-favorite-posts/trunk/wpfp-page-template.php

    r470947 r645904  
    1616    if ($favorite_post_ids):
    1717        $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());
    2324            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( __( '&larr; Previous Entries', 'buddypress' ) ) ?></div>
     30            <div class="alignright"><?php previous_posts_link( __( 'Next Entries &rarr;', 'buddypress' ) ) ?></div>
     31            <?php }
     32        echo '</div>';
     33
     34        wp_reset_query();
    2535    else:
    2636        echo "<li>";
     
    2939    endif;
    3040    echo "</ul>";
    31     wpfp_clear_list_link();
     41
     42    echo '<p>'.wpfp_clear_list_link().'</p>';
    3243    echo "</div>";
    3344    wpfp_cookie_warning();
Note: See TracChangeset for help on using the changeset viewer.