News:

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

Main Menu

Mark as read button

Started by Burke ♞ Knight, September 14, 2014, 06:24:16 PM

Previous topic - Next topic

Burke ♞ Knight

Okay, I'm doing some changes to a theme, and even in default, I cant figure out how to change the mark as read button's colors on board index.

There seems to be no image, even though it does state markread.gif in the coding:

// Mark read button.
$mark_read_button = array(
'markread' => array('text' => 'mark_as_read', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=all;' . $context['session_var'] . '=' . $context['session_id']),
);

echo '
<ul class="reset">
<li class="floatleft"><img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'new_some.png" alt="" /> ', $txt['new_posts'], '</li>
<li class="floatleft"><img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'new_none.png" alt="" /> ', $txt['old_posts'], '</li>
<li class="floatleft"><img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'new_redirect.png" alt="" /> ', $txt['redirect_board'], '</li>
</ul>
</div>';

// Show the mark all as read button?
if ($settings['show_mark_read'] && !empty($context['categories']))
echo '<div class="mark_read">', template_button_strip($mark_read_button, 'right'), '</div>';
}
else
{
echo '
<div id="posting_icons" class="flow_hidden">
<ul class="reset">
<li class="floatleft"><img src="', $settings['images_url'], '/new_none.png" alt="" /> ', $txt['old_posts'], '</li>
<li class="floatleft"><img src="', $settings['images_url'], '/new_redirect.png" alt="" /> ', $txt['redirect_board'], '</li>
</ul>
</div>';


I'd like to replace the whole thing with an image I made.
Yet, I have no idea why it calls for a non-existent image in the first place, nor do I have any idea where said image is supposed to be located at, so I can just upload one to use.

ARG01

Isn't that normally the menu_gfx.png image? That can be handled in index.css.
No, I will not offer free downloads to Premium DzinerStuido themes. Please stop asking.

Illori

Quote from: SimpMode on September 14, 2014, 06:48:50 PM
Isn't that normally the menu_gfx.png image? That can be handled in index.css.

yep

.buttonlist ul li a span {
    background: url("../images/theme/menu_gfx.png") no-repeat scroll 100% -60px rgba(0, 0, 0, 0);
    display: block;
    height: 19px;
    line-height: 19px;
    padding: 0 8px 0 0;
    position: relative;
    right: -8px;
}

Burke ♞ Knight

Funny... Way he had the theme, FireBug did not show that at all....LOL

However, does not explain why it says markread.gif when there is no such entity...

ARG01

Quote from: BurkeKnight on September 14, 2014, 06:52:15 PM


However, does not explain why it says markread.gif when there is no such entity...

I often wondered that myself. It's mentioned in both BoardIndex and MessageIndex. Probably something left over from 1.x
No, I will not offer free downloads to Premium DzinerStuido themes. Please stop asking.

Burke ♞ Knight

#5
Currently, I had no way to get around the way it was, so, I recoded the button with the image I made, and it works. :)

BoardIndex.template.php

Code (Find) Select
// Show the mark all as read button?
if ($settings['show_mark_read'] && !empty($context['categories']))
echo '<div class="mark_read">', template_button_strip($mark_read_button, 'right'), '</div>';


Code (Replace With) Select
// Show the mark all as read button?
if ($settings['show_mark_read'] && !empty($context['categories']))
echo '<div class="mark_read" align="right"><a href="' . $scripturl . '?action=markasread;sa=all;' . $context['session_var'] . '=' . $context['session_id']. '" border="0"><img src="', $settings['images_url'], '/markread.png" alt="Mark ALL messages as read" title="Mark ALL messages as read" /></a></div>';


Or if have confirm to mark as read:
Code (Replace With) Select
// Show the mark all as read button?
if ($settings['show_mark_read'] && !empty($context['categories']))
echo '<div class="mark_read" align="right"><a href="' . $scripturl . '?action=markasread;sa=all;' . $context['session_var'] . '=' . $context['session_id']. '" border="0" onclick="return confirm(\'' . $txt['are_sure_mark_read'] . '\');"><img src="', $settings['images_url'], '/markread.png" alt="Mark ALL messages as read" title="Mark ALL messages as read" /></a></div>';



(( Any way to get this post split and added to tips and tricks board? ))

ARG01

No, I will not offer free downloads to Premium DzinerStuido themes. Please stop asking.

Burke ♞ Knight

I have it working on my main site, as well as 2 others so far. :)

Advertisement: