osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 
 

Report Missing and Unassignes Images

This is a discussion on Report Missing and Unassignes Images within the New osCommerce Contributions forums, part of the osCommerce 2.2 Forums category; a function which can also be bundled with these and removes duplicate images for categories the file is just this ...


Go Back   osCommerce and osCMax shopping cart software forums > osCommerce 2.2 Forums > New osCommerce Contributions

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Reply

 

LinkBack Thread Tools
  #1  
Old 07-23-2007, 10:32 AM
michael_s's Avatar
osCMax Developer

 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 11,073
Thanks: 81
Thanked 348 Times in 327 Posts
Rep Power: 10
michael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond repute
Post Report Missing and Unassignes Images

a function which can also be bundled with these and removes duplicate images for categories
the file is just this function......

/************************************
*Functions * find and delete duplicate pictures from the database
************************************/

function goFindDuplicates() {
$image_query = tep_db_query("select products_id, products_image, products_subimage1, products_subimage2, products_subimage3,products_subimage4,products_sub image5,products_subimage6,products_subimage7,produ cts_subimage8, products_subimage9 from products order by products_id ");
$m = array("0","1","2","3","4","5","6","7","8","9"); // original array, all different
$m2 = array("products_image","products_subimage1","produ cts_subimage2","products_subimage3","products_subi mage4","products_subimage5","products_subimage6"," products_subimage7","products_subimage8","products _subimage9"); // original array, all different
$index = 1;
while ( $m= tep_db_fetch_array($image_query)) {
$xa[0]=$m['products_image'];
if ($m['products_subimage1'] != '') $xa[1]=$m['products_subimage1'];
if ($m['products_subimage2'] != '') $xa[2]=$m['products_subimage2'];
if ($m['products_subimage3'] != '') $xa[3]=$m['products_subimage3'];
if ($m['products_subimage4'] != '') $xa[4]=$m['products_subimage4'];
if ($m['products_subimage5'] != '') $xa[5]=$m['products_subimage5'];
if ($m['products_subimage6'] != '') $xa[6]=$m['products_subimage6'];
if ($m['products_subimage7'] != '') $xa[7]=$m['products_subimage7'];
if ($m['products_subimage8'] != '') $xa[8]=$m['products_subimage8'];
if ($m['products_subimage9'] != '') $xa[9]=$m['products_subimage9'];
$uniqueArray = array_unique($xa);//only unique values
$dupArray = array_diff_assoc($xa, $uniqueArray);//duplicated values
foreach ($dupArray as $value) {
//do whatever you want here like build an assoc array.
$index = array_search($value,$xa) ;
if ($index == 0) { $xa[0]= 'ax'; // hose
$index = array_search($value,$xa); // reset
}
// echo $m['products_id'] . ", duplicate value='$value' @ " . $m2[$index] . "
";
// echo "update products set " . $m2[$index] . " = '' where products_id = " . $m['products_id'] . '
';
tep_db_query("update products set " . $m2[$index] . " = '' where products_id = " . $m['products_id'] );
}
}
}



More...
__________________
Michael Sasek
osCMax Developer


  • osCMax Templates - Hundreds of premium quality templates designed for osCMax 2. Loyalty discounts up to 30% off!
    Each purchase supports the osCMax project with much needed funds!

  • xShop for osCMax - Windows Based osCMax administration. Improved workflow, security, speed and convenience.

  • osCMax Hosting - From basic hosting to High Availability, Load Balanced arrays, the most experienced osCMax host. Default multi server configuration for exceptional performance!

  • osCMax Template Tutorial - Learn how to make your own custom templates and how to use the powerful features of the osCMax template system.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Advertisement
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Report Missing and Unassignes Images michael_s New osCommerce Contributions 0 06-22-2007 10:10 AM
Report Missing and Unassignes Images michael_s New osCommerce Contributions 0 01-13-2007 02:00 PM
Report Missing and Unassignes Images michael_s New osCommerce Contributions 0 01-13-2007 12:11 PM
Missing Product Images driwashsolutions osCMax v2 Customization/Mods 0 12-08-2006 03:13 PM
HTTPS SSL images missing also weird links? doug osCommerce 2.2 Installation Help 7 05-12-2005 11:06 AM


All times are GMT -8. The time now is 08:08 PM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
http://www.oscmax.com/forums/
Copyright 2008 osCMax