Using google Docs with WordPress

I have a reason to use WordPress as a front end and Google Spreadsheet as a backend. I have been looking high and low for a plugin which would allow me to pull content from the spreadsheet and then edit it in the WordPress interface, save it back to the Google Spreadsheet. The advantage to this would be that as record in my spreadsheet would go into a single row, that I could then spice up the UI a bit to make things logical for users. – No luck.

  • Inline Google Docs http://wordpress.org/extend/plugins/inline-google-docs/

    Many people maintain dynamic content on Google Documents or hold volatile data on Google Spreadsheets. These change when collaborators save an update or users submit a form. Occasionally, one may wish to embed the contents of one’s Google Documents or Spreadsheets in a post or page to reflect the latest updates on one’s blog. This plugin seeks to provide this functionality without using an <iframe>. In addition, it caches contents of the Google Documents or Spreadsheets to speed up page loading.

  • Google Docs Viewer http://wordpress.org/extend/plugins/google-docs-viewer/
    This plugin provides multiple viewing functions related to Google Docs.

    First of all it can allow you to easily convert a link to a document so that it uses Google Docs as the viewer. Secondly, it provides a method of embedding certain document types directly into your post or page.

  • Inline Google Spreadsheet Viewer http://wordpress.org/extend/plugins/inline-google-spreadsheet-viewer/

    Fetches a published Google Spreadsheet using a [gdoc key=""] WordPress shortcode, then renders it as an HTML table, embedded in your blog post or page. The only required parameter is key, which specifies the document you’d like to retrieve. Optionally, you can also strip a certain number of rows (e.g., strip=”3″ omits the top 3 rows of the spreadsheet) and you can supply a table summary,

    and customized class value.
  • Google Doc Embedder http://wordpress.org/extend/plugins/google-document-embedder/
    Google Doc Embedder lets you embed several types of files into your WordPress pages using the Google Docs Viewer – allowing inline viewing (and optional downloading) of the following file types, with no Flash or PDF browser plug-ins required.

None of these things did what I really wanted. So, I kept looking. Eventually I found this Publishing Google docs to your blog, which talks about taking a GoogleDocs Writer document and letting it be the data for your post. But I wanted Spread sheet stuff.

Then I found HOW TO: USE GOOGLE SPREADSHEETS AS A DATA SOURCE IN WORDPRESS from 2008 (part 2). That is like a century ago. I am not sure there were even WP Custom Posts around then. But this source only tells one how to get data out of Google Spread Sheets (and I think that Google Spread Sheets have updated since then too).

There was one hopeful solution. That is PhpGrid and the phpGrid Lite WordPress Plugin (on Extend). I think I could take my whole data model and apply it inside of PhpGrid and not need Google Spread sheet.

phpGrid Lite WordPress Plugin is based on phpGrid Lite, a free version of phpGrid. phpGrid is a simple and fully customizable PHP control for generating data-bound, AJAX, PHP datagrid.

Grid-based editing, create, read, update and delete (CRUD), are the most common operations for web developers. With phpGrid web-based data editing is easy. Even with little programming background, one can develop professional looking, AJAX-enabled PHP datagrids in just a few minutes.

Finally, I did find out about GoogleDoc’s Data APIby reading Saving Form Data to Google Spreadsheets Using PHP and the Google Docs API by far IN space WEB+, but I just want to plug something in and it to work. So this solution got pushed no further. (And they were using an older, depreciated version of the API).

Cross-posting post from one WordPress Site to another

I set up another WordPress site and I wanted to transfer what I had written there to this site, so that all my writings would be together. This would include comments, links and attached media, and metadata about the post.

What I want a transfer plugin to do.

What I want a transfer plugin to do.

So I looked for a WordPress Plugin to do that. I found two (and as it is when I find more than one I have to test it out and write-up the results.):

  1. Xpost: Cross-post was the first plugin I found and it seemed to have a lot of really nice features.
  2. Transfer: the main difference between the two based on author description is that this one said that it also transferred images attached with the post.

So I tried Transfer first.

Transfer

However, when I installed Transfer, it said that it could not find the Zend Framework… Warning: require_once(Zend/XmlRpc/Client.php) [function.require-once]: failed to open stream: No such file or directory in /home1/public_html/username/wordpress/wp-content/plugins/transfer/library/Aperto/XmlRpc.php on line 3Path values changed to protect the innocent.
The plugin requires that one download Zend Framework Minimal (http://framework.zend.com/download/latest) and put the Zend folder under /wp-content/plugins/transfer/library/

I did this and I would get the WordPress white screen of death. I was told that this white screen of death was because my provider terminated a process (I had maxed out my user’s memory allocation) This white screen happens on one of my installs but not on another under a different user… so, not sure what is going on – Neither WP install would transfer the post. To get around the white screen of death I had to de-activate the plugin by editing the database.

I had initially failed to read the install requirement for Zend, so I found another solution for adding Zend to wordpress.
So I knew I needed to install the Zend Framework, I am sorta surprised that Dreamhost, my hosting provider did not have Zend set up on my server in a way that WordPress was automatically going to detect it. Oh, well is there a plugin for that? – Uh, yes there are like a gilzillion! So I went with the first one: Zend Framework [or also in WP-Extend]. I loaded it and then added the helpful code found in the online WordPress forums.

Go to your wp-config and paste this right after * @package WordPress part and before // ** MySQL settings – You can get this info from your web host ** //

/** Zend Framework **/

function add_include_path ($path)
{
foreach (func_get_args() AS $path)
{
if (!file_exists($path) OR (file_exists($path) && filetype($path) !== 'dir'))
{
trigger_error("Include path '{$path}' not exists", E_USER_WARNING);
continue;
}

$paths = explode(PATH_SEPARATOR, get_include_path());

if (array_search($path, $paths) === false)
array_push($paths, $path);

set_include_path(implode(PATH_SEPARATOR, $paths));
}
}

add_include_path(dirname(__FILE__).'/wp-content/plugins/zend-framework');

After I did both of these things all of my errors went away.

I did try a second plugin, WP-ZFF Zend Framework Full for installing the Zend Framework, this one said that the plugin would modify the include path so I thought that could use this without modifying wp-config.php but the plugin failed on import so I deleted it.
So in the sad case I that I was not able to get Transfer to work I moved on and decided to try Xpost.

Xpost

Xpost [on WP-Extend] was a breeze to set up and I actually got it working for a simple post. However, I was not able to select the target category in the master WP install, from the writer’s WP install (The test post I used just when to the default category).

Xpost not getting categories

Xpost not getting categories available on the master WP install.

The box just says categories loading. This seems to be a problem reported by Nigel and by gulliver.

The test image was not transferred to the media library of the master WP install from the writer’s WP install. Additionally, if the category of the post is changed in the Master WP install, then the writer’s WP install loses track of the post. This is only temporary… If the writer tries to cross-post the post again, then the This results in the writer not being able to update the post. (Red error message is shown.) But if the writer tries a second time then the original post in the Master WP install is found, and updated. Including the “removed” category. However, this “removed” category was intentionally moved by the editor on the Master WP install. So this creates a bit of a conflict. BTW: It would be nice to be able to select a special custom post type for imports.

It seems that Xpost was designed to broadcast out rather that to ingest.

What xpost seems to do

What Xpost seems to do

MAMP Helps

I use MAMP for my local test environment. But I have recently moved beyond just PHP apps. I am also looking at using Tomcat. I would like to mess around with DSpace locally and use Solr also. But I have found a couple of helps for adding things to MAMP.

One of the problems I am facing is that I really like apps like MacPorts. But I do not want to tinker with the CORE and default setting of my OS X machine. So I find that MAMP is a good alternative, but I can not type a command in the command line and have all the dependencies download automatically. I recently found that I could do something like this with Homebrew…. Never used it before but it looks to be the tool for the job. So I have collected a few tutorials like: installing php5.3, Using an gmail as a smtp server, and setting up solr.

Working on a Dynamic Left Menu Bar

It seems to be that the logical place to have a context based and role based menu would be on the left side. That being the assumption, the question is how to go about it, what does it contain, why does it need to change, when should it change.

I have been looking at several widgets and custom field plugins. Some of these deserve a deeper look. We might even should take a deeper look at how we are implementing custom fields and our plugin so that we have an abstraction layer.

Layering for custom fields in plugin

Here are some plugin in options which seemed to be able to handle some of this complexity.

There are really three places that custom field need to be used: so this post is not just about a dynamic left side bar. It is about a dynamic left sidebar that is run off of values in custom fields in the main post. So this post is talking about approaching custom fields with the best strategy.

  • Just Custom Fields for WordPress plugin: This plugin adds custom fields for standard and custom post types in WordPress. After installation you will see simple settings page which is self-explanatory to use.

    I found two Posts about this plugin to be really helpful: http://justcoded.com/just-labs/just-custom-fields-for-wordpress-plugin, and http://justcoded.com/implementation/wordpress-3-vs-drupal-cck/.

  • One of the ideas for the left side bar is to have a listing of related content. Related content could be all the files which belong in a single audio package, or all the digital files belonging to a physical item.
    This is where Related Widgets Plugin For WordPress comes in. The Related Widgets plugin for WordPress introduces multi-use widgets that allow you to list related posts or pages. To use the plugin, browse Appearance / Widgets, insert a Related Widget where you want it to be, and configure it as appropriate. You can optionally filter the results by category or section.
  • List Related Attachments: List Related Attachments is a sidebar widget that will display a list of filtered attachments related to the current post. This might be useful in one of two ways: listing associated content, depending on how we implement it. Or listing the photos on the right-hand sidebar.
  • Custom Field Template: This plugin adds the default custom fields on the Write Post/Page.
  • Custom Field List Widget: This plugin creates sidebar widgets with lists of the values of custom fields. The listed values can be (hyper-)linked in different ways. One possibility is to create a list of all values of a custom field, which will be groupped by their post (or page) and (hyper-)linked automatically to this post (or page). Another possibility is that you can create a list of all unique values of a custom field and specify links as you like (or not).
  • Get Custom Field Values:
    Get Custom Field Values allows the admin to use widgets, shortcodes, and/or template tags to easily retrieve and display custom field values for posts or pages.
  • Advanced Custom Fields:
    Advanced Custom Fields is the perfect solution for any wordpress website which needs more flexible data like other Content Management Systems.
  • Easy Custom Fields:This is a set of extendable classes to allow easy handling of custom post fields. https://wordpress.org/extend/plugins/easy-custom-fields/
  • Advanced Custom Field Widget: The Advanced Custom Field Widget is an extension of the Custom Field Widget by Scott Wallick, and displays values of custom field keys, allowing post- and page-specific meta sidebar content.
  • Custom Post Template: Provides a drop-down to select different templates for posts from the post edit screen. The templates replace single.php for the specified post.https://wordpress.org/extend/plugins/custom-post-template/

WordPress Custom Fields, Part I: The Basics : http://perishablepress.com/press/2008/12/17/wordpress-custom-fields-tutorial/

Custom Post Type UI: Admin UI for creating custom post types and custom taxonomies in WordPress.
https://wordpress.org/extend/plugins/custom-post-type-ui/

Plugins Awry

On Oct 24th I updated some plugins and then I could not access the back end of my WordPress install. Some sort of plugin in conflict. I posted a request for help to the forums. Some one pointed me where to go and I was able find my way into fixing my site. (Server 500 Error and blank pages when I tried to load the back end. But the font end loaded just fine.) I wanted to grab the code that I deleted from the database before I deleted it forever. So I thought I would post it here as a record of what I had running when I encountered the problem. (Something like 76 plugins running…) This was really the most detailed work I have done with PHPMyAdmin… I am shocked how comfortable I have become with the app.

a:76:{i:0;s:37:"wp-system-health/wp-system-health.php";i:1;s:25:"activelink/activelink.php";i:2;s:45:"add-link-to-facebook/add-link-to-facebook.php";i:3;s:37:"admin-ip-watcher/admin-ip-watcher.php";i:4;s:19:"akismet/akismet.php";i:5;s:57:"better-extended-live-archive/af-extended-live-archive.php";i:6;s:29:"better_links/better_links.php";i:7;s:31:"blogcopyright/BlogCopyright.php";i:8;s:17:"cforms/cforms.php";i:9;s:41:"comment-connection/comment-connection.php";i:10;s:39:"custom-taxonomies/custom-taxonomies.php";i:11;s:40:"download-monitor/wp-download_monitor.php";i:12;s:23:"email-log/email-log.php";i:13;s:21:"exec-php/exec-php.php";i:14;s:35:"exploit-scanner/exploit-scanner.php";i:15;s:37:"extended-profile/extended-profile.php";i:16;s:49:"facebook-status-for-wordpress/facebook_status.php";i:17;s:35:"fancybox-for-wordpress/fancybox.php";i:18;s:25:"find-me-on/find-me-on.php";i:19;s:33:"flickr-gallery/flickr-gallery.php";i:20;s:23:"footnotes/footnotes.php";i:21;s:21:"fotobook/fotobook.php";i:22;s:49:"genki-youtube-comments/genki_youtube_comments.php";i:23;s:50:"google-analytics-for-wordpress/googleanalytics.php";i:24;s:36:"google-sitemap-generator/sitemap.php";i:25;s:37:"hcard-commenting/hcard-commenting.php";i:26;s:19:"hrecipe/hrecipe.php";i:27;s:38:"hreview-support-for-editor/hreview.php";i:28;s:27:"in-the-loop/in-the-loop.php";i:29;s:22:"infolinks/infolink.php";i:30;s:35:"inline-tag-thing/InlineTagThing.php";i:31;s:19:"jetpack/jetpack.php";i:32;s:44:"jquery-collapse-o-matic/collapse-o-matic.php";i:33;s:25:"k2-hook-up/k2-hook-up.php";i:34;s:47:"mappress-google-maps-for-wordpress/mappress.php";i:35;s:30:"mendeleyplugin/wp-mendeley.php";i:36;s:32:"micro-anywhere/microAnywhere.php";i:37;s:15:"mycss/mycss.php";i:38;s:23:"net_bible/net_bible.php";i:39;s:30:"no-self-ping/no-self-pings.php";i:40;s:27:"php-code-widget/execphp.php";i:41;s:29:"plugin-notes/plugin-notes.php";i:42;s:55:"query-multiple-taxonomies/query-multiple-taxonomies.php";i:43;s:21:"raw-html/raw_html.php";i:44;s:27:"redirection/redirection.php";i:45;s:27:"role-scoper/role-scoper.php";i:46;s:27:"root-cookie/root-cookie.php";i:47;s:27:"simple-tags/simple-tags.php";i:48;s:38:"simplemodal-contact-form-smcf/smcf.php";i:49;s:30:"smart-youtube/smartyoutube.php";i:50;s:29:"stp-importer/stp-importer.php";i:51;s:47:"subscribe-to-comments/subscribe-to-comments.php";i:52;s:25:"subscribe2/subscribe2.php";i:53;s:61:"syntax-highlighter-and-code-prettifier/syntax-highlighter.php";i:54;s:39:"syntaxhighlighter/syntaxhighlighter.php";i:55;s:33:"tabbed-widgets/tabbed-widgets.php";i:56;s:38:"tags-2-meta-generator/em-tags2meta.php";i:57;s:47:"term-management-tools/term-management-tools.php";i:58;s:27:"theme-check/theme-check.php";i:59;s:35:"tinymcecomments/tinyMCEComments.php";i:60;s:23:"tpc-vcard/tpc-vcard.php";i:61;s:37:"twitter-importer/twitter-importer.php";i:62;s:37:"twitter-mentions-as-comments/tmac.php";i:63;s:31:"twitter-tools/twitter-tools.php";i:64;s:47:"wikindx-macro-plug-in-for-wordpress/wikindx.php";i:65;s:35:"wikipedia-autolink/cf_wikipedia.php";i:66;s:38:"wordpress-mobile-edition/wp-mobile.php";i:67;s:26:"wp-footnotes/footnotes.php";i:68;s:21:"wp-hresume/wphres.php";i:69;s:27:"wp-paginate/wp-paginate.php";i:70;s:25:"wp-recipes/wp-recipes.php";i:71;s:23:"wp-resume/wp_resume.php";i:72;s:33:"wp-security-scan/securityscan.php";i:73;s:35:"wp-social-links/wp-social-links.php";i:74;s:39:"wp-table-reloaded/wp-table-reloaded.php";i:75;s:42:"yet-another-related-posts-plugin/yarpp.php";}

This tutorial show how to use a SQL statement to access the needed table.

Criticism Persistence

A few weeks ago I found a few really helpful tips on how to avoid being criticized. To think that all these years I could have lived without being criticized.

Nine Easy Rules to Avoid Being Criticized [1] Nagesh Belludi. 26 September 2010. Nine Easy Rules to Avoid Being Criticized. http://www.rightattitudes.com/2010/09/26/nine-easy-rules-to-avoid-being-criticized [Link]

  • Rule 1: Always strive to please others and agree with everybody
  • Rule 2: Do not attempt to change people’s minds
  • Rule 3: Do not try a new idea or pursue any worthwhile goal
  • Rule 4a: Conform to established ways of doing everything
  • Rule 4b: Never step a foot away from the path of convention
  • Rule 5: Follow the crowd; stand for nothing unique
  • Rule 6: Let the world shape you; be who others want you to be
  • Rule 7a: Accept life “as is” and never examine the status quo
  • Rule 7b: Believe whatever you are told without checking evidence
  • Rule 8: Do not say, attempt, or do anything contentious or imaginative
  • Rule 9: Do not say, attempt, or accomplish anything at all

As I read these I was reminded of the Think Different campaign by Apple, Inc a few years back. I have always been inspired by the comercial. Perhaps I have always identified with not giving into the status quo. I think my Dad instilled in me a desire for excellence and doing better. This was something that Steve Jobs talked about too. He said we don’t ship junk. It makes a lot of sense: Be profitable, be honorable. Love what you do. Do what is right. Never stop learning.

httpv://youtu.be/cFEarBzelBs

Here’s to the crazy ones.
The misfits.
The rebels.
The troublemakers.
The round pegs in the square holes.
The ones who see things differently.
They’re not fond of rules.
And they have no respect for the status quo.
You can praise them, disagree with them, quote them,
disbelieve them, glorify or vilify them.
About the only thing you can’t do is ignore them.
Because they change things.
They invent. They imagine. They heal.
They explore. They create. They inspire.
They push the human race forward.
Maybe they have to be crazy.
How else can you stare at an empty canvas and see a work of art?
Or sit in silence and hear a song that’s never been written?
Or gaze at a red planet and see a laboratory on wheels?
We make tools for these kinds of people.
While some see them as the crazy ones,
we see genius.
Because the people who are crazy enough to think
they can change the world, are the ones who do.

httpv://youtu.be/Yu0qeb_rJYU

References

References
1 Nagesh Belludi. 26 September 2010. Nine Easy Rules to Avoid Being Criticized. http://www.rightattitudes.com/2010/09/26/nine-easy-rules-to-avoid-being-criticized [Link]

Admin Panel of the Plugin

Needs to be able to:

  1. Define the Metadata Values
    • Do they have controlled vocabularies?
    • What kind of input will they use?
  2. Define the work Stages
    • Including sub-work stages
  3. What are the Metadata Values in each Stage
  4. What are the help texts for each Metadata question
  5. What is the Part shown for the Keys?
  6. Does the Plugin create a special Browse Page?

Wire Frame of plugin in admin panel