Bold text on threads with unread posts

Started by propaganda, May 08, 2011, 04:38:40 PM

Previous topic - Next topic

propaganda

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.

propaganda


Baby Daisy

give me about 5 lines surrounding that
あなたは私のお尻にキスするとき、私はそれを愛する

propaganda

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

searchgr

can u pls give instructions for the above code?

Baby Daisy

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>';
あなたは私のお尻にキスするとき、私はそれを愛する

searchgr

where to add this code? do i have to replace something?


thnx

propaganda

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.

Baby Daisy

あなたは私のお尻にキスするとき、私はそれを愛する

propaganda

The 2.0 update seemed to break this function now I can't find the same code should it still be the same?

Advertisement: