Current date/time is August 23rd 2019, 11:03 pm

Search found 2 matches for C44

Like/Dislike Button Coding

Hello.. I'm trying to add the coding for the link/dislike button but it's not showing up on my forum. Please, help me. Thank you. I also have a premade skin I'm using as well and here is the url for my board. Thank you.

http://homeawayfromhome.forumotion.com/

Here is the coding I have for the CSS Stylesheet.

.bodyline{
-moz-border-radius:11px;
-webkit-border-radius: 11px;

border: 1px ##3A0D59 solid;
}
.bodylinewidth {
width:70%}
.forumline{
-moz-border-radius: 4px;
-webkit-border-radius: 4px;}

border: 2px ##3A0D59 solid;
}

a.mainmenu{
filter:alpha(opacity=100);
-moz-opacity: 1.0;
opacity: 1.0;
}
a.mainmenu:hover{
filter:alpha(opacity=70);
-moz-opacity: 0.65;
opacity: 0.65;
}

{ .fa_vote, .fa_voted, .fa_count {
font-size:12px;
font-family:Verdana, Arial, Helvetica, Sans-serif;
display:inline-block !important;
width:auto !important;
float:none !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;
}

This is what I have for the JavaScript.

$(function() {
// General Configuration of the plugin
var config = {
position_left : true, // true for left || false for right
negative_vote : true, // 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="https://i.servimg.com/u/f18/18/21/41/30/plus10.png" alt="+"/>',
icon_minus : '<img src="https://i.servimg.com/u/f18/18/21/41/30/minus10.png" alt="-"/>',

// language config
title_plus : 'Like %Guest\'s post',
title_minus : 'Dislike %Guest\'s post',

title_like_singular : '%{VOTES} person likes %Guest\'s post',
title_like_plural : '%{VOTES} people like %Guest\'s post',

title_dislike_singular : '%{VOTES} person dislikes %Guest\'s post',
title_dislike_plural : '%{VOTES} people dislike %Guest\'s post',

title_vote_bar : '%{VOTES} people liked %Guest\'s post %{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('phpbb') ? 1 :
$('.pun')[0] ? 2 :
document.getElementById('ipbwrapper') ? 3 :
document.getElementById('modernbb') ? 4 :
'badapple', // version check

// version data so we don't have to redefine these arrays during the loop
vdata = {
tag : ['SPAN', 'LI', 'SPAN', 'LI', 'LI'][version],
name : ['.name', '.postprofile dt > strong', '.username', '.popmenubutton', '.postprofile-name'][version],
actions : ['.post-options', '.profile-icons', '.post-options', '.posting-icons', '.profile-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]).closest('.post')[0];
bar = $('.vote-bar', vote[i])[0]; // vote bar
button = $('a[href*="p_vote"]', 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 ? '&nbsp;<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].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].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]);
}
});

by Beela
Yesterday at 11:56 pm
 
Search in: Scripts Problems Archives
Topic: Like/Dislike Button Coding
Replies: 23
Views: 97

Forum size

I am not sure at this point. But just be sure. Here is all the code that is in my CSS.
Code:
/*cursors*/
/* Start http://www.cursors-4u.com */ body, a:hover {cursor: url(http://cur.cursors-4u.net/nature/nat-4/nat389.cur), progress !important;} /* End http://www.cursors-4u.com */





/*badges alignment*/
.profile_field_list li { display:inline }


/*next and previous buttons for private messages*/
{#}navMP{/#}>a{
display:inline-block;
padding-left:10px;
padding-right:10px;
font-size:16px;
line-height:16px;
color:{#}eee{/#};
background:{#}BDC8D0{/#};
text-decoration:none !important;
border:1px solid {#}aaa{/#};
}
{#}navMP{/#}>a:hover{
color:{#}fff{/#};
background:{#}CDD8E0{/#};
text-decoration:none !important;
}
{#}navMP-precedent{/#}{
border-radius:8px 0 0 8px;
}
{#}navMP-suivant{/#}{
float:right;
border-radius:0 8px 8px 0;
}

{#}navMP-precedent{/#}::before{
content:"Previous"
}
{#}navMP-suivant{/#}::before{
content:"Next"
}



/************************************************************************************/
/*username member glowing*/
a[href="/u1"] {
text-decoration: none !important;
text-shadow: 0 0 .5em {#}d14be1{/#}, 0 0 .5em {#}d14be1{/#}, 0 0 .5em {#}d14be1{/#};

}
a[href="/u13"] {
text-decoration: none !important;
text-shadow: 0 0 .5em {#}a34cd4{/#}, 0 0 .5em {#}a34cd4{/#}, 0 0 .5em {#}a34cd4{/#};

}
a[href="/u18"] {
text-decoration: none !important;
text-shadow: 0 0 .5em {#}b20000{/#}, 0 0 .5em {#}b20000{/#}, 0 0 .5em {#}b20000{/#};

}
a[href="/u6"] {
text-decoration: none !important;
text-shadow: 0 0 .5em {#}107a00{/#}, 0 0 .5em {#}107a00{/#}, 0 0 .5em {#}107a00{/#};

}
/**************************************************************************************/

/*reputaion thumbs up and down*/
.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;
}



/*********************************************************************************************/




/* Color palette icons */
.color-option {
display: inline-block !important;
width: 15px !important; /* width of the icon */
height: 15px !important; /* height of the icon */
border: 2px solid {#}fff{/#} !important; /* white border around the icon */
margin: 3px !important; /* space between each icon */
box-shadow: 0 0 2px {#}778899{/#}; /* shadow */
cursor: pointer !important;
}

.color-option span{
display: block !important;
width: 15px !important; /* width of the icon */
height: 15px !important; /* height of the icon */
}

.color-option, .color-option span {
border-radius: 2px; /* roundness */
}

/* Whole palette - the width influences how many icons appear */
.sceditor-dropdown.sceditor-color-picker {
width: 200px !important; /* width of the palette */
height: 100px !important; /* height of the palette */
padding: 5px !important;
border-radius: 5px !important;
}


/*****************************************************************************************/

/*locked topic warning*/
.topic-warning-block {
border: 1px solid;
margin: 10px 0px;
padding: 15px 10px 15px 50px;
background-repeat: no-repeat;
background-position: 10px center;
background-image: url(http://1.bp.blogspot.com/_5rlxf3T9Z9U/SsIXuytpYfI/AAAAAAAADcI/I4Tm0W5gDQk/lock_32.png);
color: {#}750000{/#} !important;
background-color: {#}D26067{/#};
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
text-align: center;
font-weight: bold;
font-size: 18px;
text-shadow: 1px 1px 1px {#}AAA{/#};
}




/****************************************************************************************/
/*chatbox on the toolbar*/
{#}fa_chat_container{/#} {
background:{#}FFF{/#};
border:1px solid {#}556682{/#};
border-radius:3px;
position:fixed;
right:3px;
z-index:999;
overflow:hidden;
min-width:500px;
min-height:250px;
transition:300ms;
}

{#}fa_chat{/#} {
border:none;
width:100%;
height:100%;
}

{#}fa_chat_button{/#} {
color:{#}FFF{/#};
line-height:30px;
margin-left:10px;
padding:0 5px;
cursor:pointer;
}

{#}fa_chat_button{/#}.fa_chat_active {
color:{#}333{/#};
background:{#}FFF{/#};
}

/********************************************************************************/
/* DEFAULT LINK STYLES */
a {
-webkit-transition:500ms;
-moz-transition:500ms;
-o-transition:500ms;
transition:500ms;
}

/*TEXT HOVER, EXPAND AND GLOW*/
a:hover {
color: {#}da73ff{/#}!important;
text-shadow: 1px 1px 1px {#}00a6f6{/#};
font-size: 10px;
font-weight: bold;
font-style: italic;
cursor: pointer;
}


/* HOVER LINK STYLES */
a:hover {
text-shadow:0 0 3px {#}00a6f6{/#};
}


/*editor icons change*/
.sceditor-button-bold div {
background-image:url('https://i.servimg.com/u/f57/18/21/41/30/b10.png') !important;
background-position:0 !important;
}

.sceditor-button-italic div {
background-image:url('https://i.servimg.com/u/f57/18/21/41/30/i10.png') !important;
background-position:0 !important;
}

.sceditor-button-underline div {
background-image:url('https://i.servimg.com/u/f57/18/21/41/30/u10.png') !important;
background-position:0 !important;
}

.sceditor-button-strike div {
background-image:url('https://i.servimg.com/u/f57/18/21/41/30/s10.png') !important;
background-position:0 !important;
}

by Guest
on August 27th 2016, 11:51 pm
 
Search in: Garbage
Topic: Forum size
Replies: 53
Views: 2367

Back to top

Jump to: