Pyramids. Thanks for the great script (back in 2006)
I have tweaked slightly for B2B so that it shows:
1. Groups of access for each item
2. All image categories including
products_image
products_image_lrg
products_image_med
products_image_sm_1
products_image_sm_2
products_image_sm_3
products_image_sm_4
products_image_sm_5
products_image_sm_6
products_image_xl_1
products_image_xl_2
products_image_xl_3
products_image_xl_4
products_image_xl_5
products_image_xl_6
Here's the code if you're interested:
Code:
<?php
// missing_images_check.php vers 1.0 by pyramids 09172006
// For product info and product listing pages
// Updated by BABBiX on April 3rd 2010
$hold_miss_pic = 0;// base for missing pics
$hold_miss_pic_list = '';// hold the list of missing pics
$hold_status = 1;// for active items set to 1, otherwise set to 0
if (!file_exists('includes/configure.php')) {echo "<font size=4>Can't find the <b>'includes/configure.php'</b> file. <b>NOTE: </b>This script 'missing_images_check.php' needs to run in the shop root</font>";die();}
require ('includes/configure.php');// login info
$conn = mysql_connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD) or die(mysql_error());// connect to db
$select_db = mysql_select_db(DB_DATABASE, $conn) or die(mysql_error());//select the right db
$sql = "select p.products_image as products_image, p.products_image_lrg as products_image_lrg, p.products_image_med as products_image_med, p.products_image_sm_1 as products_image_sm_1, p.products_image_sm_2 as products_image_sm_2, p.products_image_sm_3 as products_image_sm_3, p.products_image_sm_4 as products_image_sm_4, p.products_image_sm_5 as products_image_sm_5, p.products_image_sm_6 as products_image_sm_6, p.products_image_xl_1 as products_image_xl_1, p.products_image_xl_2 as products_image_xl_2, p.products_image_xl_3 as products_image_xl_3, p.products_image_xl_4 as products_image_xl_4, p.products_image_xl_5 as products_image_xl_5, p.products_image_xl_6 as products_image_xl_6, p.products_model as products_model, p.products_group_access as products_group_access from products p where p.products_status = '" . $hold_status . "'";
$result = mysql_query($sql, $conn) or die(mysql_error());
//run through every product with the status of "on" (default) check to see if the images exists
while ($get_data = mysql_fetch_array($result)){
if (!file_exists('images/' . $get_data['products_image'])){
$hold_miss_pic++;// count missing pics
$hold_miss_pic_list .= ' Missing products_image <font color="Red"><b>' . $get_data['products_model'] . '</b></font> Product Listing Page Image: <font color="Red"><b>' . strip_tags($get_data['products_image']) . '</b></font> ' . strip_tags($get_data['products_group_access']) . '</b></font><br>';// make list of missing pics
}
if (!file_exists('images/' . $get_data['products_image_med'])){
$hold_miss_pic++;// count missing pics
$hold_miss_pic_list .= ' Missing products_image_med <font color="Red"><b> ' . $get_data['products_model'] . '</b></font> Product Info Page Image: <font color="Red"><b>' . strip_tags($get_data['products_image_med']) . '</b></font> ' . strip_tags($get_data['products_group_access']) . '</b></font><br>';// make list of missing pics
}
if (!file_exists('images/' . $get_data['products_image_lrg'])){
$hold_miss_pic++;// count missing pics
$hold_miss_pic_list .= ' Missing products_image_lrg <font color="Red"><b>' . $get_data['products_model'] . '</b></font> Product Listing Page Image: <font color="Red"><b>' . strip_tags($get_data['products_image_lrg']) . '</b></font> ' . strip_tags($get_data['products_group_access']) . '</b></font><br>';// make list of missing pics
}
if (!file_exists('images/' . $get_data['products_image_sm_1'])){
$hold_miss_pic++;// count missing pics
$hold_miss_pic_list .= ' Missing products_image_sm_1 <font color="Red"><b> ' . $get_data['products_model'] . '</b></font> Product Info Page Image: <font color="Red"><b>' . strip_tags($get_data['products_image_sm_1']) . '</b></font> ' . strip_tags($get_data['products_group_access']) . '</b></font><br>';// make list of missing pics
}
if (!file_exists('images/' . $get_data['products_image_sm_2'])){
$hold_miss_pic++;// count missing pics
$hold_miss_pic_list .= ' Missing products_image_sm_2 <font color="Red"><b> ' . $get_data['products_model'] . '</b></font> Product Info Page Image: <font color="Red"><b>' . strip_tags($get_data['products_image_sm_2']) . '</b></font> ' . strip_tags($get_data['products_group_access']) . '</b></font><br>';// make list of missing pics
}
if (!file_exists('images/' . $get_data['products_image_sm_3'])){
$hold_miss_pic++;// count missing pics
$hold_miss_pic_list .= ' Missing products_image_sm_3 <font color="Red"><b> ' . $get_data['products_model'] . '</b></font> Product Info Page Image: <font color="Red"><b>' . strip_tags($get_data['products_image_sm_3']) . '</b></font> ' . strip_tags($get_data['products_group_access']) . '</b></font><br>';// make list of missing pics
}
if (!file_exists('images/' . $get_data['products_image_sm_4'])){
$hold_miss_pic++;// count missing pics
$hold_miss_pic_list .= ' Missing products_image_sm_4 <font color="Red"><b> ' . $get_data['products_model'] . '</b></font> Product Info Page Image: <font color="Red"><b>' . strip_tags($get_data['products_image_sm_4']) . '</b></font> ' . strip_tags($get_data['products_group_access']) . '</b></font><br>';// make list of missing pics
}
if (!file_exists('images/' . $get_data['products_image_sm_5'])){
$hold_miss_pic++;// count missing pics
$hold_miss_pic_list .= ' Missing products_image_sm_5 <font color="Red"><b> ' . $get_data['products_model'] . '</b></font> Product Info Page Image: <font color="Red"><b>' . strip_tags($get_data['products_image_sm_5']) . '</b></font> ' . strip_tags($get_data['products_group_access']) . '</b></font><br>';// make list of missing pics
}
if (!file_exists('images/' . $get_data['products_image_sm_6'])){
$hold_miss_pic++;// count missing pics
$hold_miss_pic_list .= ' Missing products_image_sm_6 <font color="Red"><b> ' . $get_data['products_model'] . '</b></font> Product Info Page Image: <font color="Red"><b>' . strip_tags($get_data['products_image_sm_6']) . '</b></font> ' . strip_tags($get_data['products_group_access']) . '</b></font><br>';// make list of missing pics
}
if (!file_exists('images/' . $get_data['products_image_xl_1'])){
$hold_miss_pic++;// count missing pics
$hold_miss_pic_list .= ' Missing products_image_xl_1 <font color="Red"><b> ' . $get_data['products_model'] . '</b></font> Product Info Page Image: <font color="Red"><b>' . strip_tags($get_data['products_image_xl_1']) . '</b></font> ' . strip_tags($get_data['products_group_access']) . '</b></font><br>';// make list of missing pics
}
if (!file_exists('images/' . $get_data['products_image_xl_2'])){
$hold_miss_pic++;// count missing pics
$hold_miss_pic_list .= ' Missing products_image_xl_2 <font color="Red"><b> ' . $get_data['products_model'] . '</b></font> Product Info Page Image: <font color="Red"><b>' . strip_tags($get_data['products_image_xl_2']) . '</b></font> ' . strip_tags($get_data['products_group_access']) . '</b></font><br>';// make list of missing pics
}
if (!file_exists('images/' . $get_data['products_image_xl_3'])){
$hold_miss_pic++;// count missing pics
$hold_miss_pic_list .= ' Missing products_image_xl_3 <font color="Red"><b> ' . $get_data['products_model'] . '</b></font> Product Info Page Image: <font color="Red"><b>' . strip_tags($get_data['products_image_xl_3']) . '</b></font> ' . strip_tags($get_data['products_group_access']) . '</b></font><br>';// make list of missing pics
}
if (!file_exists('images/' . $get_data['products_image_xl_4'])){
$hold_miss_pic++;// count missing pics
$hold_miss_pic_list .= ' Missing products_image_xl_4 <font color="Red"><b> ' . $get_data['products_model'] . '</b></font> Product Info Page Image: <font color="Red"><b>' . strip_tags($get_data['products_image_xl_4']) . '</b></font> ' . strip_tags($get_data['products_group_access']) . '</b></font><br>';// make list of missing pics
}
if (!file_exists('images/' . $get_data['products_image_xl_5'])){
$hold_miss_pic++;// count missing pics
$hold_miss_pic_list .= ' Missing products_image_xl_5 <font color="Red"><b> ' . $get_data['products_model'] . '</b></font> Product Info Page Image: <font color="Red"><b>' . strip_tags($get_data['products_image_xl_5']) . '</b></font> ' . strip_tags($get_data['products_group_access']) . '</b></font><br>';// make list of missing pics
}
if (!file_exists('images/' . $get_data['products_image_xl_6'])){
$hold_miss_pic++;// count missing pics
$hold_miss_pic_list .= ' Missing products_image_xl_6 <font color="Red"><b> ' . $get_data['products_model'] . '</b></font> Product Info Page Image: <font color="Red"><b>' . strip_tags($get_data['products_image_xl_6']) . '</b></font> ' . strip_tags($get_data['products_group_access']) . '</b></font><br>';// make list of missing pics
}
}
if ($hold_miss_pic>0){
echo '<font size="4">Missing <font color="Red"><b>' . $hold_miss_pic . '</b></font> picture(s): <br><br>' . $hold_miss_pic_list . '</font>';// print the info
}else
{
echo 'No missing product_info or product_listing page images';// print the info
}
?>
Save to a new file name and upload to whereever you would place the original file.