Guest hobbyofkings Posted August 30, 2005 Share Posted August 30, 2005 Hello All, with my shop i have found it easiest to name my images with the same name I aim to use for product ID - easier to administrate as it were. sell product au0026-001 delete image au0026-001 rather than having to lookup product inorder to determine which image should go. Anyhow rather than double type I moded the produce productId code so that a blank box will assign name from image file name (less last 4 characters so at the mo built for three letter extensions) instead of a random sequence. What I was wondering is if this would be good for anyone else as if so I will make it neat and modifiable and post it, but if no one cares I won't bother. Note that this is for CC3 Remember It's your phone, It's your choice. Quote Link to comment Share on other sites More sharing options...
Guest Posted August 30, 2005 Share Posted August 30, 2005 Sounds good to me. Please post it. Quote Link to comment Share on other sites More sharing options...
Guest hobbyofkings Posted August 30, 2005 Share Posted August 30, 2005 Rough and ready version - Replace random sequence - doesn't check for image name ..... See next post Quote Link to comment Share on other sites More sharing options...
Guest hobbyofkings Posted September 7, 2005 Share Posted September 7, 2005 Good Version Now. Move to Mods if it is worth it... Anyway insert the new bit below into the index.php in admin>products Hope it is useful for someone // generate product code if(empty($_POST['productCode'])){ //Starts here $imageFormat =strtoupper(ereg_replace(".*\.(.*)$","\\1",$_POST['imageName'])); $len = (strlen($_POST['imageName']) - strlen($imageFormat))-1; $code = substr($_POST['imageName'],0,$len); if ($code){ $record["productCode"] = $db->mySQLSafe($code); }else{ //ends here $chars = array Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.