• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Fixed TMS does not inject code correctly

Adam Howard

Well-known member
#1
OK applying this code manually into the template will give me a nice red heart next to any like given.

extra.css

PHP:
/* Add heart next to like */
.LikeText:before {
content: "\2665 \0020";
color: #FF0000;
font-size: 1.5em;
margin: 0 0 0 2px;
}
/* END Add heart next to like */
But when I have TMS add it; the result is something like this

www.sociallyuncensored.eu 2013-9-18 12 37 40.png

So the code works... You can verify that by adding it to extra.css and liking a post. But for some reason TMS spits it out wrong.
 

Mike

XenForo developer
Staff member
#2
As you're doing a regex, this is another method of replacing backreferences (from preg_replace). Use \\.

I don't think I can necessarily change this behavior due to backwards compatibility.
 

Adam Howard

Well-known member
#3
As you're doing a regex, this is another method of replacing backreferences (from preg_replace). Use \\.

I don't think I can necessarily change this behavior due to backwards compatibility.
This is what I'm currently trying to apply

Screenshot from 2013-09-18 13:16:24.png


Exactly what are you suggesting as an alternative?
 

Adam Howard

Well-known member
#4
As you're doing a regex, this is another method of replacing backreferences (from preg_replace). Use \\.

I don't think I can necessarily change this behavior due to backwards compatibility.
I solved this.

You were talking about my code. Your "hint" was so vague I kept thinking you were suggesting about the code used in the "find" box.
 

Adam Howard

Well-known member
#6
Just for a point of reference for anyone who may run into this problem & find this via google...

Was

PHP:
/* Add heart next to like */
.LikeText:before {
content: "\2665 \0020";
color: #FF0000;
font-size: 1.5em;
margin: 0 0 0 2px;
}
/* END Add heart next to like */
Now

PHP:
/* Add heart next to like */
.LikeText:before {
content: "\\2665 \\0020";
color: #FF0000;
font-size: 1.5em;
margin: 0 0 0 2px;
}
/* END Add heart next to like */
^ Basically \ turns into \\