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.

Thanked post message position

View previous topic View next topic Go down

In progress Thanked post message position

Post by charmender on July 31st 2016, 7:25 am

I used Add a message to thanked post tutorial by @Ange Tuteur and it worked perfectly fine like showed in picture

I want to know how can I change position of thanked message I want it to be on the bottom of the post. (after that up down arrows)

charmender
New Member

Posts : 2
Reputation : 1
Language : English

http://anmworld.4umotion.com/

Back to top Go down

In progress Re: Thanked post message position

Post by Ange Tuteur on July 31st 2016, 4:05 pm

Hi @charmender,

Try replacing the script you installed in the tutorial with this one :
Code:
$(function() {
  var message = function(child, parent) {
        var pseudo = $(child, parent).text(),
            icon = '<img src="http://i18.servimg.com/u/f18/18/21/60/73/fa_sta10.png" alt=""/>';
   
        return '<div id="fa_thanks_message">' + icon + ' The topic starter has thanked ' + pseudo + ' ! ' + icon + '</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.post' : '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.append(node);
          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
    }
   
  }
});

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

In progress Re: Thanked post message position

Post by charmender on July 31st 2016, 4:50 pm

I updated script but I can't see thanked message It's not there btw thanks for replying @Ange Tuteur

charmender
New Member

Posts : 2
Reputation : 1
Language : English

http://anmworld.4umotion.com/

Back to top Go down

In progress Re: Thanked post message position

Post by APE on July 31st 2016, 5:05 pm

can you link us to the post where your thanked please ?





APE
Manager
Manager

Male Posts : 8648
Reputation : 762
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