- // create the user entries for this feed
- if (!get_pref("ALLOW_DUPLICATE_POSTS", $owner_uid, false)) {
- continue;
- }
+ // create the user entries for this feed (if needed)
+ if (get_pref("ALLOW_DUPLICATE_POSTS", $owner_uid, false)) {
+
+ $query = "SELECT int_id FROM ttrss_user_entries WHERE
+ ref_id = '$base_entry_id' AND owner_uid = '$owner_uid'
+ AND (feed_id = '$feed' OR feed_id IS NULL) LIMIT 1";
+
+ $result = db_query($query);
+
+ if (db_num_rows($result) == 0) {
+ _debug("allow duplicate posts is enabled and user record is not found, continuing.");
+ } else {
+ continue;
+ }
+
+ } else {
+ continue;
+ }