Making the action box make sense

So my idea here is, if you have a pending friend request with someone, and you mouse over their avatar, you should get an "accept friendship" instead of a "befriend" button.

 

I have the following mod that accomplishes this.

 

add the following langauge key

_acceptFriendship  = Accept Frendship

templates/base/scripts/BxBaseProfileView.php

around line 440 you'll find

            $p_arr['cpt_fave']          = _t('_Fave');
            $p_arr['cpt_befriend']      = _t('_Befriend');

ADD THIS


###
#SteveSoft
#05-15-2012
#           
            $p_arr['cpt_acceptfriend']     = _t('_acceptFriendship');
#

around line 468 find

           $p_arr['cpt_fave']          = '';
            $p_arr['cpt_befriend']      = '';

ADD THIS


##
#SteveSoft
#05-15-2012
#           
            $p_arr['cpt_acceptfriend'] = '';
#

in the file short_profile_info.php

around line 54 find

        $aProfileInfo['cpt_fave']             = _t('_Fave');
        $aProfileInfo['cpt_befriend']         = _t('_Befriend');

ADD THIS


###
#SteveSoft
#05-15-2012
#           
        $aProfileInfo['cpt_acceptfriend']     = _t('_acceptFriendship');

#

around line 81 find

        $aProfileInfo['cpt_fave']             = '';
        $aProfileInfo['cpt_befriend']         = '';

ADD THIS


###
#SteveSoft
#05-15-2012
#       
        $aProfileInfo['cpt_acceptfriend']     = '';

#

in inc/utils.inc.php

around line 134 find

    $cnt = db_arr("SELECT SUM(`Check`) AS 'cnt' FROM `sys_friend_list` WHERE `ID`='{$id1}' AND `Profile`='{$id2}' OR `ID`='{$id2}' AND `Profile`='{$id1}'");
    return ($cnt['cnt'] > 0 ? true : false);
}

ADD THIS


###
#SteveSoft
#05-15-2012
#
/*
 * check for friend request
 */
function is_friendRequest($id1, $id2) {
    $id1 = (int)$id1;
    $id2 = (int)$id2;
    if ($id1 == 0 || $id2 == 0)
       return;
       $aCheck = db_arr("SELECT COUNT(*) as count FROM `sys_friend_list` WHERE `ID` = '{$id1}' AND `Profile`='{$id2}' AND `Check` = '0'");
    return ($aCheck['count'] > 0 ? true : false );
}

finally...  in phpmyadmin or your favorite database editor run this query

SELECT *
FROM `sys_objects_actions`
WHERE `Caption`
REGEXP 'friend'
LIMIT 0 , 300

you will find a record with a field that says {cpt_befreind}

edit that and look at the field Eval

ONLY edit the 1st line!  Leave the rest alone!

if ({ID} == {member_id} OR is_friends({ID} , {member_id}) ) return;

replace it with this

if ({ID} == {member_id} OR is_friends({ID} , {member_id}) OR is_friendRequest({ID} , {member_id})) return;

then run this query replacing YOURDATABASE with yourdatabasename

INSERT INTO `YOURDATABASE`.`sys_objects_actions` (`ID`, `Caption`, `Icon`, `Url`, `Script`, `Eval`, `Order`, `Type`, `bDisplayInSubMenuHeader`) VALUES (NULL, '{cpt_acceptfriend}', 'action_friends.png', '', '{evalResult}', 'if ({ID} == {member_id} OR !is_friendRequest({ID} , {member_id})) return;

return "$.post(''list_pop.php?action=friend'', { ID: ''{ID}'' }, function(sData){ $(''#ajaxy_popup_result_div_{ID}'').html(sData) } );
$(''#short_profile_info'').fadeOut(5000, function(){location.reload()});
return false;";', '1', 'Profile', '0');

You will now have a button called "Accept Friendship" only when you mouse over members that have requested your friendship.

You will also see the "Accept Friendship" when you view their profile, instead of the befriend button as well.

Also, if you have a pending friend request you will NOT get the befriend button

The only thing I don't like right now is if you are the requester, it still shows the befriend button.  I will work on that on my day off.

As always, BACKUP your modified files!

backup your database before attempting this mod!



http://www.mytikibar.com
Quote · 16 May 2012

Hey Steve,

Thanks for this!

Any updates on the " if you are the requester, it still shows the befriend button." ?

Quote · 8 Jul 2012

Good idea ....thanks for sharing.

Quote · 9 Jul 2012

 

Hey Steve,

Thanks for this!

Any updates on the " if you are the requester, it still shows the befriend button." ?

 No, I haven't looked into that yet.  

I've been working on 2 pretty sweet mods, but I don't have the $100.00 yet to be a developer so I can post them.  lol

I added a video/shoutbox option for groups, and am looking at porting it over to events as well.

And of course my sitewide wall mod. which I am ALMOST done with.

http://www.mytikibar.com
Quote · 13 Jul 2012

hmm, doesn't antonlv already provide a free sitewide wall mod?

http://www.boonex.com/m/Site_s_Wall

Quote · 13 Jul 2012

Yes, but mine goes above and beyond that one.

It only displays your friends activities on the index page, you can add videos, sounds, and pics right to the wall.

If your profile is private, your activity will not show up for anyone that is NOT your friend.

When you go to your friends profile page, you only see your friends activities on the wall.

I am looking at a thumbs up/thumbs down addition for the post and any comments.

So it's above and beyond that mod.

http://www.mytikibar.com
Quote · 13 Jul 2012
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.