Cannot redeclare mime_content_type()

Forum for support on the Internet Media Manager Application

Cannot redeclare mime_content_type()

Postby benke » Wed Nov 05, 2008 3:31 pm

Hi all.

Just installed Internet Media Manager on Linux with PHP 5.2.5 with safe_mode off and short_open_tag on. Invoking configure.php went fine. After that while trying to open index.php I got the following message:

Code: Select all
Fatal error: Cannot redeclare mime_content_type() in /opt/lampp/htdocs/imm/tables/files/files.php on line 24


I commented out "else" branch between lines 20 and 28 and Internet Media Manager started without problems. Now I am able to add files, photos looks just fine but when I add swf or flv files, preview is not possible. Under the Embeded code field I get message "Sorry this mimetype is not yet handled." I wander is it maybe because of my workaround in files.php file.

Thanks in advance.
benke
 
Posts: 4
Joined: Wed Nov 05, 2008 3:17 pm

Postby shannah » Wed Nov 05, 2008 4:25 pm

Hi,

This has been reported before, and must be fixed soon.

I believe that a workaround is to upload your flv files using the import option rather than the "new" option.

To import flv files, first copy your flv into the import directory via FTP. Then in IMM, select "Import records", select "Fs" for "Import file format", and click submit. Then follow the steps.

Let me know how it goes.... I'll try to get this fixed when I get a chance.

-Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby benke » Wed Nov 05, 2008 4:37 pm

Yes it works, thanks :)

I also noticed that when I am trying to delete record, I get the following warning:

Code: Select all
Warning: S3::deleteObject(): [InvalidAccessKeyId] The AWS Access Key Id you provided does not exist in our records. in /opt/lampp/htdocs/imm/lib/S3.php on line 674


and I answered "no" to question about S3 during configuration (the s3 section in conf.ini is commented). But record is deleted anyway...
benke
 
Posts: 4
Joined: Wed Nov 05, 2008 3:17 pm

Postby shannah » Wed Nov 05, 2008 4:50 pm

Thanks for posting this. I have filed these 3 issues as bugs in the issue tracker:
http://bugs.weblite.ca/view.php?id=395
http://bugs.weblite.ca/view.php?id=394
http://bugs.weblite.ca/view.php?id=393

And I'll fix them with the next release.

Best regards

Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby leblanc » Wed Dec 10, 2008 9:32 pm

i still cant get this to work.
can someone please post a link of a working files.php

this is busting my brain.

thankyou.
leblanc
 
Posts: 3
Joined: Wed Dec 10, 2008 9:23 pm

Postby benke » Thu Dec 11, 2008 1:48 am

Leblanc, what you still can't get to work?
benke
 
Posts: 4
Joined: Wed Nov 05, 2008 3:17 pm

Postby leblanc » Thu Dec 11, 2008 9:07 am

no, not yet,
Im still novice in "php", but i am excited to see this script run.

so you said to unquote the else brance meaning these { }
right. so i took those out on lines 20 and 28 and i still get
Parse error: syntax error, unexpected T_ELSE in /home/leblanc/public_html/media/tables/files/files.php on line 20


----This is the original------

if (!function_exists('mime_content_type ') and function_exists('finfo_open')) {
function mime_content_type($filename) {
$finfo = finfo_open(FILEINFO_MIME);
$mimetype = finfo_file($finfo, $filename);
finfo_close($finfo);
return $mimetype;
}
} else

if ( !function_exists ( 'mime_content_type ' ) )
{
function mime_content_type ( $f )
{
return trim ( exec ('file -bi ' . escapeshellarg ( $f ) ) ) ;
}
}




-----And this is what i put-----

if (!function_exists('mime_content_type ') and function_exists('finfo_open')) {
function mime_content_type($filename) {
$finfo = finfo_open(FILEINFO_MIME);
$mimetype = finfo_file($finfo, $filename);
finfo_close($finfo);
return $mimetype;
}
else

if ( !function_exists ( 'mime_content_type ' ) )
{
function mime_content_type ( $f )
{
return trim ( exec ('file -bi ' . escapeshellarg ( $f ) ) ) ;
}




What am i doing wrong. Any help would be greatly appreciated. Thankyou
leblanc
 
Posts: 3
Joined: Wed Dec 10, 2008 9:23 pm

Postby benke » Thu Dec 11, 2008 9:13 am

This is how it should look:

Code: Select all
if (!function_exists('mime_content_type ') and function_exists('finfo_open')) {
function mime_content_type($filename) {
   $finfo  = finfo_open(FILEINFO_MIME);
   $mimetype = finfo_file($finfo, $filename);
   finfo_close($finfo);
   return $mimetype;
}
} /*else

if ( !function_exists ( 'mime_content_type ' ) )
{
function mime_content_type ( $f )
{
   return trim ( exec ('file -bi ' . escapeshellarg ( $f ) ) ) ;
}
}*/


Notice the /* and */ signs.
benke
 
Posts: 4
Joined: Wed Nov 05, 2008 3:17 pm

Postby leblanc » Thu Dec 11, 2008 9:18 am

wow. lol. yeah that worked. Thankyou very much for your help.
i would have never thought of that.
leblanc
 
Posts: 3
Joined: Wed Dec 10, 2008 9:23 pm


Return to Internet Media Manager Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved