The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Thanked Message - Code issue

2 posters

Go down

Solved Thanked Message - Code issue

Post by Matikka 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
Thanked Message - Code issue Messag10

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
Matikka
Forumember

Male Posts : 138
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 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?


Thanked Message - Code issue Slgray10

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

Male Posts : 51453
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Solved Re: Thanked Message - Code issue

Post by Matikka 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

Thanked Message - Code issue Mark-i10
Matikka
Matikka
Forumember

Male Posts : 138
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 December 13th 2015, 4:08 am

Do you have any templates that are modified?


Thanked Message - Code issue Slgray10

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

Male Posts : 51453
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Solved Re: Thanked Message - Code issue

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

I do.

Would this be the problem?
Matikka
Matikka
Forumember

Male Posts : 138
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 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.


Thanked Message - Code issue Slgray10

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

Male Posts : 51453
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Solved Re: Thanked Message - Code issue

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

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

Thanked Message - Code issue Temps10
Matikka
Matikka
Forumember

Male Posts : 138
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 December 13th 2015, 4:21 am

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


Thanked Message - Code issue Slgray10

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

Male Posts : 51453
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Solved Re: Thanked Message - Code issue

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

Thank you SLGray,

This worked for me Smile

Thanked Message - Code issue Worked10
Matikka
Matikka
Forumember

Male Posts : 138
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 December 13th 2015, 4:43 am

You're welcome.

Do you need your modified templates?


Thanked Message - Code issue Slgray10

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

Male Posts : 51453
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Solved Re: Thanked Message - Code issue

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

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

Male Posts : 138
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 December 13th 2015, 5:07 am

Have many modified templates do you have?


Thanked Message - Code issue Slgray10

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

Male Posts : 51453
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Solved Re: Thanked Message - Code issue

Post by Matikka 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
Thanked Message - Code issue Temps11

Profile Section
Thanked Message - Code issue Prf10

Not sure if this helps?
Matikka
Matikka
Forumember

Male Posts : 138
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 December 13th 2015, 9:48 am

More likely the issue is with the viewtopic_body template.


Thanked Message - Code issue Slgray10

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

Male Posts : 51453
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Solved Re: Thanked Message - Code issue

Post by Matikka 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: https://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
Matikka
Forumember

Male Posts : 138
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 December 14th 2015, 12:23 am

Thank you for posting the solution.

Topic solved and archived


Thanked Message - Code issue Slgray10

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

Male Posts : 51453
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Back to top

- Similar topics

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