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
Add Icons Before Subforums
Topic Started: Apr 29 2013, 03:52 AM (1,530 Views)
ghoshriju33
Member Avatar
I ❤ jQuery
[ *  *  * ]
Code Name: Add Subforum Icon

What the code does: This code adds icon before the name of a subforum.

Preview: http://w11.zetaboards.com/timecheck/index/

How to use the code: Just add it in the "Below The Board" section of board template

How to install the code:
Code:
 
<script type="text/javascript">
function addSubforumIcon(catid,subfname,imglink) {
$('#cat-' + catid + ' .c_subforum a:contains(' + subfname +')').prepend('<img src="' + imglink + '" />');
}

addSubforumIcon("CATEGORY ID","SUBFORUM NAME","IMAGE");
</script>


replace CATEGORY ID with the id of the parent category. for ex, 3697790
replace SUBFORUM NAME with the name of the subforum. for ex, Subforum #1
replace IMAGE with the url of the icon. for ex, http://z1.ifrm.com/000/1/47/f18/f18.png

to add more images, simply add another line:
Code:
 
addSubforumIcon("CATEGORY ID","SUBFORUM NAME","IMAGE");


enjoy!!!

Extra notes: This is my first code :P
Edited by ghoshriju33, Apr 29 2013, 03:53 AM.
Offline Profile Quote Post Goto Top
 
Akhil. (PM)
Member Avatar
Member
[ * ]
Good start ghoshriju. Best of luck with your first code :up:
But the image is too big, small icons are suit for that.
Edited by Akhil., Apr 29 2013, 04:56 AM.
Offline Profile Quote Post Goto Top
 
mantra effex
Member Avatar
Anime Fan
[ * ]
Is it possible to have just the image and to have no text in the sub forum area?
Thanks.
Offline Profile Quote Post Goto Top
 
DaPizzaMan
Member Avatar
#TeamSupport

mantra effex
May 30 2016, 01:15 PM
Is it possible to have just the image and to have no text in the sub forum area?
Thanks.
That would be completely separate from this code, but yes. Add the following to the Below the Board section of the Board Template in the Admin CP:
Code:
 
<script type="text/javascript">
$('.c_subforum a').css('font-size', '0');
</script>
Offline Profile Quote Post Goto Top
 
mantra effex
Member Avatar
Anime Fan
[ * ]
DaPizzaMan your a legend! Thanks
To polish it all off is it also possible to hide the word "Subforums:" from the table?
Edited by mantra effex, May 30 2016, 06:16 PM.
Offline Profile Quote Post Goto Top
 
mantra effex
Member Avatar
Anime Fan
[ * ]
BUMP
Offline Profile Quote Post Goto Top
 
DaPizzaMan
Member Avatar
#TeamSupport

use this instead:
Code:
 
<script type="text/javascript">
$('.c_subforum').css('font-size', '0');
</script>
Offline Profile Quote Post Goto Top
 
mantra effex
Member Avatar
Anime Fan
[ * ]
Super thanks DaPizzaMan!
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