PluginProbe
Document Gallery / 2.0.6
Document Gallery v2.0.6
trunk 0.8 0.8.5 1.0 1.0.1 1.0.2 1.0.3 1.0.4 1.1 1.2 1.2.1 1.3 1.3.1 1.4 1.4.1 1.4.2 1.4.3 2.0 2.0.1 2.0.10 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 All 94 releases
document-gallery / README.txt

README.txt in Document Gallery 2.0.6, at README.txt

499 lines 22.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 === Document Gallery ===
2 Contributors: dan.rossiter
3 Tags: attachments, thumbnail, documents, gallery, MS office, pdf
4 Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=EE5LWRLG933EN&lc=US&item_name=Document%20Gallery%20Plugin&item_number=document%2dgallery&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted
5 Requires at least: 3.6
6 Tested up to: 3.9
7 Stable tag: 2.0.6
8 License: GPLv2
9 License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
11 This plugin generates thumbnails for documents and displays them in a
12 gallery-like format for easy sharing.
13
14 == Description ==
15
16 This plugin allows the user to effortlessly create a gallery of documents and
17 other attached media, much like the gallery option already available for image
18 attachments.
19
20 The plugin will, by default, inherit the styling within your active theme, but
21 with a little CSS knowledge it is possible to customize the appearance to meet
22 your specific needs.
23
24 Read more in the **Installation** tab!
25
26 = Developers =
27
28 Document Gallery includes features intended to make integration with other plugins
29 simple. See the bottom of the **Installation** tab for specific documentation on
30 the various features provided.
31
32 *If this plugin has helped you, please take a moment to [rate
33 it](http://wordpress.org/support/view/plugin-reviews/document-gallery#postform)!*
34
35 == Installation ==
36
37 1. Upload `document-gallery` to the `/wp-content/plugins/` directory
38 1. Activate the plugin through the 'Plugins' menu in WordPress
39 1. Place `[dg]` in any posts or pages you want a document gallery included. See
40 below for additional display options.
41
42 = Document Gallery Options =
43
44 In order to include all compatible documents from a given page or post, you
45 must include the following shortcode in the post: `[dg]`.
46
47 In addition to the default behavior, the plugin provides many options to
48 customize behavior with various attributes, seen below:
49
50 `[dg [fancy=true] [attachment_pg=<true/false>]
51 [category/custom_taxon_name=<**comma-separated list of taxon values**> [relation=<AND/OR>]]
52 [descriptions=<true/false>] [ids=<**comma-separated list of ID #s**>]
53 [images=<true/false>] [localpost=<true/false>] [order=<ASC/DEC>] [orderby=<**see below**>]]`
54
55 Though the shortcode above may seem far from "short," none of the attributes are
56 required and most users will find that the plugin meets your needs "out of the box"
57 without any added attributes.
58
59 **Default Values**
60
61 By default, document gallery will use `no descriptions`, `orderby menu_order`
62 , `ASC order`, `no attachment_pg links`, and `no images` from the `local post`
63 if you do not specify otherwise. These defaults can be configured in your dashboard
64 under `Settings -> Document Gallery`.
65
66 **Attachment Page Option** *(New in Version 1.1)*
67
68 This option determines whether each document icon will link to the actual file
69 or to its attachment page. If you want the user to be able to click on the
70 icon and directly rective the option to download then use `attachment_pg=false`
71 (the default). If you have information on the attachment page that you want the
72 link to go to, use `attachment_pg=true`.
73
74 **Categories/Custom Taxonomy Option** *(New in Version 1.4)*
75
76 With the `categories` option you are able to select attachments based on
77 their assigned category or any other
78 [custom taxon](http://codex.wordpress.org/Taxonomies). Categories
79 or any custom taxon can be referenced simply by including `category=category_value`
80 or `taxon_name=taxon_value`. Multiple values for a single taxon may be separated
81 by commas.
82
83 **Descriptions Option**
84
85 If `true`, each document will take its own line with the description displayed
86 alongside it.
87
88 *Note: this will use the `description` field, **not** the `caption`. Be
89 careful when entering your document data.*
90
91 **Fancy** *(New in Version 2.0)*
92
93 If `true`, we will try to generate a thumbnail for each document in the gallery.
94 The success in generating thumbs will depend mostly on what your server supports.
95 To fine-tune how thumbnails are generated, visit `Settings -> Document Gallery`
96 in your site's dashboard.
97
98 *NOTE: By default, the most universally-supported option for generating thumbnails,
99 [Google Drive Viewer](https://docs.google.com/viewer) is disabled by default
100 in order to protect your privacy, since using it requires sending your documents
101 to Google's servers. If you're not working with confidential documents, you are
102 encouraged to enable this for optimum performance.*
103
104 **Order Option**
105
106 This option works alongside the `orderby` option to determine whether the
107 documents are displayed in ascending or descending order.
108
109 **Orderby Option**
110
111 * `menu_order` - This is probably the one you want to use. Menu order is
112 the order that icons appear when seen in the Insert / Upload Media Gallery
113 dialog. To change this order, you simply drag the icons around until they
114 are where you want them. In earlier versions of WordPress, menu_order was
115 modified by the integer fields in the Insert / Upload Media Gallery dialog.
116 These fields no longer exist in recent releases.
117 * `title` - Order by title.
118 * `date` - Order by upload date.
119 * `modified` - Order by last modified date.
120 * `rand` - Random order.
121 * `ID` - Order by post id.
122 * `author` - Order by author.
123 * `name` - Order by attachment slug.
124 * `parent` - Order by post/page parent id.
125 (Only useful in conjunction with `localpost=false` option.)
126 * `comment_count` - Order by number of comments (available with WP >= 2.9).
127 * `none` - No order (available with Version 2.8).
128 * `post__in` - Preserve post ID order given in the post__in array.
129
130 **Images Option** *(New in Version 1.2)*
131
132 This option will tell the plugin to include all images attached to to a page or
133 post in addition to all documents.
134
135 **IDs Option** *(New in Version 1.2)*
136
137 This is an advanced option intended for experienced WordPress users. If this
138 option is used, the plugin will ignore attached documents, instead including
139 all attachments defined by the `ids` attribute (e.g.: `ids=10,2,4,42`).
140
141 *Note: If this attribute is used, the `order`, `orderby`, `images` and other
142 attributes which generally determine which attachments to include or how to
143 order them will be ignored. Order is defined by the order the ids are
144 provided.*
145
146 **Localpost Option** *(New in Version 1.4)*
147
148 By default a document gallery only looks at attachments of the page/post where
149 the `[dg]` shortcode is used. If you would like to search beyond that local scope,
150 you must set `localpost=false`.
151
152 This option would probably be useful especially when querying with the *category
153 or taxonomy* option, though it can be used with any options you chose.
154
155 **Relation Option** *(New in Version 1.4)*
156
157 The relation option should only be used when also using the *category or custom
158 taxonomy* option (see above). Additionally, this option is only effective in
159 WordPress installs version 3.1 or higher. Older versions cannot use this value
160 and will ignore it.
161
162 When using multiple taxa, this option allows you to decide whether the attachments
163 returned must meet all of the taxa_names specified (AND) or a minimum of one
164 match (OR).
165
166 = Customize Appearance =
167
168 By default, the document gallery will use the styles within your active theme
169 to handle most of the appearance, but, with a little CSS knowledge, you can
170 customize pretty much anything about how it looks. See
171 [`style.css`](http://plugins.svn.wordpress.org/document-gallery/trunk/assets/css/style.css)
172 for an idea of what will select different elements within the gallery display.
173
174 **Example**
175
176 Say I would like to include a border for the right and bottom of the document
177 icon, but only when descriptions are shown (to delineate the icon from the
178 description text). To do this, I would need to add the following CSS to my
179 theme stylesheet:
180
181 `.document-icon-wrapper.descriptions .document-icon{
182 border-right: 1px solid #37824A;
183 border-bottom: 1px solid #37824A;
184 }`
185
186 Now, if I wanted to modify that code to instead add the same border to all of
187 the document-icons, regardless of whether they have a description or not, I
188 would just change the first line, removing the descriptions class like so:
189
190 `.document-icon-wrapper .document-icon`
191
192 *NOTE: Please don't modify the plugin stylesheet directly or your changes will
193 be lost when a new version is released.*
194
195 = Developers =
196
197 **Filter .document-icon Content**
198
199 For those unfamiliar with content filters, [here is some
200 documentation](http://codex.wordpress.org/Plugin_API/Filter_Reference) that you
201 should read before continuing.
202
203 Document Gallery implements its own filter, allowing developers to customize
204 the output generated. Specifically, the `div.document-icon` content, including
205 the div itself, the URL to the attachment, the attachment icon, and the
206 attachment title. Hooking into the `dg_doc_icon` filter will allow you to
207 modify any of this content before it reaches your users.
208
209 Any function using this filter will receive two parameters, the content to be
210 filtered and the ID number of the file represented by the icon in question.
211 If you are implementing something to override the plugin default functionality,
212 it may be useful to be able to query various attributes of the attachment with
213 this value.
214
215 One example use for this filter, which I have personally used in a project I
216 am working on, will add a query parameter to the end of each attachment URL.
217 This parameter, `rid`, specifies the referring page and allows the page
218 receiving the URL to dynamically detect which page ID the link came from.
219
220 `function dg_doc_icon( $icon, $id ){
221 $ptn = '/(.* href=")([^"]+)(".*)/s';
222
223 if( !preg_match( $ptn, $icon, $matches ) || count( $matches ) !== 4 )
224 return $icon;
225
226 if( strpos( $matches[2], '?' ) !== false )
227 return "{$matches[1]}{$matches[2]}&rid=".get_the_ID().$matches[3];
228
229 return "{$matches[1]}{$matches[2]}?rid=".get_the_ID().$matches[3];
230 }
231 add_filter( 'dg_doc_icon', 'dg_doc_icon', null, 2 );`
232
233 Obviously this is just one very specific example, but anything that requires
234 modifying the image tag, the anchor tag, or the title can be handled with this
235 filter. Note that this function does not use the $id value it receives, which
236 is perfectly alright.
237
238 == Frequently Asked Questions ==
239
240
241 = Q: Why is [insert thumbnail generation method] enabled on one of my WordPress
242 installs, but not on another one? =
243
244 A: Document Gallery works very hard behind the scenes to ensure that it enables
245 as much as is possible for any given server, but some servers just can't do
246 some of the things that the plugin supports. Document Gallery detects when a
247 server can't do something (run Ghostscript, for example) and disables that option.
248 If you later modify your server to handle one of the thumbnail generation methods,
249 Document Gallery will notice this and re-enable the option on the settings page,
250 though you will need to go in and tell Document Gallery that it should use this
251 newly-enabled method.
252
253 = Q: Why is Ghostscript so much faster than Imagick? =
254
255 A: This comes down to how the two programs work. Imagick actually delegates
256 handling of PDFs to Ghostscript behind the scenes, but it doesn't do so
257 intelligently. Before passing off the PDF, it first reads the entire contents
258 of the PDF into memory. Since we only need a single page to generate the
259 thumbnail, this is much more work than is needed. Ghostscript, on the other hand,
260 can handle reading only one page into memory, thus doing much less work before
261 returning our thumbnail.
262
263 = Q: Why isn't Google Drive Viewer enabled by default? =
264
265 A: Google Drive Viewer is the most commonly-supported thumbnail generation method,
266 alongside the Audio/Video generation, but is disabled by default. The reason
267 for this is that in order to use this method, Document Gallery has to send your
268 document over to Google's servers, where Google will generate the thumbnail for
269 you. For most users, this shouldn't be a big deal, but since some users
270 retain sensitive documents on their site, this was made opt-in to avoid
271 compromising anyone's security. If you don't have sensitive documents, I
272 would recommend enabling it, since it's currently the only way to generate a
273 thumbnail for any of the Microsoft Office files, as well as some less common
274 file types.
275
276 == Screenshots ==
277
278 1. This is an example of "fancy" thumbnails. The images are a copy of the front
279 page for each document.
280 2. This is an example of multiple Document Galleries on a single page (using
281 the `ids` attribute). It also shows how images will appear in a Document
282 Gallery. Note that the description field supports HTML markup, so the
283 possibilities are endless!
284 3. This is how the Document Gallery looks with `descriptions=false` (default).
285 Note that the display inherits styling from your active theme.
286
287 == Changelog ==
288
289 = Features For The Future =
290
291 * Full integration with the new [Wordpress 3.5 Media
292 Manager](http://codex.wordpress.org/Version_3.5#Highlights).
293 * Option to open music or video files directly from your gallery.
294 * Option to open documents directly from your gallery (&#224; la [Google Drive
295 Viewer](https://drive.google.com/viewer)).
296 * Support for adding your own filetypes/icons.
297 * Whatever else **you** would like (post on the [support
298 forum](http://wordpress.org/support/plugin/document-gallery) if you have
299 ideas)!
300
301 = 2.0.6 =
302 * **Bug Fix:** If DG failed to automagically detect the location of the
303 Ghostscript binary, manually setting the location did not enable using it.
304 Thanks for tracking this bug down,
305 [Chris](http://wordpress.org/support/profile/fredd500)!
306 * **Minor:** Included various enhancements in handling thumbnail generation
307 for image types.
308 * **Tested Up To:** Document Gallery has been tested in WP 3.9 (RC 1).
309
310 = 2.0.5 =
311 * **Bug Fix:** Rolling back part of CSS enhancments in 2.0.4 that were causing
312 errors on some servers. May revisit at a later date.
313
314 = 2.0.4 =
315 * **Enhancement:** Custom CSS is now loaded faster, meaning faster page loads
316 for your users. Tests are showing a speedup of around 30% over where it was
317 in the last release.
318 * **Enhancement:** All of the default icons were sent through
319 [Yahoo! Smush.it](http://www.smushit.com/ysmush.it/), giving a few percentage
320 points decrease in size. Thanks for the suggestion,
321 [wm](http://wordpress.org/support/profile/webbmasterpianise)!
322
323 = 2.0.3 =
324 * **Enhancement:** Now handles custom user CSS more securely.
325 * **Enhancement:** Now handles calling Ghostscript executable more securely.
326 * **Enhancement:** Now provides timing information for gallery generation
327 when running WordPress in [WP_DEBUG](https://codex.wordpress.org/WP_DEBUG)
328 mode. When enabled, DG will log to the PHP error log file.
329 * **Info:** Did you know that in tests I performed, Ghostscript (GS) performed
330 350% faster than using Imagick (IM)? Try testing with
331 [this file](http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf),
332 which finished almost instantly using GS, but took multiple minutes when
333 using IM on my test server (results may vary). See new FAQ tab to find out why.
334
335 = 2.0.2 =
336 * **Bug Fix:** Imagick was actually never working... My bad -- it is now! Thanks to
337 [kaldimar](http://wordpress.org/support/profile/kaldimar) for reporting this.
338 * **Enhancement:** Document Gallery en el Español por Andrew de
339 [WebHostingHub](http://www.webhostinghub.com/). (To help translate to another
340 language, [see here](http://wordpress.org/support/topic/seeking-translators).)
341
342 = 2.0.1 =
343 * **Bug Fix:** Resolves issue with `2.0` where DG options were not properly
344 initialized when the plugin was updated. This caused the settings page to
345 behave oddly and many other things throughout to not work as expected when
346 you updated through the dashboard. Thanks to jawhite & rigbypa for
347 [reporting this](http://wordpress.org/support/topic/errors-after-updating-to-20)!
348
349 = 2.0 =
350 * **Enhancement:** This release is a **BIG** deal! We are introducing true
351 document thumbnails (rather than the boring static images that were the same
352 for every document), meaning that you will be able to generate and display
353 thumbnails for most of your documents so your users can see a preview of the
354 document before downloading. This has been
355 [months in development](http://wordpress.org/support/topic/pdf-thumbnails-instead-of-generic-icon)
356 and I really hope that you all enjoy it!
357 * **Enhancement:** Document Gallery now has a settings page where you can
358 configure the default options for your galleries and chose how thumbnails are
359 generated.
360 * **Enhancement:** Customizing CSS for your document gallery is now *much easier*.
361 If you want to add additional styling, just navigate to `Settings -> Document Gallery`
362 in your dashboard and enter valid CSS in the "Custom CSS" textbox. See the changes
363 instantly in your galleries!
364 * **Enhancement:** Entire plugin is now
365 [Internationalization-enabled](https://codex.wordpress.org/I18n_for_WordPress_Developers).
366 This means that we can now support users speaking all languages. If you are
367 interested in translating Document Gallery into a language that you speak,
368 please [let me know](http://wordpress.org/support/topic/seeking-translators)!
369 * **Enhancement:** This release saw much of the backend refactored to better
370 support future development. Nothing you will notice unless you're digging into
371 the code, but it will keep me sane long-term ;)
372 * **Note:** The thumbnail generation implementation works very hard to support
373 all hosting servers (including Unix and Windows systems). That said, I cannot
374 test on all hosts out there, so there is the potential for bugs to appear.
375 If you notice something that doesn't look right, please don't hesitate to
376 [report the issue](http://wordpress.org/support/plugin/document-gallery)
377 so that I can resolve it. Thanks!
378
379 = 1.4.3 =
380 * **Bug Fix:** Resolves minor bug introduced in version 1.4.2. Thanks, tkokholm!
381
382 = 1.4.2 =
383 * **Note:** This release includes an increase in the minimum WP version to 3.5.
384 If you have not yet upgraded to at least this version, you should consider doing
385 so as future releases include a number of *fantastic* new features as well as
386 many security improvements. If you chose not to upgrade, you must stay with
387 Document Gallery 1.4.1 or lower until you do. Sorry for the inconvenience!
388 * **Bug Fix:** Resolved icons being displayed differently depending on which
389 user was currently logged in. (Thanks to
390 [Sean](http://wordpress.org/support/topic/error-after-update-19?replies=12#post-5041251)
391 for reporting the issue.)
392 * **Enhancement:** A number of new icons were added (mainly for the iWork suite
393 and source code filetypes) and a number of pre-existing icons were removed if
394 they were very similar to another icon.
395 * **Under The Hood:** Many, many cool things. Stay tuned for a big reveal in the
396 coming weeks!
397 PS: If you're really curious, there are some clues in the source code ;)
398
399 = 1.4.1 =
400 * **Bug Fix:** This resolves a bug introduced in `1.4`, which caused a warning
401 to be thrown when no attributes were used (i.e.: `[dg]`). (Thanks to
402 [wtfbingo](http://wordpress.org/support/topic/error-after-update-19) for
403 pointing this out!)
404
405 = 1.4 =
406
407 * **New Feature:** This release features the addition of *category/taxonomy* support,
408 [as suggested by Pyo](http://wordpress.org/support/topic/sorting-documents-by-categorytag-or-other-taxonomy).
409 * **Under The Hood:** The plugin was completely rewritten for this release. Logic
410 was cleaned up to make maintenance easier and facilitate some *big* changes
411 planned for version 2.0 of Document Gallery.
412
413 = 1.3.1 =
414
415 * **Bug Fix:** This resolves a bug introduced in version `1.3`. (Thanks to JKChad
416 for pointing this out!)
417
418 = 1.3 =
419
420 * **New Feature:** It is now possible to filter the HTML produced to represent
421 each individual icon, making it possible to add extra attributes and other
422 modifications on the fly as document icons are generated. This will probably
423 only be of use to developers and people who don't mind getting their hands
424 dirty. *(See bottom **Installation** tab for more details.)*
425 * **Enhancement:** There have been a lot of optimizations to the underlying
426 plugin code to make it run more efficiently and be easier to read, if you
427 are so inclined.
428 * **Enhancement:** Changed how images, when included within the gallery, are
429 generated so that the format of the icon returned now matches the rest of
430 the icons.
431
432 = 1.2.1 =
433
434 * **Bug Fix:** Resolved issue with the `ids` attribute in `1.2` not working.
435 Sorry about that!
436
437 = 1.2 =
438
439 * **New Feature:** Images can now be included alongside documents in a
440 document gallery (using `images=true` attribute).
441 (Thanks for the suggestion, Luca!)
442 * **New Feature:** Attachment ids can now be explicitly listed, allowing for
443 documents not attached to a post or page to be included in a document
444 gallery (e.g.: `ids=2,42,57,1`). Note that no spaces should be included.
445 * **Enhancement:** The CSS stylesheet has been enhanced for more flexibility
446 in sizing icons.
447
448 = 1.1 =
449
450 * **New Feature:** Included option to link to the attachment page as well as
451 to the actual document.
452 * **Enhancement:** Added documentation for customizing the appearance of the plugin.
453 * **Enhancement:** Many improvements to the backend, including pretty HTML output
454 and best practice implementation in calls to WordPress core functions.
455
456 = 1.0.4 =
457
458 * **Bug Fix:** Removed extra `div` at bottom when number of documents is
459 evenly divisible by 4. (Thanks, joero4ri!)
460
461 = 1.0.3 =
462
463 * **Bug Fix:** Resolved issue with detecting plugin directory. (Thanks,
464 Brigitte!)
465 * **Enhancement:** Minor improvement to how linking to individual
466 documents is handled.
467
468 = 1.0.2 =
469
470 * **Bug Fix:** Merge for changes in 1.0 did not go through correctly so users
471 downloaded the old icon set which broke the plugin. Sorry about that, but
472 all is resolved with this release!
473
474 = 1.0.1 =
475
476 * **Bug Fix:** Resolved issue with long document titles being cut off in some themes.
477
478 = 1.0 =
479
480 * **New Feature:** Plugin now has **36 icons** representing **72 filetypes**!
481 * **Enhancement:** Optimized gallery generation (faster!)
482 * **Enhancement:** Added fallback to WordPress default icons if you happen to
483 include one of the few filetypes not yet supported.
484 * **Enhancement:** Changed shortcode to `[dg]` (`[document gallery]` will still
485 work for backward compatibility).
486 * **Enhancement:** Gave documentation some **much needed** revisions.
487
488 = 0.8.5 =
489
490 * **Enhancement:** Added support for
491 [OpenDocuments](http://en.wikipedia.org/wiki/OpenDocument).
492
493 = 0.8 =
494
495 * **Release:** First public release of Document Gallery.
496 * **Feature:** Displays PDF, Word, PowerPoint, Excel, and ZIP documents from a
497 given page or post.
498 * **Feature:** Documents can be ordered by a number of
499 different factors.