Google Doc Embedder - Version 1.6

Version Description

  • Added: Additional class names for optional stylesheet use
  • Added: Support to embed TIFF images
  • Fixed: Invalid settings link in plugin list (WordPress MU)
  • Changed: Embed path to conform to Google published guidelines
Download this release

Release Info

Developer k3davis
Plugin Icon wp plugin Google Doc Embedder
Version 1.6
Comparing to
See all releases

Code changes from version 1.5.1 to 1.6

Files changed (3) hide show
  1. functions.php +1 -0
  2. gviewer.php +5 -5
  3. readme.txt +12 -6
functions.php CHANGED
@@ -68,6 +68,7 @@ function splitFilename($filename) {
68
  {
69
  $basename = substr($filename, 0, $pos);
70
  $extension = strtoupper(substr($filename, $pos+1));
 
71
  return array($basename, $extension);
72
  }
73
  }
68
  {
69
  $basename = substr($filename, 0, $pos);
70
  $extension = strtoupper(substr($filename, $pos+1));
71
+ if ($extension == "TIF") { $extension = "TIFF"; }
72
  return array($basename, $extension);
73
  }
74
  }
gviewer.php CHANGED
@@ -3,9 +3,9 @@
3
  /*
4
  Plugin Name: Google Doc Embedder
5
  Plugin URI: http://davismetro.com/gde/
6
- Description: Lets you embed PDF files and PowerPoint presentations in a page or post using the Google Document Viewer.
7
  Author: Kevin Davis
8
- Version: 1.5.1
9
  */
10
 
11
  /* Copyright 2009 Kevin Davis. E-mail: kev@tnw.org
@@ -43,7 +43,7 @@ function gviewer_func($atts) {
43
  ), $atts));
44
 
45
  // supported file types - list acceptable extensions separated by |
46
- $exts = "pdf|ppt";
47
 
48
  // check link for validity
49
  if (!validLink($file)){
@@ -58,7 +58,7 @@ function gviewer_func($atts) {
58
  $fsize = formatBytes($fsize);
59
 
60
  $code=<<<HERE
61
- <iframe src="http://docs.google.com/gview?url=%U%&embedded=true" style="width:%W%px; height:%H%px;" frameborder="0" class="gde-frame"></iframe>\n
62
  HERE;
63
 
64
  if ($save == "1") {
@@ -132,7 +132,7 @@ function gde_options() {
132
  $plugin = plugin_basename(__FILE__);
133
  function my_plugin_actlinks( $links ) {
134
  // Add a link to this plugin's settings page
135
- $settings_link = '<a href="/wp-admin/options-general.php?page=gviewer.php">Settings</a>';
136
  array_unshift( $links, $settings_link );
137
  return $links;
138
  }
3
  /*
4
  Plugin Name: Google Doc Embedder
5
  Plugin URI: http://davismetro.com/gde/
6
+ Description: Lets you embed PDF files, PowerPoint presentations, and TIFF images in a web page using the Google Docs Viewer.
7
  Author: Kevin Davis
8
+ Version: 1.6
9
  */
10
 
11
  /* Copyright 2009 Kevin Davis. E-mail: kev@tnw.org
43
  ), $atts));
44
 
45
  // supported file types - list acceptable extensions separated by |
46
+ $exts = "pdf|ppt|tif|tiff";
47
 
48
  // check link for validity
49
  if (!validLink($file)){
58
  $fsize = formatBytes($fsize);
59
 
60
  $code=<<<HERE
61
+ <iframe src="http://docs.google.com/viewer?url=%U%&embedded=true" style="width:%W%px; height:%H%px;" frameborder="0" class="gde-frame"></iframe>\n
62
  HERE;
63
 
64
  if ($save == "1") {
132
  $plugin = plugin_basename(__FILE__);
133
  function my_plugin_actlinks( $links ) {
134
  // Add a link to this plugin's settings page
135
+ $settings_link = '<a href="options-general.php?page=gviewer.php">Settings</a>';
136
  array_unshift( $links, $settings_link );
137
  return $links;
138
  }
readme.txt CHANGED
@@ -1,20 +1,20 @@
1
  === Google Doc Embedder ===
2
  Contributors: k3davis
3
  Donate link: http://pledgie.com/campaigns/6048
4
- Tags: pdf, ppt, powerpoint, google, embed, google docs, document
5
  Requires at least: 2.5
6
  Tested up to: 2.9-rare
7
  Stable tag: trunk
8
 
9
- Lets you embed PDF files and PowerPoint presentations in a web page using the Google Document Viewer.
10
 
11
  == Description ==
12
 
13
- Google Doc Embedder lets you embed PDF files and PowerPoint presentations in a web page using the Google Document Viewer.
14
 
15
- Similar to services like Scribd, Google Doc Embedder will allow you to embed a PDF or PPT (PowerPoint) file directly into your page or post, not requiring the user to have Adobe Reader or PowerPoint installed to view the contents. Unlike Scribd, the files do not need to be uploaded to any service first - including Google Documents - but can exist anywhere accessible on your site or the internet.
16
 
17
- Note: This plugin utilizes an undocumented feature of the Google Document viewer, and as such it may be subject to hazards if their viewer unexpectedly changes drastically. In this unlikely event, the plugin should degrade nicely and not break your site.
18
 
19
  == Installation ==
20
 
@@ -29,7 +29,7 @@ Go to "GDE Settings" (under "Settings" in the admin panel) to change defaults, o
29
  == Frequently Asked Questions ==
30
 
31
  = What file types can be embedded? =
32
- This plug-in can embed PDF or PPT files only. The file to embed must first be available somewhere on the internet. You can upload it to your WordPress site using the standard techniques, or link to a file on another site. **You do not need to save the file in Google Documents first to embed it, and in fact you should NOT do so, unless the file is shared publicly (can be accessed without logging in).**
33
 
34
  = How do I embed a file in my page or post? =
35
  Use the custom shortcode `[gview]` to embed the file, as shown:
@@ -56,6 +56,12 @@ That's not a question ;) but if you have any particular ideas on further develop
56
 
57
  == Changelog ==
58
 
 
 
 
 
 
 
59
  = 1.5.1 =
60
  * Fixed: Viewer not hidden if linked file not found
61
  * Fixed: Divide by zero error if file size can't be determined
1
  === Google Doc Embedder ===
2
  Contributors: k3davis
3
  Donate link: http://pledgie.com/campaigns/6048
4
+ Tags: pdf, ppt, tiff, powerpoint, google, embed, google docs, document
5
  Requires at least: 2.5
6
  Tested up to: 2.9-rare
7
  Stable tag: trunk
8
 
9
+ Lets you embed PDF, PowerPoint presentations (PPT), and TIFF images in a web page using the Google Docs Viewer.
10
 
11
  == Description ==
12
 
13
+ Google Doc Embedder lets you embed PDF files, PowerPoint presentations, and TIFF images in a web page using the Google Docs Viewer.
14
 
15
+ Similar to services like Scribd, Google Doc Embedder will allow you to embed a PDF, PowerPoint (PPT), or TIFF file directly into your page or post, not requiring the user to have Adobe Reader, PowerPoint, or other software installed to view the contents. Unlike Scribd, the files do not need to be uploaded to any service first - including Google Documents - but can exist anywhere accessible on your site or the internet.
16
 
17
+ Note: While previously the functionality of this plug-in relied upon an undocumented feature of the Google Docs Viewer, this feature is now "official" and presumably reliable in the long term. However, use of this plug-in now does imply your agreement with Google's published <a href="http://docs.google.com/viewer/TOS?hl=en" target="_blank">Terms of Service</a>.
18
 
19
  == Installation ==
20
 
29
  == Frequently Asked Questions ==
30
 
31
  = What file types can be embedded? =
32
+ This plug-in can embed PDF, PowerPoint (PPT), or TIFF files only. The file to embed must first be available somewhere on the internet. You can upload it to your WordPress site using the standard techniques, or link to a file on another site. **You do not need to save the file in Google Documents first to embed it, and in fact you should NOT do so, unless the file is shared publicly (can be accessed without logging in).**
33
 
34
  = How do I embed a file in my page or post? =
35
  Use the custom shortcode `[gview]` to embed the file, as shown:
56
 
57
  == Changelog ==
58
 
59
+ = 1.6 =
60
+ * Added: Additional class names for optional stylesheet use
61
+ * Added: Support to embed TIFF images
62
+ * Fixed: Invalid settings link in plugin list (WordPress MU)
63
+ * Changed: Embed path to conform to Google published guidelines
64
+
65
  = 1.5.1 =
66
  * Fixed: Viewer not hidden if linked file not found
67
  * Fixed: Divide by zero error if file size can't be determined