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

tuguex

Modification.xml:

<?xml version="1.0"?>
      <!DOCTYPE modification SYSTEM "http://www.simplemachines.org/xml/modification">

     <modification xmlns="http://www.simplemachines.org/xml/modification" xmlns:smf="http://www.simplemachines.org/">

<id>bigguy:cbi05</id>

<version>1.5</version>



<file name="$themedir/BoardIndex.template.php">
<operation>
<search position="replace"><![CDATA[ // If the board or children is new, show an indicator.
if ($board['new'] || $board['children_new'])
echo '<img src="', $settings['images_url'], '/on', $board['new'] ? '' : '2', '.gif" 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'], '/redirect.gif" alt="*" title="*" border="0" />';
// No new posts at all! The agony!!
else
echo '<img src="', $settings['images_url'], '/off.gif" alt="', $txt['old_posts'], '" title="', $txt['old_posts'], '" />';

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


<add><![CDATA[if ($board['new']) {
if (file_exists($settings['theme_dir'] . '/icons/' . $board['id'] . '/on.png'))
$board_new_img=$settings['theme_url']. '/icons/' . $board['id'] . '/on.png';
else
$board_new_img=$settings['images_url']. '/on.png';

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

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

echo '<img src="', $board_nonew_img,'" alt="', $txt['no_icon'], '" title="', $txt['no_icon'], '" border="0" />';
}
// Is it a redirection board?
if ($board['is_redirect'])
echo '<img src="', $settings['images_url'], '/redirect.png" alt="*" title="*" border="0" />';


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


</operation>
</file>


<file name="$themedir/MessageIndex.template.php">
<operation>
<search position="replace"><![CDATA[ // If the board or children is new, show an indicator.
if ($board['new'] || $board['children_new'])
echo '<img src="', $settings['images_url'], '/on', $board['new'] ? '' : '2', '.gif" 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'], '/redirect.gif" alt="*" title="*" border="0" />';
// No new posts at all! The agony!!
else
echo '<img src="', $settings['images_url'], '/off.gif" alt="', $txt['old_posts'], '" title="', $txt['old_posts'], '" />';

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


<add><![CDATA[if ($board['new']) {
if (file_exists($settings['theme_dir'] . '/icons/' . $board['id'] . '/on.png'))
$board_new_img=$settings['theme_url']. '/icons/' . $board['id'] . '/on.png';
else
$board_new_img=$settings['images_url']. '/on.png';

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

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

echo '<img src="', $board_nonew_img,'" alt="', $txt['no_icon'], '" title="', $txt['no_icon'], '" border="0" />';
}
// Is it a redirection board?
if ($board['is_redirect'])
echo '<img src="', $settings['images_url'], '/redirect.png" alt="*" title="*" border="0" />';


echo '</a>
</td>
<td class="windowbg2">
<b><a href="', $board['href'], '" name="b', $board['id'], '">', $board['name'], '</a></b>';]]>
</add>
</operation>
</file>
                        <file name="$languagedir/Modifications.english.php">
        <operation>
            <search position="end" />
            <add><![CDATA[$txt['no_icon'] = 'No icon set';]]>
        </add>
</operation>
</file>
</modification>

Bigguy

So BoardIndex.template and Messageindex.template.php are the files that get edited. Do you have either of these in your custom theme folder. ???

tuguex

Quote from: Bigguy on November 02, 2008, 11:34:23 AM
So BoardIndex.template and Messageindex.template.php are the files that get edited. Do you have either of these in your custom theme folder. ???

In my custom theme folder i only have BoardIndex.template file :S

Bigguy

Ok then, if the mod is installed then the messageindex.template.php has already been modified. So all you have to do is modify the Boardindex.template.php file.

tuguex

Quote from: Bigguy on November 02, 2008, 11:45:58 AM
Ok then, if the mod is installed then the messageindex.template.php has already been modified. So all you have to do is modify the Boardindex.template.php file.

Yes !!
Now appears "No icon set" in turn of the icon theme.

I will creat some folders with icons

Bigguy

If that appears then it is installed right. Now all you have to do is get a folder made for each board and put the on.png and off.png in there....along with the on2.png

tuguex

Quote from: Bigguy on November 02, 2008, 11:58:59 AM
If that appears then it is installed right. Now all you have to do is get a folder made for each board and put the on.png and off.png in there....along with the on2.png

It doesn't work :S
I have the icons here:

public_html/Themes/outline115/icons/75

And I dont know what it is  :-[

Bigguy

clear your browser cache and see. (ctrl + f5)

tuguex

Quote from: Bigguy on November 02, 2008, 12:05:20 PM
clear your browser cache and see. (ctrl + f5)


It works now xD
It was because my image icons are gif, so i upload one png file and it works ;)

Thank you very much for the support  ;)

Bigguy


glennk

HI Big Guy. Will there be a version compatible for the latest SMF beta ?? I have used this mod for a long time on smf 1 and think its great. I would really like to continue using it but am now running the beta forum.

Bigguy

There should be a version that runs with SMF 2.0 beta 3. However I will be upgrading this mod real soon. I just have to get a few errors solved on my site first. :)

zes

I want to use CBI but without having to replace On & Off.Just place any picture I want on the board In front of the hxxp:category.how [nonactive] can I do that?If it's not possible is there any other mod I can use to achieve it?
Thanks in advance

glennk

Hi Big guy Im on 2 beta 4 and I get this from version 1.5 of cbi :

Installations actions for "cbi, 1.0":
Installing this package will perform the following actions:
      Type    Action    Description
*    1.    Execute Modification    ./Themes/default/BoardIndex.template.php    Test failed
      1.    Replace    ./Themes/default/BoardIndex.template.php    Test failed
*    2.    Execute Modification    ./Themes/default/MessageIndex.template.php    Test failed
      1.    Replace    ./Themes/default/MessageIndex.template.php    Test failed
*    3.    Execute Modification    ./Themes/default/languages/Modifications.english.php    Test successful

Technoman

2.0 Beta 4

is there anything coming up for this Forum yet soon ???

Bigguy

@ zes: Not sure I understand you. Can you explain a bit more.

@ glennk: Do you have many mods installed. ???

@ Technoman: What do you mean, another version. ???

glennk

Hi Big guy I have

Tags Mod
Pretty urls
Ad Management
Auto embed video

Howevere IN 1.16 prior to upgrade I had these and many more mods but was still able to use your mod. I would dearly like to continue with this mod as my forum users have become use to it, many of the pictures used were taken by or include my board members so its a way of involving them in the forum.

Thanks for your help with this.


Bigguy

Try checking your permissions and ownership of the files then through ftp and see if that makes a difference when installing.

glennk

#398
Hi Big Guy,

Both board and message index are set to 777. Is this what you mean ??

I also uninstalled all my mods and tried again, but still get the same problem. Is this mod compatable with 2 beta 4 ??

Thanks - Glenn

Bigguy

Use the parser on this page to get the manual edits for the mod and do it that way for now. The mod has not been updated for beta 4 yet but it will work with it.

http://custom.simplemachines.org/mods/index.php?mod=511

Advertisement: