News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

How do I remove some broken image links for new topics (new.gif)?

Started by Destrogath, March 15, 2015, 11:15:37 AM

Previous topic - Next topic

Destrogath

I had originally followed this post on how to make "new topics with replies" bold - http://www.simplemachines.org/community/index.php?topic=450840.0

It worked perfectly. However, then I removed new.gif from the images folder to give it a cleaner look. What I then didn't notice was that people on Google Chrome would see a "broken image" link icons in place of the images. I then went deeper and opened MessageIndex.template and removed the following code:

// Is this topic new? (assuming they are logged in!)
if ($topic['new'] && $context['user']['is_logged'])
echo '
<a href="', $topic['new_href'], '" id="newicon' . $topic['first_post']['id'] . '"><img src="', $settings['lang_images_url'], '/new.gif" alt="', $txt['new'], '" /></a>';


This removed the icon from appearing in new posts, success! Except they still appear for child boards.



I found this set of code in MessageIndex.template, but I can't remove to remove the image call without breaking something. Can anyone help?

// Show the "Child Boards: ". (there's a link_children but we're going to bold the new ones...)
if (!empty($board['children']))
{
// Sort the links into an array with new boards bold so it can be imploded.
$children = array();
/* Each child in each board's children has:
id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */
foreach ($board['children'] as $child)
{
if (!$child['is_redirect'])
$child['link'] = '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="new_posts" ' : '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . ($child['new'] ? '</a> <a href="' . $scripturl . '?action=unread;board=' . $child['id'] . '" title="' . $txt['new_posts'] . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')"><img src="' . $settings['lang_images_url'] . '/new.gif" class="new_posts" alt="" />' : '') . '</a>';


Any help would be greatly appreciated!

Steve

I don't mess with code if I don't have to. I don't like the no new images, never saw the point in having them so this is what I did:

I uploaded a blank image, replacing the images I didn't want. I made them 1 x 1 in size or if width was needed, I made them the same width as the originals but only one pixel high.
My pet rock is not feeling well. I think it's stoned.

Destrogath

Quote from: Steve on March 15, 2015, 11:22:55 AM
I don't mess with code if I don't have to. I don't like the no new images, never saw the point in having them so this is what I did:

I uploaded a blank image, replacing the images I didn't want. I made them the same width as the originals but only one pixel high.

Great idea!

Steve

My pet rock is not feeling well. I think it's stoned.

Kindred

Or just edit the css for class new_posts to be display:none;
Сл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."

Steve

My pet rock is not feeling well. I think it's stoned.

Advertisement: