Create A Forum - Support Forums

Support => Create a Forum Codes and Support => Topic started by: aIURbliS on November 06, 2012, 02:26:43 am

Title: [Code] Topic Icons
Post by: aIURbliS 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/ (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>.