Thread Rating:
  • 10 Vote(s) - 3.2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[For 1.8] Recent Threads On Index [Updated 02-09-21]
#51
It seems to be fixed! Thanks!

What about to add collapse button, any progress?
[MyBB 1.8 Czech translation] [MyBB 1.8 plugins]: Prune old PMs + optimize DB plugin --- Thank you/like system
Reply
#52
(2015-02-02, 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.
Reply
#53
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?
Reply
#54
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.
Reply
#55
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
Reply
#56
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.
Reply
#57
well thats good too thanks....

but a new database field is generated just like for thread title/name, just need to pull it out
Reply
#58
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;
Reply
#59
how can i grab the description field from the threads table from your query? thanka

sorry it works from your query, thanks
Reply
#60
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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)