Python Forum
posts remain in Unread Posts after read
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
posts remain in Unread Posts after read
#11
(May-31-2017, 11:47 AM)metulburr Wrote:
(May-31-2017, 06:56 AM)wavic Wrote: Just happened to me. With https://python-forum.io/Thread-Writting-...nto-a-file. I had to 'mark this forum as read' to fix it
What exactly happened initially? The link i think is useless, as it must be happening on a per user basis. I mean did you read it and it still is in unread? Did you click the python icon and it not remove color? What exactly happened?

I read the thread then went to the forum. I saw that is still in bold. So I opened the thread again. Then back to the forum. And still bold. I did this two or three times more as I was thinking that someone is changing something. But so often for 2-3 seconds? Finally, I marked the forum as read.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#12
(May-31-2017, 12:39 PM)wavic Wrote:
(May-31-2017, 11:47 AM)metulburr Wrote:
(May-31-2017, 06:56 AM)wavic Wrote: Just happened to me. With https://python-forum.io/Thread-Writting-...nto-a-file. I had to 'mark this forum as read' to fix it
What exactly happened initially? The link i think is useless, as it must be happening on a per user basis. I mean did you read it and it still is in unread? Did you click the python icon and it not remove color? What exactly happened?
I read the thread then went to the forum. I saw that is still in bold. So I opened the thread again. Then back to the forum. And still bold. I did this two or three times more as I was thinking that someone is changing something. But so often for 2-3 seconds? Finally, I marked the forum as read.
The only other possibility is marking as read is by page. So if there are 2 pages, and you only look at the first page, and the new post is in the second page, it is still shown as unread.

I think this might be a bug in the system. Ill let the author know...but not much more i can do
Recommended Tutorials:
Reply
#13
I think it's correlated with snip's posts. No idea why. I had the same thing happen. Didn't get auto-marked as read, but marking everything as read did fix it.
Reply
#14
(May-31-2017, 03:53 PM)micseydel Wrote: I think it's correlated with snip's posts. No idea why. I had the same thing happen. Didn't get auto-marked as read, but marking everything as read did fix it.
thats weird...because i dont get that at all. And i have been trying to replicate it.

Also by the way...the plugin author responded to my request. All he said was
Quote:User must go to last thread page to mark it as read.

So now i must ask those getting this error....Are you going to the last thread page? Are the unread posts that keep persisting the last post in the thread at the time of the problem?

EDIT:
Actually the one you guys linked only has one thread page....so i dont think that is the issue.
Recommended Tutorials:
Reply
#15
The page I am pointing to above has three posts all
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#16
I did have that issue at one point but figured it out myself. I generally use the button on the unreads page that brings you to the latest unread post in the thread, I don't use the link that takes you to the very beginning.

Totally reasonable for the author to think that, but I'm 99% convinced this is a bug.
Reply
#17
I do not use 'Unread Posts'
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#18
The code to mark a forum read VS the code to mark all forums read. Not sure where the problem lies in the first one that the second ensures that works.
 * Mark a particular forum as read.
*
* @param int The forum ID
*/
function mark_forum_read($fid)
{
   global $mybb, $db;

   // Can only do "true" tracking for registered users
   if($mybb->settings['threadreadcut'] > 0 && $mybb->user['uid'])
   {
       // Experimental setting to mark parent forums as read
       $forums_to_read = array();

       if($mybb->settings['readparentforums'])
       {
           $ignored_forums = array();
           $forums = array_reverse(explode(",", get_parent_list($fid)));

           unset($forums[0]);
           if(!empty($forums))
           {
               $ignored_forums[] = $fid;

               foreach($forums as $forum)
               {
                   $fids = array($forum);
                   $ignored_forums[] = $forum;

                   $children = explode(",", get_parent_list($forum));
                   foreach($children as $child)
                   {
                       if(in_array($child, $ignored_forums))
                       {
                           continue;
                       }

                       $fids[] = $child;
                       $ignored_forums[] = $child;
                   }

                   if(fetch_unread_count(implode(",", $fids)) == 0)
                   {
                       $forums_to_read[] = $forum;
                   }
               }
           }
       }

       switch($db->type)
       {
           case "pgsql":
           case "sqlite":
               add_shutdown(array($db, "replace_query"), array("forumsread", array('fid' => $fid, 'uid' => $mybb->user['uid'], 'dateline' => TIME_NOW), array("fid", "uid")));

               if(!empty($forums_to_read))
               {
                   foreach($forums_to_read as $forum)
                   {
                       add_shutdown(array($db, "replace_query"), array("forumsread", array('fid' =>     $forum, 'uid' => $mybb->user['uid'], 'dateline' => TIME_NOW), array('fid', 'uid')));
                   }
               }
               break;
           default:
               $child_sql = '';
               if(!empty($forums_to_read))
               {
                   foreach($forums_to_read as $forum)
                   {
                       $child_sql .= ", ('{$forum}', '{$mybb->user['uid']}', '".TIME_NOW."')";
                   }
               }

               $db->shutdown_query("
                   REPLACE INTO ".TABLE_PREFIX."forumsread (fid, uid, dateline)
                   VALUES('{$fid}', '{$mybb->user['uid']}', '".TIME_NOW."'){$child_sql}
               ");
       }

       // START - Unread posts MOD
       $forums_to_read[] = $fid;
       $fids = implode(',', $forums_to_read);
       $db->query("DELETE TTR.* 
                   FROM " . TABLE_PREFIX . "threadsread AS TTR
                   INNER JOIN " . TABLE_PREFIX . "threads AS TT ON TT.tid = TTR.tid
                   WHERE TTR.uid = '" . $mybb->user['uid'] . "' AND TT.fid IN (" . $fids . ")");
       // END - Unread posts MOD  
   }
   // Mark in a cookie
   else
   {
       my_set_array_cookie("forumread", $fid, TIME_NOW, -1);
   }
}
/**
* Marks all forums as read.
*
*/
function mark_all_forums_read()
{
   global $mybb, $db, $cache;

   // Can only do "true" tracking for registered users
   if($mybb->user['uid'] > 0)
   {
       $db->update_query("users", array('lastvisit' => TIME_NOW), "uid='".$mybb->user['uid']."'");
       require_once MYBB_ROOT."inc/functions_user.php";
       update_pm_count('', 2);

       if($mybb->settings['threadreadcut'] > 0)
       {
           // Need to loop through all forums and mark them as read
           $forums = $cache->read('forums');

           $update_count = ceil(count($forums)/20);

           if($update_count < 15)
           {
               $update_count = 15;
           }

           $mark_query = '';
           $done = 0;
           foreach(array_keys($forums) as $fid)
           {
               switch($db->type)
               {
                   case "pgsql":
                   case "sqlite":
                       $mark_query[] = array('fid' => $fid, 'uid' => $mybb->user['uid'], 'dateline' =>  TIME_NOW);
                       break;
                   default:
                       if($mark_query != '')
                       {
                           $mark_query .= ',';
                       }
                       $mark_query .= "('{$fid}', '{$mybb->user['uid']}', '".TIME_NOW."')";
               }
               ++$done;
              // Only do this in loops of $update_count, save query time
               if($done % $update_count)
               {
                   switch($db->type)
                   {
                       case "pgsql":
                       case "sqlite":
                           foreach($mark_query as $replace_query)
                           {
                               add_shutdown(array($db, "replace_query"), array("forumsread",            $replace_query, array("fid", "uid")));
                           }
                           $mark_query = array();
                           break;
                       default:
                           $db->shutdown_query("
                               REPLACE INTO ".TABLE_PREFIX."forumsread (fid, uid, dateline)
                               VALUES {$mark_query}
                           ");
                           $mark_query = '';
                   }
               }
           }

           if($mark_query != '')
           {
               switch($db->type)
               {
                   case "pgsql":
                   case "sqlite":
                       foreach($mark_query as $replace_query)
                       {
                           add_shutdown(array($db, "replace_query"), array("forumsread",                $replace_query, array("fid", "uid")));
                       }
                       break;
                   default:
                       $db->shutdown_query("
                           REPLACE INTO ".TABLE_PREFIX."forumsread (fid, uid, dateline)
                           VALUES {$mark_query}
                       ");
               }
           }
       }
   }
   else
   {
       my_setcookie("mybb[readallforums]", 1);
       my_setcookie("mybb[lastvisit]", TIME_NOW);

       my_unsetcookie("mybb[threadread]");
       my_unsetcookie("mybb[forumread]");
   }
}
Recommended Tutorials:
Reply
#19
Client side issue?
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#20
I think it is related to the images that snippsat posts. Just about every time it happens to me (on windows 7 pro) it is in a post with an image.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Markdown in posts wavic 1 3,123 Oct-22-2022, 06:46 PM
Last Post: snippsat
  server down while making long posts metulburr 15 5,706 Oct-11-2020, 01:42 AM
Last Post: D0X3D
  Odd Behavior with Read Posts ichabod801 7 4,124 Apr-20-2019, 12:20 AM
Last Post: Skaperen
  Feature request: custom error message for "no new posts" league55 4 3,514 Jan-25-2018, 01:19 AM
Last Post: league55
  Showing wrong number of unread posts j.crater 6 4,390 Dec-14-2017, 03:29 PM
Last Post: metulburr
  browser tab linked with unread posts counter metulburr 20 12,368 Apr-26-2017, 05:24 PM
Last Post: metulburr
  Thread remains in New Posts after complete read Larz60+ 19 198,846 Apr-24-2017, 11:28 PM
Last Post: Larz60+
  remove number from unanswered posts metulburr 5 4,688 Feb-26-2017, 03:37 AM
Last Post: Skaperen
  Unanswered Posts link micseydel 27 19,772 Dec-21-2016, 06:44 PM
Last Post: stranac
  User Requirements for "liking" posts nilamo 4 5,161 Dec-08-2016, 10:22 PM
Last Post: metulburr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020