Jump to content

Recommended Posts

we you will add the images to a database (just the location where they are found and the last date they was looked at)

 

once you have that information it is simple

 

you add a script that runs when you want to run it (really run it through an admin area would be best) The script looks through the records to see if an image has not been looked at for 60 days and you could do a loop through the folders to get the file names then compare them to the records in the database to see if they all match up if they do not delete the file.

 

This is just a rough start and the file deletion could be optimized but i believe you should be able to get the idea from this.

Regards

Mark

I'm familiar with a cron job, but I'm not sure how I'd add the date on the DB. For example, if you're going to xyz.com/file.jpg directly, how can store that view to the DB? The visitor is going directly to the image and not on a page where you can add script to record the date on the DB?

What's wrong with my code? I don't get any errors, but it's not writing to the DB:

 

<?php
include('db.php');

$date = $_GET['date'];
$id = $_GET['id'];
$time=date("m-d-y");
$sql = mysql_query("UPDATE images SET `last_view`='' AND `views`= views +'1' WHERE `id`='$id'") or die(mysql_error()); 
if (isset($_POST)){
header("Location: http://www.pickaloo.com/photos/$date/$id.jpg");
}
?>

that is not exactly what i mean by the idea i gave you

what i mean is that use PHP to display image any way that will work too.

$sql = mysql_query("UPDATE images SET `last_view`='' AND `views`= views +1 WHERE `id`='$id'") or die(mysql_error()); 

try . and  be sure that $id in not empty

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.