News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Board Icons

Started by Dream Portal Team, February 01, 2013, 04:04:22 PM

Previous topic - Next topic

Bachian

I don't know why it doesn't work.

Maybe this will help.


TheListener

Did you install the mod despite the test failed messages?

Bachian

Yes. And it didn't work.

TheListener

Quote from: Bachian on May 26, 2014, 11:43:23 PM
Yes. And it didn't work.

That's why it doesn't work.

Use the mods parser which is on the mods download page to see which files marked test failed need a manual edit.

Bachian

Did that. Still isn't working.

SoLoGHoST

Hello, so it isn't working in the default, Curve, Theme either??  According to your install log pic that you posted above, it should.

This mod does theme (template file) edits, so it is possible that the edits that it does, do not cater to your themes coding.  In that case, the edits will need to be done manually to that themes files... namely, "MessageIndex.template.php".  So, in that case, you can open up the zipped package and take a look at the xml file that modifies the "MessageIndex.template.php" file, and look at the operations in there, and alter them in your theme file to match according to your themes way of handling the output of Board Icons.

Bachian

Quote from: SoLoGHoST on May 27, 2014, 01:18:41 AM
Hello, so it isn't working in the default, Curve, Theme either??  According to your install log pic that you posted above, it should.  This mod does theme edits, so it is possible that the edits that it does, do not cater to your themes coding.  In that case, the edits will need to be done manually to that themes files... namely, "MessageIndex.template.php".

Yes, it does work on the Curve theme. But it won't work with Firox Multicolor by SMFSimple, which is the theme I like to use.

SoLoGHoST

You will need to edit the "MessageIndex.template.php" file manually, after installing the mod.  Already instructed on how to do this.  Cheers :)

Bachian

I have no idea how to do that... If I link the file here, from my theme could you modify it for me, or is it too much work?

SoLoGHoST

I am in the middle of releasing, yet another update for my Post Rating Pro mod, so, I've got my hands tied right now...  could possibly look at it another day... not sure.  Sorry...

Bachian

I figured it out. I had to make the same change to the boardindex.template.php as I did the messageindex.template.php in my theme's folder.

Find:
// If the board or children is new, show an indicator.
if ($board['new'] || $board['children_new'])
echo '
<img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'on', $board['new'] ? '' : '2', '.png" alt="', $txt['new_posts'], '" title="', $txt['new_posts'], '" />';
// Is it a redirection board?
elseif ($board['is_redirect'])
echo '
<img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'redirect.png" alt="*" title="*" />';
// No new posts at all! The agony!!
else
echo '
<img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'off.png" alt="', $txt['old_posts'], '" title="', $txt['old_posts'], '" />';


Replace with:
// If the board or children is new, show an indicator.
if ($board['new'] || $board['children_new'])
{
if ($board['new_img'] !== '')
echo '
<img src="', $board['new_img'], '" alt="', $txt['new_posts'], '" title="', $txt['new_posts'], '" />';
else
echo '
<img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'on', $board['new'] ? '' : '2', '.png" alt="', $txt['new_posts'], '" title="', $txt['new_posts'], '" />';
}
// Is it a redirection board?
elseif ($board['is_redirect'])
{
if ($board['redirect_img'] !== '')
echo '
<img src="', $board['redirect_img'], '" alt="*" title="*" />';
else
echo '
<img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'redirect.png" alt="*" title="*" />';
}
// No new posts at all! The agony!!
else
{
if ($board['no_new_img'] !== '')
echo '
<img src="', $board['no_new_img'], '" alt="', $txt['old_posts'], '" title="', $txt['old_posts'], '" />';
else
echo '
<img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'off.png" alt="', $txt['old_posts'], '" title="', $txt['old_posts'], '" />';
}

samborabora

#51
Quote from: SoLoGHoST on September 25, 2013, 02:29:57 AM
Honestly, for blocks with Simple Portal, I don't know how you would do it.  With Dream Portal, you can add layouts per board, and than the modules (blocks) on that layout will only show for that board.  So, for this, you could use the "Custom Module" and have the image inserted into it with a Transparent Module Template and will only show the image for that board and that board alone.

What might be better is to use a Custom Block in Simple Portal with PHP as the Code type (if possible) and have it show on the forum, and test it via the $_REQUEST['board'] variable.  You could than have it grab an image based on the board id returned within $_REQUEST['board'].

For example:

global $boardurl;
if (!empty($_REQUEST['board']))
    echo '
        <img src="' . $boardurl . '/images/boardicons/board_' . $_REQUEST['board'] . '" alt="" />';


So, this would output the image based on the following naming convention:  "board_{board id}"

Where {board_id} is the actual id value of the board that gets returned from $_REQUEST['board'].  If this variable is empty, it will not be shown.  Therefore this will be sure to display on all pages within the board (hopefully).  And you could use the same code within the Post.php and/or Post.template.php for when users are creating New Topics.  Ofcourse, you should probably check to be sure it is an integer value, but that I'll leave up to you.

Sorry for the late reply, but I'm trying to incorporate a board icon on the "post reply" page, in place of the "Subject" txt. I have SimplePortal still installed (unfortunatly, not DreamPortal), so if you can suggest what would be the best way of, basically, calling the image the exact same way the board template does, just for the current board, I'd be most grateful! I tried that code you gave me last year, and it just gives a image with an url to the images folder, followed the board number, which is a start, but unfortunately my board names don't use that naming convention, although, if needs be, I suppose I could rename them all to cooperate with the code; it would just be far easier if I could get it to call for the names of the images that have been defined in Board Icons mod.

EDIT: I'm just going to rename all of my board icons sequencially, and use this code for my post.template.php:

Find:
// Now show the subject box for this post.
echo '
<dt>
<span', isset($context['post_error']['no_subject']) ? ' class="error"' : '', ' id="caption_subject">', $txt['subject'], ':</span>


Replace with:

// Now show the subject box for this post.
echo '
<dt>
<span', isset($context['post_error']['no_subject']) ? ' class="error"' : '', ' id="caption_subject">
<img src="' . $settings['images_url'] . '/boardimgs/' . $_REQUEST['board'] . '.jpg" alt="" />
</span>

fiesty

cant get the images to show ?

being a noob at all this stuff, i struggle to get things up and running at times (most of the time actually  :-[ )

so for anyone like me who has had/having problems getting the images to show using this mod, maybe this will help :)

i had been trying to get this mod up and running for quite a while, the problem was that the images would not show up on the forum. instead of the image, i was getting a line of text like "no new posts" instead,

after several uninstalls and reinstalling the mod, and trying all the advice from this thread, without getting any nearer to solving it,

one bit of advice was to try and trace the route of the image to see if this was the problem,
it wasn't, the images were where they were supposed to be,  but it did provide the clue to where the problem lay,
as attempting to view the image got a error stating it could not be viewed as the image "had errors"

so i checked the images i had on the computer that i chosen for the boards, which all seemed to be ok,

but after downloading them back from the server to a folder on the desktop, and trying to view them again, they were indeed corrupt!
this pointed at this happening during the transfer to the server,
(i use Filezilla for the uploading of files to the server)

the more adept users here will probably have worked out the problem by now :)

anyhow, it seems that i had the transfer type set as "auto" on filezilla,
from a choice of ASCII/AUTO/BINARY,  and i seemed to remember something about using binary transfer for some types of file,
so i reset the type to binary, and reloaded the images, and gave it another go,

and success! the images were now showing as they were supposed to :)

in my case this solved the problem, so i hope this may help any fellow noobs to get this working :)

thanks for a great mod, it has certainly made our forum look a lot better for users :)

p:s this also worked for the rss feed icon mod too, which worked ok in default and core themes, but not on other themes, it was the "binary" bit again  ::)

SoLoGHoST

Great, glad you got it working.  Yes Binary Mode in Filezilla will be sure to transfer your files correctly.  Anytime I backup file, I always transfer them in binary mode.

Cheers :)

Apllicmz

Good Mod
when update dont forget portuguese files

<file name="$languagedir/Modifications.portuguese_pt.php" error="skip">
        <operation>
            <search position="end" />
            <add><![CDATA[
//
// Board Icons MOD Begin...Translte by Candidosa2
//

$txt['boardIcons_newPostsPath'] = 'Novos Postes Caminho da Imagem: ';
$txt['boardIcons_noNewPostsPath'] = 'N&atilde;o h&aacute; poste do Caminho da Imagem: ';
$txt['boardIcons_redirectPostsPath'] = 'Redirecionar Caminho da Imagem: ';
$txt['boardIcons_manage_caption'] = 'Deixe em branco para a imagem padr&atilde;o.';

// Filepath Selection Choices...
$txt['boardIcons_select_http'] = 'http://';
$txt['boardIcons_select_boardurl'] = '{$boardurl}';
$txt['boardIcons_select_scripturl'] = '{$scripturl}';
$txt['boardIcons_select_default_theme'] = 'Tema padr&atilde;o';
$txt['boardIcons_select_theme'] = 'Este tema';

//
// Board Icons MOD END! sUPPORT BY SMFPT.NET
//
]]></add>
        </operation>
    </file>



Bob La Londe

I installed this mod on three different 2.0.9 boards and it seemed to work just fine on all of them. 

The only issue I see right now, is that I would like to have an option to change and/or turn off the icon legend at the bottom of the screen. 

Cylent1

Quote from: Bob La Londe on October 31, 2014, 01:16:16 PM
I installed this mod on three different 2.0.9 boards and it seemed to work just fine on all of them. 

The only issue I see right now, is that I would like to have an option to change and/or turn off the icon legend at the bottom of the screen.

I am running this mod in 2.0.9 also, I cannot seem to get this to work either.
I'm glad there is confirmation of this working in this release of smf.
What files did you have to edit to get this to work?
did you run in emulation mode?
any advice to get this to work?

Dream Portal Team

I don't understand why people are reporting any problems with this mod.  This mod works flawlessly in every version I have tested.  I have just tested it now in 2.0.9 and works a charm.
This is the universal account for the Dream Portal Team. All messages sent to this account will be discarded.  Please visit us at:  Dream Portal dot net for support and extensions to Dream Portal.

Cylent1

I was able to get it running with no problems by flushing the cache in forum settings, and also using the correct path format in the plugin settings.  Hope this helps a little bit...

valter071

Quote from: Dream Portal Team on November 02, 2014, 10:36:56 PM
I don't understand why people are reporting any problems with this mod.  This mod works flawlessly in every version I have tested.  I have just tested it now in 2.0.9 and works a charm.

If you can, have someone make a step by step what can be done to work out and everyone would be happy and would not be asking unnecessary questions as well as the same is not working ...

Advertisement: