Quote:
Originally Posted by ericgtr
I am not sure if this is possible but I would like to use the hook system if I can for this.
In attachment.php I have this code:
PHP Code:
// or doing it once an hour
$query = "INSERT INTO " . TABLE_PREFIX . "attachmentviews (attachmentid)
VALUES ($attachmentinfo[attachmentid])
";
defined('NOSHUTDOWNFUNC') ? $db->query_write($query) : $db->shutdown_query($query);
}
I would like to replace it with this:
PHP Code:
// or doing it once an hour
$query = "INSERT INTO " . TABLE_PREFIX . "attachmentviews (attachmentid, timestamp)
VALUES ($attachmentinfo[attachmentid], " . TIMENOW . ")
";
defined('NOSHUTDOWNFUNC') ? $db->query_write($query) : $db->shutdown_query($query);
}
It would be nice if I didn't have to force the user to edit the file for this mod 
|
The query is being executed directly after it is assigned; the only way you theoretically could modify it is if a hook was placed directly after the $query = "whatever"; and then have your own $query = 'whatever'; that would overwrite it.
But looking at that, there is no way to do it through a plugin for replacing the sql in that query.