Un-answeredTopics for SMF 2.0?

Started by Phphelp, August 24, 2013, 08:11:54 PM

Previous topic - Next topic

margarett

That's easy ;)

Find:
$request = $smcFunc['db_query']('', '
SELECT COUNT(m.id_msg) as total
FROM {db_prefix}messages as m
INNER JOIN {db_prefix}topics AS t ON (t.id_topic = m.id_topic)
WHERE m.id_board IN ({array_int:list_boards})
AND m.approved = 1
AND t.num_replies = 0
AND m.poster_time > {int:time_limit}',
array(
'list_boards' => $boards_to_access,
'time_limit' => $timeLimit,
)
);

Replace with:
$request = $smcFunc['db_query']('', '
SELECT COUNT(m.id_msg) as total
FROM {db_prefix}messages as m
INNER JOIN {db_prefix}topics AS t ON (t.id_topic = m.id_topic)
WHERE t.id_board IN ({array_int:list_boards})
AND t.approved = 1
AND t.locked = 0
AND t.num_replies = 0
AND m.poster_time > {int:time_limit}',
array(
'list_boards' => $boards_to_access,
'time_limit' => $timeLimit,
)
);


Find:
$request = $smcFunc['db_query']('', '
SELECT
m.id_msg, m.subject, m.smileys_enabled, m.poster_time, m.body, m.id_topic, t.id_board, b.id_cat,
b.name AS bname, c.name AS cname, t.num_replies, m.id_member, m2.id_member AS id_first_member,
IFNULL(mem2.real_name, m2.poster_name) AS first_poster_name, t.id_first_msg,
IFNULL(mem.real_name, m.poster_name) AS poster_name, t.id_last_msg
FROM {db_prefix}messages AS m
INNER JOIN {db_prefix}topics AS t ON (t.id_topic = m.id_topic)
INNER JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board)
INNER JOIN {db_prefix}categories AS c ON (c.id_cat = b.id_cat)
INNER JOIN {db_prefix}messages AS m2 ON (m2.id_msg = t.id_first_msg)
LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)
LEFT JOIN {db_prefix}members AS mem2 ON (mem2.id_member = m2.id_member)
WHERE b.id_board IN ({array_int:list_boards})
AND m.approved = 1
AND t.num_replies = 0
AND m.poster_time > {int:time_limit}
ORDER BY m.id_msg DESC
LIMIT {int:offset}, {int:limit}',

array(
'list_boards' => $boards_to_access,
'time_limit' => $timeLimit,
'offset' => $_REQUEST['start'],
'limit' => 10,
)
);

Replace with:
$request = $smcFunc['db_query']('', '
SELECT
m.id_msg, m.subject, m.smileys_enabled, m.poster_time, m.body, m.id_topic, t.id_board, b.id_cat,
b.name AS bname, c.name AS cname, t.num_replies, m.id_member, m.id_member AS id_first_member,
IFNULL(mem.real_name, m.poster_name) AS first_poster_name, t.id_first_msg,
IFNULL(mem.real_name, m.poster_name) AS poster_name, t.id_last_msg
FROM {db_prefix}messages AS m
INNER JOIN {db_prefix}topics AS t ON (t.id_topic = m.id_topic)
INNER JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board)
INNER JOIN {db_prefix}categories AS c ON (c.id_cat = b.id_cat)
LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)
WHERE t.id_board IN ({array_int:list_boards})
    AND  t.id_first_msg = m.id_msg
AND t.approved = 1
AND t.locked = 0
AND t.num_replies = 0
AND m.poster_time > {int:time_limit}
ORDER BY m.id_msg DESC
LIMIT {int:offset}, {int:limit}',

array(
'list_boards' => $boards_to_access,
'time_limit' => $timeLimit,
'offset' => $_REQUEST['start'],
'limit' => 10,
)
);
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

roza

It worked! Thank you very much margarett. It has been much better now and I'm looking forward to see when you find free time to slightly improve this tip so that the template of unanswered topics page become similar to these default pages "unread posts since last visit" and "new replies to your posts".
Thanks again.

dougiefresh

Quote from: margarett on January 06, 2016, 04:45:42 AM
Hi.

Apart from the locked thing, the files attached here should work fine (the pagination thing is fixed), even if with some performance hit
http://www.simplemachines.org/community/index.php?topic=510124.msg3605476#msg3605476

I could pack the changes but I'm honestly out of time to properly test things :(
I could packages up the changes into a mod for you if you want....  O:)

dougiefresh

#63
It took me an hour to package up the changes.  The mod is available here....  Proper credit for the code is given within the mod description to margarett, Phphelp and Arantor.....

Quote from: roza on January 06, 2016, 02:51:18 PM
It worked! Thank you very much margarett. It has been much better now and I'm looking forward to see when you find free time to slightly improve this tip so that the template of unanswered topics page become similar to these default pages "unread posts since last visit" and "new replies to your posts".
In what way are they not familiar?
Never mind, I see what's different.....

Biology Forums

What's the action required to access this page?

dougiefresh

There is a new link underneath the "Show new replies to your posts" called "Show unanswered topics".  Click there and you'll see the unanswered posts.  I've attached a picture of what it looks like right now....

margarett

Hi dougiefresh

Thank you for packing this into an easy to use MOD. Again, kudos for your work ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

dougiefresh

You're welcome!

I'm gonna see if I can do something like the recent posts thing, purely as an opinion....  I'm thinking something like the attachment, but above the start of the posts.....  And might as well look into making the reply, quote, etc buttons work, too....

dougiefresh

I've added a topic list to the mod.  All the buttons (for example, "reply", "quote", "delete" and all the good stuff) that should show up working for the template.  The v1.1 mod is released on my website.... 

I also added admin panel options so that things like days to look for unanswered topics and default view of the list (topic or post) are included.  Anything else I should add?

roza

Thank you so much dougiefresh! I just installed the mod and It's working very nice. I really appreciate your work.

Biology Forums

Quote from: dougiefresh on February 29, 2016, 10:09:05 AMAnything else I should add?

How about filters?

Unanswered in the past 24 hours, week, and year.

dougiefresh

Quote from: Shuban on March 02, 2016, 08:12:43 PM
How about filters?

Unanswered in the past 24 hours, week, and year.
Let me look into that.  Would you want it as a dropdown menu kinda thing or what?

Biology Forums

Yes, a drop down menu using <select> is best

dougiefresh



CZNeo

Hi all,

I have started using SMF some time ago and am missing some features. I came across this MOD that should help me showing topics with no answer (aka new topics). However, after successful installation I am not able to get it working. I mean, when I post a new topic, plugin page still says "there is no unanswered topic"

I am running latest SMF, Czech language pack (MOD locales are in english), defaut theme. Any suggestions?

Cheers,
Petr

thunderchld

Thank you guys! This is great.

Feature request:  Permissions.

It would be nice if we could install this and only let certain groups see which are unanswered so they could respond.

E.g. We have 4 groups, Staff, Plot, Member1 Member 2.  Only "Staff" being able to see what is unanswered would allow them to answer questions from the other 3 groups.
(if that makes any sense)

That would allow us to provide answers yet not draw attention to unanswered issues.

dougiefresh

Please put all bug reports and feature requests in the support thread.  Thank you!




@thunderchld:  https://www.simplemachines.org/community/index.php?topic=544090.msg3936363#msg3936363

@CZNeo:  Try version 2.3.....

thunderchld

@dougiefresh - you rock; thank you!  I went back and forth which place to put it.  I really appreciate it.

efk

This mod seems very interesting. Will try it in near future. Waiting on you to finish that request about permissions :)

Advertisement: