Page 1 of 1
Displaying Video Description
Posted: Sat Jan 03, 2004 9:47 pm
by Mo
Using PHP I am scanning a directory for .AVI files then listing the file names and sizes as links to play them. I do not want to display the file names, but rather a description of the file. I do not want to use a database. Can this be done? I know that an image stores a description (by right-clicking and viewing the images properties).
Posted: Sat Jan 03, 2004 11:39 pm
by Gen-ik
The best way is to store a .txt file with the .avi and give it the same name. That way you can put the description of the movie in the text file and load it up into PHP, ie if the movie is called Boobs.avi then create a text file called Boobs.txt
Posted: Mon Jan 05, 2004 8:38 am
by Mo
Yes, I think that is a good way. I use one text file for all of my videos, correct?
Posted: Mon Jan 05, 2004 9:57 am
by m3mn0n
Nah, with that way each AVI should have its own TXT.
If the information isn't going to be changing much, why not use [php_man]switch[/php_man]() and set a $description variable for each of the filenames. Unless of course embedding the data within the code is a bad solution for you. Sometimes I do it this way, sometimes I use a DB or TXT/HTML file.
Posted: Mon Jan 05, 2004 10:44 am
by JAM
If going for the multible textfiles solution;
To ease up on the handling of this a text file with the identical name (except the .avi/.txt extension of course) is one idea.
A very simple but understandable example:
Code: Select all
$filename = 'my_name_is_foo.avi';
$text = substr($filename,-3); // my_name_is_foo
include($text.'.txt'); // my_name_is_foo.txt holding the description