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.

Send a friend request

View previous topic View next topic Go down

Solved Send a friend request

Post by midoweb96 on March 3rd 2012, 7:50 pm

hi all
i need to help with jquery code .
Send a friend request on profile... i trying more but not work Exclamation
for phpbb2
this my code
Code:
$(document).ready(function() {

 var username = $('.name').get();

  $('.postdetails.poster-profile').after('<br /><div class="friend"><a  href="/profile?friend='+ username+'&amp;mode=editprofile&amp;page_profil=friendsfoes">Send a friend request</a></div>');


    });

can anyone help me
thanks .

midoweb96
Forumember

Posts : 166
Reputation : 12
Language : Css - Html - Jquery

Back to top Go down

Solved Re: Send a friend request

Post by LGforum on March 4th 2012, 3:12 am

Your variable username isn't holding the username... its holding a whole array of all the elements with className of username on the page.
You'll need to loop through the post profiles.

I'd suggest looking at this to see how it is done on other board types:
http://www.avacweb.com/t17-3-add-as-friend-and-user-wall-link-in-post-profiles

LGforum
Hyperactive

Male Posts : 2260
Reputation : 258
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

Solved Re: Send a friend request

Post by midoweb96 on March 4th 2012, 10:40 am

thank LG
Read this before , I did not find phpbb2 ..but i search code for phpbb2
Is there any way ?

midoweb96
Forumember

Posts : 166
Reputation : 12
Language : Css - Html - Jquery

Back to top Go down

Solved Re: Send a friend request

Post by LGforum on March 4th 2012, 2:50 pm

I'm sure it can be done on phpbb2, probably reasonably easy with templates. But I don't look at it. Somewhere else on my forum someone posted a phpbb2 version. http://www.avacweb.com/t183-i-need-to-add-as-friend-link-to-the-post-profile

LGforum
Hyperactive

Male Posts : 2260
Reputation : 258
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

Solved Re: Send a friend request

Post by midoweb96 on March 4th 2012, 4:35 pm

ok work by using templates .
Question ..here http://www.avacweb.com/t17- (for phpbb3)
can we add return false; and hide on click and changed Events ?
Can the addition of these events?
i trying this ..but not work
Code:
$(document).ready(function(){
$('.friend-admin').click(function(){
$(.friend-admin).hide(5000);
return false;
});
$('.friend-admin').click(function(){
$('.friend-admin').change();
$('.msg').html("Was added to list  friends");
$('.postprofile').before('<div class="msg"></div>
});
});

thanks

midoweb96
Forumember

Posts : 166
Reputation : 12
Language : Css - Html - Jquery

Back to top Go down

Solved Re: Send a friend request

Post by LGforum on March 4th 2012, 8:27 pm

That code is nonsense Razz lol
I linked you to the phpbb2 code: http://www.avacweb.com/t183-i-need-to-add-as-friend-link-to-the-post-profile#1655

LGforum
Hyperactive

Male Posts : 2260
Reputation : 258
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

Solved Re: Send a friend request

Post by midoweb96 on March 4th 2012, 8:54 pm

hhhh
I'm sure it does not work

midoweb96
Forumember

Posts : 166
Reputation : 12
Language : Css - Html - Jquery

Back to top Go down

Solved Re: Send a friend request

Post by LGforum on March 4th 2012, 11:54 pm

Well i didn't write it. Try asking the author.

LGforum
Hyperactive

Male Posts : 2260
Reputation : 258
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

Solved Re: Send a friend request

Post by midoweb96 on March 6th 2012, 7:08 pm

OK thanks solved.

midoweb96
Forumember

Posts : 166
Reputation : 12
Language : Css - Html - Jquery

Back to top Go down

View previous topic View next topic Back to top


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