Updated Sharing to include Unlimited Time and the option to use 0 for unlimited views

This commit is contained in:
johnnyq
2023-08-22 09:57:57 -04:00
parent 3f9c7fe220
commit 7c1cb0f617
2 changed files with 5 additions and 3 deletions

View File

@@ -38,8 +38,8 @@ if (mysqli_num_rows($sql) !== 1 || !$row) {
exit();
}
// Check item share is active & hasn't been viewed too many times
if ($row['item_active'] !== "1" || $row['item_views'] >= $row['item_view_limit']) {
// Check item share is active & hasn't been viewed too many times but allow 0 views as that is consider infinite views
if ($row['item_active'] !== "1" || ($row['item_view_limit'] > 0 && $row['item_views'] >= $row['item_view_limit'])) {
echo "<div class='alert alert-danger'>Item cannot be viewed at this time. Check with the person that sent you this link to ensure it is correct and has not expired.</div>";
include("guest_footer.php");
exit();