News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

cbi v0.5 (Custom Board Icons)

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

Previous topic - Next topic

symon


taejien

Which version are you using? the older or the newer one?

I tried installing it, everything went without a hitch, but the pictures didn't show.

So my files look like..

forum/Themes/mytheme/icons/5/on.gif
forum/Themes/mytheme/icons/5/on2.gif
forum/Themes/mytheme/icons/5/off.gif

Yet, it didn't show up.

symon

Did you replace the code in your theme files?

I did them manually (very easy) in Babylon as well as the default:

BoardIndex.template.php
MessageIndex.template.php

Two simple chunks of replacement code :)

taejien

Quote from: symon on April 17, 2007, 06:59:35 AM
Did you replace the code in your theme files?

I did them manually (very easy) in Babylon as well as the default:

BoardIndex.template.php
MessageIndex.template.php

Two simple chunks of replacement code :)

Which code do I replace in there?

Bigguy

In cbi 1 in your BoardIndex.template.php file You would find this:

// 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], '" />';
// 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], '" />';
// No new posts at all! The agony!!
else
echo '<img src="', $settings['images_url'], '/off.gif" alt="', $txt[334], '" title="', $txt[334], '" />';


And replace it with this:

if ($board['new']) {
if (file_exists($settings['theme_dir'] . '/icons/' . $board['id'] . '/on.gif'))
$board_new_img=$settings['theme_url']. '/icons/' . $board['id'] . '/on.gif';
else
$board_new_img=$settings['images_url']. '/on.gif';

echo '<img src="', $board_new_img,'" alt="', $txt[333], '" title="', $txt[333], '" border="0" />';
} elseif ($board['children_new']) {
if (file_exists($settings['theme_dir'] . '/icons/' . $board['id'] . '/on2.gif'))
$childboard_new_img=$settings['theme_url']. '/icons/' . $board['id'] . '/on2.gif';
else
$childboard_new_img=$settings['images_url']. '/on2.gif';

echo '<img src="', $childboard_new_img,'" alt="', $txt[333], '" title="', $txt[333], '" border="0" />';
} else {
if (file_exists($settings['theme_dir'] . '/icons/' . $board['id'] . '/off.gif'))
$board_nonew_img=$settings['theme_url']. '/icons/' . $board['id'] . '/off.gif';
else
$board_nonew_img=$settings['images_url']. '/off.gif';

echo '<img src="', $board_nonew_img,'" alt="', $txt[334], '" title="', $txt[334], '" border="0" />';
}


Then in the MessageIndex.template.php file you would find this:

// 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], '" />';
// 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], '" />';
// No new posts at all! The agony!!
else
echo '<img src="', $settings['images_url'], '/off.gif" alt="', $txt[334], '" title="', $txt[334], '" />';


And replace it with this:

if ($board['new']) {
if (file_exists($settings['theme_dir'] . '/icons/' . $board['id'] . '/on.gif'))
$board_new_img=$settings['theme_url']. '/icons/' . $board['id'] . '/on.gif';
else
$board_new_img=$settings['images_url']. '/on.gif';

echo '<img src="', $board_new_img,'" alt="', $txt[333], '" title="', $txt[333], '" border="0" />';
} elseif ($board['children_new']) {
if (file_exists($settings['theme_dir'] . '/icons/' . $board['id'] . '/on2.gif'))
$childboard_new_img=$settings['theme_url']. '/icons/' . $board['id'] . '/on2.gif';
else
$childboard_new_img=$settings['images_url']. '/on2.gif';

echo '<img src="', $childboard_new_img,'" alt="', $txt[333], '" title="', $txt[333], '" border="0" />';
} else {
if (file_exists($settings['theme_dir'] . '/icons/' . $board['id'] . '/off.gif'))
$board_nonew_img=$settings['theme_url']. '/icons/' . $board['id'] . '/off.gif';
else
$board_nonew_img=$settings['images_url']. '/off.gif';

echo '<img src="', $board_nonew_img,'" alt="', $txt[334], '" title="', $txt[334], '" border="0" />';
}


Save both files and upload them to your themes folder and you should be good to go.

taejien

Quote from: Bigguy on April 18, 2007, 12:01:42 AM
In cbi 1 in your BoardIndex.template.php file You would find this:

// 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], '" />';
// 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], '" />';
// No new posts at all! The agony!!
else
echo '<img src="', $settings['images_url'], '/off.gif" alt="', $txt[334], '" title="', $txt[334], '" />';


And replace it with this:

if ($board['new']) {
if (file_exists($settings['theme_dir'] . '/icons/' . $board['id'] . '/on.gif'))
$board_new_img=$settings['theme_url']. '/icons/' . $board['id'] . '/on.gif';
else
$board_new_img=$settings['images_url']. '/on.gif';

echo '<img src="', $board_new_img,'" alt="', $txt[333], '" title="', $txt[333], '" border="0" />';
} elseif ($board['children_new']) {
if (file_exists($settings['theme_dir'] . '/icons/' . $board['id'] . '/on2.gif'))
$childboard_new_img=$settings['theme_url']. '/icons/' . $board['id'] . '/on2.gif';
else
$childboard_new_img=$settings['images_url']. '/on2.gif';

echo '<img src="', $childboard_new_img,'" alt="', $txt[333], '" title="', $txt[333], '" border="0" />';
} else {
if (file_exists($settings['theme_dir'] . '/icons/' . $board['id'] . '/off.gif'))
$board_nonew_img=$settings['theme_url']. '/icons/' . $board['id'] . '/off.gif';
else
$board_nonew_img=$settings['images_url']. '/off.gif';

echo '<img src="', $board_nonew_img,'" alt="', $txt[334], '" title="', $txt[334], '" border="0" />';
}


Then in the MessageIndex.template.php file you would find this:

// 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], '" />';
// 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], '" />';
// No new posts at all! The agony!!
else
echo '<img src="', $settings['images_url'], '/off.gif" alt="', $txt[334], '" title="', $txt[334], '" />';


And replace it with this:

if ($board['new']) {
if (file_exists($settings['theme_dir'] . '/icons/' . $board['id'] . '/on.gif'))
$board_new_img=$settings['theme_url']. '/icons/' . $board['id'] . '/on.gif';
else
$board_new_img=$settings['images_url']. '/on.gif';

echo '<img src="', $board_new_img,'" alt="', $txt[333], '" title="', $txt[333], '" border="0" />';
} elseif ($board['children_new']) {
if (file_exists($settings['theme_dir'] . '/icons/' . $board['id'] . '/on2.gif'))
$childboard_new_img=$settings['theme_url']. '/icons/' . $board['id'] . '/on2.gif';
else
$childboard_new_img=$settings['images_url']. '/on2.gif';

echo '<img src="', $childboard_new_img,'" alt="', $txt[333], '" title="', $txt[333], '" border="0" />';
} else {
if (file_exists($settings['theme_dir'] . '/icons/' . $board['id'] . '/off.gif'))
$board_nonew_img=$settings['theme_url']. '/icons/' . $board['id'] . '/off.gif';
else
$board_nonew_img=$settings['images_url']. '/off.gif';

echo '<img src="', $board_nonew_img,'" alt="', $txt[334], '" title="', $txt[334], '" border="0" />';
}


Save both files and upload them to your themes folder and you should be good to go.

Thankyou. I finally got it working.

Bigguy


- danny

I can't get this to work on SMF 1.1.2/TP v0.9.8 using the Dilber Multicolor theme.

Can you help? I've got the icon folders already done (it worked fine on Default theme).

Bigguy

Have you done all the necessary edits to the BoardIndex.template.php and the MessageIndex.template.php of that theme. ???

The edits for these two files are just above you:

http://www.simplemachines.org/community/index.php?topic=126263.msg1058102#msg1058102

- danny

Quote from: Bigguy on April 20, 2007, 12:45:32 AM
Have you done all the necessary edits to the BoardIndex.template.php and the MessageIndex.template.php of that theme. ???

The edits for these two files are just above you:

http://www.simplemachines.org/community/index.php?topic=126263.msg1058102#msg1058102

Dude! I have no clue how I missed that, but you kick ass!  :D

watt

Thank very much...Bigguy  for cool mod.

masesto

What is wrong in this error, please help me. thx


Parse error: syntax error, unexpected T_ELSEIF in .../Themes/dilbermc/MessageIndex.template.php on line 49
40:             <td class="windowbg" width="51" align="center" valign="middle"><a href="', $scripturl, '?action=unread;board=', $board['id'], '.0">';
41:
42:          // if ($board['new']) {
43:                if (file_exists($settings['theme_dir'] . '/icons/' . $board['id'] . '/on.gif'))
44:                   $board_new_img=$settings['theme_url']. '/icons/' . $board['id'] . '/on.gif';
45:                else
46:                   $board_new_img=$settings['images_url']. '/on.gif';
47:    48:                   echo '<img src="', $board_new_img,'" alt="', $txt[333], '" title="', $txt[333], '" border="0" />';
49:             } elseif ($board['children_new']) {
50:                if (file_exists($settings['theme_dir'] . '/icons/' . $board['id'] . '/on2.gif'))
51:                   $childboard_new_img=$settings['theme_url']. '/icons/' . $board['id'] . '/on2.gif';
52:                else
53:                   $childboard_new_img=$settings['images_url']. '/on2.gif';

SMdot™

does this only work with the default theme... if so can someone help me figure out what I got to do to get it working with my site

SMdot™

love the mod... don't see why one would use it on the main forum (guess you could use similar size icons). I use bigger images on my child boards, to differentiate the sections from the site... makes it look less forumy =P

peta-sucks.com

Would anyone be interested in setting this up for me on my boards?

Bigguy

What theme are you using and what version of the mod are you trying to install.

babjusi

Cool, I will try to install these Custom Board Icons in my forum as well

khoking

Kho King
www.ShaShinKi.com
www.PentaxWorld.com

Bigguy


Apostaganha

Its not working on my "child doards"  :)

its suppose to be on2.gif, off2.gif, on3.gif, off3.gif, and so on right?

Advertisement: