Month: March 2018
📖 Read pages 58-60 of Japanese from Zero! 1
Also did a fair amount of writing practice of these new hiragana.
If you’re finding that it doesn’t seem to work or does so sporadically, you might take a look for things like emoji or other potential unrecognized characters for the URLs you’re trying to use to see if that’s what is causing the bug.
Add support for acquisition kind
I’m including some potential code below, though it will also require adding the appropriate icon and some meta data in a few places for the “Kinds” meta box as well as to the admin UI locations which are currently missing.
I’ve “cheated” a bit and defaulted to display the “wish” icon and thus some of its metadata, so the acquisition kind would need its own icon (the same shopping cart icon may be best) and some small meta data would need to be changed as well in the final.
For those who need to have this right away, the code below will “work” from a display standpoint.
Taxonomy Code template
Code snippet I’ve added to indieweb-post-kinds/includes/class-kind-taxonomy.php just under the section for the wish kind:
'acquisition' => array(
'singular_name' => __( 'Acquisition', 'indieweb-post-kinds' ), // Name for one instance of the kind
'name' => __( 'Acquisitions', 'indieweb-post-kinds' ), // General name for the kind plural
'verb' => __( 'Acquired', 'indieweb-post-kinds' ), // The string for the verb or action (liked this)
'property' => 'acquired-of', // microformats 2 property
'format' => 'status', // Post Format that maps to this
'description' => __( 'Purchases, gifts, found things, or objects donated to me', 'indieweb-post-kinds' ),
'description-url' => 'http://indieweb.org/acquisition',
'show' => true, // Show in Settings
),
Naturally the “true” flag for ‘show’ should be set to “false” until the code is feature complete.
A simple view for the acquisition post kind
Add the following code to the folder indieweb-post-kinds/views/ in a file named kind-acquisition.php
<?php
/*
* Acquisition Template
*
*/
$mf2_post = new MF2_Post( get_the_ID() );
$cite = $mf2_post->fetch();
if ( ! $cite ) {
return;
}
$author = Kind_View::get_hcard( ifset( $cite['author'] ) );
$url = ifset( $cite['url'] );
$embed = self::get_embed( $url );
?>
<section class="response h-product h-cite">
<header>
<?php
echo Kind_Taxonomy::get_before_kind( 'wish' );
if ( ! $embed ) {
if ( ! array_key_exists( 'name', $cite ) ) {
$cite['name'] = self::get_post_type_string( $url );
}
if ( isset( $url ) ) {
echo sprintf( '<a href="%1s" class="p-name u-url">%2s', $url, $cite['name'] );
} else {
echo sprintf( '<span class="p-name">%1s</span>', $cite['name'] );
}
if ( $author ) {
echo ' ' . __( 'by', 'indieweb-post-kinds' ) . ' ' . $author;
}
if ( array_key_exists( 'publication', $cite ) ) {
echo sprintf( ' <em>(<span class="p-brand">%1s</span>)</em>', $cite['publication'] );
}
}
?>
</header>
<?php
if ( $cite ) {
if ( $embed ) {
echo sprintf( '<blockquote class="e-summary">%1s', $embed );
} elseif ( array_key_exists( 'summary', $cite ) ) {
echo sprintf( '<blockquote class="e-summary">%1s</blockquote>', $cite['summary'] );
}
}
// Close Response
?>
</section>
<?php
Future enhancements
Future additions/improvements to this kind could include potentially adding new data fields to indicate the “location purchased” as well as the “purchase price”, the “manufacturer” and maybe the “condition” with a dropdown for selecting options like brand new, like new, very good, good, acceptable, poor, and unspecified. These could be marked up with the h-product related microformats of p-price and p-brand. These would then need to be tucked into the view as appropriate as well.
Checkin Starbucks
👓 The Academy Awards Scandal That First Got PwC Its Job Counting Oscars Votes | Time
Years before PricewaterhouseCoopers caused a scandal for mixing up Oscars envelopes, another controversy got the firm that gig.
📖 Read pages 30-39 and 48-57 of Japanese from Zero! 1
Went back and picked up a prior section because I was more curious to begin practicing writing my hiragana. There’s some interesting linguistics material and beginning grammar in this section. I’ll have to come back to it and practice some more to absorb both the vocabulary and the grammar.
📖 Read pages 97-119 of Ramona the Brave by Beverly Cleary
Ramona broods at home with a baby sitter while her parents learn about the Owl Incident. Ramona spends the first night in her new room.
Highlights, Quotes, & Marginalia
“Oh, I see,” said Mrs. Kemp, a remark Ramona knew grown-ups made when they were not interested in conversation with children.
Added on Thursday, March 1, 2018 morning
… although fathers, Ramona knew, did not spend as much time as mothers thinking up ways to improve their children.
Sadly probably true, but awfully sexist nonetheless.
Added on Thursday, March 1, 2018 morning
Ramona lay in bed with her thoughts as jumbled as a bag of jacks.
What a great little simile here.
Added on Thursday, March 1, 2018 morning