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 Sat 03 Mar 2012, 18:50

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 Sun 04 Mar 2012, 02:12

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 Sun 04 Mar 2012, 09:40

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 Sun 04 Mar 2012, 13:50

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 Sun 04 Mar 2012, 15:35

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 Sun 04 Mar 2012, 19:27

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 Sun 04 Mar 2012, 19:54

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 Sun 04 Mar 2012, 22:54

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 Tue 06 Mar 2012, 18:08

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