Author Topic: [Code] Topic Icons  (Read 598 times)

0 Members and 0 Guests are viewing this topic.

Offline aIURbliS

  • Hero Member
  • *****
  • Posts: 1215
  • Karma: 45
  • Gender: Male
  • Location: U.S.
    • View Profile
[Code] Topic Icons
« on: November 06, 2012, 02:26:43 am »
Description: Changes the topic icon based on the tag in the topic name. When writing the tag in the topic title, it's required to write out [icon-TAG] for the new icon to appear.


This code utilizes jQuery, please use the latest version found in this thread: http://support.createaforum.com/5/jquery-v1-8-update/

Footers:
Code: [Select]
<script>function xboi209_topicicons(tag,img_url){$("td.subject.windowbg2 > div > span > a:contains('[icon-"+tag+"]')").each(function(){$(this).html($(this).text().replace("[icon-"+tag+"]",""));$(this).parents("tr").children("td.icon2.windowbg").children("img").attr("src",img_url)})}
xboi209_topicicons("TAG","IMAGE_URL");
</script>

Editing Instructions: Look near the end of the code for TAG and replace it with whatever tag you want and IMAGE_URL and replace it with whatever image you want. For more topic icons, add xboi209_topicicons("TAG","IMAGE_URL"); to the end of the code before the </script>.
All codes I make are tested on the latest version of Google Chrome and upon request of other browsers.

Share on Facebook Share on Twitter


 

Related Topics

  Subject / Started by Replies Last post
0 Replies
601 Views
Last post November 04, 2012, 11:33:01 pm
by aIURbliS
4 Replies
970 Views
Last post August 01, 2013, 01:02:41 am
by aIURbliS
2 Replies
341 Views
Last post November 26, 2013, 05:19:10 pm
by WholesaleChat
2 Replies
284 Views
Last post March 16, 2014, 01:37:09 pm
by CreateAForum
0 Replies
675 Views
Last post October 15, 2015, 08:18:19 pm
by kill4hell7845