The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Send a friend request

2 posters

Go down

Solved Send a friend request

Post by midoweb96 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 Send a friend request  Ascaso
thanks .
midoweb96
midoweb96
Forumember

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

Back to top Go down

Solved Re: Send a friend request

Post by LGforum 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
LGforum
Hyperactive

Male Posts : 2265
Reputation : 264
Language : English
Location : UK

Back to top Go down

Solved Re: Send a friend request

Post by midoweb96 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
midoweb96
Forumember

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

Back to top Go down

Solved Re: Send a friend request

Post by LGforum 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
LGforum
Hyperactive

Male Posts : 2265
Reputation : 264
Language : English
Location : UK

Back to top Go down

Solved Re: Send a friend request

Post by midoweb96 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
midoweb96
Forumember

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

Back to top Go down

Solved Re: Send a friend request

Post by LGforum 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
LGforum
Hyperactive

Male Posts : 2265
Reputation : 264
Language : English
Location : UK

Back to top Go down

Solved Re: Send a friend request

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

hhhh
I'm sure it does not work Send a friend request  Ascaso
midoweb96
midoweb96
Forumember

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

Back to top Go down

Solved Re: Send a friend request

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

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

Male Posts : 2265
Reputation : 264
Language : English
Location : UK

Back to top Go down

Solved Re: Send a friend request

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

OK thanks solved.
midoweb96
midoweb96
Forumember

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

Back to top Go down

Back to top

- Similar topics

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