Thread Rating:
  • 10 Vote(s) - 3.2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[For 1.8] Recent Threads On Index [Updated 02-09-21]
The readme file addresses how to achieve this.
Reply
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>
Reply
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.
Reply
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.
Reply
(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?
Reply
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.
Reply
(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!
Reply
This should be handled via plugin without code chnages... not?
[MyBB 1.8 Czech translation] [MyBB 1.8 plugins]: Prune old PMs + optimize DB plugin --- Thank you/like system
Reply
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]
Reply
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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)