PluginProbe
Document Gallery / 2.0.4
Document Gallery v2.0.4
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.4, at README.txt

485 lines 21.7 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.8.1
7 Stable tag: 2.0.4
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 = Q: Why is -insert thumbnail generation method- enabled on one of my WordPress
241 installs, but not on another one? =
242
243 A: Document Gallery works very hard behind the scenes to ensure that it enables
244 as much as is possible for any given server, but some servers just can't do
245 some of the things that the plugin supports. Document Gallery detects when a
246 server can't do something (run Ghostscript, for example) and disables that option.
247 If you later modify your server to handle one of the thumbnail generation methods,
248 Document Gallery will notice this and re-enable the option on the settings page,
249 though you will need to go in and tell Document Gallery that it should use this
250 newly-enabled method.
251
252 = Q: Why is Ghostscript so much faster than Imagick? =
253
254 A: This comes down to how the two programs work. Imagick actually delegates
255 handling of PDFs to Ghostscript behind the scenes, but it doesn't do so
256 intelligently. Before passing off the PDF, it first reads the entire contents
257 of the PDF into memory. Since we only need a single page to generate the
258 thumbnail, this is much more work than is needed. Ghostscript, on the other hand,
259 can handle reading only one page into memory, thus doing much less work before
260 returning our thumbnail.
261
262 = Q: Why isn't Google Drive Viewer enabled by default? =
263
264 A: Google Drive Viewer is the most commonly-supported thumbnail generation method,
265 alongside the Audio/Video generation, but is disabled by default. The reason
266 for this is that in order to use this method, Document Gallery has to send your
267 document over to Google's servers, where Google will generate the thumbnail for
268 you. For most users, this shouldn't be a big deal, but since some users
269 retain sensitive documents on their site, this was made opt-in to avoid
270 compromising anyone's security. If you don't have sensitive documents, I
271 would recommend enabling it, since it's currently the only way to generate a
272 thumbnail for any of the Microsoft Office files, as well as some less common
273 file types.
274
275 == Screenshots ==
276
277 1. This is an example of "fancy" thumbnails. The images are a copy of the front
278 page for each document.
279 2. This is an example of multiple Document Galleries on a single page (using
280 the `ids` attribute). It also shows how images will appear in a Document
281 Gallery. Note that the description field supports HTML markup, so the
282 possibilities are endless!
283 3. This is how the Document Gallery looks with `descriptions=false` (default).
284 Note that the display inherits styling from your active theme.
285
286 == Changelog ==
287
288 = Features For The Future =
289
290 * Full integration with the new [Wordpress 3.5 Media
291 Manager](http://codex.wordpress.org/Version_3.5#Highlights).
292 * Option to open music or video files directly from your gallery.
293 * Option to open documents directly from your gallery (&#224; la [Google Drive
294 Viewer](https://drive.google.com/viewer)).
295 * Support for adding your own filetypes/icons.
296 * Whatever else **you** would like (post on the [support
297 forum](http://wordpress.org/support/plugin/document-gallery) if you have
298 ideas)!
299
300 = 2.0.4 =
301 * **Enhancement:** Custom CSS is now loaded faster, meaning faster page loads
302 for your users. Tests are showing a speedup of around 30% over where it was
303 in the last release.
304 * **Enhancement:** All of the default icons were sent through
305 [Yahoo! Smush.it](http://www.smushit.com/ysmush.it/), giving a few percentage
306 points decrease in size. Thanks for the suggestion,
307 [wm](http://wordpress.org/support/profile/webbmasterpianise)!
308
309 = 2.0.3 =
310 * **Enhancement:** Now handles custom user CSS more securely.
311 * **Enhancement:** Now handles calling Ghostscript executable more securely.
312 * **Enhancement:** Now provides timing information for gallery generation
313 when running WordPress in [WP_DEBUG](https://codex.wordpress.org/WP_DEBUG)
314 mode. When enabled, DG will log to the PHP error log file.
315 * **Info:** Did you know that in tests I performed, Ghostscript (GS) performed
316 350% faster than using Imagick (IM)? Try testing with
317 [this file](http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf),
318 which finished almost instantly using GS, but took multiple minutes when
319 using IM on my test server (results may vary). See new FAQ tab to find out why.
320
321 = 2.0.2 =
322 * **Bug Fix:** Imagick was actually never working... My bad -- it is now! Thanks to
323 [kaldimar](http://wordpress.org/support/profile/kaldimar) for reporting this.
324 * **Enhancement:** Document Gallery en el Español por Andrew de
325 [WebHostingHub](http://www.webhostinghub.com/). (To help translate to another
326 language, [see here](http://wordpress.org/support/topic/seeking-translators).)
327
328 = 2.0.1 =
329 * **Bug Fix:** Resolves issue with `2.0` where DG options were not properly
330 initialized when the plugin was updated. This caused the settings page to
331 behave oddly and many other things throughout to not work as expected when
332 you updated through the dashboard. Thanks to jawhite & rigbypa for
333 [reporting this](http://wordpress.org/support/topic/errors-after-updating-to-20)!
334
335 = 2.0 =
336 * **Enhancement:** This release is a **BIG** deal! We are introducing true
337 document thumbnails (rather than the boring static images that were the same
338 for every document), meaning that you will be able to generate and display
339 thumbnails for most of your documents so your users can see a preview of the
340 document before downloading. This has been
341 [months in development](http://wordpress.org/support/topic/pdf-thumbnails-instead-of-generic-icon)
342 and I really hope that you all enjoy it!
343 * **Enhancement:** Document Gallery now has a settings page where you can
344 configure the default options for your galleries and chose how thumbnails are
345 generated.
346 * **Enhancement:** Customizing CSS for your document gallery is now *much easier*.
347 If you want to add additional styling, just navigate to `Settings -> Document Gallery`
348 in your dashboard and enter valid CSS in the "Custom CSS" textbox. See the changes
349 instantly in your galleries!
350 * **Enhancement:** Entire plugin is now
351 [Internationalization-enabled](https://codex.wordpress.org/I18n_for_WordPress_Developers).
352 This means that we can now support users speaking all languages. If you are
353 interested in translating Document Gallery into a language that you speak,
354 please [let me know](http://wordpress.org/support/topic/seeking-translators)!
355 * **Enhancement:** This release saw much of the backend refactored to better
356 support future development. Nothing you will notice unless you're digging into
357 the code, but it will keep me sane long-term ;)
358 * **Note:** The thumbnail generation implementation works very hard to support
359 all hosting servers (including Unix and Windows systems). That said, I cannot
360 test on all hosts out there, so there is the potential for bugs to appear.
361 If you notice something that doesn't look right, please don't hesitate to
362 [report the issue](http://wordpress.org/support/plugin/document-gallery)
363 so that I can resolve it. Thanks!
364
365 = 1.4.3 =
366 * **Bug Fix:** Resolves minor bug introduced in version 1.4.2. Thanks, tkokholm!
367
368 = 1.4.2 =
369 * **Note:** This release includes an increase in the minimum WP version to 3.5.
370 If you have not yet upgraded to at least this version, you should consider doing
371 so as future releases include a number of *fantastic* new features as well as
372 many security improvements. If you chose not to upgrade, you must stay with
373 Document Gallery 1.4.1 or lower until you do. Sorry for the inconvenience!
374 * **Bug Fix:** Resolved icons being displayed differently depending on which
375 user was currently logged in. (Thanks to
376 [Sean](http://wordpress.org/support/topic/error-after-update-19?replies=12#post-5041251)
377 for reporting the issue.)
378 * **Enhancement:** A number of new icons were added (mainly for the iWork suite
379 and source code filetypes) and a number of pre-existing icons were removed if
380 they were very similar to another icon.
381 * **Under The Hood:** Many, many cool things. Stay tuned for a big reveal in the
382 coming weeks!
383 PS: If you're really curious, there are some clues in the source code ;)
384
385 = 1.4.1 =
386 * **Bug Fix:** This resolves a bug introduced in `1.4`, which caused a warning
387 to be thrown when no attributes were used (i.e.: `[dg]`). (Thanks to
388 [wtfbingo](http://wordpress.org/support/topic/error-after-update-19) for
389 pointing this out!)
390
391 = 1.4 =
392
393 * **New Feature:** This release features the addition of *category/taxonomy* support,
394 [as suggested by Pyo](http://wordpress.org/support/topic/sorting-documents-by-categorytag-or-other-taxonomy).
395 * **Under The Hood:** The plugin was completely rewritten for this release. Logic
396 was cleaned up to make maintenance easier and facilitate some *big* changes
397 planned for version 2.0 of Document Gallery.
398
399 = 1.3.1 =
400
401 * **Bug Fix:** This resolves a bug introduced in version `1.3`. (Thanks to JKChad
402 for pointing this out!)
403
404 = 1.3 =
405
406 * **New Feature:** It is now possible to filter the HTML produced to represent
407 each individual icon, making it possible to add extra attributes and other
408 modifications on the fly as document icons are generated. This will probably
409 only be of use to developers and people who don't mind getting their hands
410 dirty. *(See bottom **Installation** tab for more details.)*
411 * **Enhancement:** There have been a lot of optimizations to the underlying
412 plugin code to make it run more efficiently and be easier to read, if you
413 are so inclined.
414 * **Enhancement:** Changed how images, when included within the gallery, are
415 generated so that the format of the icon returned now matches the rest of
416 the icons.
417
418 = 1.2.1 =
419
420 * **Bug Fix:** Resolved issue with the `ids` attribute in `1.2` not working.
421 Sorry about that!
422
423 = 1.2 =
424
425 * **New Feature:** Images can now be included alongside documents in a
426 document gallery (using `images=true` attribute).
427 (Thanks for the suggestion, Luca!)
428 * **New Feature:** Attachment ids can now be explicitly listed, allowing for
429 documents not attached to a post or page to be included in a document
430 gallery (e.g.: `ids=2,42,57,1`). Note that no spaces should be included.
431 * **Enhancement:** The CSS stylesheet has been enhanced for more flexibility
432 in sizing icons.
433
434 = 1.1 =
435
436 * **New Feature:** Included option to link to the attachment page as well as
437 to the actual document.
438 * **Enhancement:** Added documentation for customizing the appearance of the plugin.
439 * **Enhancement:** Many improvements to the backend, including pretty HTML output
440 and best practice implementation in calls to WordPress core functions.
441
442 = 1.0.4 =
443
444 * **Bug Fix:** Removed extra `div` at bottom when number of documents is
445 evenly divisible by 4. (Thanks, joero4ri!)
446
447 = 1.0.3 =
448
449 * **Bug Fix:** Resolved issue with detecting plugin directory. (Thanks,
450 Brigitte!)
451 * **Enhancement:** Minor improvement to how linking to individual
452 documents is handled.
453
454 = 1.0.2 =
455
456 * **Bug Fix:** Merge for changes in 1.0 did not go through correctly so users
457 downloaded the old icon set which broke the plugin. Sorry about that, but
458 all is resolved with this release!
459
460 = 1.0.1 =
461
462 * **Bug Fix:** Resolved issue with long document titles being cut off in some themes.
463
464 = 1.0 =
465
466 * **New Feature:** Plugin now has **36 icons** representing **72 filetypes**!
467 * **Enhancement:** Optimized gallery generation (faster!)
468 * **Enhancement:** Added fallback to WordPress default icons if you happen to
469 include one of the few filetypes not yet supported.
470 * **Enhancement:** Changed shortcode to `[dg]` (`[document gallery]` will still
471 work for backward compatibility).
472 * **Enhancement:** Gave documentation some **much needed** revisions.
473
474 = 0.8.5 =
475
476 * **Enhancement:** Added support for
477 [OpenDocuments](http://en.wikipedia.org/wiki/OpenDocument).
478
479 = 0.8 =
480
481 * **Release:** First public release of Document Gallery.
482 * **Feature:** Displays PDF, Word, PowerPoint, Excel, and ZIP documents from a
483 given page or post.
484 * **Feature:** Documents can be ordered by a number of
485 different factors.