Different board Icons

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

Previous topic - Next topic

inf4mi

Quote from: Bigguy on January 14, 2008, 05:18:00 PM
If you run it through a package parser like this one here [nofollow] it will tell you all the edits and were to put them. :)
Thank U for help.
But

UI have downloaded -  cbi-1.zip [nofollow] (2KB)

Then I go to - SMF Helper Package Parser Beta.

Upload your package (ZIP or TAR.GZ file):  - I choose this archive.
Choose your SMF version: 1.1.4

Operation: Install
Show: I took 2 variants - All Edits (default) and Only Theme edits (editing a theme to support a mod)

Here is answer:



ERROR: The package-info.xml file is invalid!

Debugging Information
Error message: String could not be parsed as XML
Source: /home/bigguy/public_html/smfhelper/forum/package.php5:133
Errors encountered while parsing XML file:

   1. Entity: line 1: parser error : XML declaration allowed only at the start of the document
   2. <?xml version="1.0"?>
   3. ^

Stack Trace:
#0 /home/bigguy/public_html/smfhelper/forum/package.php5(133): SimpleXMLElement->__construct(' <?xml versi...')
#1 /home/bigguy/public_html/smfhelper/forum/package.php5(94): parsePackageInfoXML('/tmp/smf_xml/pa...', 'install', 'theme')
#2 /home/bigguy/public_html/smfhelper/forum/package.php5(756): parseArchive('/tmp/php1ybunF', 'install', 'theme')
#3 {main}

XML File:

    <?xml version="1.0"?>
    <!DOCTYPE package-info SYSTEM "http://www.simplemachines.org/xml/package-info">
    <package-info xmlns="http://www.simplemachines.org/xml/package-info" xmlns:smf="http://www.simplemachines.org/">

   <id>bigguy:cbi05</id>

   <name>cbi, 1.0</name>   

   <version>1.0</version>

   <type>modification</type>

   <install>
      <readme>readme.txt</readme>
      <modification>modification.xml</modification>
   </install>

   <uninstall>
      <modification reverse="true">modification.xml</modification>
   </uninstall>
</package-info>



Bigguy

Here are all the edits for my cbi mod:

In your BoardIndex.template.php find:

Quote// 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 with:

Quoteif ($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 and close; then in MessageIndex.template.php find:

Quote// 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 with:

Quoteif ($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 and upload....make sure to KEEP THE ORIGINALS ;)

inf4mi

Quote from: Bigguy on January 15, 2008, 11:42:57 AM
Here are all the edits for my cbi mod:

Thanks, but I do not have such code, that your wrote,
I have like this one, I have written:

http://www.simplemachines.org/community/index.php?topic=7370.msg1382479#msg1382479

Bigguy

Replace what you have with this but keep backups of the original files and see if it works. Your code is pretty much the same and should have the same effect.

inf4mi

#184
Thanks
I changed files,  forum does not have errors.

How to say to forum  where to take icons.

I  read reedme:

forum/Themes/default/icons/1/on.gif

I found where my icons of my theme are:

/forum/Themes/safmc101/images/1/on.gif

/forum/Themes/safmc101/images/1/on2.gif
...
/forum/Themes/safmc101/images/2/on.gif

and so on.

But I do not see new icons my forum.
Now it has not icon,  It has "alt" message: "New messages"

Then I looked code:

<img src="http://...../forum/Themes/safmc101/images/on.gif" alt="New messages"...

Help, Thanks

P.S.
My theme has different  colours, and so there such : on_blue.gif on_green.gif


Bigguy

The 1 in this string is a folder that is named after the board id:

forum/Themes/default/icons/1/on.gif

This is were your icons have to go.

Bigguy

Make sure to put them in the theme folder of the theme you are using; mine are here:

Themes/Sea_Side/icons/2/off.gif

inf4mi

Quote from: Bigguy on January 15, 2008, 06:32:07 PM
Make sure to put them in the theme folder of the theme you are using; mine are here:

Themes/Sea_Side/icons/2/off.gif

Thank U a lot.
It works.

Can U advise where to get different nice icons ?

Bigguy

I use google and type in free .png images or something similar. There is some on my site I think.

popomovies

I'm kind of confused. What I want to do is a different icon for each board, whether as there's two icons on default, one for new posts and second for old posts.

For the board id, does it correspond to each board?
I put all 3 in
themes/default/images/icon/1/on.gif
themes/default/images/icon/1/on2.gif
themes/default/images/icon/1/off.gif

Then I put all 3 again in
themes/default/images

If so far so good, I went on my site popomovies.com and wala, there it is... but it isn't doing what I'm trying to do. Do I have to setup a board id of 2? 3? and so on?

What is the edited code to add more icons to the board? Thanks!

Kindred

popomovies,

I'm not sure what you are asking exactly, but I'll answer the question I THINK you are asking...

in the mod, as released, you will need to create a directory for EACH board that you want custom icons for, with the BoardID as the name of the directory...  you will put on, on2 and off images in each of those directories.

If the directory does NOT exist, then the system will use the on, on2 and off image files in the images directory for that board.
Сл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."

Hj Ahmad Rasyid Hj Ismail


Snogmarr

Quote from: Abu Fahim Ismail on December 09, 2009, 05:01:35 PM
Any update for smf 2.0 rc2?

It works perfectly for RC2 see pics
hmm wont let me upload pics,,,, but it does work great on rc2

king999

but howe to change icon's i install successfully this mod but who to change icon's.

samueliyinbo

pardon me please but I am new at this. how do i know my board id?

king999

which id you want  samueliyinbo

Gary

It's simple to find a BOARD_ID look in the URL eg: index.php?board=115.0 in this case it is 115 (the .0 is not part of the ID)
Gary M. Gadsdon
Do NOT PM me unless I say so
War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

king999


ivan91tran

Quote from: Anguz on December 28, 2004, 12:31:08 AM
Quote from: LiL_J on December 27, 2004, 11:21:32 PM
sup bro worked like a charm.  take a look at it hxxp:kevmundial.com/board [nonactive] ;) ;) :)

Glad it worked. :)

I may give it an admin setting and package it someday...

Apologies for digging up an old topic, but I was searching for answers on this forum. I wonder if I could have a setting where if there were no images set for a board/forum, it'll go ahead and choose the default on/off images?

Kindred

there is a mod, called CBI which does exactly that.
Сл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."

Advertisement: