Python Forum
Unanswered Posts link
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unanswered Posts link
#11
That plugin author has never once responded to any of my support questions or github issues. 
https://github.com/lukasamd/MyBB-View_Unanswered_Posts

Since this plugin just automates the search function with a link to it, and the search allows to select a start date, there must be a way. If someone wants to scan the php files to try some things, let me know. This plugin is fairly safe to "test" different things as its just reading from the database, and not writing it it.

Ive been looking through that plugin php files, and i cant find where i would put a condition to check only from a certain date
I am assuming it would be in this method
https://github.com/lukasamd/MyBB-View_Un...s.php#L187
Recommended Tutorials:
Reply
#12
It would be in the query. Here:


$sql = "SELECT tid
            FROM " . TABLE_PREFIX . "threads 
            WHERE {$this->where} >>> May be here. I barely know sql
            ORDER BY dateline DESC
            LIMIT 500";
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#13
Ok, so between the where and order lines, we could add: (to only show threads from the past 60 days)
and dateline >= dateadd(now(), interval -60 day)
...assuming we're using mysql.
Reply
#14
(Oct-08-2016, 07:13 PM)nilamo Wrote: Ok, so between the where and order lines, we could add: (to only show threads from the past 60 days)
and dateline >= dateadd(now(), interval -60 day)
...assuming we're using mysql.

Yes it is mysql.

This did not work. But create a mysql error when searching.
Recommended Tutorials:
Reply
#15
Shouldn't that be date_add? And is dateline the correct type?
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply
#16
and t.date >= ( CURDATE() - INTERVAL 3 DAY )
I am just copy and pasting
I can only read sql.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#17
I have no idea. I dont do anything with mysql. If another mod was to tinker with the code that is better at mysql...have at it.

Quote:Shouldn't that be date_add?
I can try it


Just to confirm, you mean this

        // Make a query to search unanswered topics
        $sql = "SELECT tid
            FROM " . TABLE_PREFIX . "threads 
            WHERE {$this->where}
            ORDER BY dateline DESC
            LIMIT 500";
        $result = $db->query($sql);
to this
        // Make a query to search unanswered topics
        $sql = "SELECT tid
            FROM " . TABLE_PREFIX . "threads 
            WHERE {$this->where}
            and dateline >= date_add(now(), interval -1 day)
            ORDER BY dateline DESC
            LIMIT 500";
        $result = $db->query($sql);
EDIT:
Currently this last is what it is, and i still see an old post (more than 1 day) with 0 posts on the search query.
Recommended Tutorials:
Reply
#18
I use a lot of sql, but I don't use sql functions much, and I don't remember php. Assuming {$this->where} resolves to an expression, that should work.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply
#19
Exactly. I've read it from Stack Overflow. But this is far from me.
But may be here there is more adequate answers. Ot the same question.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#20
I dont think that worked. Currently it shows (3), but none when you select it. 

And there are at least 1 thread without any responses older than 1 day (much older), 1 thread without any response just recently, and then 1 more, etc.

So i am going to comment that out for now.
Recommended Tutorials:
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  posts remain in Unread Posts after read Larz60+ 27 49,041 Jun-02-2017, 05:24 PM
Last Post: Kebap
  remove number from unanswered posts metulburr 5 4,755 Feb-26-2017, 03:37 AM
Last Post: Skaperen
  Testing unanswered posts (new) ichabod801 0 2,941 Oct-08-2016, 11:08 PM
Last Post: ichabod801
  testing unanswered posts (old) metulburr 0 3,373 Sep-02-2016, 04:40 PM
Last Post: metulburr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020