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();

View File

@ -17,7 +17,7 @@
<div id="div_share_link_form">
<label>Views / Expire <strong class="text-danger">*</strong></label>
<label>Views / Expire <strong class="text-danger">*</strong> <small class="text-secondary">Enter 0 for unlimited</small></label>
<div class="form-row">
<div class="col-4">
<div class="input-group mb-3">
@ -36,6 +36,8 @@
<option value="30 MINUTE">30 Minutes</option>
<option value="24 HOUR">24 Hours (1 Day)</option>
<option value="72 HOUR">72 Hours (3 Days)</option>
<option value="100 YEAR">NEVER</option>
</select>
</div>
</div>