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 Message - Code issue

View previous topic View next topic Go down

Solved Thanked Message - Code issue

Post by Matikka on December 13th 2015, 3:12 am

Hello,
I am using the code from "Tips & Tricks" where you can add a custom Thanked message i was just wondering is there a way to remove the user's rank? see image below i have also inserted the code i am using. This is for PHPBB2.

Forum Url: http://stars-clan.forumotion.co.uk/
The Forum is for members only, if you need access i have setup an account so you can access the Forum. Let me know if you need it.

Code:
$(function() {
  var message = function(child, parent) {
        var pseudo = $(child, parent).text(),
            icon = '<img src="http://i68.servimg.com/u/f68/14/69/73/51/citade11.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' : '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
    }
 
  }
});


Screenshot of the Issue


Is there a way to remove the "Forum Moderator" part in the thanked message and just have the users name.

Thanks in Advance.


Last edited by Matikka on December 13th 2015, 1:00 pm; edited 2 times in total

Matikka
Forumember

Male Posts : 88
Reputation : 3
Language : English
Location : United Kingdom

http://www.Stars-Clan.Forumotion.co.uk

Back to top Go down

Solved Re: Thanked Message - Code issue

Post by SLGray on December 13th 2015, 3:25 am

The code should only display the username of the member who been thanked. Is there a member called MarkForum Moderator?


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 36747
Reputation : 2449
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

Solved Re: Thanked Message - Code issue

Post by Matikka on December 13th 2015, 3:28 am

No, the user name is just "Mark" but for some reason it is showing his Forum rank which is Forum Moderator

Edit: added a screenshot


Matikka
Forumember

Male Posts : 88
Reputation : 3
Language : English
Location : United Kingdom

http://www.Stars-Clan.Forumotion.co.uk

Back to top Go down

Solved Re: Thanked Message - Code issue

Post by SLGray on December 13th 2015, 4:08 am

Do you have any templates that are modified?


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 36747
Reputation : 2449
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

Solved Re: Thanked Message - Code issue

Post by Matikka on December 13th 2015, 4:10 am

I do.

Would this be the problem?

Matikka
Forumember

Male Posts : 88
Reputation : 3
Language : English
Location : United Kingdom

http://www.Stars-Clan.Forumotion.co.uk

Back to top Go down

Solved Re: Thanked Message - Code issue

Post by SLGray on December 13th 2015, 4:13 am

Is one of them related to messages/posts?

Try this: turn off your modified templates. The option is above the templates.


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 36747
Reputation : 2449
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

Solved Re: Thanked Message - Code issue

Post by Matikka on December 13th 2015, 4:20 am

Where would i find it? would it be in the list below.


Matikka
Forumember

Male Posts : 88
Reputation : 3
Language : English
Location : United Kingdom

http://www.Stars-Clan.Forumotion.co.uk

Back to top Go down

Solved Re: Thanked Message - Code issue

Post by SLGray on December 13th 2015, 4:21 am

It is above the list. It will have two choices: yes or no.


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 36747
Reputation : 2449
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

Solved Re: Thanked Message - Code issue

Post by Matikka on December 13th 2015, 4:31 am

Thank you SLGray,

This worked for me Smile


Matikka
Forumember

Male Posts : 88
Reputation : 3
Language : English
Location : United Kingdom

http://www.Stars-Clan.Forumotion.co.uk

Back to top Go down

Solved Re: Thanked Message - Code issue

Post by SLGray on December 13th 2015, 4:43 am

You're welcome.

Do you need your modified templates?


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 36747
Reputation : 2449
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

Solved Re: Thanked Message - Code issue

Post by Matikka on December 13th 2015, 5:00 am

Yes, i wondered why it had reverted back, only just noticed it Very Happy

Matikka
Forumember

Male Posts : 88
Reputation : 3
Language : English
Location : United Kingdom

http://www.Stars-Clan.Forumotion.co.uk

Back to top Go down

Solved Re: Thanked Message - Code issue

Post by SLGray on December 13th 2015, 5:07 am

Have many modified templates do you have?


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 36747
Reputation : 2449
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

Solved Re: Thanked Message - Code issue

Post by Matikka on December 13th 2015, 5:13 am

I have made so many modifications to the Forum, not sure where to start. would i need to post all codes to the modified templates i have for you to go through them?

Edit:
The Modified templates are: General & Profile

General section


Profile Section


Not sure if this helps?

Matikka
Forumember

Male Posts : 88
Reputation : 3
Language : English
Location : United Kingdom

http://www.Stars-Clan.Forumotion.co.uk

Back to top Go down

Solved Re: Thanked Message - Code issue

Post by SLGray on December 13th 2015, 9:48 am

More likely the issue is with the viewtopic_body template.


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 36747
Reputation : 2449
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

Solved Re: Thanked Message - Code issue

Post by Matikka on December 13th 2015, 12:59 pm

Hi SLGray,
i have fixed the issue and can use all the Modified template again i done the following:

I used the hide rank title text tips and tricks: http://help.forumotion.com/t122026-hiding-rank-title-text

Then removed this code from the Viewtopics_body:
Code:
{postrow.displayed.POSTER_RANK}

this then fixed the issue i was having with the rank being added at the end of Forum Users. Thank you for the assistence this can now be locked. Smile

Matikka
Forumember

Male Posts : 88
Reputation : 3
Language : English
Location : United Kingdom

http://www.Stars-Clan.Forumotion.co.uk

Back to top Go down

Solved Re: Thanked Message - Code issue

Post by SLGray on December 14th 2015, 12:23 am

Thank you for posting the solution.

Topic solved and archived


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 36747
Reputation : 2449
Language : English
Location : United States

http://ztwds.forumotion.com/

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