Howto: Script Autoimport Videofiles Mythtv

#!/usr/bin/php <? $db=mysql_connect(‚localhost‘,’root‘,’DBPW‘); mysql_select_db(‚mythconverg‘); echo mysql_errno() . „: “ . mysql_error(). „n“; $d = dir(„/home/video/“); while (false !== ($entry = $d->read())) { if  ( (substr(strtolower($entry),-4)==‘.avi‘) or (substr(strtolower($entry),-4)==‘.vob‘)  ) { echo $entry.“n“; $res=mysql_query(„select * from recorded where basename=’$entry’“); echo mysql_errno() . „: “ . mysql_error(). „n“; if (mysql_num_rows($res)==0) { echo „- not foundn“; mysql_query(“ INSERT INTO […]

HowTo: Mythtv Filename / Dateiname

Dateiname aus Aufzeichnungsname erstellen. #!/usr/bin/php <? function allow_text($email) { $text=$email; $chars = „ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-0123456789 „; // Erlaubte Zeichen $dummy = 0; $helper = „“; for ($i=0;$i<strlen($text);$i++) { for ($j=0;$j<strlen($chars);$j++) if ($text[$i]==$chars[$j]) $helper.=$text[                                                                                                 $i]; } return $helper; } $db=mysql_connect(‚localhost‘,’root‘,’DBPW‘); mysql_select_db(‚mythconverg‘); echo mysql_errno() . „: “ . mysql_error(). „n“; $res=mysql_query(„select *,date_format(starttime,’%d.%m.%Y %H:%i‘) as ‚dater‘ fr                                                                                                 om recorded where […]