2012-09-18, 01:05 PM
Hey guys i have a problem ... when i press de mark all as read button of my board all my message icons goes unread ... i traked down the problem to this code
is the query good or am I missing a step?
I also tried this
But same result ... any help would be appreciated
If some of you can help me get this working as a function like this, it would really be handy.
$check = is_tid_read($tid, $uid); // return true or false
$query_view = $db->query("SELECT * FROM ".TABLE_PREFIX."threadsread WHERE tid='$tid' AND uid='$uid' AND dateline > ".$tab["lastpost"]);
if($db->num_rows($query_view)==0){
$read_image='<img src="'.$mybb->settings['bburl'].'/images/fs_unread.gif">';
} else {
$read_image='<img src="'.$mybb->settings['bburl'].'/images/fs_read.gif">';
}
is the query good or am I missing a step?
I also tried this
$mquery = $db->simple_select("threadsread", "dateline", "uid='$uid' AND tid='$tid'");
$thread_read = $db->fetch_field($mquery, "dateline");
if($mybb->settings['threadreadcut'] > 0 && $uid){
$read_image='<img src="'.$mybb->settings['bburl'].'/images/fs_read.gif">';
} else {
$read_image='<img src="'.$mybb->settings['bburl'].'/images/fs_unread.gif">';
}
But same result ... any help would be appreciated
If some of you can help me get this working as a function like this, it would really be handy.
$check = is_tid_read($tid, $uid); // return true or false