Alignment add friend and reputation improvement scripts question - Invision
3 posters
Page 1 of 1
Alignment add friend and reputation improvement scripts question - Invision
Hello dear Forumotion friends
I've added the scripts the title refers to, to my testforums, they work on my phpbb3, my ModernBB and they kinda work on my Invision test forum.
So for Invision I have a couple of questions for it, explained in the following screenshot:
Q 1: How to align the result of the Reputation improvement script in a way it creates a space at the rightside so it's not sticked to the button next to it? SOLVED by SLGray
Q 2: How to align the result of the add friend+wall to postprofile script to the same position as the rest of the postprofile info? SOLVED
Q 3: How to get the script to actually display the posters name in front of Prikbord (wall) ?
It only displays the 's' that goes after the posters name, on my other test forums it displays the right way, but here on my Invision the posters name is missing, although the link is working correctly!
If needed you can have a look at a post where it's visible Here!
Kind regards,
Tonny
I've added the scripts the title refers to, to my testforums, they work on my phpbb3, my ModernBB and they kinda work on my Invision test forum.
So for Invision I have a couple of questions for it, explained in the following screenshot:
- Screenshot:
Q 3: How to get the script to actually display the posters name in front of Prikbord (wall) ?
It only displays the 's' that goes after the posters name, on my other test forums it displays the right way, but here on my Invision the posters name is missing, although the link is working correctly!
If needed you can have a look at a post where it's visible Here!
Kind regards,
Tonny
Last edited by SLGray on January 23rd 2018, 6:47 pm; edited 3 times in total (Reason for editing : Q2 solved by SLGray)
Re: Alignment add friend and reputation improvement scripts question - Invision
Please post the links to the 2 tutorials you used.
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.
Re: Alignment add friend and reputation improvement scripts question - Invision
SLGray wrote:Please post the links to the 2 tutorials you used.
I'm sorry @SLGray I don't remember which posts contained the scripts but I found them here in the archives..
The Reputation improvement script I used is this one:
- Reputation Improvement script, on all pages:
- Code:
$(function() {
// General Configuration of the plugin
var config = {
position_left : true, // true for left || false for right
negative_vote : false, // true for negative votes || false for positive only
vote_bar : true, // display a small bar under the vote buttons
// button config
icon_plus : '<img src="http://i18.servimg.com/u/f18/18/21/41/30/plus10.png" alt="+"/>',
icon_minus : '<img src="http://i18.servimg.com/u/f18/18/21/41/30/minus10.png" alt="-"/>',
// language config
title_plus : 'Vind %{USERNAME}\'s post leuk',
title_minus : 'Vind %{USERNAME}\'s post niet leuk',
title_like_singular : '%{VOTES} persoon vindt %{USERNAME}\'s post leuk',
title_like_plural : '%{VOTES} personen vinden %{USERNAME}\'s post leuk',
title_dislike_singular : '%{VOTES} persoon vindt %{USERNAME}\'s post niet leuk',
title_dislike_plural : '%{VOTES} personen vinden %{USERNAME}\'s post niet leuk',
title_vote_bar : '%{VOTES} personen vinden %{USERNAME}\'s post leuk %{PERCENT}'
},
// function bound to the onclick handler of the vote buttons
submit_vote = function() {
var next = this.nextSibling, // the counter next to the vote button that was clicked
box = this.parentNode,
bar = box.getElementsByTagName('DIV'),
vote = box.getElementsByTagName('A'),
mode = /eval=plus/.test(this.href) ? 1 : 0,
i = 0, j = vote.length, pos, neg, percent;
// submit the vote asynchronously
$.get(this.href, function() {
next.innerHTML = +next.innerHTML + 1; // add to the vote count
next.title = next.title.replace(/(\d+)/, function(M, $1) { return +$1 + 1 });
pos = +vote[0].nextSibling.innerHTML;
neg = vote[1] ? +vote[1].nextSibling.innerHTML : 0;
percent = pos == 0 ? '0%' : pos == neg ? '50%' : Math.round(pos / (pos + neg) * 100) + '%';
if (bar[0]) {
bar[0].style.display = '';
bar[0].firstChild.style.width = percent;
box.title = box.title.replace(/\d+\/\d+/, pos + '/' + ( pos + neg )).replace(/\(\d+%\)/, '(' + percent + ')');
}
});
// revoke voting capabilities on the post once the vote is cast
for (; i < j; i++) {
vote[i].href = '#';
vote[i].className = vote[i].className.replace(/fa_vote/, 'fa_voted');
vote[i].onclick = function() { return false };
}
return false;
},
vote = $('.vote'), i = 0, j = vote.length,
version = $('.bodylinewidth')[0] ? 0 : document.getElementById('wrap') ? 1 : $('.pun')[0] ? 2 : document.getElementById('ipbwrapper') ? 3 : 'badapple', // version check
// version data so we don't have to redefine these arrays during the loop
vdata = {
tag : ['SPAN', 'LI', 'SPAN', 'LI'][version],
name : ['.name', '.postprofile dt > strong', '.username', '.popmenubutton'][version],
actions : ['.post-options', '.profile-icons', '.post-options', '.posting-icons'][version],
},
post, plus, minus, n_pos, n_neg, title_pos, title_neg, li, ul, bar, button, total, percent, span, pseudo, vote_bar; // startup variables for later use in the loop
// prevent execution if the version cannot be determined
if (version == 'badapple') {
if (window.console) console.warn('This plugin is not optimized for your forum version. Please contact the support for further assistance.');
return;
}
for (; i < j; i++) {
post = $(vote[i]).parentsUntil('.post').parent()[0];
bar = $('.vote-bar', vote[i])[0]; // vote bar
button = $('.vote-button', vote[i]); // plus and minus buttons
pseudo = $(vdata.name, post).text() || 'MISSING_STRING'; // username of the poster
ul = $(vdata.actions, post)[0]; // post actions
li = document.createElement(vdata.tag); // vote system container
li.className = 'fa_reputation';
if (li.tagName == 'SPAN') li.style.display = 'inline-block';
// calculate votes
if (bar) {
total = +bar.title.replace(/.*?\((\d+).*/, '$1');
percent = +bar.title.replace(/.*?(\d+)%.*/, '$1');
n_pos = Math.round(total * (percent / 100));
n_neg = total - n_pos;
} else {
n_pos = 0;
n_neg = 0;
}
// set up negative and positive titles with the correct grammar, votes, and usernames
title_pos = (n_pos == 1 ? config.title_like_singular : config.title_like_plural).replace(/%\{USERNAME\}/g, pseudo).replace(/%\{VOTES\}/g, n_pos);
title_neg = (n_neg == 1 ? config.title_dislike_singular : config.title_dislike_plural).replace(/%\{USERNAME\}/g, pseudo).replace(/%\{VOTES\}/g, n_neg);
// define the vote counts
li.innerHTML = '<span class="fa_count fa_positive" title="' + title_pos + '">' + n_pos + '</span>' + (config.negative_vote ? ' <span class="fa_count fa_negative" title="' + title_neg + '">' + n_neg + '</span>' : '');
span = li.getElementsByTagName('SPAN'); // get the vote count containers for use as insertion points
// create positive vote button
plus = document.createElement('A');
plus.href = button[0] ? button[0].firstChild.href : '#';
plus.onclick = button[0] ? submit_vote : function() { return false };
plus.className = 'fa_vote' + (button[0] ? '' : 'd') + ' fa_plus';
plus.innerHTML = config.icon_plus;
plus.title = (button[0] ? config.title_plus : title_pos).replace(/%\{USERNAME\}/g, pseudo);
span[0] && li.insertBefore(plus, span[0]);
// create negative vote button
if (config.negative_vote) {
minus = document.createElement('A');
minus.href = button[1] ? button[1].firstChild.href : '#';
minus.onclick = button[1] ? submit_vote : function() { return false };
minus.className = 'fa_vote' + (button[1] ? '' : 'd') + ' fa_minus';
minus.innerHTML = config.icon_minus;
minus.title = (button[1] ? config.title_minus : title_neg).replace(/%\{USERNAME\}/g, pseudo);
span[1] && li.insertBefore(minus, span[1]);
}
// create vote bar
if (config.vote_bar) {
vote_bar = document.createElement('DIV');
vote_bar.className = 'fa_votebar';
vote_bar.innerHTML = '<div class="fa_votebar_inner" style="width:' + percent + '%;"></div>';
vote_bar.style.display = bar ? '' : 'none';
li.title = config.title_vote_bar.replace(/%\{USERNAME\}/, pseudo).replace(/%\{VOTES\}/, n_pos + '/' + (n_pos + n_neg)).replace(/%\{PERCENT\}/, '(' + percent + '%)');
li.appendChild(vote_bar);
}
// finally insert the vote system and remove the default one
config.position_left ? ul.insertBefore(li, ul.firstChild) : ul.appendChild(li);
vote[i].parentNode.removeChild(vote[i]);
}
});
The CSS for the reputation improvement I used is this:
- CSS Reputation Improvement:
- Code:
.fa_vote, .fa_voted, .fa_count {
font-size:12px;
font-family:Verdana, Arial, Helvetica, Sans-serif;
display:inline-block !important;
width:auto !important;
transition:300ms;
}
.fa_voted, .fa_vote:hover { opacity:0.4 }
.fa_voted { cursor:default }
.fa_count {
font-weight:bold;
margin:0 3px;
cursor:default;
}
.fa_positive { color:#4A0 }
.fa_negative { color:#A44 }
.fa_votebar, .fa_votebar_inner {
background:#C44;
height:3px;
}
.fa_votebar_inner {
background:#4A0;
transition:300ms;
}
The Add friend+wall to postprofile script I used is this one:
- Social Profilelinks (in topics):
- Code:
$(function() {
var posts = $('.postprofile', document.getElementById('main-content')), i = 0, p;
for(; (p = posts[i++]); ) {
var userlink = p.getElementsByTagName('a')[1]
, name = userlink.innerHTML.replace(/<[^>]+>/g, '')
, uid = userlink.href.match(/\d+$/)[0];
p.innerHTML += '<a href="/profile?friend=' + name + '&mode=editprofile&page_profil=friendsfoes">Wordt vriend(in)</a><br><a href="/u' + uid + 'wall">' + name + '\s Prikbord</a>';
}
});
I hope it's okay to post them this way, if not please delete them..
Last edited by TonnyKamper on January 17th 2018, 6:00 pm; edited 1 time in total (Reason for editing : Added the used CSS code)
Re: Alignment add friend and reputation improvement scripts question - Invision
The reputation improvement tutorial is this one: https://help.forumotion.com/t142870-improve-the-reputation-system-so-it-counts-votes
Re: Alignment add friend and reputation improvement scripts question - Invision
Please provide me test account so I can check it out live.
Re: Alignment add friend and reputation improvement scripts question - Invision
Ikerepc wrote:Please provide me test account so I can check it out live.
Thank you very much for your assistance @Ikerepc PM with login details is sent
Re: Alignment add friend and reputation improvement scripts question - Invision
Could you send me the test account by PM?
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.
Re: Alignment add friend and reputation improvement scripts question - Invision
SLGray wrote:Could you send me the test account by PM?
PM is sent to you @SLGray thank you very much for your assistance
I just managed to align the result of the "Add Friend + Wall" script properly, so one problem less on that, only thing left on this is that it doesn't display the posters name before 'Prikbord' (translation for Wall), just the addional 's which comes after the posters name..
Kind regards,
Tonny Kamper
Last edited by TonnyKamper on January 20th 2018, 11:12 pm; edited 1 time in total
Re: Alignment add friend and reputation improvement scripts question - Invision
Add this to your CSS:
- Code:
fa_reputation {
margin-right: YOUR NUMBERpx;
}
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.
Re: Alignment add friend and reputation improvement scripts question - Invision
SLGray wrote:Add this to your CSS:
- Code:
fa_reputation {
margin-right: YOUR NUMBERpx;
}
Thank you "`SLGray` 10px puts the thumb up a little to the left but the green bar beneath it just stretches further and appeared to be attached to the button next to it.. is it possible to take the green bar out entirely?
Re: Alignment add friend and reputation improvement scripts question - Invision
- Code:
.fa_votebar, .fa_votebar_inner {
margin-right: YOUR NUMBERpx;
}
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.
Re: Alignment add friend and reputation improvement scripts question - Invision
SLGray wrote:
- Code:
.fa_votebar, .fa_votebar_inner {
margin-right: YOUR NUMBERpx;
}
Yay that did the trick on that one @SLGray Thank you very much, problem 1 is now solved too
Only thing left now is the display of the posters name from the Add as friend + wall script.
Re: Alignment add friend and reputation improvement scripts question - Invision
Is this the one you are using: https://help.forumotion.com/t141390-friend-foes-request-in-posts?highlight=friend ?
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.
Re: Alignment add friend and reputation improvement scripts question - Invision
SLGray wrote:Does it suppose to show the usernames?
Yes it does @SLGray on all other testforum versions it displays the poster's name as you can see on this screenshot of my phpbb3 version:
- Screenshot posters name phpbb3:
It also displays the posters name at my phpbb2 and at my ModernBB testforums..
Re: Alignment add friend and reputation improvement scripts question - Invision
SLGray wrote:Is this the one you are using: https://help.forumotion.com/t141390-friend-foes-request-in-posts?highlight=friend ?
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.
Re: Alignment add friend and reputation improvement scripts question - Invision
SLGray wrote:SLGray wrote:Is this the one you are using: https://help.forumotion.com/t141390-friend-foes-request-in-posts?highlight=friend ?
No I don't think so, my code looks different, I found mine after endlessly searching through topics and as I remember correctly it was a solution provided by someone on a secundary question of that specific topic, so the title of the topic is totally different, that's why I'm having difficulties to find it back, I totally forgot what the title of the topic was..
I use this code, now updated with a little bit of style for the alignement of the result:
- Code:
$(function() {
var posts = $('.postprofile', document.getElementById('main-content')), i = 0, p;
for(; (p = posts[i++]); ) {
var userlink = p.getElementsByTagName('a')[1]
, name = userlink.innerHTML.replace(/<[^>]+>/g, '')
, uid = userlink.href.match(/\d+$/)[0];
p.innerHTML += '<a style="margin-left:10px;" href="/profile?friend=' + name + '&mode=editprofile&page_profil=friendsfoes">Wordt vriend(in)</a><br><a style="margin-left:10px;" href="/u' + uid + 'wall">' + name + '\'s Prikbord</a>';
}
});
Re: Alignment add friend and reputation improvement scripts question - Invision
Only question 3 is still unsolved..
Does anyone know how to address the poster's username in the script, so it will display the posters name before the link to his/her wall ?
Kind regards
TonnyKamper wrote:Q 3: How to get the script to actually display the posters name in front of Prikbord (wall) ?
It only displays the 's' that goes after the posters name, on my other test forums it displays the right way, but here on my Invision the posters name is missing, although the link is working correctly!
Does anyone know how to address the poster's username in the script, so it will display the posters name before the link to his/her wall ?
Kind regards
Re: Alignment add friend and reputation improvement scripts question - Invision
I just tested it on my forum, and it worked. There must be something on your forum that is interfering with it.
One thing that I did notice on my forum is that the username does not show ownership ('s).
One thing that I did notice on my forum is that the username does not show ownership ('s).
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.
Re: Alignment add friend and reputation improvement scripts question - Invision
SLGray wrote:I just tested it on my forum, and it worked. There must be something on your forum that is interfering with it.
One thing that I did notice on my forum is that the username does not show ownership ('s).
Thank you @SLGray that is very strange, on my forum it shows the ownership 's but not the username before it although the link is working properly.. Did you tried it on version Invision? Because on my phpBB3 and ModernBB forums it does display the username.. only for some reason on my Invision it doesn't and I can't figure out why.. Could it be caused by something in my CSS?
Re: Alignment add friend and reputation improvement scripts question - Invision
It could be or JavaScripts, templates, etc.
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.
Re: Alignment add friend and reputation improvement scripts question - Invision
SLGray wrote:It could be or JavaScripts, templates, etc.
Thanks @SLGray I'll switch off all other javascripts to see if that will work, then switch them back on one by one to find the guilty one if it does work without other javascripts.. as for templates, I haven't got a clue what to look for and where.. and in my css I have some things that effect the posters profile in the post, so I guess I'll have to disable them to see if one of them is causing it..
I'll report back when I have the results of doing this..
Re: Alignment add friend and reputation improvement scripts question - Invision
We will wait for your reply.
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.
Re: Alignment add friend and reputation improvement scripts question - Invision
Well I tried everything I could think of @SLGray ... I disabled all javascripts exept the "Add friend + wall" script and it still wouldn't show the posters name in the result.. Then I took out all codes related to the postprofile from the CSS and it made no difference, the posters name didn't show in the result of the script. The only templates that are slightly adjusted are the General/index_body and the Portal/mod_recent_topics.. I tried forcing the default templates, but that made no difference either !
So I don't know what to do anymore..
Do you have any ideas of what more can be done to get the posters name show up?
So I don't know what to do anymore..
Do you have any ideas of what more can be done to get the posters name show up?
Re: Alignment add friend and reputation improvement scripts question - Invision
Anyone ? Question 3 is still a mystery..
Similar topics
» alignment question
» I haw question about images in scripts...
» Invision Question.
» Invision CSS question
» Hmmmm interesting question regarding Invision coding
» I haw question about images in scripts...
» Invision Question.
» Invision CSS question
» Hmmmm interesting question regarding Invision coding
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum