开发者 | acumensystems |
---|---|
更新时间 | 2010年11月30日 22:29 |
捐献地址: | 去捐款 |
PHP版本: | 2.5 及以上 |
WordPress版本: | 3.0 |
[attachmentgallery]
shortcode. Any page containing attachments (which Wordpress typically inserts as
HTML links) will have these attachments removed, and a structured HTML gallery containing those attachments inserted
where the shortcode was placed.
Note - requires the free ImageMagick software for thumbnailing - see install section for more details.
TODO: if rel="attachment then find the file type, check if it's mime matches our file type search
Get the GUID of the actual file, and return it
yum -y install ImageMagick-devel
and pecl install imagick
/wp-content/plugins/
[attachmentgallery]
to any of your pages/posts with attachmentsCurrently only PDFs are supported, but we are able to expand this easily on request. Immediate upcoming considerations would be document types such as Word, Excel, Powerpoint and their open source equivalents, along with bitmap image formats such as JPG, PNG, TIFF, and BMP, and vector image formats such as PSD and SVG.
You can style them with the CSS classes attachment_gallery
, attachment_gallery_item
, attachment_gallery_item_title
etc, as so:
.attachment_gallery{
background-color:#eee;
border:solid 1px #888;
padding:10px;
}
.attachment_gallery_item{
background-color:#fff;
border:solid 1px #888;
padding:10px;
}
.attachment_gallery_item_download{
text-align:right;
display:block;
width:100%;
margin:5px;
}
.attachment_gallery_item_thumbnail{
border:solid 1px #ccc;
float:left;
margin-right:10px;
width:100px;
}
Not yet, though please get in touch if you'd find this useful.
Like this:
<div class="attachment_gallery"> <div class="attachment_gallery_item"> <div class="attachment_gallery_item_thumbnail"> <a href="http://example.com/my.pdf"> <img src="http://example.com/my.pdf/attachment-gallery/thumbnail.php?size=100&file=http://example.com/my.pdf" /> </a> </div> <a href="http://example.com/my.pdf"> PDF Title </a> </div> <dl class="attachment_gallery_meta attachment_gallery_meta_title"> <dt>Title</dt> <dd><div class="nl">Title extracted from PDF</div></dd> </dl> <dl class="attachment_gallery_meta attachment_gallery_meta_subject"> <dt>Subject</dt> <dd><div class="nl">Subject extracted from PDF</div></dd> </dl> <div class="attachment_gallery_item_download"> <a href="http://example.com/my.pdf">Download Now</a> </div> </div> </div>