Python Forum
posts remain in Unread Posts after read - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Forum & Off Topic (https://python-forum.io/forum-23.html)
+--- Forum: Board (https://python-forum.io/forum-26.html)
+--- Thread: posts remain in Unread Posts after read (/thread-3421.html)

Pages: 1 2 3


RE: posts remain in Unread Posts after read - wavic - May-31-2017

(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-system-comand-into-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.


RE: posts remain in Unread Posts after read - metulburr - May-31-2017

(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-system-comand-into-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


RE: posts remain in Unread Posts after read - micseydel - May-31-2017

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.


RE: posts remain in Unread Posts after read - metulburr - May-31-2017

(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.


RE: posts remain in Unread Posts after read - wavic - May-31-2017

The page I am pointing to above has three posts all


RE: posts remain in Unread Posts after read - micseydel - May-31-2017

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.


RE: posts remain in Unread Posts after read - wavic - May-31-2017

I do not use 'Unread Posts'


RE: posts remain in Unread Posts after read - metulburr - May-31-2017

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]");
   }
}



RE: posts remain in Unread Posts after read - wavic - May-31-2017

Client side issue?


RE: posts remain in Unread Posts after read - Larz60+ - May-31-2017

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.