The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Friend Request in posts

Page 2 of 2 Previous  1, 2

View previous topic View next topic Go down

Good idea?

89% 89% 
[ 34 ]
5% 5% 
[ 2 ]
5% 5% 
[ 2 ]
 
Total Votes : 38

Friend Request in posts

Post by Rehua on July 30th 2009, 5:40 pm

First topic message reminder :

My idea:


A button next to your posts which says "add friend" or "add foe".
This will add something as a friend.

~Niels

Rehua
Forumember

Male Posts : 669
Reputation : 1
Language : Dutch, English, German, French
Location : On Forumotion.

http://vocatrem.findtalk.biz/forum.htm

Back to top Go down


Re: Friend Request in posts

Post by Codyy on October 2nd 2009, 7:00 am

well, only if we got the feature "notifyed when new friend request" was activated

Codyy
Active Poster

Male Posts : 1030
Reputation : 16
Language : English
Location : F L o R i D A

http://forumansion.net

Back to top Go down

Re: Friend Request in posts

Post by DanAkiCcc on November 5th 2009, 8:13 pm

Gooooooooood!!! :wouhou:

DanAkiCcc
New Member

Posts : 15
Reputation : 0
Language : Greece

Back to top Go down

Re: Friend Request in posts

Post by SLGray on February 21st 2015, 10:35 pm

Bumping to move it to the first page.


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 36748
Reputation : 2449
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

Re: Friend Request in posts

Post by Guest on February 21st 2015, 10:45 pm

Voted yes, because I believe this is an excellent idea!

Guest
Guest


Back to top Go down

Re: Friend Request in posts

Post by Rupture on February 21st 2015, 11:02 pm

@Codyy wrote:well, only if we got the feature "notifyed when new friend request" was activated
I voted yes but I do have to agree, a notification when a people get a friend request would be quite useful.

Rupture
Forumember

Male Posts : 325
Reputation : 6
Language : English, Español, Deutsch, Catalá
Location : Earth

http://raptorgaming.forumotion.com

Back to top Go down

Re: Friend Request in posts

Post by SLGray on February 22nd 2015, 4:36 pm

@Rupture wrote:
@Codyy wrote:well, only if we got the feature "notifyed when new friend request" was activated
I voted yes but I do have to agree, a notification when a people get a friend request 
There are notifications now with the toolbar.


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 36748
Reputation : 2449
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

Re: Friend Request in posts

Post by _Twisted_Mods_ on February 25th 2015, 6:16 am

here you go for all 4 versions .. it will add buttons to post profile to add friend or foe

goto acp>modules>javascript management

create a new sscript

title:add friends
placement: in topics
copy the code below and save/submit

Code:
$(function(){
  if (document.getElementById('wrap')){
$('.post').each(function(){
    var userlink = $(this).find('.author a').text()
    $(this).find('.postprofile dd:last').prepend('<a class="profile-icon" href="/profile?friend=' + userlink + '&mode=editprofile&page_profil=friendsfoes"><img title="Add As Friend" alt="Add As Friend" src="http://icons.iconarchive.com/icons/oxygen-icons.org/oxygen/16/Actions-list-add-user-icon.png" width="25" height="25"></a>');
    $(this).find('.postprofile dd:last').append('<a class="profile-icon" href="/profile?foe=' + userlink + '&mode=editprofile&page_profil=friendsfoes"><img title="Add To Foes" alt="Add To Foes" src="http://icons.iconarchive.com/icons/oxygen-icons.org/oxygen/16/Actions-list-remove-user-icon.png" width="25" height="25"></a>');
   
});}//phpbb3
 
    else if ($('.bodylinewidth').length){
$('.post').each(function(){
    var userlink = $(this).find('.name').text()
    alert(userlink)
    $(this).next('tr').find('.messaging td').prepend('<a class="profile-icon" href="/profile?friend=' + userlink + '&mode=editprofile&page_profil=friendsfoes"><img title="Add As Friend" alt="Add As Friend" src="http://icons.iconarchive.com/icons/oxygen-icons.org/oxygen/16/Actions-list-add-user-icon.png" width="25" height="25"></a>');
    $(this).next('tr').find('.messaging td').append('<a class="profile-icon" href="/profile?foe=' + userlink + '&mode=editprofile&page_profil=friendsfoes"><img title="Add To Foes" alt="Add To Foes" src="http://icons.iconarchive.com/icons/oxygen-icons.org/oxygen/16/Actions-list-remove-user-icon.png" width="25" height="25"></a>');
   
});} //phpbb2
 
    else if ($('.pun').length){
$('.post').each(function(){
    var userlink = $(this).find('.user a[href^="/u"]').text()
    $(this).find('.user-contact').prepend('<a class="profile-icon" href="/profile?friend=' + userlink + '&mode=editprofile&page_profil=friendsfoes"><img title="Add As Friend" alt="Add As Friend" src="http://icons.iconarchive.com/icons/oxygen-icons.org/oxygen/16/Actions-list-add-user-icon.png" width="20" height="20"></a>');
    $(this).find('.user-contact').append('<a class="profile-icon" href="/profile?foe=' + userlink + '&mode=editprofile&page_profil=friendsfoes"><img title="Add To Foes" alt="Add To Foes" src="http://icons.iconarchive.com/icons/oxygen-icons.org/oxygen/16/Actions-list-remove-user-icon.png" width="20" height="20"></a>');
   
});}  //punbb
 
    else if (document.getElementById('ipbwrapper')){
$('.post').each(function(){
    var userlink = $(this).find('.author a').text()
    $(this).find('.postprofile dd:last').append('<a class="profile-icon" href="/profile?friend=' + userlink + '&mode=editprofile&page_profil=friendsfoes"><img title="Add As Friend" alt="Add As Friend" src="http://icons.iconarchive.com/icons/oxygen-icons.org/oxygen/16/Actions-list-add-user-icon.png" width="25" height="25"></a>');
    $(this).find('.postprofile dd:last').append('<a class="profile-icon" href="/profile?foe=' + userlink + '&mode=editprofile&page_profil=friendsfoes"><img title="Add To Foes" alt="Add To Foes" src="http://icons.iconarchive.com/icons/oxygen-icons.org/oxygen/16/Actions-list-remove-user-icon.png" width="25" height="25"></a>');
   
});}; //invision
});

_Twisted_Mods_
Helper
Helper

Male Posts : 2032
Reputation : 302
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

Re: Friend Request in posts

Post by JScript on February 25th 2015, 2:24 pm

@_Twisted_Mods_
Your code is very nice, well done! Very good

Here is my version based on yours with little modifications, see:

New code link: http://help.forumotion.com/t50435p30-friend-request-in-posts#945268

Code:

$(function() {
   if (!_userdata.session_logged_in) {
      return false;
   }
   var FFinPosts = {
      sFriend: "Add As Friend",
      sFoes: "Add To Foes",
      oTarget: $('.post'),
      iLen: 0,
      sUser_name: "",
      oThis: null
   };
   FFinPosts.iLen = FFinPosts.oTarget.length;

   for (var i = 0; i < FFinPosts.iLen; i++) {
      FFinPosts.oThis = $(FFinPosts.oTarget[i]);
      FFinPosts.sUser_name = FFinPosts.oThis.find('.author a, .name, .user a[href^="/u"]').text();

      if (FFinPosts.sUser_name !== _userdata.username) {
         FFinPosts.oThis.find('.postprofile dd:last, .postdetails.poster-profile, .user-contact')
            .append(
               '<a class="profile-icon" href="/profile?friend=' + FFinPosts.sUser_name + '&mode=editprofile&page_profil=friendsfoes">' +
               '   <img title="Add As Friend" alt="Add As Friend" src="http://icons.iconarchive.com/icons/oxygen-icons.org/oxygen/16/Actions-list-add-user-icon.png" width="25" height="25">' +
               '</a>' +
               '<a class="profile-icon" href="/profile?foe=' + FFinPosts.sUser_name + '&mode=editprofile&page_profil=friendsfoes">' +
               '   <img title="Add To Foes" alt="Add To Foes" src="http://icons.iconarchive.com/icons/oxygen-icons.org/oxygen/16/Actions-list-remove-user-icon.png" width="25" height="25">' +
               '</a>'
            )
      }
   }
});

Working on all versions too.

JS


Last edited by JScript on February 25th 2015, 7:16 pm; edited 1 time in total

JScript
Forumember

Male Posts : 741
Reputation : 168
Language : PT-BR, EN
Location : Brazil

http://jscript.forumeiros.com/

Back to top Go down

Re: Friend Request in posts

Post by Rupture on February 25th 2015, 6:23 pm

No offense but this kinda sucks if it keeps showing up after they are already in your friends list.. can't you make it so it goes away?

Rupture
Forumember

Male Posts : 325
Reputation : 6
Language : English, Español, Deutsch, Catalá
Location : Earth

http://raptorgaming.forumotion.com

Back to top Go down

Re: Friend Request in posts

Post by JScript on February 25th 2015, 7:15 pm

@Rupture wrote:No offense but this kinda sucks if it keeps showing up after they are already in your friends list.. can't you make it so it goes away?
Yes, try this code:
Code:

$(function() {
   if (!_userdata.session_logged_in) {
      return false;
   }
   var FFinPosts = {
      sFriend: "Add As Friend",
      sFoes: "Add To Foes",
      oTarget: $('.post'),
      iLen: 0,
      sUser_name: "",
      oFF_list: null,
      aFF_list: [],
      vTemp: null,
      oThis: null
   };
   FFinPosts.iLen = FFinPosts.oTarget.length;

   $.ajax({
      url: "/u" + _userdata.user_id + 'friends',
      cache: false,
      type: "get",
      dataType: "text",
      success: function(response, status, xhr) {
         if (xhr.status == 200) {
            FFinPosts.oFF_list = $('#profile-advanced-details ol .message-header > a[href^="/u"]', response);

            for (var i = 0; i < FFinPosts.oFF_list.length; i++) {
               FFinPosts.aFF_list[FFinPosts.aFF_list.length] = $(FFinPosts.oFF_list[i]).text();
            }

            for (var i = 0; i < FFinPosts.iLen; i++) {
               FFinPosts.oThis = $(FFinPosts.oTarget[i]);
               FFinPosts.sUser_name = FFinPosts.oThis.find('.author a, .name, .user a[href^="/u"]').text();

               if (FFinPosts.sUser_name !== _userdata.username) {
                  FFinPosts.vTemp = FFinPosts.oThis.find('.postprofile dd:last, .postdetails.poster-profile, .user-contact');

                  if (FFinPosts.aFF_list.indexOf(FFinPosts.sUser_name) == -1) {

                     FFinPosts.vTemp.append(
                        '<a class="profile-icon" href="/profile?friend=' + encodeURIComponent(FFinPosts.sUser_name) + '&mode=editprofile&page_profil=friendsfoes">' +
                        '   <img title="Add As Friend" alt="Add As Friend" src="http://icons.iconarchive.com/icons/oxygen-icons.org/oxygen/16/Actions-list-add-user-icon.png" width="25" height="25">' +
                        '</a>'
                     )
                  } else {
                     FFinPosts.vTemp.append(
                        '<a class="profile-icon" href="/profile?foe=' + encodeURIComponent(FFinPosts.sUser_name) + '&mode=editprofile&page_profil=friendsfoes">' +
                        '   <img title="Add To Foes" alt="Add To Foes" src="http://icons.iconarchive.com/icons/oxygen-icons.org/oxygen/16/Actions-list-remove-user-icon.png" width="25" height="25">' +
                        '</a>'
                     )
                  }
               }
            }
         }
      }
   });
});

However, it is the last time I post here, so as not to disturb the topic ok?
If you want something more, open a topic in the support area.


So long,

JS

JScript
Forumember

Male Posts : 741
Reputation : 168
Language : PT-BR, EN
Location : Brazil

http://jscript.forumeiros.com/

Back to top Go down

Re: Friend Request in posts

Post by SLGray on November 16th 2015, 10:52 pm

Bumping to move this suggestion to the first page.


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 36748
Reputation : 2449
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

Re: Friend Request in posts

Post by SarkZKalie on November 17th 2015, 5:36 am

Can we have Friend & Foes available in simple profile?

SarkZKalie
Forumember

Male Posts : 450
Reputation : 78
Language : English

http://rotavn.nstars.org/

Back to top Go down

Re: Friend Request in posts

Post by Genesis on January 18th 2016, 9:56 pm

Voted yes, why not?

Genesis
Helper
Helper

Male Posts : 2331
Reputation : 322
Language : English
Location : Forumountain

http://forumpromocean.com

Back to top Go down

Re: Friend Request in posts

Post by SarkZKalie on February 23rd 2016, 7:38 am

Voted yes!

SarkZKalie
Forumember

Male Posts : 450
Reputation : 78
Language : English

http://rotavn.nstars.org/

Back to top Go down

Re: Friend Request in posts

Post by rocket2300 on February 23rd 2016, 8:17 am

I thought this was already sorted ?. I have it in my members post profiles and once used
and accepted it goes away. Don't ask me where I got it from because I can't remember, but
is was done by one of the FM staff. Im using phpBB3.

rocket2300
Forumember

Male Posts : 214
Reputation : 4
Language : english
Location : United Kingdom

http://www.suzuki-intruder.org

Back to top Go down

Page 2 of 2 Previous  1, 2

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum