"add friend" js code help
4 posters
Page 1 of 1
"add friend" js code help
Hi,
i added the codes from this tutorial to my forum
http://www.avacweb.com/t17p15-re-1-add-as-friend-and-user-wall-link-in-post-profiles
and it used to work but now my viewtopic_body is heavily edited and it doesnt appear. im using punbb. what should i do?
i tried this code:
and this:
but nothing worked. i hope u help me
i added the codes from this tutorial to my forum
http://www.avacweb.com/t17p15-re-1-add-as-friend-and-user-wall-link-in-post-profiles
and it used to work but now my viewtopic_body is heavily edited and it doesnt appear. im using punbb. what should i do?
i tried this code:
- Code:
$(function(){
('Copyright AvacWeb. All Rights Reserved. Use and modification of this script is not allowed without this entire copyright notice in the original, copied, or modified script. No distribution without consent.');
var posts = $('.username', document.getElementById('main-content'));
for(var i = 0, p; (p = posts[i++]); ) {
var userlink = p.getElementsByTagName('a')[0], name = userlink.innerHTML.replace(/<[^>]+>/g, ''), uid = userlink.href.match(/[0-9]+$/)[0];
$('.friendlink', p.parentNode.parentNode).html('<a href="/profile?friend=' + name + '&mode=editprofile&page_profil=friendsfoes">Add as Friend</a>');
$('.walllink', p.parentNode.parentNode).html('<a href="/u' + uid + 'wall">' + name + '\'s Wall</a>');
}
});
and this:
- Code:
$(function(){
var posts = $('.username', document.getElementById('main-content')), i = 0, p;
for(; (p = posts[i++]); ) {
var userlink = p.getElementsByTagName('a')[0]
, name = userlink.innerHTML.replace(/<.*?>/g, '')
, uid = userlink.href.match(/\d+$/)[0];
p.parentNode.parentNode.innerHTML += '<a href="/profile?friend=' + name + '&mode=editprofile&page_profil=friendsfoes">Add as Friend</a><br><a href="/u' + uid + 'wall">' + name + '\'s Wall</a>';
}
});
but nothing worked. i hope u help me
Re: "add friend" js code help
This code no longer works right now LG is going to have a look at it when he gets the time.
The problem is down to the new editor system and the way codes are made and used.
Also FM made some little javascript Fixes not so long a go and this knocked some of the javascript's out from LG's systems. This is a problem to lots of codes no longer working but one by one He is fixing them.
Ape
The problem is down to the new editor system and the way codes are made and used.
Also FM made some little javascript Fixes not so long a go and this knocked some of the javascript's out from LG's systems. This is a problem to lots of codes no longer working but one by one He is fixing them.
Ape
Re: "add friend" js code help
this code used to work on my forum just some days ago (maybe a week) but i modify my viewtopic_body very often and i make new changes there so i think thats my problem..
Re: "add friend" js code help
The code should still work on normal forums - however if you edit your templates, your responsible for editing Javascripts to meet your personalized site. This was mentioned in the tutorial that it likely won't work on PunBB boards with edited templates.
Someone with knowledge of Javascript may be willing to edit the script for you, but honestly you could probably find a decent way of adding the links in via templates.
Someone with knowledge of Javascript may be willing to edit the script for you, but honestly you could probably find a decent way of adding the links in via templates.
LGforum- Hyperactive
- Posts : 2265
Reputation : 264
Language : English
Location : UK
Re: "add friend" js code help
Lol, im so dumb and i didnt even think about puting this at tempates..
its good, but what to write instead of ' + name ' because it needs to be changed to make it work..
in here:
its good, but what to write instead of ' + name ' because it needs to be changed to make it work..
in here:
- Code:
<a style="position:relative;top:1px;" href="/profile?friend=' + name + '&mode=editprofile&page_profil=friendsfoes">
Re: "add friend" js code help
Sorry I don't visit this forum often.
Try putting this for a wall link:
And try this for the wall:
These are just intuitive guesses however.
Try putting this for a wall link:
- Code:
<a href="/profile?friend={postrow.displayed.POSTER}&mode=editprofile&page_profil=friendsfoes">Add as Friend</a>
And try this for the wall:
- Code:
<a href="/u{postrow.displayed.POSTER_ID}">Visit Wall</a>
These are just intuitive guesses however.
LGforum- Hyperactive
- Posts : 2265
Reputation : 264
Language : English
Location : UK
Re: "add friend" js code help
Topic Solved & Archived
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Similar topics
» I want to code "Adffine friend in threads"
» When i paste a long code via [code][/code] the page expands
» I need help for my friend
» How to add someone as your friend
» removing 'friend/foe'
» When i paste a long code via [code][/code] the page expands
» I need help for my friend
» How to add someone as your friend
» removing 'friend/foe'
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum