Posts Tagged ‘wordpress’

Waffle is now Obsession Du Jour…

May 21st, 2013 by Reinder

... and it's full of content from my Tumblr.

Just because I found out that I could, and because it seemed like a good idea in the light of Yahoo!, a company with a track record of ruining everything it takes over, taking over Tumblr, I have imported all my Tumblr posts into my WordPress blog and changed its name so it is now the same as the Tumblr, Obsession Du Jour. Sorry if those 275-ish posts spammed your RSS feed. It'll only happen this once. I hope.

I'm not planning to stop posting to Tumblr, mind. It's just a precaution. I hope I'll be able to easily mirror Tumblr stuff to WordPress and vice versa from here on, though.

There was actually already some content duplicated on both blogs, but honestly, the overlap is not that great. I never posted individual comic updates there, for instance.

Useful WordPress hack courtesy of Erin, plus to-do list for the blog

December 10th, 2008 by Reinder

I didn't lose a lot of irreplaceable stuff in last Sunday's hard drive crash. Luckily, all my working files and my financial accounts are on external drives as a matter of standard procedure - I never keep them on the same physical volume where my operating system is. But I did lose a few items that needed to be on that volume or that I'd quickly saved into my Documents folder. I lost a handy shell script for ripping sound (and only sound) from DVDs that Xepher of Xepher.net gave me the basics of and that I finished myself until it did what it was supposed to, in a clunky way. And I nearly lost this:

<?php
$__reinAdCode = array(); //just prepping the array.
//this defines the google adWords javascript for later use
$__reinAdCode['adWords'] =
'<script type="text/javascript">
<<!--
google_ad_client = "[number]";
google_ad_width = 160;
google_ad_height = 600;
google_ad_format = "160x600_as";
google_ad_type = "text_image";
//2007-03-18: Blog
google_ad_channel = "[number]";
google_color_border = "36414d";
google_color_bg = "FFFFFF";
google_color_link = "0000FF";
google_color_text = "000000";
google_color_url = "008000";
//-->
</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>';

//project wonderful code for later use
$__reinAdCode['project_wonderful'] =
'<!-- Begin Project Wonderful ad code: -->
<!-- IMPORTANT: All lines, including these comments, must be included. -->
<!-- Removing or altering them could result in your ads being automatically shut down! -->
<!-- Ad box ID: [number] -->
<script language=\'JavaScript\' type=\'text/javascript\'>
// <![CDATA[
r = new String (Math.random()*1000);
r = r.substr(0, 5);
s = new String ("<script language=\'JavaScript\' type=\'text/javascript\'");
s += "src = http://www.projectwonderful.com/gen.php";
s += "?id=[number]&type=4";
s += "&r=" + r;
if (document.referrer){
s += "&referer=" + escape(document.referrer);
}
s += "><\/scr";
s += "ipt>";
document.write(s);
// ]]>
</script>
<noscript><map name="admap[number]" id="admap[number]"><area href="http://www.projectwonderful.com/out_nojs.php?r=0&c=0&id=[number]&type=4" shape="rect" coords="0,0,125,125" title="" alt="" target="_blank" /></map>
<table cellpadding="0" border="0" cellspacing="0" width="125" bgcolor=""><tr><td><img src="http://www.projectwonderful.com/nojs.php?id=[number]&type=4" width="125" height="125" usemap="#admap1971" border="0" alt="" /></td></tr><tr><td bgcolor="" colspan="1"><center><a style="font-size:10px;color:#0000ff;text-decoration:none;line-height:1.2;font-weight:bold;font-family:Tahoma, verdana,arial,helvetica,sans-serif;" href="http://www.projectwonderful.com/advertisehere.php?id=[number]&type=4" target="_blank">Project Wonderful - Your ad here, right now, for as low as $0</a></center></td></tr><tr><td colspan="1" valign="top" width="125" height="3" bgcolor="#000000"><center><img src="http://www.projectwonderful.com/black.png" width="125" height="3" border="0" alt="" /></center></td></tr></table>
</noscript>
<!-- End Project Wonderful ad code. -->';

?>

<div id="sidebar">
<?php
/* Widgetized sidebar, if you have the plugin installed. */
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) :
?>
<ul>

<li>
<?php include (TEMPLATEPATH . '/searchform.php'); ?>
</li>

<!-- Author information is disabled per default. Uncomment and fill in your details if you want to use it.
<li><h2>Author</h2>
<p>A little something about you, the author. Nothing lengthy, just an overview.</p>
<</li>
-->

<?php
if ( is_404() || is_category() || is_day() || is_month()
|| is_year() || is_search() || is_paged() ) :
?>
<li>

<?php
if (is_404()) {/* If this is a 404 page (currently empty) */
} elseif (is_category()) { /* If this is a category archive */
?>
<p>You are currently browsing the archives for the <?php single_cat_title(''); ?> category.</p>

<?php } elseif (is_day()) {/* If this is a daily archive */ ?>
<p>
You are currently browsing the <a href="<?php bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> blog archives for the day <?php the_time('l, F jS, Y'); ?>.
</p>

<?php } elseif (is_month()) { /* If this is a monthly archive */ ?>
<p>
You are currently browsing the <a href="<?php bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a>
blog archives for <?php the_time('F, Y'); ?>.
</p>

<?php } elseif (is_year()) { /* If this is a yearly archive */ ?>
<p>
You are currently browsing the <a href="<?php bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a>
blog archives for the year <?php the_time('Y'); ?>.
</p>

<?php } elseif (is_search()) { /* If this is a search page */ ?>
<p>
You have searched the <a href="<?php echo bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a>
blog archives for <strong>'<?php the_search_query(); ?>'</strong>. If you are unable to find anything in these search results, you can try one of these links.
</p>

<?php } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { /* this is paged browsing view */ ?>
<p>You are currently browsing the <a href="<?php echo bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> blog archives.</p>
<?php } /* this ends the paged browsing output and the chain of elseif's */ ?>

</li>
<?php
/* this ends the if( is_404() || is_category() || is_day() ||..blah blah blah crap above */
endif;
?>

<li>
<div style="margin:20px auto;padding:10px 3px 10px 25px;text-align:center;">
<?php echo $__reinAdCode['project_wonderful']; ?>
</div>
</li>

<?php wp_list_pages('title_li=<h2>Pages</h2>' ); ?>

<li>
<h2>Archives</h2>
<ul>
<?php wp_get_archives('type=monthly'); ?>
</ul>
</li>

<!-- rein I think the below needs to be wrapped in an <li></li> -->
<?php wp_list_categories('show_count=1&title_li=<h2>Categories</h2>'); ?>

<?php
/* If this is the frontpage or a normal page? */
if ( is_home() || is_page() ) :
?>

<li>
<?php wp_list_bookmarks(); ?>
</li>

<li>
<?php echo $__reinAdCode['adWords']; ?>
</li>

<li>
<h2>Meta</h2>
<ul>
<?php wp_register(); ?>
<li><?php wp_loginout(); ?></li>
<li><a href="http://wordpress.org/" title="Powered by WordPress, state-of-the-art semantic personal publishing platform.">WordPress</a></li>
<?php wp_meta(); ?>
</ul>
</li>
<?php else : ?>
<li>
<?php echo $__reinAdCode['adWords']; ?>
</li>
<?php endif; /* end of the homepage/normal page check */ ?>
</ul>
<?php endif; /* this is the end of the dynamic sidebar if */ ?>
</div>

(Notes: HTML/PHP tags are escape-crippled so they show up in the published blog, so do not use the source code for this blog page; identifying information for the ad boxes has been stripped out. Quotes should not show up as smart quotes, and one of these days, I'm gonna figure out how to turn that off in WordPressNevermind. Single quotes in the javascript for the ad boxes have been escaped, which they should be if you decide to use this. Apologies for the lack of indents - they were there in the source, but the blog doesn't have CSS to make them show up correctly. Pastebin version)

What it is: a modification to the sidebar in WordPress's default theme, so that the ad boxes show up in a certain place within the sidebar, regardless of whether the version of the sidebar shown is the full version shown on the front page or the shorter version shown in the archive navigation sections and custom pages. It was sent to me by reader Erin, who insists that it's not up to the standards of coding she writes in her day job, but it's definitely an improvement on the original in both clarity and functionality.

Now the next step for me will be to make that sidebar show up on all pages. That could take me a while, though. WordPress's template structure is hideously complicated and I'd have to sit down and study if for several days before I'd be able to figure out how to manipulate it fully. This is in stark contrast with the template coding for Movable Type, which was tag based and very easy for me to understand. On the other hand, WordPress runs a lot more smoothly; Movable Type's performance was horrible and despite the efforts of some very smart coders, it was pretty much defenseless against spam - the spam wouldn't get published but a concerted attack could kill the installation, the site it was on and the system hosting it. So I'll put up with having less effective control over the blog's appearance - I can always study it whenever I do have some time.

Other to-do items include adding some alternate templates for distribution to the website, though I may end up doing that through WillowCMS and CaRP instead,