I changed the SQL statement from
Code:
$sql = $this->registry->db->query("SELECT * FROM `" . TABLE_PREFIX . "blog` WHERE `userid`='" . $post['userid'] ."' ORDER BY `blogid` DESC LIMIT 1");
to
Code:
$sql = $this->registry->db->query("SELECT * FROM `" . TABLE_PREFIX . "blog` WHERE `userid`='" . $post['userid'] ."' AND `state`='visible' AND `pending`='0' ORDER BY `blogid` DESC LIMIT 1");
adding "
AND `state`='visible' AND `pending`='0' ". Now only "visible" posts which have been published (not "publish later") are displayed instead of all posts regardless of status. The problem of visible but non-public blog posts still remains.
I've attached the updated product file with the two changes above.