The following warnings occurred:
Warning [2] Undefined array key "pointsview" - Line: 1442 - File: inc/plugins/newpoints/core/hooks.php PHP 8.2.11 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/newpoints/core/hooks.php 1442 errorHandler->error_callback
/inc/class_plugins.php 142 newpoints_blockview
/showthread.php 471 pluginSystem->run_hooks



This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Tutorial Use a custom display for the newest thread in the forum display thread list
Files
#1
It is possible you want to display the newest thread in the forum thread list in a special way than the rest, probably separated. You will need a plugin to accomplish this.

   

Attached is a Hooks file, once you import the attached file to the Hooks plugin system you will be able to:
  • Use `{$newestThread}` inside the `forumdisplay_threadlist` template to display the newest thread
  • Create custom `newest_forumdisplay_thread` and `newest_forumdisplay_thread_deleted` templates to format the newest thread differently.

Please, note that there are some considerations for this feature:
  • Only one thread will be affected, the newest thread in the forum for the current user, based on pagination, permissions, or filtering features.
  • You can try to use `{$newestThread}` inside other templates, like in the `forumdisplay` template, but this was not tested thoroughly.
  • If the `newest_forumdisplay_thread` and `newest_forumdisplay_thread_deleted` templates are not found in the theme, the code will simply fallback to the core `forumdisplay_thread` and `forumdisplay_thread_deleted` templates.

You can check the attached images for a final result. The `newest_forumdisplay_thread` template for the attached previews is the following (based off the default theme):
Code:
<br class="clear" />
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder clear">
    <tr class="inline_row">
        <td align="center" class="{$bgcolor}{$thread_type_class}" width="2%"><span class="thread_status {$folder}" title="{$folder_label}">&nbsp;</span></td>
        <td align="center" class="{$bgcolor}{$thread_type_class}" width="2%">{$icon}</td>
        <td class="{$bgcolor}{$thread_type_class}">
            {$attachment_count}
            <div>
              <span>{$prefix} {$gotounread}{$thread['threadprefix']}<span class="{$inline_edit_class} {$new_class}" id="tid_{$inline_edit_tid}"><a href="{$thread['threadlink']}">{$thread['subject']}</a></span>{$thread['multipage']}</span>
                <div><span class="author smalltext">{$thread['profilelink']}{$lang->comma}</span><span class="thread_start_datetime smalltext">{$thread['start_datetime']}</span></div>
            </div>
        </td>
        <td align="center" class="{$bgcolor}{$thread_type_class}"><a href="{$mybb->settings['bburl']}/misc.php?action=whoposted&tid={$thread['tid']}" onclick="MyBB.whoPosted({$thread['tid']}); return false;">{$thread['replies']}</a>{$unapproved_posts}</td>
        <td align="center" class="{$bgcolor}{$thread_type_class}">{$thread['views']}</td>
        {$rating}
        <td class="{$bgcolor}{$thread_type_class}" style="white-space: nowrap; text-align: right;">
            <span class="lastpost smalltext">{$lastpostdate}<br />
            <a href="{$thread['lastpostlink']}">{$lang->lastpost}</a>: {$lastposterlink}</span>
        </td>
    {$modbit}
    </tr>
</table>
<br class="clear" />


Attached Files Thumbnail(s)
   
Reply