Forum Moderators: coopster

Message Too Old, No Replies

what script should i use?

suggestions wanted

         

zinc

5:05 pm on Jun 2, 2004 (gmt 0)

10+ Year Member



i'm looking for a script that can index over 100.000 images in one of my web directories and add the information to a mysql database, all images are in jpg format. basically what i'm trying to do is make a cover site, but with over a 100.000 covers, i would like to make it as easy as possible for user to find the cover there looking for.

[edited by: jatar_k at 5:27 pm (utc) on June 2, 2004]
[edit reason] removed email [/edit]

thedagda

6:43 pm on Jun 2, 2004 (gmt 0)

10+ Year Member



Zinc,

Check your messages. I just sent you one.

httpwebwitch

6:50 pm on Jun 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You might find an easy way using glob(). Refer to the PHP manual for good examples using this function. There you'll even find ways to sniff recursively through directories to find images.

Here's a simple attempt:

<?php
$imagearray = glob("/path/{*.jpg,*.gif,*.png}", GLOB_BRACE);
foreach ($imagearray as $filename) {
$query="INSERT into table ('imageURL') VALUES ('".$filename."')";
$result=mysql_query($query);
}
?>

zinc

6:55 pm on Jun 2, 2004 (gmt 0)

10+ Year Member



yeah basically i just want the image name and size stored in the database and have the a search that with allow me to put in a key ford for example Abba and it will show all the results for abba. and also yes there is multiple directories with in the main covers one, they dont go any deeper that 3 dir--- thedagda or httpwebwitch if you got msn messenger you can add me , hollowman2010@hotmail.com

httpwebwitch

7:20 pm on Jun 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Adding the image URL and the image dimensions to a database will be easy - those tasks can be automated using built-in PHP functions (provided you put them together in the right way).

I'd use glob() to get all the image URLs and throw them into a database.

Then I'd walk through the database and use getimagesize() to find the height and width for each.

The really hard part of your project will be entering all those searchable keywords appropriate for each cover... For instance I presume that an ABBA cover might be found if I searched for "ABBA", "Bjorn", "Dancing Queen", "Super Trooper"

Maybe you'll need a more robust data architecture that includes tables or columns for
"album",
"song_title",
"artists",
"covers",
"publishers",
"date"
etc.

You'd need a system of cross-references between each, and entering the data would take a long time. But then once the info is entered, the whole thing would be searchable in many ways with a lot of flexibility.

[url]launch.yahoo.com[/url] has that sort of thing for their discographies.

I think you've got a pretty ambitious project going on there. Good luck!

zinc

7:28 pm on Jun 2, 2004 (gmt 0)

10+ Year Member



cheers i'l need it, anyone got a magic lamp by any chance, it might come in handy. if it comes to i'l just ask christina aquilera if i can borrow her genie in a bottle. lol

zinc

7:35 pm on Jun 2, 2004 (gmt 0)

10+ Year Member



all the covers are named in such a way that if you searched for abba it will find all the covers will abba in the name of it, atlest thats what i want it to do

httpwebwtich you said this

Adding the image URL and the image dimensions to a database will be easy - those tasks can be automated using built-in PHP functions (provided you put them together in the right way).
I'd use glob() to get all the image URLs and throw them into a database.

do you have any scripts that will do exactly that.
the covers directory is http;//81.104.107.121/covers/

there are no other file types in these directories, just jpg files.
cheers