INTRODUCTION:
In this tutorial I will be showing you how to set a default post icon for all threads, but still allow users to pick another icon if they want. Very simple.
TUTORIAL:
1. Go to Admin CP > Configuration > Post Icons.
2. Hover over Edit in the corresponding row of the default post icon you want to use.
3. In the end of the link there will be &iid=2 whereas 2 is the id of that specific post icon.
4. Go to Admin CP > Templates & Style > Templates > Your template set > Ungrouped Templates > posticons.
5. Replace all the code inside the posticons template with the code below, using the id you found in step 3 instead of {example}:
6. In order to update all existing threads to use the same post icon, execute this SQL query (by replacing X with the icon ID you found in step 3):
7. In order to update all existing posts to use the same post icon, execute this SQL query (by replacing X with the icon ID you found in step 3):
CONCLUSION:
In the end, on a New Thread or New Reply page you will see something like the image below. Basically, we removed the "no icon" option from the left and added an invisible option which is checked by default. If the user doesn't select another post icon then it will use the post icon from the invisible option.
In this tutorial I will be showing you how to set a default post icon for all threads, but still allow users to pick another icon if they want. Very simple.
TUTORIAL:
1. Go to Admin CP > Configuration > Post Icons.
2. Hover over Edit in the corresponding row of the default post icon you want to use.
3. In the end of the link there will be &iid=2 whereas 2 is the id of that specific post icon.
4. Go to Admin CP > Templates & Style > Templates > Your template set > Ungrouped Templates > posticons.
5. Replace all the code inside the posticons template with the code below, using the id you found in step 3 instead of {example}:
<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>
6. In order to update all existing threads to use the same post icon, execute this SQL query (by replacing X with the icon ID you found in step 3):
UPDATE `mybb_threads` SET `icon` = 'X' WHERE `icon` = '';
7. In order to update all existing posts to use the same post icon, execute this SQL query (by replacing X with the icon ID you found in step 3):
UPDATE `mybb_posts` SET `icon` = 'X' WHERE `icon` = '';
CONCLUSION:
In the end, on a New Thread or New Reply page you will see something like the image below. Basically, we removed the "no icon" option from the left and added an invisible option which is checked by default. If the user doesn't select another post icon then it will use the post icon from the invisible option.