News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Different board Icons

Started by memo, March 15, 2004, 08:29:55 AM

Previous topic - Next topic

Assistance

I dont see how I could possible have a board title that long to have it effect it
I would just type that in the board description


with your tip Rose, I actually didnt add images (yet) but I realized I can you html
so currently I have the center tag on them

now I sleep

(thanks again)
~playing poker~

RebelRose

Your very welcome, glad to help

karimali831

Thanks kindred, I replaced the whole code as you said in the boardindex.template.php and replace it on the server. But I still don't understand what else I have to change round...

www.forums.ds-clan.net

thanks
Karim

karimali831

oo I am editing Themes/default/BoardIndex.template.php is that right? From that replacment code you sent this is the changes I made:

   // Individual board icons. If a custom image exists, use it. Otherwise use the default image.
               if (file_exists($settings['theme_dir'] . '/images/on_' . $board['1.0'] . 'on2.gif')) --HERE-- And the icon stays the same :(
                  $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" />';

karimali831

...  :'( ... Remember I using the enterprise theme not the default.

Kindred

well, obviously, if you are using a different theme, you will need to replace the code in the boardindex.template.php of the theme you are using.

Yes...   my code shows the DEFAULT icons if no special icon is present.

if (file_exists($settings['theme_dir'] . '/images/on_' . $board['1.0'] . 'on2.gif'))

See?  IF the FILE EXISTS, use it....

special icons need to be named on_##.gif, off_##.gif and on2_##.gif, where the ## is the actual number of the board you want the icon for and they need to be uploaded to your theme directory/images
Сл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."

choloman05

Alright Kindred, I'm kind of understanding this now, But I have 17 boards and would want 17 distinct icons. Where in the code do I put in the file name of 17 different icons and make sure they display on the right board? Thanks.

Kindred

Didn't you read any of this thread?!?!?!

You do not have to put ANY specific names in the code. That is the whole point of this code snippet.

Install this code snippet.
Use the correct file names.
it will work if you have 17 or 1700 boards...
Сл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."

choloman05

#108
Haha, alright sorry. I did read it, but I guess I'm lacking faith here and just need to go ahead and try it out before trying to understand it. Thanks for the quick reply!

EDIT:  I tried it but no images are showing up. I named them "on1.gif", "on21.gif", and "off1.gif" as suggested earlier. Am I naming them wrong? Should they be "on_1.0.gif", "on2_1.0.gif", and "off_1.0.gif" for Board 1.0 ? or does it not matter?

-ps. I'm running Dilber MC theme on 1.1RC2, if that matters.

Kindred

1- yes, the code that I quoted requires the underscores (hence the reason I said, in every post, use on_##.gif etc...)

2- yes, other themes may require you to modify that specific theme's boardindex.template.php (if present)
Сл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."

choloman05

 Thanks, but I'm still left with 2 questions:

1. in renaming the image files, does it matter if they're labeled "1" or "1.0" for Board#1 ?

2. I added your code in my boardindex.template of the modified theme I'm using (Dilber MC), Is there other modifications that I need to do to that template besides the code you've listed here?

Thanks again.

Kindred

1. the file should be named on_1.gif
2. no, that code should be all you need.
Сл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."

choloman05

  Still not working. I don't know what's wrong.  In the box where my new image should be, all I have is a little white box with a red "x" and "No new posts" in text.  :-\

Rudolf

Place the icons in the images folder of the Dilber theme.
I will update all my mods in the next few weeks. Thanks for your patience.

SVG-Collapse (you need an SVG compliant browser)

choloman05

 haha! Thank you! That did the trick. I appreciate it very much :D

VegasBoxers

Quote from: [Unknown] on January 20, 2005, 01:38:31 AM

The first one ($board['id']) was correct.  You just have to create files in the images directory:

on##.gif
on2##.gif
off##.gif

Where ## is the id; for example, 13.

-[Unknown]

I understand how to perform this mod, but I do have 1 question. 

Why is it that we need to have 3 images for each board? 

I understand that one is displayed when there is new material, and another displays when there is nothing new.  When does the third image display?

Thanks!
VB

Bigguy

It gets displayed if there is a new post in a child board.

VegasBoxers

Thanks Big Guy!

Can't that just be the same as if there is a new message in THAT board?

I'm working on creating new icons.  An "on" icon and an "off" icon for each board.  Can't the third one just be the "on" icon but saved as a different filename?

Is there any benefit to having a 3rd different icon?  Or is it just personal preference?

Thanks!
VB

Bigguy

You could make on.gif and on2.gif the same image, that would do that. and there is code around for adding different icons to different boards like this here

VegasBoxers

yeah, that coding is located earlier in this thread.  But is there any benefit to having a 3rd icon for the parent board?

Thanks!
VB

Advertisement: