I’m on R&R time visiting my good friend Mike in Durango. We both share a background in Geology but careers in technology, so we do tend to talk about geekery. When I showed up he gently teased that he had a project for me, and as it turns out, it was just the right size […]
As of Mon, 19 Aug 2013 02:00:11 -0400 10518 Five Card stories have been created on this site from a pool of 13589 tagged photos. I have bot looked at all 10,000+ stories- this site has been humming along, for the most part un-attended for months and back to 2008. In some exchanges a week […]
Last January, Tim Owens did a masterful job of assembling the Daily Create site out of a premium theme (Salutation), a mix of plugins (including Awesome Flickr Gallery, Tubepress, and Gravity Forms), etc– and no custom code.
When I arrived at UMW in February, I offered to take over the creation of the challenges. It is a mix of ones submitted by our site users, borrowed ones from the Daily Shoot, b3ta Challenges, the Vancouver Draw Down, and the 30 Day Drawing Challenge, plus about a good 30% we just dreamed up.
Creating them turned out to be a bit tedious as there was at least 7 different things to set on the interface. We had to have them, scheduled in advance, each to be published at 10:00 am EST.
(1) The title would be present if it was submitted via a form; for one from scratch it is entered/pasted.
(2) The post name was manually entered, based on the tag for the day
(3) Depending on the type of Daily Create, we had a format for the post that would use a set of links to flickr, you tube tags to set up the instructions, and for the embedding of media, a Tubepress shortcode, flickr gallery ID, or a SoundCLoud embed code. For these, the tag had to be manually entered in at least two spots. For the flickr ones, we would have to create an Awesome flickr gallery (another admin page), and manually copy/paste the shortcode. I started by copying from old posts (and managing a few times to edit the wrong one) and later kept a generalized version in a text doc for cutting/pasting
(4) The future date for publishing was manually set (10:00am EST)
(5) Two categories assigned for the type, and an overall category we use to group all assignments.
(6) The tag is entered here
(7) The theme required a selection menu to match it to the type of assignment (each type has its own graphic which is displayed in the single post view.
I did this for about two months before rolling up my elbows to see if this could be streamlined.
Each of the four types (Audio, Video, Photography, Drawing) have a different content structure which is what embeds the creative works in a post. When I looked it at, once the type was set and the tag as known (the tag tdc123 is also the slug for the post), it was potentially template-able.
I looked to see if there were any plugins for setting up at least the templates for the content, but did not find any that allowed for multiple templates.
But ti was looking at the admin interface for this very theme (the theme options down the right sidebar) that it dawned on me that I could possibly create my own box with a drop down menu to select a type, and when saved, the post would automagically fill in the right content and check the right boxes, etc.
So after completing the Daily Creates for 6 months in advance, doing this seriously paid off. I was typically able to knock off a months worth in about 90 minutes, and more of that was having to look around or make up assignments.
The way is works now is for a new post or if I edit something that is a draft, the TDC Settings meta box is activated.
(Gulp, note in this fake example, it should be a Drawing type, not photography, this assignment is not reallly in the mix… yet)
The only thing it needs is (1) the title, (the code automatically creates the next tag it should use based on the last one created) and (2) I just select the type from the drop down menu, and click Save Draft.
When saved, everything else is done for me!
(1) Tag is used for the url
(2) The basic content is created according to the kind of assignment, and the tag is inserted where it is needed. The * is because the automation is not 100% complete; I still have to generate the flickr gallery shortcode for Photography and Drawing types (I did experiment with calling the code directly; it was close but not quite correct). Also, the embed codes for SoundCloud are random IDs, not related to the group name, so that code is also manual.
(3) The future publication date is automatically set! This saves a ton of time. It simply looks for the last one created, and then sets the publication date for 24 hours later.
(4) Categories automatically checked
(5) (6) The tags and the header setting for the template are auto selected.
This is all done by some custom code to intercept the hook when a draft is saved, and then updating the post data (and some post metadata).
Below is the semi hairy code… broken into parts for explanation. This all lives in the functions.php part of the theme template (which truly should be done as a child theme). If I were more clever, I would have made it a plugin, but the code would be the same (One day I want to be 0.01% as code clever as Boone Gorges).
Here we go… code below the fold…
Who needs a stinking academy to provide a code challenge? With some basics under the belt (which of course you cannot do without) and google (which usually lands you at Stack Overflow), you can tinker away. Well, I can. Here was a tool I whipped up in about 10 minutes, and then spent about another […]
Here is a new toy to play with- announcing Pechaflickr, the pecha kucha + battle decks + flickr mashup. Type in a tag, click “play”, and you will be served up 20 random flickr photos, displayed each for 20 seconds. The idea is to have people practice the art of improv to a set of […]
While I’m on the code doc kick… this one is not mine, but something I applied on my site. A week or so ago I came across (from RSS feeds? nah, I think it was in twitter? maybe a squirrel stepped o my keyboard?) Steph Gray’s Reading: keeping on top of stuff I save, some […]
I spent about 15 minutes writing a small PHP function for one of my sites, and then another hour writing it up. What for? Well, let’s back up. If you are running online events where people might come from anywhere, there can always be challenges for getting the right time to people. For our NMC […]
cc licensed flickr photo shared by bitzcelt Elwood: It’s 106 miles to get this sidebar coded, we’ve got a full tank of gas, half a pack of cigarettes, it’s dark and we’re wearing sunglasses. Jake: Hit it. I have no idea why I opened this way except for Jim Groom Inspiration. But to jive my […]
I’ve done a handful of web projects this year where it made sense to store data in Google Spreadsheets, and then use a bit of PHP code to make them be dynamically displayed on a web site. In many cases, these are tables of data that are parsed and presented nicely in the web site, […]