Hi!
It's probably something easy to spot but somehow I fail to do so.
I'm working on a plugin that updates the users table in the database with the dateline of a post - based on a list of fids.
This is the hook I use:
and this is the function:
My problem there is the part with $post['dateline']. I all works fine if I fill the array with a set number or stuff like time() but as soon as I try to fill it with the value from the other array all I get is a 0 in the "lastippost" field in the database. However it seems to work just like that in the datahandler/post.php file itself.
Do you have any idea why it doesn't work?
Many thanks in advance!
Senya
It's probably something easy to spot but somehow I fail to do so.
I'm working on a plugin that updates the users table in the database with the dateline of a post - based on a list of fids.
This is the hook I use:
$plugins->add_hook("datahandler_post_insert_post", "lastippost_insert");
and this is the function:
function lastippost_insert()
{
global $db, $mybb, $post;
if ($mybb->settings['lastippost'] != '')
{
$forenids = explode(",", trim($mybb->settings['lastippost']));
if (in_array($post['fid'], $forenids))
{
$db->update_query("users",array('lastippost' => (int)$post['dateline']),"uid = '".$post['uid']."'");
}
}
}
My problem there is the part with $post['dateline']. I all works fine if I fill the array with a set number or stuff like time() but as soon as I try to fill it with the value from the other array all I get is a 0 in the "lastippost" field in the database. However it seems to work just like that in the datahandler/post.php file itself.
Do you have any idea why it doesn't work?
Many thanks in advance!
Senya