Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: Save Post 0.7

  1. #1
    Member
    Join Date
    Jan 2010
    Posts
    37
    Thanks
    41
    Thanked 20 Times in 7 Posts

    Default Save Post 0.7

    Save Post
    Version: 0.7
    Author: William Dahlheim
    Created on: 2010/02/21
    Last Updated: 2010/06/04
    Tested on: 1.3.0
    Plugins Required: None
    Plug & Play: Yes
    Supported: Yes

    Description
    This plugin adds a link in the sb_base_show_post_extra_fields field, allowing your members to save/flag a post as a favorite. These are shown in a sidebar widget. The sidebar widget is dynamically updated. The saved posts are saved in the user's profile data as "saved_posts". Please note that this plugin is only tested using jQuery 1.4.2.

    As of version 0.5, saved posts are shown publicly on user profiles.

    Instructions
    1. Upload the "save_post" folder to your plugins folder.
    2. Install the plugin from Plugin Management in Admin as per usual.
    3. Turn the Save Post widget on in Plugin Settings > Widgets

    Revision History
    v.0.7 2010/05/27 - Nick - Updated for compatibility with the Bookmarking plugin
    v.0.6 2010/04/17 - Nick - Fix for $h->vars['user'] clashing with other plugins
    v.0.5 2010/03/22 - Nick - Added a "Saved Posts" page in the user's profile
    v.0.4 2010/02/22 - William - Added icon in widget that removes the post on click
    v.0.3 2010/02/22 - William - Made it into its own widget. Thanks again, Nick!
    v.0.2 2010/02/22 - William - Removed unnecessary plugin hooks. Moved save_post_widget.php to template folders. Thanks a bunch Nick!
    v.0.1 2010/02/21 - William - Released first version

    Please click "Rate Thread" and give this plugin a rating. Thank you.
    Attached Thumbnails Attached Thumbnails save_post_0_5..png  
    Attached Files Attached Files
    Last edited by williamd; 03-23-2010 at 12:44 PM.


  2. #2
    Former lead dev Nick's Avatar
    Join Date
    Jun 2009
    Location
    Kakamigahara, Japan
    Posts
    2,869
    Blog Entries
    88
    Thanks
    481
    Thanked 806 Times in 526 Posts

    Default

    This is great! I love how it adds your saved links to the widget on the fly like that. Brilliant!

    Two suggestions to make it a bit better:

    1. Remove the admin_plugin_settings and admin_sidebar_plugin_settings hooks because they aren't being used and cause a fatal error if you try to visit the settings page.

    2. Make a "templates" folder and put save_post_widget.php in it. Then, in the Text Widget, users can put
    PHP Code:
    $h->displayTemplate('save_post_widget''save_post'); 
    instead of needing to move the file to their theme folder. If they later move the file to their theme to customize, that code will still find it.

  3. #3
    Member
    Join Date
    Jan 2010
    Posts
    37
    Thanks
    41
    Thanked 20 Times in 7 Posts

    Default

    Hey Nick,

    Thanks! :-) I had a lot of fun creating it. Hotaru makes it easy! I really appreciate your input and I just updated the package and this post accordingly. Should work a bit better now!

    As it is now, there is no limit on the amount of saved posts that are displayed in the sidebar. I guess that will be in ver. 0.3 along with a small admin interface or just inline buttons to remove items from the list in the widget. Who needs sleep anyway?

  4. #4
    Former lead dev Nick's Avatar
    Join Date
    Jun 2009
    Location
    Kakamigahara, Japan
    Posts
    2,869
    Blog Entries
    88
    Thanks
    481
    Thanked 806 Times in 526 Posts

    Default

    Thanks for making those updates!

    Future versions might use their own widget instead of the Text Widget, and show the latest (10) saved links in the widget with a "more" link that goes to all the links in a users profile. Currently the profile section from the Users plugin is a bit of a mess. We need a hassle-free way for plugin developers to add extra pages to user profiles. I'll give that some thought.

    The reason I would give Save Post its own widget is because in its current form, the widget title still shows to logged out users. Something like this would setup the widget:

    PHP Code:
    /**
         * Register Saved Post widget
         */
        
    public function install_plugin($h)
        {
            
    $h->addWidget('save_post''save_post''');  // plugin name, function name, optional arguments
        
    }

        
    /**
         * Displays Save Post widget
         */
        
    public function widget_save_post($h)
        {
            
    $h->displayTemplate('save_post_widget''save_post'); // template name, plugin name
        

    In the template, you'd need to put a wrapper around the code, e.g.

    PHP Code:
    <h2 class='widget_head widget_save_post_title'>Saved Posts</h2>

    <
    div class='widget_body widget_save_post_body'>

    // output

    </div
    The end result would look the same, but you'd have a bit more flexibility and not need the Text Widget.

    This is fun, eh? :-D

  5. #5
    Senior Member rushnp774's Avatar
    Join Date
    Nov 2009
    Location
    Lees Summit, MO
    Posts
    142
    Blog Entries
    2
    Thanks
    14
    Thanked 10 Times in 6 Posts

    Default

    Wow, sounds like a really awesome plugin. Thanks! The only thing I don't like is that now I'm going to have too many extra buttons in my _base_show_post_extra_fields field. My tags, tweet this, fb share, buzz, etc icons are all going to wrap around onto a new layer unless I figure something out. Any ideas Nick or William? Guess I could always just reduce the left padding between the icons, but I don't want to cram them together too close.

    This could probably be further extended by allowing people to email their favorites, or at least a selected favorite to other people. That'd just add another method for people to share posts they find helpful besides using social media buttons. I'm a huge fan of an "email this"-type button, because even people who don't use social media likely use email. I'd be happy to help out with that if you want William.

    Again, awesome stuff, and I'll get to testing it on my local development server.

  6. #6
    Senior Member rushnp774's Avatar
    Join Date
    Nov 2009
    Location
    Lees Summit, MO
    Posts
    142
    Blog Entries
    2
    Thanks
    14
    Thanked 10 Times in 6 Posts

    Default

    Hmm, probably something simple, but I have two problems with this plugin after installing it:

    1) The Save/Remove button only appears when I'm logged in as an admin. Is that supposed to happen?

    2) The text widget where I entered, "$h->displayTemplate('save_post_widget');" (without the quotes) gives me a "page not found" error when I run the page.

    The plugin is installed, and the text widget is activated & has the PHP box checked. I'm sure it's something tiny, but I'm not sure what I'm doing wrong. Any suggestions?

  7. #7
    Member
    Join Date
    Jan 2010
    Posts
    37
    Thanks
    41
    Thanked 20 Times in 7 Posts

    Default

    Nick, you're right. It makes much more sense to have it as its own widget. Code ahs been updated and uploaded! Thanks!

  8. Thanked by:


  9. #8
    Former lead dev Nick's Avatar
    Join Date
    Jun 2009
    Location
    Kakamigahara, Japan
    Posts
    2,869
    Blog Entries
    88
    Thanks
    481
    Thanked 806 Times in 526 Posts

    Default

    Quote Originally Posted by rushnp774 View Post
    I'm going to have too many extra buttons ... Any ideas Nick or William?
    Yes! you've prompted me to write one possible solution here.

  10. #9
    Former lead dev Nick's Avatar
    Join Date
    Jun 2009
    Location
    Kakamigahara, Japan
    Posts
    2,869
    Blog Entries
    88
    Thanks
    481
    Thanked 806 Times in 526 Posts

    Default

    Quote Originally Posted by williamd View Post
    Nick, you're right. It makes much more sense to have it as its own widget. Code ahs been updated and uploaded! Thanks!
    Wow, you work fast!

  11. #10
    Member
    Join Date
    Jan 2010
    Posts
    37
    Thanks
    41
    Thanked 20 Times in 7 Posts

    Default

    Hiya!

    Yes, that's kinda how I wanted it - only to be shown for logged in users. That can be easily changed in save_post_widget.php - remove the if loggedIn statement. Then again, you should download the latest package and try that out instead and get all the widgety goodness! Much cleaner now.

    I hear you regardig the many buttons in sb_base_show_post_extra_fields. It can get a little crowded. An easy fix would be to change certain plugins to use sb_base_show_post_extras instead, which is in a div just below! A bit hacky, but it could work and give you a whole extra row to fill with plugins!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [Docs] Save and Access Plugin Settings
    By Nick in forum Developing Plugins
    Replies: 0
    Last Post: 06-27-2009, 02:55 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •