The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

make a change to the Add a message to thanked posts Code

View previous topic View next topic Go down

Solved make a change to the Add a message to thanked posts Code

Post by APE on February 2nd 2016, 6:06 am

Technical Details


Forum version : #phpBB3
Position : Member
Concerned browser(s) : Mozilla Firefox, Google Chrome, Internet Explorer, Opera, Safari, Other
Screenshot of problem : http://i68.servimg.com/u/f68/12/23/10/57/captur88.png
Who the problem concerns : Yourself
When the problem appeared : its always been there
Forum link : http://chatworld.forumotion.co.uk/

Description of problem

I have been making a change to this my forum and have been using this
http://help.forumotion.com/t142451-add-a-message-to-thanked-posts For some time now and i wanted to make a small change to it,

Now my problem is i have 2 thumbs one on the left and one on the right
What i want is the code to be changed a little so i can make one thumb point the other way so there sort of like this http://i68.servimg.com/u/f68/13/25/37/43/captur10.png

EDIT: i added the Codes for the left and right
Left Thumb img: http://i68.servimg.com/u/f68/12/23/10/57/thumb210.png
Right Thumb img


So can some one help me there Wink

Thanks to anyone that can do this Wink


Last edited by APE on February 3rd 2016, 2:57 am; edited 2 times in total

APE
Manager
Manager

Male Posts : 8339
Reputation : 718
Language : fluent in dork / mumbojumbo & English haha
Location : STUCK IN FORUMOTIONS SERVERS HELP ME !!!!!!

http://chatworld.forumotion.co.uk/

Back to top Go down

Solved Re: make a change to the Add a message to thanked posts Code

Post by APE on February 3rd 2016, 1:10 am

as im going to bed now i will bump it Razz

BUMP





APE
Manager
Manager

Male Posts : 8339
Reputation : 718
Language : fluent in dork / mumbojumbo & English haha
Location : STUCK IN FORUMOTIONS SERVERS HELP ME !!!!!!

http://chatworld.forumotion.co.uk/

Back to top Go down

Solved Re: make a change to the Add a message to thanked posts Code

Post by Genesis on February 3rd 2016, 1:29 am

Not an expert but maybe if you change it so the code does not repeat the icon on the right side and had Icon2 represent the right icon?

Try:
Code:
$(function() {
var message = function(child, parent) {
var pseudo = $(child, parent).text(),
icon = '<img src="FIRST IMAGE" alt=""/>';

            icon2 = '<img src='SECOND IMAGE" alt=""/>';

return '<div id="fa_thanks_message">' + icon + ' The topic starter has thanked ' + pseudo + ' ! ' + icon2 + '</div>';
},

version = $('.bodylinewidth')[0] ? 0 : document.getElementById('wrap') ? 1 : $('.pun')[0] ? 2 : document.getElementById('ipbwrapper') ? 3 : 'badapple', // version check
node = document.createElement(version ? 'DIV' : 'TR'),
post = $(version ? 'div' : 'tr' + '.post'),
j = post.length,
i = 0;

if (version == 'badapple') {
if (window.console) console.error('This plugin is not optimized for your forum version. Please contact the support for further assistance.');
return;
}

node.id = 'fa_thanks'; // id for style modifications
if (!version) node.innerHTML = '<td colspan="2"></td>'; // phpbb2 must have a cell as the child node

for (; i < j; i++) {

if ((version ? post[i] : post[i].firstChild).style.backgroundColor) { // thanked posts have the backgroundColor style property

post[i].className += ' thanked'; // mark the thanked post with a class
(version ? node : node.firstChild).innerHTML = message(['.name', 'dl > dt > strong', '.username', '.popmenubutton'][version], post[i]); // thanks message

switch (version) {

case 0 : // phpbb2
node.firstChild.style.backgroundColor = post[i].firstChild.style.backgroundColor;
node.firstChild.className = post[i].firstChild.className;
post[i].parentNode.insertBefore(node, post[i].nextSibling);
break;

case 1 : // phpbb3
post[i].firstChild.insertBefore(node, post[i].firstChild.lastChild.previousSibling);
break;

case 2 : // punbb
node.className = 'postfoot';
node.style.margin = '0';
post[i].appendChild(node);
break;

case 3 : // invision
node.className = 'post-footer';
node.style.backgroundColor = post[i].style.backgroundColor;
post[i].appendChild(node);
break;

}

break; // break out of the for loop when the thanked post is found
}

}
});
*whispers it may not work*

Genesis
Forum Reviewer
Forum Reviewer

Male Posts : 2331
Reputation : 322
Language : English
Location : Forumountain

http://forumpromocean.com

Back to top Go down

Solved Re: make a change to the Add a message to thanked posts Code

Post by APE on February 3rd 2016, 2:12 am

Nope it did not work Sad





APE
Manager
Manager

Male Posts : 8339
Reputation : 718
Language : fluent in dork / mumbojumbo & English haha
Location : STUCK IN FORUMOTIONS SERVERS HELP ME !!!!!!

http://chatworld.forumotion.co.uk/

Back to top Go down

Solved Re: make a change to the Add a message to thanked posts Code

Post by Genesis on February 3rd 2016, 2:31 am

I messed the code up, try this:
Code:
$(function() {
var message = function(child, parent) {
var pseudo = $(child, parent).text(),
icon = '<img src="IMAGE ONE" alt=""/>';

            icon2 = '<img src="IMAGE TWO" alt=""/>';

return '<div id="fa_thanks_message">' + icon + ' The topic starter has thanked ' + pseudo + ' ! ' + icon2 + '</div>';
},

version = $('.bodylinewidth')[0] ? 0 : document.getElementById('wrap') ? 1 : $('.pun')[0] ? 2 : document.getElementById('ipbwrapper') ? 3 : 'badapple', // version check
node = document.createElement(version ? 'DIV' : 'TR'),
post = $(version ? 'div' : 'tr' + '.post'),
j = post.length,
i = 0;

if (version == 'badapple') {
if (window.console) console.error('This plugin is not optimized for your forum version. Please contact the support for further assistance.');
return;
}

node.id = 'fa_thanks'; // id for style modifications
if (!version) node.innerHTML = '<td colspan="2"></td>'; // phpbb2 must have a cell as the child node

for (; i < j; i++) {

if ((version ? post[i] : post[i].firstChild).style.backgroundColor) { // thanked posts have the backgroundColor style property

post[i].className += ' thanked'; // mark the thanked post with a class
(version ? node : node.firstChild).innerHTML = message(['.name', 'dl > dt > strong', '.username', '.popmenubutton'][version], post[i]); // thanks message

switch (version) {

case 0 : // phpbb2
node.firstChild.style.backgroundColor = post[i].firstChild.style.backgroundColor;
node.firstChild.className = post[i].firstChild.className;
post[i].parentNode.insertBefore(node, post[i].nextSibling);
break;

case 1 : // phpbb3
post[i].firstChild.insertBefore(node, post[i].firstChild.lastChild.previousSibling);
break;

case 2 : // punbb
node.className = 'postfoot';
node.style.margin = '0';
post[i].appendChild(node);
break;

case 3 : // invision
node.className = 'post-footer';
node.style.backgroundColor = post[i].style.backgroundColor;
post[i].appendChild(node);
break;

}

break; // break out of the for loop when the thanked post is found
}

}
});

Genesis
Forum Reviewer
Forum Reviewer

Male Posts : 2331
Reputation : 322
Language : English
Location : Forumountain

http://forumpromocean.com

Back to top Go down

Solved Re: make a change to the Add a message to thanked posts Code

Post by APE on February 3rd 2016, 3:03 am

THANK YOU @Forumedic rock guitar groar banana Yes That Worked

Topic solved and archived





APE
Manager
Manager

Male Posts : 8339
Reputation : 718
Language : fluent in dork / mumbojumbo & English haha
Location : STUCK IN FORUMOTIONS SERVERS HELP ME !!!!!!

http://chatworld.forumotion.co.uk/

Back to top Go down

View previous topic View next topic Back to top


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