MyBB Community Forums

Full Version: MyForumIcons
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
As promised, I have now released my first mod for MyBB.

AKA: PL9 Forum Icons

MyForumIcons is just that, a means to add custom forum icons for your forums while still holding the main forum icons in place if you did not input a custom icon.

This thread I intend to use for suggestions and feedback. You will find that I have given the link to download and a couple of the screenshots.

Features:
- Enable/Disable Setting
- Extra forum option to add location of your custom icon
- If no icon was designated, default forum icon is used

More details and download can be found here: http://mods.mybboard.net/view/pl9-forum-icons

Template Troubles:
Open forumbit_depth2_forum template

Find:
<img src="{$theme['imgdir']}/{$lightbulb['folder']}.gif" alt="{$lightbulb['altonoff']}" title="{$lightbulb['altonoff']}" class="ajax_mark_read" id="mark_read_{$forum['fid']}" />

Replace with:
<if $mybb->settings['enable_MyForumIcons'] then>
<if $forum['forum_icon'] then>
<img src="{$forum['forum_icon']}" alt="{$lightbulb['altonoff']}" title="{$lightbulb['altonoff']}" class="ajax_mark_read" id="mark_read_{$forum['fid']}" />
<else />
<img src="{$theme['imgdir']}/{$lightbulb['folder']}.gif" alt="{$lightbulb['altonoff']}" title="{$lightbulb['altonoff']}" class="ajax_mark_read" id="mark_read_{$forum['fid']}" />
</if>
<else />
<img src="{$theme['imgdir']}/{$lightbulb['folder']}.gif" alt="{$lightbulb['altonoff']}" title="{$lightbulb['altonoff']}" class="ajax_mark_read" id="mark_read_{$forum['fid']}" />
</if>

Parse Error:
Replace the above code with:
<if $mybb->settings[enable_MyForumIcons] then>
<if $forum[forum_icon] then>
<img src="{$forum['forum_icon']}" alt="{$lightbulb['altonoff']}" title="{$lightbulb['altonoff']}" class="ajax_mark_read" id="mark_read_{$forum['fid']}" />
<else />
<img src="{$theme['imgdir']}/{$lightbulb['folder']}.gif" alt="{$lightbulb['altonoff']}" title="{$lightbulb['altonoff']}" class="ajax_mark_read" id="mark_read_{$forum['fid']}" />
</if>
<else />
<img src="{$theme['imgdir']}/{$lightbulb['folder']}.gif" alt="{$lightbulb['altonoff']}" title="{$lightbulb['altonoff']}" class="ajax_mark_read" id="mark_read_{$forum['fid']}" />
</if>
Approved Smile
You should probably specify that the template conditionals plugin is needed as MyBB has no native <if then> syntax.
Wait what? I'm using <if then> without that plugin.
(2012-07-26, 12:38 AM)Steve Moore Wrote: [ -> ]Wait what? I'm using <if then> without that plugin.

That's not possible. We don't parse the templates to provide such functionality.
It could be that it is similarly coded to the original PL9 forum icons for 1.4. That plugin replicated the code from ZBs PHP in templates plugin.

Of course, you would expect the developer of the plugin to know that....Confused
I included it in the original apparently and included it in this one as well so I could eliminate the use of having to tell others to install it as well.

I haven't coded for MyBB in a very long time hence why I forgot. Please don't put me in the corner with a dunce cap. Sad
(2012-07-26, 12:57 AM)Steve Moore Wrote: [ -> ]I included it in the original apparently and included it in this one as well so I could eliminate the use of having to tell others to install it as well.

I haven't coded for MyBB in a very long time hence why I forgot. Please don't put me in the corner with a dunce cap. Sad

Not a problem - but you might want to check on ZB's forum - mybbhacks. Apparently (and I am not sure which plugin was causing the issue) the original PL9 icons plugin conflicted with the PHP in templates plugin. Just a heads up, I am not sure if it is fixed.
I believe I included a fix with mine but I will double check.

Checked his site but apparently he no longer offers either.
Both look alive and well to me

http://mybbhacks.zingaburga.com/showthread.php?tid=464
http://mybbhacks.zingaburga.com/showthread.php?tid=260

His site is running very slow and is taking forever to load - it must have seemed abandoned. Big Grin
Pages: 1 2