ChannelEaton http://blog.channeleaton.com Most recent posts at ChannelEaton posterous.com Thu, 15 Sep 2011 12:40:00 -0700 Thank you, Vim http://blog.channeleaton.com/thank-you-vim http://blog.channeleaton.com/thank-you-vim
%s/,//g
%s/edu/edu,/g
%s/,/\r/g

You saved 30 minutes of my life.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/26245/avatar.jpg http://posterous.com/users/2JUhq4UA Aaron Eaton Aaron Aaron Eaton
Tue, 13 Sep 2011 12:29:00 -0700 Follow-up: Just as a feared (UPDATED) http://blog.channeleaton.com/follow-up-just-as-a-feared http://blog.channeleaton.com/follow-up-just-as-a-feared

I had a feeling that this would happen.

Media_httpiimgurcomlg_hcsmv

I thought I had a great idea here, and while it works if the current user is an author or higher on both sites, if the user only exists on the current site you get the message above when attempting to insert an image into the post. Now, it can be solved just by granting the current user access to the ‘media site’, but then that would also allow them to create, edit, and delete all media that exists in the ‘media site’ library. That’s no good.

While searching through the WordPress Codex I came across the upload_files user capability which is required to do ANYTHING with the media library. I thought that I could create a new user role that only allowed the user to access the media library. Unfortunately, upload_files is an all-or-nothing deal. Either the user has full rights to the media library or none at all.

If only a more granular control was available for this purpose.

Do you have a solution?


UPDATE

It seems that I was a little off about the all-or-nothing nature of the upload_files user capability. The ability to delete items in the media library is handled by a different capability. That’s the good news.

Now to figure out how to bar regular users from uploading to the ‘media site’…

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/26245/avatar.jpg http://posterous.com/users/2JUhq4UA Aaron Eaton Aaron Aaron Eaton
Tue, 13 Sep 2011 08:08:00 -0700 Sharing media libraries across network sites in WordPress http://blog.channeleaton.com/sharing-media-libraries-across-network-sites http://blog.channeleaton.com/sharing-media-libraries-across-network-sites

Media_httpiimgurcom6h_awvxb

This is part of a larger project I’m developing at work.

The ultimate goal is to have a central blog where the department can serve up sanctioned images, video, and audio for students to use on their portfolios – also hosted in the same WordPress multisite network. After realizing that a (good) solution does not yet exist, I set out to create my own.

The first hurdle was to create a new tab in the Upload/Insert media page. This task was made easy by a great tutorial here.

The second and most difficult hurdle was solved by looking through the core code. I was looking for an existing function that handled the entire functionality of the media library. Eventually I found it in wp-admin/includes/media.php on line 822. The function is called media_upload_library().

Now for the last step. Plugging media_upload_library() into my code will only create a duplicate media library for the blog I am currently editing. To load a library from a different blog I need one last function. Before calling media_upload_library(), I call up another useful core WP function switch_to_blog($int) where $int is the blog ID number. This number can be found in the WP database.

I haven’t yet had a chance to thoroughly test this code. I’ve only tested this on sites where I am an admin so I’m sure I will run into trouble when I test it as a low-level user. If you have any suggestions, please let me know.

Here’s the code so far:

// Add filter that inserts our new tab
function nsm_menu($tabs) {
  $newtab = array('shared_media' => __('Network Shared Media', 'networksharedmedia'));
  return array_merge($tabs, $newtab);
}
add_filter('media_upload_tabs', 'nsm_menu');

// Load media_nsm_process() into the existing iframe
function nsm_menu_handle() {
  return wp_iframe('media_nsm_process');
}
add_action('media_upload_shared_media', 'nsm_menu_handle');

/*
 * media_nsm_process() contains the code for what you want to display. This function MUST start with the word 'media' in order
 * for the proper CSS to load.
 *
 * First, we switch to the blog containing all of the media. This is called up by the blog # found in the database.
 *
 * Then we call media_upload_library() which contains all of the code needed to show the library, select media sizes, and
 * insert into the post.
 */
 function media_nsm_process() {
   switch_to_blog(3);
   media_upload_library();
 }

Take a look at the follow-up post.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/26245/avatar.jpg http://posterous.com/users/2JUhq4UA Aaron Eaton Aaron Aaron Eaton
Fri, 05 Aug 2011 06:38:00 -0700 How I make it rain at work. http://blog.channeleaton.com/how-i-make-it-rain-at-work http://blog.channeleaton.com/how-i-make-it-rain-at-work
Media_httpfastcachega_pikzw

What's the next step you can take to move your project forward that takes less than 15 minutes?

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/26245/avatar.jpg http://posterous.com/users/2JUhq4UA Aaron Eaton Aaron Aaron Eaton
Tue, 19 Jul 2011 13:44:00 -0700 My future kids are SO going to have a zipline over a pit of giant chainsaws! http://blog.channeleaton.com/my-future-kids-are-so-going-to-have-a-zipline http://blog.channeleaton.com/my-future-kids-are-so-going-to-have-a-zipline

Sometimes, of course, their mastery fails, and falls are the common form of playground injury. But these rarely cause permanent damage, either physically or emotionally. While some psychologists — and many parents — have worried that a child who suffered a bad fall would develop a fear of heights, studies have shown the opposite pattern: A child who’s hurt in a fall before the age of 9 is less likely as a teenager to have a fear of heights.

By gradually exposing themselves to more and more dangers on the playground, children are using the same habituation techniques developed by therapists to help adults conquer phobias, according to Dr. Sandseter and a fellow psychologist, Leif Kennair, of the Norwegian University for Science and Technology.

via nytimes.com

What's that, little Timmy? Your arm got sawed off?

Rub some dirt in it and ride the zipline again!

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/26245/avatar.jpg http://posterous.com/users/2JUhq4UA Aaron Eaton Aaron Aaron Eaton
Wed, 06 Jul 2011 07:47:00 -0700 Dear God, don't let me die. http://blog.channeleaton.com/dear-god-dont-let-me-die http://blog.channeleaton.com/dear-god-dont-let-me-die

Screen_shot_2011-07-06_at_9
What have I done?

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/26245/avatar.jpg http://posterous.com/users/2JUhq4UA Aaron Eaton Aaron Aaron Eaton
Fri, 24 Jun 2011 06:50:00 -0700 The Pie is a Lie http://blog.channeleaton.com/the-pie-is-a-lie http://blog.channeleaton.com/the-pie-is-a-lie
Let’s break that down a little. Suppose Robinson Crusoe is tired of trying to scoop up fish with his hands and figures out how to turn a tree branch into a spear, increasing his daily catch tenfold. Can Friday, who never thought to make a spear, properly complain that Crusoe has received an “unfair distribution” of fish?

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/26245/avatar.jpg http://posterous.com/users/2JUhq4UA Aaron Eaton Aaron Aaron Eaton
Wed, 01 Jun 2011 11:09:00 -0700 Thanks, Facebook. http://blog.channeleaton.com/thanks-facebook http://blog.channeleaton.com/thanks-facebook

Screen_shot_2011-06-01_at_1
...or I could talk to her...

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/26245/avatar.jpg http://posterous.com/users/2JUhq4UA Aaron Eaton Aaron Aaron Eaton
Tue, 17 May 2011 13:53:00 -0700 A 'Dear John' Letter to Excel http://blog.channeleaton.com/a-dear-john-letter-to-excel http://blog.channeleaton.com/a-dear-john-letter-to-excel

Dear Excel,

Over the past several years you and I have become great friends. I thought that we would share everything with each other; well until you wouldn't share my documents with my friends, family, and coworkers.

I have to admit something:
I've been with another spreadsheet program. It's name is Google Docs. It's given me great satisfaction for the past year and a half. It has no problem sharing with all of the people I interact with, following me wherever I feel like working, and being easy to work with.

But you always had that one characteristic that kept me from leaving you completely: Pivot Tables.

Your robust pivot tables enabled me to understand my data with great ease; but alas, Google Docs recognized my frustration of being split between two people and took aim at my sadness.

Today Google Docs completed it's package and I cant turn away from it.

So...I'm writing this letter to let you know that we should go our separate ways. I know you can make an enterprise very happy, but for me as an individual I cant be satisfied by you.

It's not you, it's me.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/26245/avatar.jpg http://posterous.com/users/2JUhq4UA Aaron Eaton Aaron Aaron Eaton
Tue, 10 May 2011 11:42:00 -0700 ANGRY BIRDS theme!!! covered by Pomplamoose http://blog.channeleaton.com/angry-birds-theme-covered-by-pomplamoose http://blog.channeleaton.com/angry-birds-theme-covered-by-pomplamoose

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/26245/avatar.jpg http://posterous.com/users/2JUhq4UA Aaron Eaton Aaron Aaron Eaton
Tue, 05 Apr 2011 06:00:51 -0700 It's Alive! http://blog.channeleaton.com/its-alive http://blog.channeleaton.com/its-alive

P223

After 3 weeks, 1 cheesecloth, and 8 coffee filters, my orange milk liqueur is complete.

Check out the recipe here:
http://www.leethal.net/zine/?p=1402

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/26245/avatar.jpg http://posterous.com/users/2JUhq4UA Aaron Eaton Aaron Aaron Eaton
Thu, 24 Mar 2011 15:29:50 -0700 Wait...what? http://blog.channeleaton.com/waitwhat http://blog.channeleaton.com/waitwhat

P218

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/26245/avatar.jpg http://posterous.com/users/2JUhq4UA Aaron Eaton Aaron Aaron Eaton
Thu, 24 Mar 2011 14:02:00 -0700 State to online, out-of-state shoppers: Pay up - chicagotribune.com http://blog.channeleaton.com/state-to-online-out-of-state-shoppers-pay-up http://blog.channeleaton.com/state-to-online-out-of-state-shoppers-pay-up
We expect that people will pay what they owe, recognizing this is part of their responsibility as a citizen," she said.

Oh Illinois. You crack me up.

Now watch your population continue the disappearing act.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/26245/avatar.jpg http://posterous.com/users/2JUhq4UA Aaron Eaton Aaron Aaron Eaton
Tue, 15 Mar 2011 07:41:00 -0700 And for my next trick... http://blog.channeleaton.com/and-for-my-next-trick http://blog.channeleaton.com/and-for-my-next-trick

In my attempt to banish my mouse to desk purgatory, I've installed this extension. As an avid vim user, much of this feels natural.

If you'd like to give it a try, you can download the extension here:
https://chrome.google.com/extensions/detail/dbepggeogbaibhgnhhndojpepiihcmeb

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/26245/avatar.jpg http://posterous.com/users/2JUhq4UA Aaron Eaton Aaron Aaron Eaton
Wed, 09 Mar 2011 11:42:00 -0800 Beginning of the end http://blog.channeleaton.com/beginning-of-the-end http://blog.channeleaton.com/beginning-of-the-end

Jake - Are we going to suit up in NO?

Me - ...

        I'll bring it if you will

Jake - suit - CHECK

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/26245/avatar.jpg http://posterous.com/users/2JUhq4UA Aaron Eaton Aaron Aaron Eaton
Tue, 01 Feb 2011 13:31:00 -0800 Don't Insult Us http://blog.channeleaton.com/dont-insult-us http://blog.channeleaton.com/dont-insult-us

Screen_shot_2011-02-01_at_3
I received this nice little email from HR. It states that all employees have been given a 2% raise while we are in the middle of a wage freeze...

Now read further.

It turns out our 2% "raise" is only the government graciously allowing us to keep 2% more of WHAT WE EARNED.

Please HR, don't insult us.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/26245/avatar.jpg http://posterous.com/users/2JUhq4UA Aaron Eaton Aaron Aaron Eaton
Fri, 28 Jan 2011 15:04:00 -0800 MOTOROLA ATRIX Promo http://blog.channeleaton.com/motorola-atrix-promo http://blog.channeleaton.com/motorola-atrix-promo

Apple better come up with a few killer features on the next iPhone or I'm jumping ship.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/26245/avatar.jpg http://posterous.com/users/2JUhq4UA Aaron Eaton Aaron Aaron Eaton
Thu, 06 Jan 2011 17:46:04 -0800 Early cooking tools of Tex-Mexicans http://blog.channeleaton.com/early-cooking-tools-of-tex-mexicans http://blog.channeleaton.com/early-cooking-tools-of-tex-mexicans

P206

Are people REALLY this lazy?

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/26245/avatar.jpg http://posterous.com/users/2JUhq4UA Aaron Eaton Aaron Aaron Eaton
Thu, 06 Jan 2011 07:42:00 -0800 Remains of the Day: Get Ready for the Mac App Store Tomorrow http://blog.channeleaton.com/remains-of-the-day-get-ready-for-the-mac-app http://blog.channeleaton.com/remains-of-the-day-get-ready-for-the-mac-app

And this is one reason why I am almost exclusively using Google Docs. No limits.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/26245/avatar.jpg http://posterous.com/users/2JUhq4UA Aaron Eaton Aaron Aaron Eaton
Mon, 27 Dec 2010 14:38:06 -0800 He served me http://blog.channeleaton.com/he-served-me http://blog.channeleaton.com/he-served-me

P201

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/26245/avatar.jpg http://posterous.com/users/2JUhq4UA Aaron Eaton Aaron Aaron Eaton