News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

cbi v0.5 (Custom Board Icons)

Started by Bigguy, November 11, 2006, 11:59:46 AM

Previous topic - Next topic

Yahmez

I got this working on 2.0 RC2     Sort of....

It is a stripped down version that does not default back to the standard board icons if new ones are not present. But if you have all your board icons set up they should work.

This should get us by until Bigguy gets the chance to update for 2.0 RC2

BoardIndex.template.php
Find:


                // If the board or children is new, show an indicator.
                if ($board['new'] || $board['children_new'])
                    echo '
                            <img src="', $settings['images_url'],'/', $context['theme_variant'], '/on', $board['new'] ? '' : '2', '.png"alt="', $txt['new_posts'], '" title="', $txt['new_posts'], '" />';
                // Is it a redirection board?
                elseif ($board['is_redirect'])
                    echo '
                            <img src="', $settings['images_url'],'/', $context['theme_variant'], '/redirect.png" alt="*" title="*"/>';
                // No new posts at all! The agony!!
                else
                    echo '
                            <img src="', $settings['images_url'],'/', $context['theme_variant'], '/off.png" alt="', $txt['old_posts'],'" title="', $txt['old_posts'], '" />';

                echo '
                        </a>
                    </td>
                    <td class="info">
                        <a class="subject" href="', $board['href'],'" name="b', $board['id'], '">', $board['name'], '</a>';


Replace With:

                // If the board or children is new, show an indicator.
                if ($board['new'] || $board['children_new'])
                    echo '
                            <img src="', $settings['images_url'], '/', $context['theme_variant'], '/icons/', $board['id'], '/on', $board['new'] ? '' : '2', '.png" alt="', $txt['new_posts'], '" title="', $txt['new_posts'], '" />';
                // Is it a redirection board?
                elseif ($board['is_redirect'])
                    echo '
                            <img src="', $settings['images_url'], '/', $context['theme_variant'], '/redirect.png" alt="*" title="*" />';
                // No new posts at all! The agony!!
                else
                    echo '
                            <img src="', $settings['images_url'], '/', $context['theme_variant'],  '/icons/', $board['id'], '/off.png" alt="', $txt['old_posts'], '" title="', $txt['old_posts'], '" />';

                echo '
                        </a>
                    </td>
                    <td class="info">
                        <a class="subject" href="', $board['href'], '" name="b', $board['id'], '">', $board['name'], '</a>';



MessageIndex.template.php
Find:


            // If the board or children is new, show an indicator.
            if ($board['new'] || $board['children_new'])
                echo '
                        <img src="', $settings['images_url'], '/' .$context['theme_variant'], '/on', $board['new'] ? '' : '2', '.png" alt="', $txt['new_posts'], '" title="', $txt['new_posts'], '" border="0" />';
            // Is it a redirection board?
            elseif ($board['is_redirect'])
                echo '
                        <img src="', $settings['images_url'], '/' .$context['theme_variant'], '/redirect.png" alt="*" title="*" border="0" />';
            // No new posts at all! The agony!!
            else
                echo '
                        <img src="', $settings['images_url'], '/' .$context['theme_variant'], '/off.png" alt="', $txt['old_posts'], '" title="', $txt['old_posts'], '" />';

            echo '
                    </a>
                </td>
                <td class="info">
                    <a class="subject" href="', $board['href'], '" name="b', $board['id'], '">', $board['name'], '</a>';


Replace With:

                // If the board or children is new, show an indicator.
                if ($board['new'] || $board['children_new'])
                    echo '
                            <img src="', $settings['images_url'], '/', $context['theme_variant'], '/icons/', $board['id'], '/on', $board['new'] ? '' : '2', '.png" alt="', $txt['new_posts'], '" title="', $txt['new_posts'], '" />';
                // Is it a redirection board?
                elseif ($board['is_redirect'])
                    echo '
                            <img src="', $settings['images_url'], '/', $context['theme_variant'], '/redirect.png" alt="*" title="*" />';
                // No new posts at all! The agony!!
                else
                    echo '
                            <img src="', $settings['images_url'], '/', $context['theme_variant'],  '/icons/', $board['id'], '/off.png" alt="', $txt['old_posts'], '" title="', $txt['old_posts'], '" />';

                echo '
                        </a>
                    </td>
                    <td class="info">
                        <a class="subject" href="', $board['href'], '" name="b', $board['id'], '">', $board['name'], '</a>';

MarcusJ

I just came back to SMF after a couple months on a sub par forum.  It feels great to be back.

This mod was one of my favorite.  Is there any word on a version for RC2?

Bigguy

Thanks for posting that Yahmez. I have not had a chance to do much with this mod recently. I will see what I can come up with in the next little while. (week or so.) That is all I can promise right now.

Yahmez

Quote from: Bigguy on November 12, 2009, 08:07:26 PM
Thanks for posting that Yahmez. I have not had a chance to do much with this mod recently. I will see what I can come up with in the next little while. (week or so.) That is all I can promise right now.
No problem Bigguy! I ♥ CBI!
And I want to upgrade soon, with so many mods installed I have to start on my own. Thank you for the great mods and support!

Neverhurry

Oh, i need this mod RC2 version! thanks!
I am using SMF 2.0.1, curve themes.

YogiBear

This mod is just what I'm looking for but can I use it as a Site Admin ie. with no access to cpanel?

Now it's using the .png extension I'm wondering if I can host the image as for any other photo then insert the code with the img tags.

What I'm planning to do is use the same image in all boards.
SMF v2.1.3  Mods : Snow & Garland v1.4,  PHP  v.7.4.33

Kindred

Yogi,

In order to use this, you would need to have either cpanel or ftp access to the site.
There is no admin interface...     Since there is no admin interface, there is nowhere for you to add the filename....    the filenames and locations are hardcoded to be the THEME/Images/boardID/on.png, off.png and on2.png

If you want to use the same image for all boards, then there i no need for this mod... just replace the theme's default copies of on.gif, on2.gif and off.gif.

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

YogiBear

SMF v2.1.3  Mods : Snow & Garland v1.4,  PHP  v.7.4.33

Manu.G

Quote from: ҰΛĥmΞڃ on November 09, 2009, 06:52:10 PM
I got this working on 2.0 RC2     Sort of....

It is a stripped down version that does not default back to the standard board icons if new ones are not present. But if you have all your board icons set up they should work.

This should get us by until Bigguy gets the chance to update for 2.0 RC2

BoardIndex.template.php
Find:


                // If the board or children is new, show an indicator.
                if ($board['new'] || $board['children_new'])
                    echo '
                            <img src="', $settings['images_url'],'/', $context['theme_variant'], '/on', $board['new'] ? '' : '2', '.png"alt="', $txt['new_posts'], '" title="', $txt['new_posts'], '" />';
                // Is it a redirection board?
                elseif ($board['is_redirect'])
                    echo '
                            <img src="', $settings['images_url'],'/', $context['theme_variant'], '/redirect.png" alt="*" title="*"/>';
                // No new posts at all! The agony!!
                else
                    echo '
                            <img src="', $settings['images_url'],'/', $context['theme_variant'], '/off.png" alt="', $txt['old_posts'],'" title="', $txt['old_posts'], '" />';

                echo '
                        </a>
                    </td>
                    <td class="info">
                        <a class="subject" href="', $board['href'],'" name="b', $board['id'], '">', $board['name'], '</a>';


Replace With:

                // If the board or children is new, show an indicator.
                if ($board['new'] || $board['children_new'])
                    echo '
                            <img src="', $settings['images_url'], '/', $context['theme_variant'], '/icons/', $board['id'], '/on', $board['new'] ? '' : '2', '.png" alt="', $txt['new_posts'], '" title="', $txt['new_posts'], '" />';
                // Is it a redirection board?
                elseif ($board['is_redirect'])
                    echo '
                            <img src="', $settings['images_url'], '/', $context['theme_variant'], '/redirect.png" alt="*" title="*" />';
                // No new posts at all! The agony!!
                else
                    echo '
                            <img src="', $settings['images_url'], '/', $context['theme_variant'],  '/icons/', $board['id'], '/off.png" alt="', $txt['old_posts'], '" title="', $txt['old_posts'], '" />';

                echo '
                        </a>
                    </td>
                    <td class="info">
                        <a class="subject" href="', $board['href'], '" name="b', $board['id'], '">', $board['name'], '</a>';



MessageIndex.template.php
Find:


            // If the board or children is new, show an indicator.
            if ($board['new'] || $board['children_new'])
                echo '
                        <img src="', $settings['images_url'], '/' .$context['theme_variant'], '/on', $board['new'] ? '' : '2', '.png" alt="', $txt['new_posts'], '" title="', $txt['new_posts'], '" border="0" />';
            // Is it a redirection board?
            elseif ($board['is_redirect'])
                echo '
                        <img src="', $settings['images_url'], '/' .$context['theme_variant'], '/redirect.png" alt="*" title="*" border="0" />';
            // No new posts at all! The agony!!
            else
                echo '
                        <img src="', $settings['images_url'], '/' .$context['theme_variant'], '/off.png" alt="', $txt['old_posts'], '" title="', $txt['old_posts'], '" />';

            echo '
                    </a>
                </td>
                <td class="info">
                    <a class="subject" href="', $board['href'], '" name="b', $board['id'], '">', $board['name'], '</a>';


Replace With:

                // If the board or children is new, show an indicator.
                if ($board['new'] || $board['children_new'])
                    echo '
                            <img src="', $settings['images_url'], '/', $context['theme_variant'], '/icons/', $board['id'], '/on', $board['new'] ? '' : '2', '.png" alt="', $txt['new_posts'], '" title="', $txt['new_posts'], '" />';
                // Is it a redirection board?
                elseif ($board['is_redirect'])
                    echo '
                            <img src="', $settings['images_url'], '/', $context['theme_variant'], '/redirect.png" alt="*" title="*" />';
                // No new posts at all! The agony!!
                else
                    echo '
                            <img src="', $settings['images_url'], '/', $context['theme_variant'],  '/icons/', $board['id'], '/off.png" alt="', $txt['old_posts'], '" title="', $txt['old_posts'], '" />';

                echo '
                        </a>
                    </td>
                    <td class="info">
                        <a class="subject" href="', $board['href'], '" name="b', $board['id'], '">', $board['name'], '</a>';


Thx for the code, but when I insert the code, I have to move the icons to /Themes/default/images/icons
or the icons aren't to see.  :-[
Version SMF 2.0.8
SimplePortal 2.3.5

Yahmez

Quote from: Manu0372 on November 22, 2009, 11:57:14 AM
Thx for the code, but when I insert the code, I have to move the icons to /Themes/default/images/icons
or the icons aren't to see.  :-[

That should be the correct location. The version I provided does not default back to the original icons if no new ones are found. So after installing, if you do not have the icons in place you will see the 'alternate text' instead of an icon.

MarcusJ

This is one of my favorite modifications for SMF.  Is there any word on a version for the latest release of SMF 2?

MATTEK

This would definitely be something my members would like to see.
SMF 2.0.1

Like Comics, Books, Movies or T.V. Shows? Read about them here!!

Bigguy

I found a version on my site that was made for SMF 2.0 but it might need some updates.

nassatellite

Do these modifications warn curve (new default) theme?

Bigguy

I have tested it once on curve and will have to do a bit of updating.

Xarcell

can't wait for the update on 2.0 rc2! Sweet mod...

MarcusJ


Bigguy

Sorry all been working on getting a new site up and running. I will be looking at this mod later today and/or tonight if I have the time to and update it then if I can. I will test it on a live site first I guess before anything happens.

Bigguy

Ok, a new version has been uploaded to the mod site. it has been updated to work with SMF 2.0 RC2. I tested it and all should work fine. READ THE README FOR INSTRUCTIONS ON WHERE TO PUT THE ICONS FOLDER.

MarcusJ

Thanks Bigguy,

I have a question.  I've tried to install the mod and I get an error on the modifications to BoardIndex.template.php.  As far as I can tell I haven't used any mods which effect this. 

SMF 2.0 RC2

1.     Custom Form Mod      1.6
2.    Pretty URLs    1.0RC
3.    SimplePortal    2.3.1
4.    Downloads System Pro    1.0.10
5.    Aeva ~ Auto-Embed Video & Audio    7.0
6.    SMF Media Gallery    2.0.5

I know how to install a mod manually, but I'm curious if something is wrong with the package or with my install of SMF.  It's a relatively new install, just a few weeks old.  I've attached my BoardIndex.template.php so you can see it.

Thanks for any feedback you can provide.

Advertisement: