Monday, March 23rd, 2009 - 23:34 | Author: christina

Another one of those things I stash here for future use.  This one is about how to have Blogger's comments be numbered.  Ease of reference, and all.

The source for the good numberedness code is Fernandooo1 at Quite Random.  Reproducing here for my stashliness.  Also to show a few amendments, and to rail about Internet Explorer failing.

First, the code.  If you know Javascript at all, it's actually wicked easy - declare a counting variable just before the comment starts, then increment and print.

<b:includable id='comments' var='post'>

[...]

<dl id='comments-block'>

<script type='text/javascript'>var CommentsCounter = 0;</script>

<b:loop values='data:post.comments' var='comment'>

<dt style='clear: both;' class='comment-author' expr:id='"comment-" + data:comment.id'>
<a expr:name='"comment-" + data:comment.id'/>

<span class='numberingcomments'>
<a expr:href='data:comment.url' title='Comment Link'>
<script type='text/javascript'>
CommentsCounter++;
document.write('#' + CommentsCounter + ': ');
</script>
</a>
</span>

<b:if cond='data:comment.authorUrl'>
<a expr:href='data:comment.authorUrl' rel='nofollow'>
<data:comment.author/>
</a>
<b:else/>
<data:comment.author/>
</b:if>
<data:commentPostedByMsg/>
</dt>

<dd class='comment-body'>
[...]
</dd>

</b:loop>
</dl>

In the CSS block at the top, style .numberingcomments however you like.

This is slightly different from the original code at Quite Random, primarily in that I did not want the number off to the right.  It currently displays as image, number#, author.

What I wanted was to change the dl/dt/dd stuff to ol/li/p stuff.  However, it seems that Internet Explorer has a little hasLayout issue.  When I changed the tags as noted just now, the icons (for anonymous, OpenID, Blogger, &c) would be vertically aligned to the middle, rather than the top, and no numbers would appear.

If I can figure out how to get around that for Internet Explorer, I will absolutely post that here.  I've nothing against Javascript, I just prefer simpler solutions.

Monday, March 23rd, 2009 - 23:14 | Author: christina

Everybody and their third biologically-related familial unit has posted something like this.  I put it here because I don't feel like reading everybody's &c posts to find the one that has everything I want.  Plus, I don't trust (a) my memory (b) the internet.  I want to always be able to find it.

Which is almost entirely why I post here, come to think of it.

Basically, Blogger has no "more" or "lj-cut" functionality.  You can get a start, sort of, with Blogger's help files, but they're (a) not that fleshed out and (b) not that good.

First, don't use a classic template, use one of the newer ones.  I did not work with a classic template, so I don't know.  Information primarily culled from here.

  1. Edit the HTML, and expand the widget templates.
  2. At the top, look for the <b:skin> tag.  It's near the giant "This is what template this is" box.  Just before that, put this code:

    <style>
    <b:if cond='data:blog.pageType == &quot;item&quot;'>
       div.fullpost {display:inline;}
    <b:else/>
       div.fullpost {display:none;}
    </b:if>
    </style>

  3. Search for <data:post.body>.  Put this in just after:
    <b:if cond='data:blog.pageType != &quot;item&quot;'>
       <b:if cond='data:post.labels'>
          <b:loop values='data:post.labels' var='label'>
             <b:if cond='data:label.name == &quot;more&quot;'>
                <a expr:href='data:post.url'>...<b>Read more</b></a>
             </b:if>
          </b:loop>
       </b:if>
    </b:if>
  4. Change that "more" to the text you want.

You're done!  To make the cut:

Outside text.
<div class="fullpost">Inside text.</div>

Ah, Blogger.  As a friend said, aren't you supposed to copy successful technology?

Category: Uncategorized  | Tags: ,  | Leave a Comment
Saturday, November 15th, 2008 - 17:39 | Author: christina

Mostly for me at work.

more…

Category: Uncategorized  | Tags:  | Leave a Comment
Wednesday, November 12th, 2008 - 12:00 | Author: christina

Everyone and their cousin has one. I am myself and have my own. I note that I don't deal with international addresses at my place of business.

more…

Category: Uncategorized  | Tags: ,  | Leave a Comment
Tuesday, November 11th, 2008 - 14:54 | Author: christina

I got tired of the format=light being able to be applied to any URL, and also continuing to append even if it's already there, so:

javascript:if(location.href.indexOf("format=light")==-1&&location.href.indexOf("livejournal.com")>-1&&location.href.indexOf("html")>-1){location.search+=(location.search?'&':'?')+'format=light'}

(Updated to add a bit that requires 'html' to be present.)

Friday, November 07th, 2008 - 14:06 | Author: christina

How To Enable Mouse Wheel Scrolling in Ubuntu Hardy on VMware Fusion

Category: Uncategorized  | Tags: , ,  | Leave a Comment
Friday, November 07th, 2008 - 13:18 | Author: christina

I hate tag clouds. But I like the inline display. So:

\wp-includes\category-template.php

At lines 342 and 372, change the numbers to what you want.

Category: Uncategorized  | Tags:  | Leave a Comment
Friday, November 07th, 2008 - 12:58 | Author: christina

I prefer GUI over CLI for some things, so naturally someone will say "Just go to Terminal and type blahdeeblah!".  Fie on them, I say.

The Cisco VPN client doesn't work with Vista Home 64-bit, and I already had a Ubuntu 8.04 virtual machine, so I set up a VPN thing there.  My steps:

  • Go to Applications > Add/Remove and install "VPN Connection Manager (vpnc)" and "Gnome-RDP".
  • Click on the network connection icon in the tray and select VPN Connections > Configure VPN.
  • Choose Add:
    • Forward.
    • "Compatible Cisco VPN client (vpnc)", forward.
    • Connection Name: A user-friendly name for the connection.
    • Gateway: The IP address your admin provides.
    • Group Name: The group name &c.
    • In the Optional tab, click "Override user name", and enter in your username.
    • Forward.
    • Click Apply, then Close.

To connect, click on the network connection icon again and select VPN Connections > aitpdx webservers. The icon should change to a lock.

The steps to create and run a remote desktop session are remarkably similar to the steps when in Windows, so I won't recreate them here.

Category: Uncategorized  | Tags: , , , , , ,  | Leave a Comment
Saturday, October 25th, 2008 - 22:29 | Author: christina

I never remember!  Argh!

Default Foreground: 0, 0, 0
Default Bold Foreground: 255, 255, 255
Default Background: 255, 255, 255
Default Bold Background: 0, 0, 0
Cursor Colour: 0, 0, 220

Category: Uncategorized  | Tags:  | Leave a Comment
Tuesday, October 21st, 2008 - 14:59 | Author: christina

Elsewhere, I had an issue with using Wordpress's RSS widget with Google shared items - namely, it would put TitleTitle, for example.  This is because Google's .xml file was using 'title' and 'link' twice.

I found a fix for it elsewhere, so I'll summarise it here:

1. Open wp-includes/rss.php and go to line 46 or thereabouts. Remove 'title' from the CONTENT_CONSTRUCTS array.

2. Open wp-includes/widgets.php and look for the wp_widget_rss_output function - I found it at line 1094. Within this code block, look for the following code and add the highlighted lines:

foreach ($rss->items as $item ) {
             while ( strstr($item['link'], 'http') != $item['link'] ) {
                 $item['link'] = substr($item['link'], 1);
             }
             if($secondhttp = strpos($item['link'],'http',5)) {
                 $item['link'] = substr($item['link'],0,$secondhttp);
             }
             $link = clean_url(strip_tags($item['link']));
Category: Uncategorized  | Tags: , , ,  | Leave a Comment
Tuesday, October 21st, 2008 - 10:17 | Author: christina

To train SpamAssassin on what is spam vs. what is ham:

sa-learn --no-sync --spam --mbox ~/mail/spam
sa-learn --no-sync --ham --mbox ~/mail/spam

The source for this is here.

I have mine set to two aliases, since my spam folders don't change names - spamtime and hamtime. To set an alias, from what I know:

  1. Edit the .bash_profile file using your favourite text editor.
  2. Add this line after the PATH= line: alias spamtime='sa-learn --no-sync --spam --mbox ~/mail/spam'
  3. Save and close.

The next time you log into your account, you should be able to use that alias.

While I'm at it…  The option for allowing you to suspend Pine using Ctrl-Z is in Setup > Config: search for 'enable-suspend'.

Category: Uncategorized  | Tags: , , ,  | Leave a Comment
Monday, October 20th, 2008 - 08:55 | Author: christina

The Greasemonkey script killfile is wonderful.  On occasion it needs correction, but that is because blogs change, not out of any fault of the author.  Since the author sends out updates, I figured I'd record a few changes here, so I can update them when the script updates come out.

The only one today is for scalzi.com:

scalzi:[{scenario:wordpressScenario,hrefpat:"^[^/]*//whatever[^/]*/"}],

Friday, October 17th, 2008 - 13:45 | Author: christina

Two things that are useful to me:

http://ascii.cl/htmlcodes.htm
http://www.avenue-it.com/html/extracharacters.html

Category: Uncategorized  | Tags: ,  | Leave a Comment
Friday, October 17th, 2008 - 11:19 | Author: christina

I'm testing this linking thing.  This is the .pdf for GoldMine's table definitions.  Its original location is here; I've stored it here for safe-keeping.

(Later, I will figure out how to get WP to allow for uploads. In the interim, I am full of tired and cannot focus properly on anything, including (but not limited to) tying my own shoes.)

Friday, October 17th, 2008 - 10:45 | Author: admin

I can create and save a profile in the scanner/camera wizard in Vista, hooray.  To edit them for heaven's sake, go to:
C:\Users\[User]\AppData\Local\Microsoft\UserScanProfiles

http://msdn.microsoft.com/en-us/library/aa360097(VS.85).aspx

Category: Software Foo  | Tags: , ,  | Leave a Comment