MyBB Community Forums
[For 1.8] Recent Threads On Index [Updated 02-12-19] - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Extensions (https://community.mybb.com/forum-201.html)
+--- Forum: Plugins (https://community.mybb.com/forum-73.html)
+---- Forum: Plugin Releases (https://community.mybb.com/forum-102.html)
+---- Thread: [For 1.8] Recent Threads On Index [Updated 02-12-19] (/thread-159857.html)

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


RE: Recent Threads On Index - Eldenroot - 02-02-2015

It seems to be fixed! Thanks!

What about to add collapse button, any progress?


RE: Recent Threads On Index - dragonexpert - 02-02-2015

(02-02-2015, 03:43 PM)Eldenroot Wrote: It seems to be fixed! Thanks!

What about to add collapse button, any progress?

Sorry, no progress there, but I will get the mods site updated later today with the fix.


RE: Recent Threads On Index - expat - 02-03-2015

How can i call the description field from another plugin that inserts into standard myBB tables?

btw, how much server load does these things use up?


RE: Recent Threads On Index - dragonexpert - 02-03-2015

I'm not sure which description you are referring to.

Server load is not that much unless you change the refresh rate by altering the recentthread_headerinclude template. It only adds one query.


RE: Recent Threads On Index - expat - 02-04-2015

well, i am not using AJAX anyways,

but the thread description plugin adds a thread description which is better as an abstract for the thread post


RE: Recent Threads On Index - dragonexpert - 02-04-2015

The only kind of description I can generate code for would be the first x characters in the first post of the thread. If that is what you would like replace the query with this:
SELECT t.*, u.username AS userusername, u.usergroup, u.displaygroup, u.avatar as threadavatar, u.avatardimensions as threaddimensions, lp.usergroup AS lastusergroup, lp.avatar as lastavatar, lp.avatardimensions as lastdimensions, lp.displaygroup as lastdisplaygroup, f.name as forum, p.message
            FROM ".TABLE_PREFIX."threads t
LEFT JOIN " . TABLE_PREFIX . "posts p ON(p.tid=t.firstpost)
LEFT JOIN ".TABLE_PREFIX."forums f ON (t.fid=f.fid) 
            LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=t.uid)
            LEFT JOIN ".TABLE_PREFIX."users lp ON (t.lastposteruid=lp.uid)
            WHERE 1=1 $where AND t.visible > {$approved} {$unsearchableforumssql} {$ignoreforums}
            ORDER BY t.lastpost DESC
            LIMIT $threadlimit

You then should do this in the while loop:
$desclength = 70;
if(strlen($thread['message']) > $desclength)
{
$thread['message'] = my_substr($thread['message'], 0, $desclength) . " ...";
}

You then use {$thread['message']} in the recentthread_thread template where you want it displayed.


RE: Recent Threads On Index - expat - 02-04-2015

well thats good too thanks....

but a new database field is generated just like for thread title/name, just need to pull it out


RE: Recent Threads On Index - dragonexpert - 02-05-2015

I need to know the name of the table and the name of the field to be able to help. If its not the mybb_posts or mybb_threads table, I also need to know the structure of it which can be found by running this query in PHPMyAdmin
SHOW CREATE TABLE $tablenamehere;



RE: Recent Threads On Index - expat - 02-05-2015

how can i grab the description field from the threads table from your query? thanka

sorry it works from your query, thanks


RE: Recent Threads On Index - dragonexpert - 02-05-2015

I updated the Mods Site with the 8.0 build. If you used the code from Github after I had posted on January 31st, you have the latest version.