Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: propaganda on May 08, 2011, 04:38:40 PM

Title: Bold text on threads with unread posts
Post by: propaganda on May 08, 2011, 04:38:40 PM
I am trying to append the threads with unread posts to have bold text as well as the new image. My php skills aren't great but I think it needs to be done in this line

                        <a href="', $topic['new_href'], '" id="newicon' . $topic['first_post']['id'] . '"><img src="', $settings['lang_images_url'], '/new.gif" alt="', $txt['new'], '" /></a>';

Does the new icon show up when there are no posts, or only on a new thread? If so how can I accomplish this please. Thank you in advance for any help.
Title: Re: Bold text on threads with unread posts
Post by: propaganda on May 09, 2011, 06:46:07 PM
Anyone can help me with this plz?
Title: Re: Bold text on threads with unread posts
Post by: Baby Daisy on May 10, 2011, 03:01:47 AM
give me about 5 lines surrounding that
Title: Re: Bold text on threads with unread posts
Post by: propaganda on May 10, 2011, 08:59:31 PM
    echo '
                        ', $topic['is_locked'] ? '<img src="' . $settings['images_url'] . '/icons/quick_lock.gif" class="floatright" alt="" id="lockicon' . $topic['first_post']['id'] . '" style="margin: 0;" />' : '', '
                        ', $topic['is_sticky'] ? '<img src="' . $settings['images_url'] . '/icons/show_sticky.gif" class="floatright" alt="" id="stickyicon' . $topic['first_post']['id'] . '" style="margin: 0;" />' : '';

         echo '
                        ', $topic['is_sticky'] ? '<strong>' : '', '<span id="msg_' . $topic['first_post']['id'] . '">', $topic['first_post']['link'], (!$context['can_approve_posts'] && !$topic['approved'] ? '&nbsp;<em>(' . $txt['awaiting_approval'] . ')</em>' : ''), '</span>', $topic['is_sticky'] ? '</strong>' : '';


         // 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>';

         echo '
                        <small id="pages' . $topic['first_post']['id'] . '">', $topic['pages'], '</small>
                     </td>
                     <td class="', $alternate_class, ' starter">
                        ', $topic['first_post']['member']['link'], '
                     </td>
                     <td class="', $color_class, ' replies">
                        ', $topic['replies'], '
                     </td>
                     <td class="', $color_class, ' views">
                        ', $topic['views'], '
                     </td>
                     <td class="', $alternate_class, ' lastpost">
                        <a href="', $topic['last_post']['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="', $txt['last_post'], '" title="', $txt['last_post'], '" /></a>
                        <span class="smalltext">
                           ', $topic['last_post']['time'], '<br />
                           ', $txt['by'], ' ', $topic['last_post']['member']['link'], '
                        </span>
                     </td>';
Title: Re: Bold text on threads with unread posts
Post by: searchgr on May 11, 2011, 02:54:23 AM
can u pls give instructions for the above code?
Title: Re: Bold text on threads with unread posts
Post by: Baby Daisy on May 11, 2011, 02:58:08 AM
Try this;

    echo '
                        ', $topic['is_locked'] ? '<img src="' . $settings['images_url'] . '/icons/quick_lock.gif" class="floatright" alt="" id="lockicon' . $topic['first_post']['id'] . '" style="margin: 0;" />' : '', '
                        ', $topic['is_sticky'] ? '<img src="' . $settings['images_url'] . '/icons/show_sticky.gif" class="floatright" alt="" id="stickyicon' . $topic['first_post']['id'] . '" style="margin: 0;" />' : '';

         echo '
                        ', ($topic['is_sticky'] || $topic['new'] ? '<strong>' : ''), '<span id="msg_' . $topic['first_post']['id'] . '">', $topic['first_post']['link'], (!$context['can_approve_posts'] && !$topic['approved'] ? '&nbsp;<em>(' . $txt['awaiting_approval'] . ')</em>' : ''), '</span>', ($topic['is_sticky'] || $topic['new'] ? '</strong>' : '');


         // 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>';

         echo '
                        <small id="pages' . $topic['first_post']['id'] . '">', $topic['pages'], '</small>
                     </td>
                     <td class="', $alternate_class, ' starter">
                        ', $topic['first_post']['member']['link'], '
                     </td>
                     <td class="', $color_class, ' replies">
                        ', $topic['replies'], '
                     </td>
                     <td class="', $color_class, ' views">
                        ', $topic['views'], '
                     </td>
                     <td class="', $alternate_class, ' lastpost">
                        <a href="', $topic['last_post']['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="', $txt['last_post'], '" title="', $txt['last_post'], '" /></a>
                        <span class="smalltext">
                           ', $topic['last_post']['time'], '<br />
                           ', $txt['by'], ' ', $topic['last_post']['member']['link'], '
                        </span>
                     </td>';
Title: Re: Bold text on threads with unread posts
Post by: searchgr on May 11, 2011, 03:03:27 AM
where to add this code? do i have to replace something?


thnx
Title: Re: Bold text on threads with unread posts
Post by: propaganda on May 11, 2011, 10:56:23 AM
That works that you so much for the help daisy.

@Searchgr the code replaces code in the index.template.php of your theme file and ads bold text to threads with new post that you the user hasn't read.
Title: Re: Bold text on threads with unread posts
Post by: Baby Daisy on May 11, 2011, 01:27:29 PM
Marked as solved
Title: Re: Bold text on threads with unread posts
Post by: propaganda on July 11, 2011, 05:08:00 PM
The 2.0 update seemed to break this function now I can't find the same code should it still be the same?