MyBB Community Forums

Full Version: Recent Threads On Index [Updated 02-09-21]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
The readme file addresses how to achieve this.
I have now made a new fix for making it so if you use SEO Urls, the threads should have the correct url now. Before the thread link in the template was hardcoded using an id parameter. Now I have it actually use the value of get_thread_link($tid, $action). If you do not want to wait for this feature, you can edit the template recentthread_thread and change

<span class="{$new_class}" id="tid_{$thread['tid']}"><a href="{$mybb->settings['bburl']}/showthread.php?tid={$thread['tid']}">{$thread['subject']}</a></span>

to this:

<span class="{$new_class}" id="tid_{$thread['tid']}"><a href="{$threadlink}">{$thread['subject']}</a></span>
Apologies if this is somewhere obvious, but I haven't been able to find it --

Guests are not being shown the avatars for this plug-in. Have I got a setting somewhere wrong? Anybody know? They're not hidden anywhere else, just in the recent threads table, and just for guests.
It is intentional that guests can't view avatars. Users have an option in User CP to view avatars and since guests don't have access to User CP, they aren't allowed to view them.
(2021-03-13, 09:59 PM)dragonexpert Wrote: [ -> ]It is intentional that guests can't view avatars.  Users have an option in User CP to view avatars and since guests don't have access to User CP, they aren't allowed to view them.

Thanks for the quick reply. Is there a way to change this setting so that guests can view avatars?
You'll need to change these 2 lines in inc/plugins/recentthreads/hooks.php

        if($mybb->settings['recentthread_avatar'] && $mybb->user['showavatars'])

        if($mybb->settings['recentthread_lastavatar'] && $mybb->user['showavatars'])

Remove the second part of the condition.
(2021-03-13, 10:48 PM)dragonexpert Wrote: [ -> ]You'll need to change these 2 lines in inc/plugins/recentthreads/hooks.php

        if($mybb->settings['recentthread_avatar'] && $mybb->user['showavatars'])

        if($mybb->settings['recentthread_lastavatar'] && $mybb->user['showavatars'])

Remove the second part of the condition.

Perfect, thank you so much for your help!
This should be handled via plugin without code chnages... not?
I've slightly modified my index template and template.json so you can use it in a sidebar instead of below or above the forums.

index template should include this:
<div class="side" style="float: right; width: 21%">	
{$recentthreadtable}
</div>
<div class="forum" style="float: left; width: 79%;">{$forums}
</div>

templates.json should look like this:
{"recentthread":{"title"
"<div id=\"recentthreads\">\n<table border=\"0\" cellspacing=\"1\" cellpadding=\"6\" class=\"tborder\" style=\"clear: both;max-height:300px\">\n<thead>\n    <tr>\n    <td class=\"thead{$expthead}\" colspan=\"{$colspan}\" style=\"text-align:left; font-size: 10pt;\">\n   \n<div><b>~ <a href=\"{$mybb->settings['bburl']}\/misc.php?action=recent_threads\" title=\"Show More Threads\">{$lang->recentthreads_recentthreads}<\/a> ~<\/b><\/div>\n<\/td>\n    <\/tr>\n<\/thead>\n<tbody style=\"{$expdisplay}\" id=\"cat_9999_e\">\n    <tr>\n    <td class=\"tcat\" colspan=\"1\"><strong>{$lang->recentthreads_thread} \/ {$lang->recentthreads_author}<\/strong><\/td>\n    <td class=\"tcat\"><strong>{$lang->recentthreads_last_post}<\/strong><\/td>\n{$modheader}\n    <\/tr>\n    {$recentthreads}\n<\/tbody>\n    <\/table>\n<\/div>"},

"recentthread_thread":{"template"
"<tr>\r\n    <td class=\"{$trow}{$thread_type_class}\">{$arrow}&nbsp;{$recentprefix}<span class=\"{$new_class}\" id=\"tid_{$thread['tid']}\"><a href=\"{$threadlink}\">{$thread['subject']}<\/a><\/span>&nbsp;&nbsp;{$thread['multipage']}<br \/>{$create_string} {$thread['author']}<br \/>{$posteravatar}<\/td>\r\n     <td class=\"{$trow}{$thread_type_class}\">{$lastposttimeago}<br \/>\r\n    <a href=\"{$lastpostlink}\">Last Post:<\/a> {$lastposterlink}<br \/>{$lastavatar}<\/td>\r\n{$modcol}\r\n  

Have fun!
[Image: 40760215fx.jpg]
Thanks for your contribution OlDirty. Do you mind if I create a new file called sidebar_templates.json and add it to the plugin for the next release? This way if users would prefer to use it as a sidebar rather than above / below the forum list they have that option.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42