Search for Broken Images

12 posts by 2 authors in: Forums > CMS Builder
Last Post: August 5, 2010   (RSS)

Got it!

list($uploadsRecords, $uploadsMetaData) = getRecords(array(
'tableName' => 'uploads',
'perPage' => '1000',
'orderBy' => 'num',
));
?>
<?php foreach ($uploadsRecords as $record): ?>

<?php
$url = "/var/www/vhosts/domain.com/httpdocs";
$url .= $record['urlPath']; ?>
// making path full to root
<?php if (file_exists($url))
{
// echo "this image is here";
}
else
{
echo "This image isnt here";
echo("<p><a href=\"/cmsAdmin/admin.php?menu={$record['tableName']}&action=edit&num={$record['recordNum']}\"><img src=\"{$record['urlPath']}\"></a></p>");
// print link to CMSB admin to edit record

}
?>
<?php endforeach ?>