Jump to the post that solved this thread.
Solved: 2 Years, 8 Months, 3 Weeks ago 1.8.20 Empty folders - message count of unread instead of inbox
#1
Solved: 2 Years, 8 Months, 3 Weeks ago

  1. Go to private messages
  2. Click empty folders
  3. There are message count field that show count of unread messages instead of messages from inbox, despite the all messages are read. Inbox shows 0.
Reply
#2
Solved: 2 Years, 8 Months, 3 Weeks ago
Please include the screenshot because I think you use a special plugin for that, am I right?
[MyBB 1.8 Czech translation] [MyBB 1.8 plugins]: Prune old PMs + optimize DB plugin --- Thank you/like system
Reply
#3
Solved: 2 Years, 8 Months, 3 Weeks ago
... and the plugin is now incompatible because of new structure of folders.
@Eldenroot has a fixed version of that plugin I believe... Toungue
Reply
#4
Solved: 2 Years, 8 Months, 3 Weeks ago
private.php - inbox
   
private.php?action=empty - empty folders
   
I have all messages read, not unread how suggests empty folders page.
   

It's clean version of the newest mybb. There are no plugins.
Reply
#5
Solved: 2 Years, 8 Months, 3 Weeks ago
It's because the new folder structure isn't regarded at this point.
You could do something like this:

In private.php search for:
$foldersexploded = explode("$%%$", $mybb->user['pmfolders']);
$folderlist = '';
foreach($foldersexploded as $key => $folders)
{
    $folderinfo = explode("**", $folders, 2);
    $fid = $folderinfo[0];
    $foldername = get_pm_folder_name($fid, $folderinfo[1]);
    $query = $db->simple_select("privatemessages", "COUNT(*) AS pmsinfolder", " folder='$fid' AND uid='".$mybb->user['uid']."'");
    $thing = $db->fetch_array($query);
    $foldercount = my_number_format($thing['pmsinfolder']);
    eval("\$folderlist .= \"".$templates->get("private_empty_folder")."\";");
}

and change it to:
$foldersexploded = explode("$%%$", $mybb->user['pmfolders']);
$folderlist = $unread = '';
foreach($foldersexploded as $key => $folders)
{
    $folderinfo = explode("**", $folders, 2);
    $fid = $folderinfo[0];
    if($folderinfo[0] == "1")
    {
        $fid = "1";
        $unread = " AND status='0'";
    }
    if($folderinfo[0] == "0")
    {
        $fid = "1";
    }
    $foldername = get_pm_folder_name($folderinfo[0], $folderinfo[1]);
    $query = $db->simple_select("privatemessages", "COUNT(*) AS pmsinfolder", " folder='$fid'$unread AND uid='".$mybb->user['uid']."'");
    $thing = $db->fetch_array($query);
    $foldercount = my_number_format($thing['pmsinfolder']);
    eval("\$folderlist .= \"".$templates->get("private_empty_folder")."\";");
}
Reply
#6
Solved: 2 Years, 8 Months, 3 Weeks ago
(2019-03-24, 09:05 PM)effone Wrote: ... and the plugin is now incompatible because of new structure of folders.
@Eldenroot has a fixed version of that plugin I believe... Toungue
Unfortunately not, waiting for your reply Smile you wrote that it is simple and you look soon Smile
(2019-03-25, 06:19 PM)Poftorek Wrote: private.php - inbox

private.php?action=empty - empty folders

I have all messages read, not unread how suggests empty folders page.


It's clean version of the newest mybb. There are no plugins.
OK, this is not related to plugin, you are right, this is a bug in an implementation
[MyBB 1.8 Czech translation] [MyBB 1.8 plugins]: Prune old PMs + optimize DB plugin --- Thank you/like system
Reply
Jump to the post that solved this thread.


Forum Jump:


Users browsing this thread: 1 Guest(s)