Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[contribution] Report Missing and Unassignes Images


azer

Recommended Posts

here is the beggining of the support thread for Report Missing and Unassignes Images

 

http://www.oscommerce.com/community/contributions,4503

 

 

A fast report that displays products that have missing and unassigned images.

 

This is useful to hand over to a graphics person who can then review the list of missing images, create them and upload them to the server.

 

Also good to hand over to the person in charge of the inventory so that they know which products need to have images assigned to them.

 

The bottom of the report also display total counts for missing images an unassigned images.

 

This is very easy to install with one code change in the file attached to the package.

MS2

Link to comment
Share on other sites

question ,ideas, request on the version Missing Pics 2.1 of nov 2006 :

 

 

Im trying to improve a little bit the layout can i give you some litlle extra work ?

 

BUGS ?

 

 

1) It seems taht it shows the missing image file on the server , but what about the product with no images ?

 

2) It show the name of the product but not in the admin language , in english only so when you click on the name of the product , it doesnt open the edit product page but rather it goes to add a new product page :

				  <td class="dataTableContent"><a href="<? echo tep_href_link(FILENAME_CATEGORIES, 'pID=' . $id . '&action=new_product') . '">' . $product['products_name']; ?></a></td>

 

that is because the call is made by the products_name while it should be by the products_id

 

3) the center tags doesnt seems o work work

<td class="dataTableHeadingContent" align="center" width="30"><?php echo TABLE_HEADING_PRODUCT_ID; ?></td>
			  <td class="dataTableHeadingContent" align="center" ><?php echo TABLE_HEADING_PRODUCT_NAME; ?></td>

 

 

IDEAS AND TODO

 

4) the script use <? instead of <php everywhere , it s surely working but on some server it's really giving errors

 

5) is there any way to make the product name in Bold ?

 

6) gave the border a 1 instead of 0 it s really even more readeable espcially when you got extra pic

<table border="0" width="100%" cellspacing="0" cellpadding="0">
		<tr>
		  <td valign="top"><table border="[b]1[/b]" width="100%" cellspacing="0" cellpadding="2">
			<tr class="dataTableHeadingRow">
			  <td class="dataTableHeadingContent" align="center" width="30"><?php echo TABLE_HEADING_PRODUCT_ID; ?></td>

 

7) put a little triangle gif in front of name with alt like " click here to edit product"

 

8) being able to send to any email or admin if contribution admin level is installed an email report

 

9) "Congratulations!" at the end could be in language variable

 

i hope you like all the ideas :-)

MS2

Link to comment
Share on other sites

2) It show the name of the product but not in the admin language , in english only so when you click on the name of the product , it doesnt open the edit product page but rather it goes to add a new product page :

 

	   <td class="dataTableContent"><a href="<? echo tep_href_link(FILENAME_CATEGORIES, 'pID=' . $id . '&action=new_product') . '">' . $product['products_name']; ?></a></td>

 

 

that is because the call is made by the products_name while it should be by the products_id

 

i dont understand why , i use the ultra pic extra code to show the missing ultra pic images and i got several time the same product in differentes lines , but the most incredible , it show different ID fot he same product in different line and show excatly the same path for the missing images

 

Product ID Product Name Missing Image Path

 

290 matt finish court wedding rings with polished groove Image/shop/articles/lrg/bnfp597-pair-white_b.jpg (Col: products_image)

Image/shop/articles/lrg/bnfp597-pair-white_b.jpg (Col: products_image_lrg)

 

 

328 matt finish court wedding rings with polished groove Image/shop/articles/lrg/bnfp597-pair-white_b.jpg (Col: products_image)

Image/shop/articles/lrg/bnfp597-pair-white_b.jpg (Col: products_image_lrg)

 

 

330 matt finish court wedding rings with polished groove Image/shop/articles/lrg/bnfp597-pair-white_b.jpg (Col: products_image)

Image/shop/articles/lrg/bnfp597-pair-white_b.jpg (Col: products_image_lrg)

MS2

Link to comment
Share on other sites

The purpose of the script was only to find missing images, not products with no images assigned.

 

Feel free to contribute to the package. I really don't have to time to touch it right now. I just ask that you keep the code clean, easy to read, and don't remove the comments.

Please use the forums for support! I am happy to help you here, but I am unable to offer free technical support over instant messenger or e-mail.

Link to comment
Share on other sites

  • 1 year later...

i get a error:

<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- left_navigation_eof //-->
</table></td>

<!-- body_text_eof //-->
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<? require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</body>
</html>
<? require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

i did not have a column_right.php in the admin aerea

 

if i take the wrong file or it is a bug?

 

rgds

 

alfred

Link to comment
Share on other sites

  • 3 months later...

i could see that those 3 contributions could benefit from each other

 

Database Check Tool : a multi purpose check up of all products/categories aspects

http://addons.oscommerce.com/info/5962

 

 

Report Missing and Unassignes Images (compatible with multi image contribution)

http://www.oscommerce.com/community/contributions,4503

 

 

Remove Unused Images (for the moment lacking osc admin layout)

http://www.oscommerce.com/community/contributions,6346

 

 

the last one could be included in the first one , using maximum capacity of the second !!

MS2

Link to comment
Share on other sites

  • 1 year later...

Any idea how to get this working with More Pics? As currently is shows as:

 

You have 0 product images in your store and they are all accounted for!

 

When I know there are thousands. :(

Edited by Whiskers
Link to comment
Share on other sites

  • 5 months later...

Hi,

 

I need some help if poss...

 

Contrib missing_pics_2.1

 

I am using a contrib to hide categories from public view as i have lots of products in there that i do not wish to show live yet, which some are also because of missing images.

 

to make sure the products with missing images are in the right category i wanted to add a column into the missing_pics.php file, which i have done, but am having a problem with the sql query to pull the category name and place it next to the product...

 

I have added

$product_query3 = tep_db_query("SELECT categories_name FROM " . TABLE_CATEGORIES_DESCRIPTION . " WHERE categories_id='". $product2."'");
	$cat = tep_db_fetch_array($product_query3);

 

after:

$product_query2 = tep_db_query("SELECT categories_id FROM products_to_categories WHERE products_id = '" . (int)$id . "'");
       $product2 = tep_db_fetch_array($product_query2);

 

then added in

<td class="dataTableContent" align="center" width="30"><? echo $cat; ?></td>

 

after:

<tr>
                 <td class="dataTableContent" align="center" width="30"><? echo $id; ?></td>

 

But it doesnt show the category name at all... i have checked the sql query directly in phpmyadmin and it returns a result so i am pretty stumped... any help is appreaciated...

 

thanks - mark

Link to comment
Share on other sites

Hi All....

 

I still need some help on the previous post about getting the right SQL query so i can display the category name....

 

I have also tried to add alernate table colours on the page too, this is for when i launch a new site/add lots of products you can see the lines more easily.

 

I have the alternate colours working but both rows are exactly the same and duplicate that way down the page. i'm not a php/sql coder so if anyone can point me i the right direction to finish it off is greatly appreciated...

 

Many Thanks

 

This is the page i have:

 

<?
/*
 missing_pics.php,v 2.1 2006/11/20 22:05:52

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Idea by FaustinoInc.com

 Rewritten by Brian Burton (dynamoeffects)

 Released under the GNU General Public License
*/
 require('includes/application_top.php');
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <? echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<? echo CHARSET; ?>">
<title><? echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<script language="javascript" src="includes/general.js"></script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onLoad="SetFocus();">
<!-- header //-->
<? require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
 <tr>
   <td width="<? echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<? echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
<!-- left_navigation //-->
<? require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
   </table></td>
<!-- body_text //-->
   <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
     <tr>
       <td class="pageHeading"><? echo HEADING_TITLE; ?></td>
     </tr>
<?
 /* ------------------------------------------------------------- */
 /* ------------------ CONFIGURABLE SETTINGS -------------------- */
 /* ------------------------------------------------------------- */

 //Change this line if you keep your images stored in a strange directory.
 //Don't touch it unless you're having problems.
 $image_directory = DIR_FS_CATALOG . DIR_WS_IMAGES;


 /*  ** Image Columns **
  *  If you have various image contributions installed and have more than one  
  *  image column in your database, add additional items to this array to include them.
  *  For example, if you have UltraPics installed, the array would look like this:
  *  $image_columns = array('products_image',
  *                         'products_image_med', 	
  *                         'products_image_lrg', 	
  *                         'products_image_sm_1', 	
  *                         'products_image_xl_1', 	
  *                         'products_image_sm_2', 	
  *                         'products_image_xl_2', 	
  *                         'products_image_sm_3', 	
  *                         'products_image_xl_3', 	
  *                         'products_image_sm_4', 	
  *                         'products_image_xl_4', 	
  *                         'products_image_sm_5', 	
  *                         'products_image_xl_5', 	
  *                         'products_image_sm_6', 	
  *                         'products_image_xl_6');
  */
 $image_columns = array('products_image');

 /* ------------------ STOP EDITING HERE -------------------- */

 $column_query_string = '';
 $image_count = 0;

 foreach ($image_columns as $column) {
   if ($column_query_string != '') $column_query_string .= ', ';
   $column_query_string .= $column;
 }

 $image_array = array();
 $images_query = tep_db_query("SELECT products_id, " . $column_query_string . " FROM " . TABLE_PRODUCTS);

 while ($row = tep_db_fetch_array($images_query)) {
   $image_array[$row['products_id']] = array();

   foreach ($image_columns as $column) {
     if ($row[$column] != '') {
       $image_array[$row['products_id']][] = array('image' => $row[$column], 'column' => $column);
       $image_count++;
     }
   }
 }

 /* Our image array is now built, start checking files. */
 $missing_images = array();

 foreach ($image_array as $id => $product) {
   foreach ($product as $image) {
     if (!is_file($image_directory . $image['image'])) {
       if (!is_array($missing_images[$id])) $missing_images[$id] = array();

       $missing_images[$id][] = $image['image'] . '  <i>(Col: ' . $image['column'] . ')</i>';
     }
   }
 }
?>
     <tr>
       <td class="main">
<?  if (count($missing_images) > 0) { ?>
         <table border="0" width="100%" cellspacing="0" cellpadding="0">
           <tr>
             <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
               <tr class="dataTableHeadingRow">
             <!--    <td class="dataTableHeadingContent" align="center" width="30"><?php echo TABLE_HEADING_PRODUCT_ID; ?></td> --> 
                 <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CATEGORY; ?></td>
                 <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCT_NAME; ?></td>
                 <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCT_IMAGES; ?></td>
               </tr>
<?
     foreach ($missing_images as $id => $files) { 
       $product_query = tep_db_query("SELECT products_name FROM products_description WHERE products_id = '" . (int)$id . "' AND language_id = '" . ($language_id > 0 ? (int)$language_id : '1') . "'");
       $product = tep_db_fetch_array($product_query);
       $product_query2 = tep_db_query("SELECT categories_id FROM products_to_categories WHERE products_id = '" . (int)$id . "'");
       $product2 = tep_db_fetch_array($product_query2);
	$product_query3 = tep_db_query("SELECT categories_name FROM " . TABLE_CATEGORIES_DESCRIPTION . " WHERE categories_id='". $product2."'");
	$cat = tep_db_fetch_array($product_query3);
?>
               <tr>
                <!-- <td class="dataTableContent" align="center" width="30"><? echo $id; ?></td> -->
                 <td class="dataTableContent" align="center"><? echo $cat; ?></td>
                 <td class="dataTableContent"><a href="<? echo tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $product2[categories_id] . '&pID=' . $id . '&action=new_product') . '">' . $product['products_name']; ?></a></td>
                 <td class="dataTableContent">

<?  //  foreach ($files as $f) { echo $f . '<br />'; } ?>
                 </td>
               </tr>
               <tr>
                 <td colspan="4" style="padding: 0px; height: 1px; font-size: 1px; background-color: #772936"></td>
               </tr>
               <? //  } ?>
               </tr>

                               <!-- test to alternate row bagrounds-->

                               <tr>
                <!-- <td class="dataTableContent1" align="center" width="30"><? echo $id; ?></td> -->
                 <td class="dataTableContent1" align="center"><? echo $cat; ?></td>
                 <td class="dataTableContent1"><a href="<? echo tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $product2[categories_id] . '&pID=' . $id . '&action=new_product') . '">' . $product['products_name']; ?></a></td>
                 <td class="dataTableContent1">

<?     
       foreach ($files as $f) {
         echo $f . '<br />';
       }
?>
                 </td>
               </tr>
               <tr>
                 <td colspan="4" style="padding: 0px; height: 1px; font-size: 1px; background-color: #772936"></td>
               </tr>
               <?
     }
?>
               </tr>

               <!-- eof test alternate background -->

             </table></td>
           </tr>
         </table>
<?
   } else { ?>
         <table border="0" width="100%" height="100">
           <tr>
             <td class="main" valign="middle" align="center"><b><h2>Congratulations!</h2><br />You have <? echo $image_count . ' product image' . ($image_count == 1 ? '' : 's'); ?> in your store and they are all accounted for!</b></td>
           </tr>
         </table>
<?  } ?>
       </td>
     </tr>
   </table></td>

<!--    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
<!-- left_navigation //-->
<?php // require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- left_navigation_eof //-->
 <!--  </table></td> -->

<!-- body_text_eof //-->
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<? require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</body>
</html>
<? require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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...