Support ⇒ Troubleshootings ⇒ Unread Message count "-1" ⇒ Community Forums ⇒ CPG Dragonfly™ CMS
Forum IndexTroubleshootings

Unread Message count "-1" Reply to topic


I tried to post this to the project module, but got an error.
So hopefully the devs see this.

Occassionally I see a user with "-1" unread messages. It happened to me recently also, but I'm not sure how it happens.
In any case, I would suggest the following changes to stop it happening.

In Private_Messages/read.php

Line 82: Replace with $sql = "user_new_privmsg = user_new_privmsg - 1 WHERE user_new_privmsg > 0"; Line 86: Replace with $sql = "user_unread_privmsg = user_unread_privmsg - 1 WHERE user_unread_privmsg > 0"; Line 90: Replace with $db->sql_query("UPDATE ".$user_prefix."_users SET $sql AND user_id = ".$userinfo['user_id']);

That should make sure that it never falls below zero.

Test Signature

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):

Last edited by hybrid on Mon Sep 22, 2014 5:27 am; edited 2 times in total


See link

Pro_News CM™ - Content Management for Dragonfly CMS™

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux / 1.3.39 - 2.4.9 / 5.5.42 - 5.6.16 / 5.4.37 - 5.5.11 / 9.4


Ok, so at least it should be fixed in V10.

Test Signature

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):

All times are UTC


Jump to: