Posts: 5,151
Threads: 396
Joined: Sep 2016
Oct-08-2016, 05:22 PM
(This post was last modified: Oct-08-2016, 05:37 PM by metulburr.)
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:
Posts: 2,953
Threads: 48
Joined: Sep 2016
Oct-08-2016, 07:01 PM
(This post was last modified: Oct-08-2016, 07:09 PM by wavic.)
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";
Posts: 3,458
Threads: 101
Joined: Sep 2016
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.
Posts: 5,151
Threads: 396
Joined: Sep 2016
Oct-08-2016, 10:50 PM
(This post was last modified: Oct-08-2016, 10:52 PM by metulburr.)
(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:
Posts: 4,220
Threads: 97
Joined: Sep 2016
Shouldn't that be date_add? And is dateline the correct type?
Posts: 2,953
Threads: 48
Joined: Sep 2016
Oct-08-2016, 10:57 PM
(This post was last modified: Oct-08-2016, 10:58 PM by wavic.)
and t.date >= ( CURDATE() - INTERVAL 3 DAY ) I am just copy and pasting
I can only read sql.
Posts: 5,151
Threads: 396
Joined: Sep 2016
Oct-08-2016, 11:03 PM
(This post was last modified: Oct-08-2016, 11:28 PM by metulburr.)
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:
Posts: 4,220
Threads: 97
Joined: Sep 2016
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.
Posts: 2,953
Threads: 48
Joined: Sep 2016
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.
Posts: 5,151
Threads: 396
Joined: Sep 2016
Oct-08-2016, 11:31 PM
(This post was last modified: Oct-08-2016, 11:33 PM by metulburr.)
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:
|