File: /home/httpd/html/freecams1.com/public_html/admin/delMob.php
<?
//deletes mobile versions of all videos
include_once('db.php');
$result = dbQuery("SELECT * FROM content WHERE mobile != ''",false);
foreach($result as $row) {
echo "Processing $row[record_num]\n";
$first = $row['filename'][0];
$second = $row['filename'][1];
$third = $row['filename'][2];
$forth = $row['filename'][3];
$fifth = $row['filename'][4];
$subdir = $first.'/'.$second.'/'.$third.'/'.$forth.'/'.$fifth.'/';
$mobFile = $row['mobile'];
$filepath = "$video_path/$subdir".$mobFile;
if(is_file($filepath)) {
if(unlink($filepath)) {
dbQuery("UPDATE content SET mobile = '' WHERE record_num = '$row[record_num]'");
}
}
}
exit("Done");