Advertisement:

Author Topic: Different board Icons  (Read 197883 times)

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,142
  • Gender: Male
Re: Different board Icons
« Reply #60 on: February 23, 2005, 03:16:21 PM »
IMHO, using a simple dash between them would work out fine... on12.gif, , on12-2.gif.

-[Unknown]

Offline Mike Bobbitt

  • Full Member
  • ***
  • Posts: 566
    • Army.ca
Re: Different board Icons
« Reply #61 on: February 23, 2005, 03:33:53 PM »
True, and very easy to do. :)

Code: [Select]
// This board doesn't have new posts, but its children do.
   elseif ($board['children_new'])
   echo '<img src="', $settings['images_url'], '/on', $board['id'], '-2.gif" alt="', $txt[333], '" title="', $txt[333], '" border="0" />';

Online The Burglar!

  • Native Language Support Specialist
  • SMF Hero
  • *
  • Posts: 6,457
  • Gender: Male
    • https://www.facebook.com/hermans.mixen on Facebook
    • Mashups & Mixen
Re: Different board Icons
« Reply #62 on: August 10, 2005, 07:20:55 PM »
ehm.. i have the board id's on my forums/boards but what if i have more than one subboard so i case

i have named a board called windows

which has sub-boards

-windows 95
-windows 98
-windows ME
-Windows XP
--windows XP Home
--Windows XP Pro
-Windows NT
--Windows NT WKS
--Windows NT SRV
-Windows 2000
--Windows 2000 Pro
--Windows 2000 Server
--Windows 2000 Advanced Server

How it's set up then
for the main board i got now this

board id

on_xx.gif
off_xx.gif

for the first sub board on2_xx.gif

!? ;)

how should i declare that in order to work nicely

so when one post is posted in win95 so the board logo should give me a windows logo within a text as 95 is on the main board but actually it's a sub-board posting...
and so on for each sub board  ???

so look at this URL
« Last Edit: August 10, 2005, 07:29:14 PM by The Burglar! »
Met vriendelijke groet, The Burglar!

Mashups & Mixen | NL pakket parser

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,142
  • Gender: Male
Re: Different board Icons
« Reply #63 on: August 10, 2005, 11:28:23 PM »
I'm afraid you don't know, in that template, which child board it is.

-[Unknown]

Offline Elmacik

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,251
  • Gender: Male
  • = Human Draft =
    • IT Store
Re: Different board Icons
« Reply #64 on: September 02, 2005, 09:24:36 AM »
i read all the discussion here, but i think there are something new in 1.1 beta 3 as i couldnt make it.
anyone to do this for 1.1 beta 3  ?
Home of Elmacik

Online Kindred

  • Support Specialist
  • SMF Master
  • *
  • Posts: 31,375
  • Gender: Male
    • wagner999 on Facebook
    • @Kindred_999 on Twitter
Re: Different board Icons
« Reply #65 on: September 06, 2005, 03:14:55 PM »
Code: [Select]
it works fine in SMF 1.1 beta 3 and beta 4...

this code is in BoardIndex.template.php
[code]
// If the board is new, show a strong indicator.
if ($board['new'])
echo '<img src="', $settings['images_url'], '/on.gif" alt="', $txt[333], '" title="', $txt[333], '" border="0" />';
// This board doesn't have new posts, but its children do.
elseif ($board['children_new'])
echo '<img src="', $settings['images_url'], '/on2.gif" alt="', $txt[333], '" title="', $txt[333], '" border="0" />';
// No new posts at all!  The agony!!
else
echo '<img src="', $settings['images_url'], '/off.gif" alt="', $txt[334], '" title="', $txt[334], '" border="0" />';

replace it with this code:
            // If the board is new, show a strong indicator.
            if ($board['new'])
               echo '<img src="', $settings['images_url'], '/on_' . $board['id'] . '.gif" alt="', $txt[333], '" title="', $txt[333], '" border="0" />';
            // This board doesn't have new posts, but its children do.
            elseif ($board['children_new'])
               echo '<img src="', $settings['images_url'], '/on2_' . $board['id'] . '.gif" alt="', $txt[333], '" title="', $txt[333], '" border="0" />';
            // No new posts at all!  The agony!!
            else
               echo '<img src="', $settings['images_url'], '/off_' . $board['id'] . '.gif" alt="', $txt[334], '" title="', $txt[334], '" border="0" />';
[/code]






!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Now, a question for [unknown] or other power php coders...

Is there a way to determine if a file exists... and if not, default to the un-numbered icons?
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support forums.  Thank you.

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,142
  • Gender: Male
Re: Different board Icons
« Reply #66 on: September 06, 2005, 03:34:02 PM »
Yeah, using file_exists($settings['theme_dir'] . '/images/...gif').

-[Unknown]

Online Kindred

  • Support Specialist
  • SMF Master
  • *
  • Posts: 31,375
  • Gender: Male
    • wagner999 on Facebook
    • @Kindred_999 on Twitter
Re: Different board Icons
« Reply #67 on: September 06, 2005, 03:42:08 PM »
so, in theory...  this should work... right?

(just a sanity check...)
Code: [Select]
// individual board icons!
if (file_exists($settings['theme_dir'] . '/images/on_' . $board['id'] . '.gif'))
$board_new_img=$settings['images_url'], '/on_' . $board['id'] . '.gif';
if (file_exists($settings['theme_dir'] . '/images/on2_' . $board['id'] . '.gif'))
$childboard_new_img=$settings['images_url'], '/on2_' . $board['id'] . '.gif';
if (file_exists($settings['theme_dir'] . '/images/off_' . $board['id'] . '.gif'))
$board_nonew_img=$settings['images_url'], '/off_' . $board['id'] . '.gif';

// If the board is new, show a strong indicator.
if ($board['new'])
echo '<img src="',$board_new_img,'" alt="', $txt[333], '" title="', $txt[333], '" border="0" />';
// This board doesn't have new posts, but its children do.
elseif ($board['children_new'])
echo '<img src="',$childboard_new_img,'" alt="', $txt[333], '" title="', $txt[333], '" border="0" />';
// No new posts at all!  The agony!!
else
echo '<img src="',$board_nonew_img,'" alt="', $txt[334], '" title="', $txt[334], '" border="0" />';
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support forums.  Thank you.

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,142
  • Gender: Male
Re: Different board Icons
« Reply #68 on: September 06, 2005, 03:43:21 PM »
The theory is right, but that code won't work, because you don't assign $board_new_img except when the file does exist (so it will be undefined/whatever it was before otherwise.)

-[Unknown]

Online Kindred

  • Support Specialist
  • SMF Master
  • *
  • Posts: 31,375
  • Gender: Male
    • wagner999 on Facebook
    • @Kindred_999 on Twitter
Re: Different board Icons
« Reply #69 on: September 06, 2005, 03:46:20 PM »
WHOOPS!    forgot the ELSE!

thanks for the quick check...

Code: [Select]
// individual board icons!
if (file_exists($settings['theme_dir'] . '/images/on_' . $board['id'] . '.gif'))
$board_new_img=$settings['images_url'], '/on_' . $board['id'] . '.gif';
else
$board_new_img=$settings['images_url'], '/on.gif';
if (file_exists($settings['theme_dir'] . '/images/on2_' . $board['id'] . '.gif'))
$childboard_new_img=$settings['images_url'], '/on2_' . $board['id'] . '.gif';
else
$childboard_new_img=$settings['images_url'], '/on2.gif';
if (file_exists($settings['theme_dir'] . '/images/off_' . $board['id'] . '.gif'))
$board_nonew_img=$settings['images_url'], '/off_' . $board['id'] . '.gif';
else
$board_nonew_img=$settings['images_url'], '/off.gif';

// If the board is new, show a strong indicator.
if ($board['new'])
echo '<img src="',$board_new_img,'" alt="', $txt[333], '" title="', $txt[333], '" border="0" />';
// This board doesn't have new posts, but its children do.
elseif ($board['children_new'])
echo '<img src="',$childboard_new_img,'" alt="', $txt[333], '" title="', $txt[333], '" border="0" />';
// No new posts at all!  The agony!!
else
echo '<img src="',$board_nonew_img,'" alt="', $txt[334], '" title="', $txt[334], '" border="0" />';
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support forums.  Thank you.

Offline Dinagyang

  • Semi-Newbie
  • *
  • Posts: 49
Re: Different board Icons
« Reply #70 on: October 21, 2005, 12:14:22 AM »
Ok

This is what I have

Code: [Select]
// If the board is new, show a strong indicator.
                                if ($board['new'])
                                        echo '<img src="', $settings['images_url'], '/edu/on', $board['id'], '.gif" alt="', $txt[333], '" title="', $txt[333], '" border="0" />';
                                // This board doesn't have new posts, but its children do.
                                elseif ($board['children_new'])
                                        echo '<img src="', $settings['images_url'], '/edu/on2', $board['id'], '.gif" alt="', $txt[333], '" title="', $txt[333], '" border="0" />';
                                // No new posts at all!  The agony!!
                                else
                                        echo '<img src="', $settings['images_url'], '/edu/off', $board['id'], '.gif" alt="', $txt[334], '" title="', $txt[334], '" border="0" />';

                                echo '</td>

It works great, however, I only need to have this on 5 boards under category 'colleges & universities' and I have 30 other boards. How do I avoid creating duplicate images for the other boards that require no special image icon?

Offline dbachen

  • Newbie
  • *
  • Posts: 2
Re: Different board Icons
« Reply #71 on: November 06, 2005, 12:13:52 PM »
WHOOPS!    forgot the ELSE!

thanks for the quick check...

Code: [Select]
// individual board icons!
if (file_exists($settings['theme_dir'] . '/images/on_' . $board['id'] . '.gif'))
$board_new_img=$settings['images_url'], '/on_' . $board['id'] . '.gif';
else
$board_new_img=$settings['images_url'], '/on.gif';
if (file_exists($settings['theme_dir'] . '/images/on2_' . $board['id'] . '.gif'))
$childboard_new_img=$settings['images_url'], '/on2_' . $board['id'] . '.gif';
else
$childboard_new_img=$settings['images_url'], '/on2.gif';
if (file_exists($settings['theme_dir'] . '/images/off_' . $board['id'] . '.gif'))
$board_nonew_img=$settings['images_url'], '/off_' . $board['id'] . '.gif';
else
$board_nonew_img=$settings['images_url'], '/off.gif';

// If the board is new, show a strong indicator.
if ($board['new'])
echo '<img src="',$board_new_img,'" alt="', $txt[333], '" title="', $txt[333], '" border="0" />';
// This board doesn't have new posts, but its children do.
elseif ($board['children_new'])
echo '<img src="',$childboard_new_img,'" alt="', $txt[333], '" title="', $txt[333], '" border="0" />';
// No new posts at all!  The agony!!
else
echo '<img src="',$board_nonew_img,'" alt="', $txt[334], '" title="', $txt[334], '" border="0" />';

Actually, you've got a bug in there as you're concatenating the code with a , instead of a .

Here's the entire block, with that fixed.
Code: [Select]
// Individual board icons. If a custom image exists, use it. Otherwise use the default image.
if (file_exists($settings['theme_dir'] . '/images/on_' . $board['id'] . '.gif'))
$board_new_img=$settings['images_url']. '/on_' . $board['id'] . '.gif';
else
$board_new_img=$settings['images_url']. '/on.gif';

if (file_exists($settings['theme_dir'] . '/images/on2_' . $board['id'] . '.gif'))
$childboard_new_img=$settings['images_url']. '/on2_' . $board['id'] . '.gif';
else
$childboard_new_img=$settings['images_url']. '/on2.gif';

if (file_exists($settings['theme_dir'] . '/images/off_' . $board['id'] . '.gif'))
$board_nonew_img=$settings['images_url']. '/off_' . $board['id'] . '.gif';
else
$board_nonew_img=$settings['images_url']. '/off.gif';


               // If the board is new, show a strong indicator.
                if ($board['new'])
echo '<img src="', $board_new_img,'" alt="', $txt[333], '" title="', $txt[333], '" border="0" />';

                // This board doesn't have new posts, but its children do.
                elseif ($board['children_new'])
echo '<img src="', $childboard_new_img,'" alt="', $txt[333], '" title="', $txt[333], '" border="0" />';
                    // No new posts at all!  The agony!!
                    else
echo '<img src="', $board_nonew_img,'" alt="', $txt[334], '" title="', $txt[334], '" border="0" />';

Offline Elmacik

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,251
  • Gender: Male
  • = Human Draft =
    • IT Store
Re: Different board Icons
« Reply #72 on: November 06, 2005, 01:17:13 PM »
In your opinion what happens if a comma used instead of a dot ?
Home of Elmacik

Offline dbachen

  • Newbie
  • *
  • Posts: 2
Re: Different board Icons
« Reply #73 on: November 07, 2005, 09:54:47 AM »
In your opinion what happens if a comma used instead of a dot ?

You get a parsing error.

Offline Elmacik

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,251
  • Gender: Male
  • = Human Draft =
    • IT Store
Re: Different board Icons
« Reply #74 on: November 07, 2005, 10:22:01 AM »
I and others dont
Home of Elmacik

Offline Pod

  • Semi-Newbie
  • *
  • Posts: 91
  • Gender: Male
Re: Different board Icons
« Reply #75 on: February 23, 2006, 07:16:29 PM »
simple question
is it possible for any 1 to show me how this is done?




where it has the custom icon, but still, beside the custom icon it has rather there's new post and if theres no new post?
Things change if you change them, thing about it

Offline Pod

  • Semi-Newbie
  • *
  • Posts: 91
  • Gender: Male
Re: Different board Icons
« Reply #76 on: February 26, 2006, 11:39:35 AM »
thanks for a week long no help.
it worked. thanks again  8)
Things change if you change them, thing about it

Offline Vinspire

  • Sr. Member
  • ****
  • Posts: 853
  • Gender: Male
    • The Box Of Heart Forum
Re: Different board Icons
« Reply #77 on: May 10, 2006, 05:24:02 AM »
Any sample of those who manage to get it working ? :)

Offline Vinspire

  • Sr. Member
  • ****
  • Posts: 853
  • Gender: Male
    • The Box Of Heart Forum
Re: Different board Icons
« Reply #78 on: May 11, 2006, 02:05:08 AM »
Any idea of where i could find a nice icons online ?

Offline JayBachatero

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,630
  • Gender: Male
    • @jaycreations on Twitter
    • JayBachatero.com
Re: Different board Icons
« Reply #79 on: May 12, 2006, 03:54:51 PM »
Depending on what type of icons you are looking for you can find a few online in deviantart.com and in many KDE Gnome related website.  kde-look.org and gnome-look.org
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert