So i wrote a little function. And set up the report link. The function is below. The issue is that when i go into the forum near the top it says "0 new messages" but once i click on that it has a message in my inbox, and is marked as unread (according to the icon). What am i missing?
Note the code is rough and uses all static info until i get it working.
Code: Select all
function pm_user() {
global $dblink; //This is my db connection
if( !$dblink )
include_once('db.php');
db_connect();
$sql = "INSERT INTO `phpbb_privmsgs` (`author_id`,`author_ip`,`message_time`,`message_subject`,`message_text`,`bbcode_uid`)
VALUES ('55','127.0.0.1','".time()."','test subj','prg test','3ikap621');";
$measurements=mysql_query($sql) or die('Failed getting measurements: ' . mysql_error());
$newid=mysql_insert_id();
$sql = "INSERT INTO `phpbb_privmsgs_to` (`msg_id`, `user_id`, `author_id`,`pm_unread`,`pm_new`)
VALUES ('".$newid."', '2', '55','1','0');";
$measurements=mysql_query($sql) or die('Failed getting measurements: ' . mysql_error());
}