coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: dreams83 on October 20, 2006, 03:50:15 AM

Title: How to turn off media player?
Post by: dreams83 on October 20, 2006, 03:50:15 AM
I have some music on my site and i have a flash player to play music. So I want to remove the embeded media player. I hvae a picture attached with the highlighted player that I want to remove. If you guys can point in the right direction liek where I could edit the code for it that would be great. Because I I edit a plugin to go show the flash player if the file being viewed is MP3 so I still want the embbed media player to show up for other files like wma.

Thank You

(http://player.png)
Title: Re: How to turn off media player?
Post by: dreams83 on October 20, 2006, 10:51:02 PM
Okay I was able to find a way to do it now.

I copy the function theme_html_picture() from sample theme.php to my current's template's theme.php and just do not set the player.
This is what I did:


if (stristr($picture_url,".WMA") ){ //It will run the code before if the file is not MP3
    if ($mime_content['content']=='movie' || $mime_content['content']=='audio') {

        if ($CURRENT_PIC_DATA['pwidth']==0 || $CURRENT_PIC_DATA['pheight']==0) {
            $CURRENT_PIC_DATA['pwidth']  = 320; // Default width

            // Set default height; if file is a movie
            if ($mime_content['content']=='movie') {
                $CURRENT_PIC_DATA['pheight'] = 240; // Default height
            }
        }

        $ctrl_offset['mov']=15;
        $ctrl_offset['wmv']=45;
        $ctrl_offset['swf']=0;
        $ctrl_offset['rm']=0;
        $ctrl_offset_default=45;
        $ctrl_height = (isset($ctrl_offset[$mime_content['extension']]))?($ctrl_offset[$mime_content['extension']]):$ctrl_offset_default;
        $image_size['whole']='width="'.$CURRENT_PIC_DATA['pwidth'].'" height="'.($CURRENT_PIC_DATA['pheight']+$ctrl_height).'"';
    }
}


Is there a better way to do it?
Title: Re: How to turn off media player?
Post by: Sami on October 21, 2006, 07:23:58 AM
maybe it's better to change the if statment to :

if (!stristr($picture_url,".mp3") ){ //It will run the code before if the file is not MP3

this way it run on all other type (not just WMA) instead of mp3
Title: Re: How to turn off media player?
Post by: dreams83 on October 22, 2006, 07:36:49 AM
thank you
Title: Re: How to turn off media player?
Post by: Sami on October 22, 2006, 07:42:02 AM
Can we mark this thread as a solved?
Title: Re: How to turn off media player?
Post by: bïöµï¢ on October 23, 2006, 02:49:40 AM
Quote from: Sami on October 21, 2006, 07:23:58 AMif (!stristr($picture_url,".mp3") ){ //It will run the code before if the file is not MP3

this way it run on all other type (not just WMA) instead of mp3

This is great!.. Tnx (& for the topic) :)
Title: Re: How to turn off media player?
Post by: dreams83 on October 23, 2006, 09:23:58 AM
yeah, it is solved :-) Thank you