On Life and Love

What in tarnation?

Why have I suddenly become obsessed with reggaeton? Don Omar, Daddy Yankee, etc. Weird. I’ve got to be scaring coworkers and my roomie if they hear what’s blaring out of my headphones.

Then again, I may do that normally…

I’ve hacked out a few thousand words over the past couple of days, and while not all of it is published yet, some of it is up on the Ila des Mains series page. My character is morphing on me, becoming less nervous and neurotic in some respects, but I shall endeavor to keep her close to the brand of psychotic she was in the first couple of stories. That, of course, is the problem with not touching a storyline for three months on top of a writing a character that isn’t much of a mimicry of yourself.

Oh, well. That universe is still fun, and I have outlines for the next ten or so stories already. I shall play until it becomes untenable.

I had a bit of PHP fun in getting the links at the end of each story to point to the next story in the series. I refuse to make one huge WordPress Page and paginate for each new segment. That’s unmaintainable, particularly if I start inserting stories in wherever there are gaps later.

The solution is convoluted, though, because WordPress’ support of multi-Page pagination is non-existent. So while still inside the Loop on a Story page (which is its own template, so I can show word count and link to the parent index), I stuck in the following line of code:

<?php $pageID = $post->ID; ?>

Just after the loop, I put in the following construct:

$posts = @$wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_status='static' AND post_parent='$post->post_parent' AND menu_order>'$post->menu_order' AND ID>'$pageID' ORDER BY menu_order ASC");
if($posts) {
foreach($posts as $post) {

Forward to <a href="<?php the_permalink(); ?>" title="The next story in the sequence."><?php the_title(); ?></a>.</p>

<?php break; } } ?>

I suspect that won’t indent or look any kind of pretty, but I basically created another Loop based on Pages pulled out by having the same parent as the current page (the parent in this case would be the Ila des Mains series page) and a page order (an arbitrary number I give a page, starting with 0 for the first story and increasing for each new one, like numbering chapters) larger than the page order of the current story. Then I can use normal template tags (since I run “start_wp()”) like “the_permalink()” to toss in a link.

Took me two damn days to figure that shit out. Glad I got it, though.

Now it’s over an hour past my bedtime, and I need my beauty rest.