Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Follow 0.5

  1. #1
    Admin & Development shibuya246's Avatar
    Join Date
    Jun 2009
    Location
    Tokyo, Japan
    Posts
    784
    Blog Entries
    2
    Thanks
    205
    Thanked 326 Times in 192 Posts

    Default Follow 0.5

    Follow
    Version: 0.5
    Author: shibuya246
    Created on: 2010/05/07
    Last Updated: 2010/08/20
    Tested on: Hotaru 1.2.0 ~ 1.4.1
    Plugins Required: None
    Plug & Play: Yes
    Supported: Yes

    Description
    Basic Follower/Following plugin works with core $h class for Friends

    Instructions
    1. Upload the "follow" folder to your plugins folder.
    2. Install it from Plugin Management in Admin.

    Revision History
    v.0.5 2010/08/20 - Nick - Fix for logged out users being able to see the follow/unfollow buttons
    v.0.4 2010/05/27 - Nick - Updated for compatibility with the Bookmarking plugin
    v.0.3 2010/05/17 - shibuya246 - Added hook for sb_base to make link on posts page for following poster
    v.0.2 2010/04/27 - shibuya246 - Updated to use new Friends class in $h->
    v.0.1 2010/04/21 - shibuya246 - Released first version

    Please click "Rate Thread" and give this plugin a rating. Thank you.
    Attached Thumbnails Attached Thumbnails hotarucms-following.JPG  
    Attached Files Attached Files

  2. Thanked by:


  3. #2
    Senior Member
    Join Date
    Sep 2009
    Posts
    526
    Thanks
    209
    Thanked 85 Times in 64 Posts

    Default

    Hi Shibuya, I'm getting the following error on the profile page after installing this plugin.

    mydbname.hotaru_friends doesn't exist in <serverpath>/html/libs/extensions/ezSQL/mysql/ez_sql_mysql.php on line 257


    Also when I tried installing it, I noticed that this plugin takes longer to install than the others. However, after the page loaded I was prompted to download the admin_index.php file (My internet connection was pretty good at that time). I just canceled the download prompt and deliberately refreshed the Plugin Management page, this plugin did show up as installed. But when I go to my (or other members' profile, I get the above error.
    Last edited by nothingman; 05-13-2010 at 09:26 AM.

  4. #3
    Former lead dev Nick's Avatar
    Join Date
    Jun 2009
    Location
    Kakamigahara, Japan
    Posts
    2,915
    Blog Entries
    88
    Thanks
    519
    Thanked 846 Times in 551 Posts

    Default

    The hotaru_friends database table is created when you upgrade to Hotaru 1.2. You did run the upgrade script, didn't you?

  5. Thanked by:


  6. #4
    Senior Member
    Join Date
    Sep 2009
    Posts
    526
    Thanks
    209
    Thanked 85 Times in 64 Posts

    Default

    Quote Originally Posted by Nick View Post
    The hotaru_friends database table is created when you upgrade to Hotaru 1.2. You did run the upgrade script, didn't you?
    Of course I did. It's install/upgrade.php right?

    Would it be safe to run it again?

  7. #5
    Senior Member
    Join Date
    Sep 2009
    Posts
    526
    Thanks
    209
    Thanked 85 Times in 64 Posts

    Default

    Ok, I ran the following SQL script and it's working fine. I hope I'm doing this correctly

    CREATE TABLE `hotaru_friends` (
    `follower_user_id` int(20) NOT NULL default '0',
    `following_user_id` int(20) NOT NULL default '0',
    `friends_updatedts` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
    PRIMARY KEY (`follower_user_id`,`following_user_id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Friends';

  8. #6
    Member apfind's Avatar
    Join Date
    May 2010
    Location
    New York City
    Posts
    56
    Thanks
    24
    Thanked 7 Times in 6 Posts

    Default

    Thanks shibuya246! Really liking this plugin!

    Was trying to customize it:

    Is it possible to add a follow link in the extra post field similar to Tweet This and Save Post?

    I tried this and some other things... but could not get it to work:

    PHP Code:
        public function sb_base_show_post_extra_fields($h)
        {
            if (
    $h->currentUser->loggedIn && $h->vars['user']->name != $h->currentUser->name) {
            
    // check if already following
            
    $follow $h->isFollowing($h->vars['user']->id);
            if (
    $follow == 0) {
                 echo 
    "<li><a href='" $h->url(array('page'=>'follow''user'=>$h->vars['user']->name)) . "'>" $h->lang['follow_follow_user'] . "</a></li>\n";
            } else {
             echo 
    "<li><a href='" $h->url(array('page'=>'unfollow''user'=>$h->vars['user']->name)) . "'>" $h->lang['follow_unfollow_user'] . "</a></li>\n";
            }
         }
        } 

  9. #7
    Admin & Development shibuya246's Avatar
    Join Date
    Jun 2009
    Location
    Tokyo, Japan
    Posts
    784
    Blog Entries
    2
    Thanks
    205
    Thanked 326 Times in 192 Posts

    Default

    Updated v.0.3 2010/05/17 - shibuya246 - Added hook for sb_base to make link on posts page for following poster

    http://hotarucms.org/showthread.php?...ull=1#post4142

  10. #8
    Admin & Development shibuya246's Avatar
    Join Date
    Jun 2009
    Location
    Tokyo, Japan
    Posts
    784
    Blog Entries
    2
    Thanks
    205
    Thanked 326 Times in 192 Posts

    Default

    Quote Originally Posted by apfind View Post
    Thanks shibuya246! Really liking this plugin!

    Was trying to customize it:

    Is it possible to add a follow link in the extra post field similar to Tweet This and Save Post?

    I tried this and some other things... but could not get it to work:

    PHP Code:
        public function sb_base_show_post_extra_fields($h)
        {
            if (
    $h->currentUser->loggedIn && $h->vars['user']->name != $h->currentUser->name) {
            
    // check if already following
            
    $follow $h->isFollowing($h->vars['user']->id);
            if (
    $follow == 0) {
                 echo 
    "<li><a href='" $h->url(array('page'=>'follow''user'=>$h->vars['user']->name)) . "'>" $h->lang['follow_follow_user'] . "</a></li>\n";
            } else {
             echo 
    "<li><a href='" $h->url(array('page'=>'unfollow''user'=>$h->vars['user']->name)) . "'>" $h->lang['follow_unfollow_user'] . "</a></li>\n";
            }
         }
        } 
    ok, that is the right hook for it. You came close, but some of the variables you needed $h->vars['user'] were not available on this page.
    I have recoded the plugin and released a version with an option to have link for "follow user" on the posts page. I might look at an ajax solution if people want it also.

    http://hotarucms.org/showthread.php?...ull=1#post4142

  11. #9
    Member apfind's Avatar
    Join Date
    May 2010
    Location
    New York City
    Posts
    56
    Thanks
    24
    Thanked 7 Times in 6 Posts

    Default

    Awesome! Thanks Shibuya! This is great!

  12. #10
    Junior Member
    Join Date
    Jan 2011
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    When I click the option to "show the follow link" on each post, it still does not show up? What am i missing?

Thread Information

Users Browsing this Thread

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

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
  •