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



Find us on Facebook
Go Back   osCommerce and osCMax shopping cart software forums > osCommerce 2.2 Forums > New osCommerce Contributions

Connect with Facebook Register FAQDonate Members List Calendar Mark Forums Read


Closed Thread

 

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


 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 15,761
Thanks: 139
Thanked 609 Times in 521 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

*** Do not PM me requesting paid help. The only paid work I do is for AABox Web Hosting customers ***

Stay Up To Date with everything osCMax:
Free osCMax Newsletters - Security notices, New Releases, osCMax News
osCMax on Twitter - Up to the minute info as it happens. Know it first.

osCMax User Manual - osCMax Templates - Advanced Template Tutorial

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Closed Thread

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 09:10 AM
Report Missing and Unassignes Images michael_s New osCommerce Contributions 0 01-13-2007 01:00 PM
Report Missing and Unassignes Images michael_s New osCommerce Contributions 0 01-13-2007 11:11 AM
Missing Product Images driwashsolutions osCMax v2 Customization/Mods 0 12-08-2006 02:13 PM
HTTPS SSL images missing also weird links? doug osCommerce 2.2 Installation Help 7 05-12-2005 10:06 AM


All times are GMT -8. The time now is 03:58 AM.


Powered by vBulletin®
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO
Copyright 2009 osCMax
Inactive Reminders By Icora Web Design