// POST AN ARTICLE notification write
$result = mysql_query("
CALL AddNotificationOnPosts(".$UserId.",".$LastId.",".$LastGroupId.");
");
$ArrayIncrement = 0;
while($row = mysql_fetch_assoc($result))
{
// Now update each notifications.xml for every user that need this
$ArrayUserIdToUpdate[$ArrayIncrement] = $row['user_id'];
$ArrayMessagesCount[$ArrayIncrement] = $row['messages'];
$ArrayNotificationCount[$ArrayIncrement] = $row['notifications'];
$ArrayTasksCount[$ArrayIncrement] = $row['tasks'];
$ArrayTotalCount[$ArrayIncrement] = $row['total'];
$ArrayIncrement++;
}
/* WRITEING THE XML */
foreach($ArrayUserIdToUpdate as $Key=>$UserIdToUpdate)
{
echo $UserIdToUpdate."-<br/>";
echo $ArrayMessagesCount[$Key]."-<br/>";
echo $ArrayNotificationCount[$Key]."-<br/>";
echo $ArrayTasksCount[$Key]."-<br/>";
echo $ArrayTotalCount[$Key]."-<br/><br/>";
file_put_contents('../xdata/xml/notifications/'.$UserIdToUpdate.'.xml','<?xml version="1.0"?><data><page messages="'.$ArrayMessagesCount[$Key].'" notifications="'.$ArrayNotificationCount[$Key].'" tasks="'.$ArrayTasksCount[$Key].'" total="'.$ArrayTotalCount[$Key].'"/></data>');
}