The purpose of this sample is to demonstrate how to add support for non-image file
types into DAlbum. In particular support for movies (AVI/MPG/Windows Media/QuickTime),
audio (WAV,MP3,WMA) and PDF files is added. Support for ANY file type can
be implemented by changing a few lines in ./config/customtypes.php.
Another interesting feature is custom fields (DAlbum 1.35+). Any album or image can be
assigned a set of custom parameters which are stored in the .albumdef.ini file.
These custom fields can be changed using web interface too.
This sample defines two custom fields: Width and Height for video files.
They are mandatory for QuickTime movies and optional for AVI/MPG/Windows Media.
Please check demo site for a demonstration.
Instructions
1. Download already patched set of templates from customtypes.zip.
2. Edit your t_showimg.php page template, find the place
where image is displayed and wrap it with the following lines:
| <?php if (!cCustom_DisplayCustomType($image)) { /*** customtypes sample ***/ ?>
|
... image code ...
| <?php } /*** customtypes sample ***/ ?>
|
The result should look like follows:
| <table border="0" cellpadding="2" cellspacing="2" >
<tr id="imageWrap">
<?php if (isset($_template['ExifDetails'])) { ?>
<td style='vertical-align: top'>
<div class='imgDetails'>
<?php template('ExifDetails'); ?>
</div>
</td>
<?php } /* ExifDetails */ ?>
<td id="showimgImageCell">
|
| <?php if (!cCustom_DisplayCustomType($image)) { /*** customtypes sample ***/ ?>
|
| <a href="<?php template('ImageHref');?>">
<img id="Image"
src="<?php template('ImageSrc');?>"
title="<?php template('ImageAlt');?>"
<?php template('ImageWidthHeight'); ?>
alt="">
</a>
|
| <?php } /*** customtypes sample ***/ ?>
|
| </td>
</tr>
</table>
</center>
</td></tr>
<!-- Row 3: copyright -->
|
2. Edit your custom.php and append the following
code to the file:
3. [Optional] Edit your custom.css and append the following lines to the file:
| /* Draws a border around media player control
The style below is suitable for main_blue.css color scheme.
*/
#MediaPlayer
{
border: 4px #336699 solid;
background-color: black;
filter: progid:DXImageTransform.Microsoft.dropShadow(color='#222222', OffX='10', OffY='10')
progid:DXImageTransform.Microsoft.BasicImage(enabled:false);
}
|
You may need to adjust colors in this snippet to match your color scheme. The given example
is for main_blue.css stylesheet.
4. Extract ./config/customtypes.php file from the downloaded archive into
your ./config directory.
5. Extract ./pictures/_icons/*.* files from the downloaded archive into
_icons subfolder of your pictures directory.
6. That's all. Modify the code above as needed. To add additional file types edit
./config/customtypes.php file.
|