![]() |
|
Quick extension for mp3 and flv / Audio and Video for 1.0.3beta - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: General support (https://forum.zenphoto.org/forum-4.html) +--- Thread: Quick extension for mp3 and flv / Audio and Video for 1.0.3beta (/thread-830.html) |
Quick extension for mp3 and flv / Audio and Video for 1.0.3beta - cvogt - 2006-10-07 I wanted to have mp3 and video working in zenphoto with minimal change from the original code. I took inspiration (and flv player and little code) from the post Support of videos for ZenPhoto. [b]Notice: [/b]You NEED to have a picture with the same name like the flv or mp3 in the album folder (eg. for albums/nice_sounds/beep.mp3 you also need albums/nice_sounds/beep.jpg). Otherwise it will not be shown in the album. This is the way I got audio and video working: [list=1] Put the following code at the end of the function printDefaultSizedImage() (after line 868): echo ''; echo ''.
}` Furthermore put the following code just at the beginning of the same function (after line 863): $file_wo_ext = substr($file_full,0,strrpos($file_full,".")); if( file_exists( $file_wo_ext.".flv" )){
}` [/list] Upload some mp3, flv and the belonging pictures and try it out. For more information how to create flv see the post Support of videos for ZenPhoto. Quick extension for mp3 and flv / Audio and Video for 1.0.3beta - La0c00n - 2006-10-07 Hello, I've been offline for a long time... So, i'm (really) gonna release zenvideo-0.2 with with support for most of the themes (including stopdesign). I could include too the support of mp3... Using your code. Would you mind if i use your code cvogt ? Quick extension for mp3 and flv / Audio and Video for 1.0.3beta - cvogt - 2006-10-08 UPDATE: Make this hack work properly in IE: I experienced problems with the videos in IE and found a web page covering that problem. I made some more changes, and the function printDefaultSizedImage() now looks like this: // [BEGIN] added by cvogt: check for non image data $file_full = $_SERVER['DOCUMENT_ROOT'].getFullImageURL(); $file_wo_ext = substr($file_full,0,strrpos($file_full,".")); if( file_exists( $file_wo_ext.".flv" )){
`
`'.
} echo "[img][/img]"; if( file_exists( $file_wo_ext.".mp3" )){ echo '';
`
` '.
} `` }` Now it works properly . Quick extension for mp3 and flv / Audio and Video for 1.0.3beta - cvogt - 2006-10-08 @La0c00n: sure, use my code . And notice the above edits. |