forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: Pieter.txt on September 14, 2010, 05:02:59 pm

Title: Download movie link
Post by: Pieter.txt on September 14, 2010, 05:02:59 pm
I'm performing a test-upgrade of my gallery to 1.5. Everything is going fine so far. It's just that I was using the movie_download plugin, which allows displaying a download-link for various file-types.
It appears that something similar is now available in the default installation as well. However, it only works for movies. Is it possible to modify this behaviour such that it also displays for other filetypes, such as PDF and MP3?
Title: Re: Download movie link
Post by: Αndré on September 14, 2010, 06:41:28 pm
Sure. Just modify that code to your needs:
Code: [Select]
        if ($mime_content['content']=='movie') {
            $info[$lang_picinfo['download_URL']] = '<a href="' . $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . $path_to_pic.'">'. $lang_picinfo['movie_player'] .'</a>';
        }
Title: Re: Download movie link
Post by: Pieter.txt on September 14, 2010, 07:28:29 pm
So, are you saying I should modify core code and should do so with each (security) update?
Isn't it possible to modify this behaviour via a plugin or something?
Title: Re: Download movie link
Post by: Αndré on September 14, 2010, 07:49:00 pm
Copy the appropriate function to the theme.php file of your theme and modify it there as described in the docs (http://documentation.coppermine-gallery.net/en/theme.htm#theme_engine).
Title: Re: Download movie link
Post by: phill104 on September 14, 2010, 08:45:26 pm
Just to expand on Andre's information, any changes you make you theme.php will remain after any updates as long as you rename your custom theme as per the docs. Some people are suggesting that information is not clear enough hence my addition.
Title: Re: Download movie link
Post by: Pieter.txt on September 14, 2010, 11:17:33 pm
Thanks for the link to the appropriate section in the documentation. I didn't know you could override functions in theme.php.