1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  1. shibuya246

    shibuya246 Hotaru Developer Staff Member Admin

    shibuya246 submitted a new resource:

    Follow - Follow

    Read more about this resource...
     
    Last edited: Oct 29, 2014 at 12:06 AM
    andynghiem and anika039 like this.
  2. nothingman

    nothingman Active Member

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

    [​IMG]

    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: May 13, 2010
  3. Nick

    Nick Well-Known Member

    The hotaru_friends database table is created when you upgrade to Hotaru 1.2. You did run the upgrade script, didn't you? :confused:
     
    nothingman likes this.
  4. nothingman

    nothingman Active Member

    Of course I did. It's install/upgrade.php right?

    Would it be safe to run it again? :confused:
     
  5. nothingman

    nothingman Active Member

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

     
  6. apfind

    apfind New Member

    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:
        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";
            }
         }
        }
     
  7. shibuya246

    shibuya246 Hotaru Developer Staff Member Admin

  8. shibuya246

    shibuya246 Hotaru Developer Staff Member Admin

    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?729-Follow-0.2&p=4142&viewfull=1#post4142
     
  9. apfind

    apfind New Member

    Awesome! Thanks Shibuya! This is great!
     
  10. jerryisrockin

    jerryisrockin New Member

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

    Graeme Member

    I had a problem with this plugin, whereby the follow button wasn't working on localhost...just incase anyone has the same problem, all I did to fix it was make a tiny change in follow_update.php:

    from this:

    to this:
     
  12. shibuya246

    shibuya246 Hotaru Developer Staff Member Admin

    do you have a line number. I dont see this in the 0.5 version
     
  13. Graeme

    Graeme Member

    I have it on line 30 of follow_update.php - it's in the templates folder of the plugin

    I'm still using one of the older versions of Hotaru though
     
  14. shibuya246

    shibuya246 Hotaru Developer Staff Member Admin

    I dont think you have the latest version of this plugin. It is available for download from the forums here
    http://forums.hotarucms.org/showthread.php?729-Follow-0-5

    The entire code of that file is as a follows

    Code:
    
        require_once($_SERVER['DOCUMENT_ROOT'] . '/functions/funcs.files.php');
        $h = startHotaru();
    
        require_once(PLUGINS . 'follow/follow.php');
        $Follow = new Follow($h);
       
        $action = $h->cage->post->testAlnumLines('action');  
    
        $user_id = $h->cage->post->testInt('user_id');
        switch ($action) {
    	case "unfollow":
    	    $h->unfollow($user_id);
    	    break;
    	case "follow":
    	    $h->follow($user_id);
    	    break;
        }
        
        if ($h->isFollowing($user_id)) { echo json_encode(array('result'=>'Unfollow')); } else { echo json_encode(array('result'=>'Follow')); }
        exit; // This is ajax call to stop here, just in case we are thinking of printing anything else out below
    
     
  15. shibuya246

    shibuya246 Hotaru Developer Staff Member Admin

    I dont think you have the latest version of this plugin. It is available for download from the forums here
    http://forums.hotarucms.org/showthread.php?729-Follow-0-5

    The entire code of that file is as a follows

    Code:
    
        require_once($_SERVER['DOCUMENT_ROOT'] . '/functions/funcs.files.php');
        $h = startHotaru();
    
        require_once(PLUGINS . 'follow/follow.php');
        $Follow = new Follow($h);
       
        $action = $h->cage->post->testAlnumLines('action');  
    
        $user_id = $h->cage->post->testInt('user_id');
        switch ($action) {
    	case "unfollow":
    	    $h->unfollow($user_id);
    	    break;
    	case "follow":
    	    $h->follow($user_id);
    	    break;
        }
        
        if ($h->isFollowing($user_id)) { echo json_encode(array('result'=>'Unfollow')); } else { echo json_encode(array('result'=>'Follow')); }
        exit; // This is ajax call to stop here, just in case we are thinking of printing anything else out below
    
     
  16. seekyt

    seekyt Donor Donor

    I'm having a little bit of trouble getting the activity to load on the "Follower" and "Following" pages.

    I just did a fresh install of 1.5.2 on MAMP.

    When I view the "follower" and "Following" pages, nothing shows up in the "follower_activity" column. The subsequent column is also blank. This happens no matter what the activity item is (comment, post, etc.).

    I installed the updated Activity and Comments plugins, fresh from their respective forum threads.

    Can you please offer me some insight on what might be going wrong?
     
  17. shibuya246

    shibuya246 Hotaru Developer Staff Member Admin

    thanks. have updated to solve that now
    http://forums.hotarucms.org/showthread.php?227-Activity-1-4
     
  18. seekyt

    seekyt Donor Donor

    Thank you. This plugin is still causing some problems (even with the activity upgrade). The activity is still not displaying on the tables, and if using "Tabbed profiles" i can't get the forms to show at all without editing the follow.php file to change "tab-pane" to "tab-pane active" . I have tested these functions using the plugins in their default state.


    After the edit, #tab_followers and #tab_following show the same empty follower form. "$h->vars['follow_type']" seems like it's not working just right.

    Do you have any idea what I'm doing wrong? It is very important to me to get the "Follow" plugin working properly.
     
  19. seekyt

    seekyt Donor Donor

    I was able to get this plugin working with one exception - for some reason, the "activity" function does not want to work properly. It keeps giving "No Activity Yet" for all users, despite their activity.

    From "follow_followers.php":

    PHP:
    <td class="follow_activity">
                        <?php 
                        $action 
    $h->pluginHook('follow_activity''', array($user->user_id)); 
                        
                        if (!
    $action) { echo "No activity yet."; } else {
                            
    $activity = new Activity();
                            echo 
    $activity->activityContent($h$action['Activity_follow_activity']);
                            if (
    $follow_settings['follow_show_time_date']) {
                                echo 
    "<br /><small>[" date('g:ia, M jS'strtotime($action['Activity_follow_activity']->useract_date)) . "]</small>";
                            }
                        }
                        
    ?>
                    </td>    
    I think there is some kind of error with the "$action" variable.

    To get the tables to show properly, even with tabbed UI, I simply removed the "tab-pane" class from from the "divs" in follow.php. Even though the content isn't "tabbed" any longer, it's still accessible, with the exception of "activity"
     
  20. seekyt

    seekyt Donor Donor

    Here's more information from the Error_Log:

    In follow_followers.php on line ~ 95
     
    sereban likes this.

Share This Page