Location: PHPKode > projects > PHP Media Manager with IMDB > config.php
<?php
//maximum size of video for re-encoding in Kb. In this case files bigger than 1.5GB won't get processed.
define ("MAX_SIZE",$max); 
$max = '1500000';

// ------------- IMPORTANT STUFF -------------
// Database connection - needs to be able to select, update, insert and for database and table to already exist
$sqlserver = "localhost";
$databasename = "";
$tablename = ""; // not strictly necessary, but what the...
$dbh=mysql_connect ($sqlserver, $databasename, $tablename) or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ($databasename);

// -----File locations
// No trailing slashes, thank you!
$httppath = ""; // Directory in which you've stored the PHP files.
$ffmpegpath = ""; // Directory in which you have stored FFMPEG, flvmdi and associated files.


// -----Encoding options
$bitrate = "200000"; // Video encoding bitrate in bits/second
$flvdir = "vids"; // the location where you are storing the encoded FLV files

// FLV player options
$player_width = 680; // FLV player width
$player_height = 400; // FLV player height

// timeout for "already encoded" message in ms
$already_timeout = 4000; 

// movie file types for conversion by ffmpeg
define("MOVIEFILETYPES", "avi mpeg mpg mov mp2 mpv wmv"); 
$movielist = explode(" ", MOVIEFILETYPES);
define("MOVIELOCATIONS", "d:/|e:/|f:/"); // movie file types for conversion by ffmpeg separated by a single | pipe. Duplicates shouldn't matter.

// file extensions the scanner should pick up. If a file type is not on the list it will not be included
define("SCANADDEXTENSIONS", "avi mpeg mpg mov mp2 mpv mp3 wav ogg flac wma");
$scan_add_extensions = explode(" ", SCANADDEXTENSIONS);

// ---------------------- FUNCTIONS -------------------- //

//This function reads the extension of the file
function getExtension($str) {
$i = strrpos($str,".");
if (!$i) { return ""; }
$l = strlen($str) - $i;
$ext = substr($str,$i+1,$l);
return $ext;
}

function RemoveExtension($strName)
{
$ext = ".".getExtension($strName);
if($ext !== false)
{
$strName = substr($strName, 0, -strlen($ext));
}
return $strName;
} 

// Function for retrieving paths recursively
Function listdir($start_dir='.') {
  $files = array();
  if (is_dir($start_dir)) {
    $fh = opendir($start_dir);
    while (($file = readdir($fh)) !== false) {
      # loop through the files, skipping . and .., and recursing if necessary
      if (strcmp($file, '.')==0 || strcmp($file, '..')==0) continue;
      $filepath = $start_dir . '/' . $file;
      if ( is_dir($filepath) )
        $files = array_merge($files, listdir($filepath));
      else
        array_push($files, $filepath);
    }
    closedir($fh);
  } else {
    # false if the function was called with an invalid non-directory argument
    $files = false;
  }
 return $files;
}
?>
Return current item: PHP Media Manager with IMDB