We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Emoticons in Titles; Or anywhere you wish!
Topic Started: Jul 14 2016, 07:33 PM (500 Views)
DaPizzaMan
Member Avatar
#TeamSupport

Code Name: Emoticons in Titles (Member Titles and Topic Titles built-in)

What the code does: The code replaces all text emoticons (i.e. :)) with their image counter-parts (i.e. :) ).

How to use the code: There are some customizations with this code. You can install the Member Titles-only version, as per this request, which requires no editing and just needs to be installed where indicated below. Alternatively, you can install the Member Titles and Topic Titles-only version, as per the conversation in the aforementioned request. For people who understand some CSS: you may create your own list of places where text emoticons should be replaced with image emoticons.

How to install the code: Admin CP -> Board Template -> Above the Copyright

Extra notes: Please note there is a one hour delay if you add a new emoticon to your board that you want to appear as an image in any of the places the code works.

Member Titles Only

Member Titles and Topic Titles

You Decide Where!
Edited by DaPizzaMan, Jul 15 2016, 08:13 AM.
Offline Profile Quote Post Goto Top
 
polocolo
Member Avatar
Member
[ *  *  * ]
Wow, Awesome!
Offline Profile Quote Post Goto Top
 
RichardInTN
Member Avatar
I believe in I.D.I.C.
[ *  *  * ]
I noticed that it does the emoticons that come standard with Zetaboard that are enclosed with colons (like :wub: )... but when I tried to use an uploaded emoticon (where :heart: was the tag for it) it wouldn't convert to the heart emoticon that I had uploaded. I checked in a message and in messages the uploaded emoticon works just fine.


ETA: My question - Is this code supposed to be limited to only default emoticons... or is that just a glitch?
Edited by RichardInTN, Jul 15 2016, 12:44 AM.
Offline Profile Quote Post Goto Top
 
Skyon Archer
Member Avatar
Member
[ *  *  *  * ]
It works off a list from your forum. All emoticons are listed on one page and it looks for that "symbol" you put and returns the associated image.

For example, all emoticons listed for your forum are located here: http://w11.zetaboards.com/Great_Escape/keys

If that's the board you were trying to use, note that there is no :heart: on that page.
Offline Profile Quote Post Goto Top
 
RichardInTN
Member Avatar
I believe in I.D.I.C.
[ *  *  * ]
I know that there's no ":heart:" there... but there is one on my test board... where I'm currently testing the script.

ETA: here's the link to the key page there: http://w11.zetaboards.com/Escape_Test_Kitchen/keys

ETA II: I wish there was a profile field here for "Test Board URL" like there is for "My Board URL"
Edited by RichardInTN, Jul 15 2016, 03:33 AM.
Offline Profile Quote Post Goto Top
 
Skyon Archer
Member Avatar
Member
[ *  *  *  * ]
It has to be a simple fix. Try changing the word to something else and/or add another emoticon and see if it's just not seeing the last on in the list.
Offline Profile Quote Post Goto Top
 
RichardInTN
Member Avatar
I believe in I.D.I.C.
[ *  *  * ]
I can do that... be right back.
O.k. ... that's weird.

Now it shows all of them I try (including both new ones, I added two)



So... I took it to my "real board"... and it doesn't read added emoticons there. I wonder if it could be a conflict... (it was the only code on my test board)
Edited by RichardInTN, Jul 15 2016, 03:54 AM.
Offline Profile Quote Post Goto Top
 
Skyon Archer
Member Avatar
Member
[ *  *  *  * ]
You could, in theory, just do a simple replace.

For example, say you wanted to display the beating heart image. You could change the text you normally put to have the heart displayed changed no matter where it is. However, I'd use something that is virtually impossible to replicate by accidental typing, such as:
Code:
 

<script type="text/javascript">
$('body :not(script)').contents().filter(function() {
return this.nodeType === 3;
}).replaceWith(function() {
return this.nodeValue.replace('8hYsspqMv39',"<img src='http://z5.ifrm.com/30328/32/0/e5329919//e5329919.gif' alt='heart' />");
});
</script>

Then, wherever you want the Posted Image to be displayed, just type the "word" 8hYsspqMv39.

If you want to do many replacements, then use something like this:
Code:
 
<script type="text/javascript">
$('body :not(script)').contents().filter(function() {
return this.nodeType === 3;
}).replaceWith(function() {
return this.nodeValue.replace(/the/gi, "<img src='http://z5.ifrm.com/30328/32/0/e5329919//e5329919.gif' alt='heart' />").replace(/staff/gi, "<img src='http://z5.ifrm.com/30158/152/0/e5313073//e5313073.png' alt='grin' />").replace(/image/gi, "<img src='http://z5.ifrm.com/30158/152/0/e5258387//e5258387.gif' alt='cheers' />");
});
</script>


Above, I'm changing the words the, staff and image with images all over the board.
Offline Profile Quote Post Goto Top
 
RichardInTN
Member Avatar
I believe in I.D.I.C.
[ *  *  * ]
Anddddddd... now it works on the "Real" board.

There must be some kind of time delay on it LOL
Offline Profile Quote Post Goto Top
 
Skyon Archer
Member Avatar
Member
[ *  *  *  * ]
Glad it's working. You can keep my option handy in case you want to change some other stuff later on :)
Offline Profile Quote Post Goto Top
 
DaPizzaMan
Member Avatar
#TeamSupport

There is a one hour delay if you recently add emoticons because it would be absurd for the code to check the emoticons list every time a topic title/member title showed up. I could shorten that a bit, but I think it's decent where it is now. Also, I'll edit my post to mention that delay. Sorry anout that.
Offline Profile Quote Post Goto Top
 
Skyon Archer
Member Avatar
Member
[ *  *  *  * ]
You da' man . . . DaPizzaMan :D

Nice codes, by the way.
Offline Profile Quote Post Goto Top
 
RichardInTN
Member Avatar
I believe in I.D.I.C.
[ *  *  * ]
DaPizzaMan
Jul 15 2016, 08:12 AM
There is a one hour delay if you recently add emoticons because it would be absurd for the code to check the emoticons list every time a topic title/member title showed up. I could shorten that a bit, but I think it's decent where it is now. Also, I'll edit my post to mention that delay. Sorry anout that.
You were making me think I was crazier than I already thought I was!

(I was kidding when I mentioned a time delay... LOL... guess I got that right!)
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · ZetaBoards Codes & Modifications · Next Topic »
Add Reply