MyBB Community Forums

Full Version: Set a default post icon for each forum/subforum
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I was wondering, is there any way to set a custom post icon for boards on my forum?

http://thehockeynation.ca

(If this is the wrong place to put this, can somebody please move it to the right forum. Thanks)
You can try to follow this tutorial: http://community.mybb.com/thread-92128.html
(2013-07-01, 10:48 PM)José F. Wrote: [ -> ]You can try to follow this tutorial: http://community.mybb.com/thread-92128.html

That's very interesting and I will do that (thank you) but that's not what I meant.

For example, on here the custom Post Icon is set to "no icon", that's what meant when I was asking if there was a way to change that for specific forums, sorry.

To explain this a little better, what I'd like to do is either:

Add a default post icon for each forum and subforum I have. So for example, set the default post icon for one of my forums to Toungue or the pencil instead of "no icon", so every new thread/post has this icon selected by default. And for another one, a different icon selected by default.

OR (because I realize this might not be possible)

A way to set default post-icons to be the same as the original post in a thread. So if I set the default post icon to the pencil when posting a new thread, the rest of the posts in that thread would also be selected by default as the pencil.

I hope this explains it better, I realized now that I put "custom" instead of "default" in the thread title.
Would still like to know if this is possible.
this can be of some help --> [Tutorial] How to set a default post icon

related SQL queries (F is forum ID and T is thread ID)
UPDATE `mybb_threads` SET `icon` = 'X' WHERE `fid` = 'F'; 
UPDATE `mybb_posts` SET `icon` = 'X' WHERE `tid` = 'T'; 
(2013-07-03, 05:33 PM).m. Wrote: [ -> ]this can be of some help --> [Tutorial] How to set a default post icon

related SQL queries (F is forum ID and T is thread ID)
UPDATE `mybb_threads` SET `icon` = 'X' WHERE `fid` = 'F'; 
UPDATE `mybb_posts` SET `icon` = 'X' WHERE `tid` = 'T'; 

Thank you so much, I'll give this a shot! I saw this tutorial when I was looking for any info on this, but I didn't know you could add the forum id to that.

In order to make this work for specific forums/subforums would I need to edit the code somehow:


<tr>
<td class="trow1" style="vertical-align: top"><strong>{$lang->post_icon}</strong></td>
<td class="trow1" valign="top" colspan="2">{$iconlist}<input type="radio" class="radio" name="icon" value="{example}" checked="checked" style="display: none;" /></td>
</tr>

and add it for each forum I want this to work in?
Every time I bump the thread we get a little closer to getting it working. So here's hoping that continues.



Also, how does this one thread have so many views lol...
I was looking for something similar myself and found solution:

Download Template Conditionals http://mybbhacks.zingaburga.com/showthread.php?tid=464 if you haven't, activate it, then use a code similar to this (replace whole template code):
<tr>
     <td class="trow1" style="vertical-align: top"><strong>{$lang->post_icon}</strong></td>
<if in_array($GLOBALS['fid'], array(4,6,7)) then>
     <td class="trow1" valign="top">{$iconlist}<input type="radio" class="radio" name="icon" value="<if $GLOBALS['fid'] == 4 then>1<elseif $GLOBALS['fid'] == 6 then>2<elseif $GLOBALS['fid'] == 7 then>3<else>-1</if>" checked="checked" style="display: none;" /></td>
<else>
     <td class="trow1" valign="top">{$iconlist}<span class="smalltext"><label><input type="radio" class="radio" name="icon" value="-1"{$no_icons_checked} />{$lang->no_post_icon}</label></span></td>
</if>
</tr>

In this code forums with ids 4,6,7 have default post icons, the rest has visible "no icon" selected. Forum with id 4 has default icon with iid 1, forum with id 6 - iid 2, forum with id 7 - iid 3.

So to add more/other forums change array(4,6,7) to your own comma separated fid list, then edit the <if $GLOBALS['fid'] == 4 then>1<elseif $GLOBALS['fid'] == 6 then>2<elseif $GLOBALS['fid'] == 7 then>3<else>-1</if> adequately.

@down, the same template as in tutorial, so posticons.
(2013-07-05, 06:46 PM)Destroy666 Wrote: [ -> ]I was looking for something similar myself and found solution:

Download Template Conditionals http://mybbhacks.zingaburga.com/showthread.php?tid=464 if you haven't, activate it, then use a code similar to this (replace whole template code):
<tr>
     <td class="trow1" style="vertical-align: top"><strong>{$lang->post_icon}</strong></td>
<if in_array($GLOBALS['fid'], array(4,6,7)) then>
     <td class="trow1" valign="top">{$iconlist}<input type="radio" class="radio" name="icon" value="<if $GLOBALS['fid'] == 4 then>1<elseif $GLOBALS['fid'] == 6 then>2<elseif $GLOBALS['fid'] == 7 then>3<else>-1</if>" checked="checked" style="display: none;" /></td>
<else>
     <td class="trow1" valign="top">{$iconlist}<span class="smalltext"><label><input type="radio" class="radio" name="icon" value="-1"{$no_icons_checked} />{$lang->no_post_icon}</label></span></td>
</if>
</tr>

In this code forums with ids 4,6,7 have default post icons, the rest has visible "no icon" selected. Forum with id 4 has default icon with iid 1, forum with id 6 - iid 2, forum with id 7 - iid 3.

So to add more/other forums change array(4,6,7) to your own comma separated fid list, then edit the <if $GLOBALS['fid'] == 4 then>1<elseif $GLOBALS['fid'] == 6 then>2<elseif $GLOBALS['fid'] == 7 then>3<else>-1</if> adequately.

This seems to be exactly what I was looking for, thank you. Just one question, what template should I be looking for exactly to replace with the code above?