When I tried to send an email on my new iiNet last night, I
discovered that outgoing port 25 was blocked. This is quite common
with ISPs, since it tends to prevent a good deal of spam and other
malware activity. But it’s a nuisance for me, since I like to send
mail via my own mail server.
But, unlike many other ISPs (not looking at anyone cough bigpond in
particular), iiNet let you turn off the blocking if you know what
you’re doing.
Nice touch.
Summary pages in Drupal, such as this one, display “teasers”
of the nodes (pages or blog entries) if the entry is longer than a
certain (configurable) length. If the entry is trimmed this way,
Drupal helpfully displays a “read more” link below the teaser. This is
ok, but it can be easy to miss if you are just looking at the text of
the article, and mentally “tuning out” the noise of the links below.
So I modified my theme’s node.tpl.php (part of the now-default
PHPTemplate engine) to hack in a “more” link at the end of the
last paragraph:
--- node.tpl.php (revision 43)
+++ node.tpl.php (working copy)
@@ -9,6 +9,11 @@
<span class="taxonomy">[<?php print $terms?>]</span>
<?php }; ?>
<?php }; ?>
+ <?php if ($readmore) {
+ // insert a link before the closing P tag if there's more to read
+ $read_more = ' <span class="readmore">...<a href="' . $node_url . '">more</a>...</span>';
+ $content = preg_replace('/<\/p>$/', $read_more . '$1', $content);
+ }; ?>
<div class="content"><?php print $content?></div>
<?php if ($links) { ?><div class="links">» <?php print $links?></div><?php }; ?>
</div>
This requires a variable, $readmore, to be set in template.php:
function _phptemplate_variables($hook, $vars) {
switch ($hook) {
case 'node':
$vars['readmore'] = ($vars['node']->teaser && $vars['node']->readmore);
break;
}
return $vars;
}
(and some styling in style.css, but you can figure this out for
yourself ;) )
And now I have discrete little “…more…” links at the end of the
last paragraph of trimmed article summaries.
I kind of feel like this should have been possible by simply adding
the link after $content rather than stuffing something into it with
a regex, and causing it to be displayed inline with CSS, but my CSSfu
is not strong enough. Suggestions welcome…
After a frustrating weekend of ADSL outages a couple of weeks ago,
thanks either to my ISP or, more likely, their upstream provider (the
Australian Monopoly Telco Who Shall Not Be Named), I started hunting
around for a new ISP. Just on a whim, I checked my exchange on the
ADSL2+ roll-out status page at iiNet. And lo! It’s available!
So I signed up for their standard plan, which gives me “up to” 24Mbps
and 10GB download per month (plus another 10GB off peak). Given that I
haven’t had to try too hard to keep within my current 5GB (+5GB) plan,
and iiNet’s 10+10 is $20/mo less, it seemed like a good place to
start. I also get their local phone service (bundled with ADSL2+) and
VoIP, which should be interesting.
The downside of upgrading from ADSL to ADLS2+ is that there’s no “fast
churn”. In other words, I had to disconnect my current service and
then wait for the new one to be provisioned. But now it’s active! (And
only three business days later, which is better than I expected.)
I don’t have the new ADSL2+ modem yet, but even with my current modem
(a Netcomm NB1300) I’ve seen download speeds of about 380KBps
(that’s bytes there sonny), which is fairly impressive. Uploads are
going at about 60-80KBps, which is a lot better than the old 24KBps.
My line attentuation is hovering around the 50dB mark according to the
NB1300, which I’m led to believe means I probably won’t get much more
than 10Mbps anyway, but we’ll see how it goes when the new modem
arrives.
It’s amazing how long five days felt without ‘net connectivity,
though… :-D
I’m giving up on blosxom. Not that there’s anything wrong with it, but the advantages of keeping my blog in Drupal are too great to ignore.
I liked the idea of blosxom, and I love having a local copy of my blog in plain text (and being able to manage it in subversion), but the hassle of maintaining another bunch of HTML/CSS, and the extra work involved in adding functionality like comments, is just not worth it.
So, look over here for future (frequent?) posts. :) I’ll get around to bringing the blosxom content across and putting in redirects soon.
I just spent a frustrating couple of hours beating my head against a
Drupal site, trying to change the site name (that appears in the site
banner and title). No matter what I set in the admin/settings page,
the site name remained unchanged. The database was being updated
correctly:
mysql> select * from variable where name = 'site_name'\G
*************************** 1. row ***************************
name: site_name
value: s:20:"My Fancy Drupal Site";
but the old name was still displaying on the site (and every time I
went back in to admin/settings, the name had reverted).
Finally, I remembered this section of settings.php:
/**
* Variable overrides:
*
* To override specific entries in the 'variable' table for this site,
* set them here. You usually don't need to use this feature. This is
* useful in a configuration file for a vhost or directory, rather than
* the default settings.php. Any configuration setting from the 'variable'
* table can be given a new value.
*/
$conf = array(
'site_name' => 'My Drupal Site',
// 'theme_default' => 'bluemarine',
'anonymous' => 'Visitor'
);
D’oh!
So I commented out that 'site_name' line, and everything worked as
expected.
This is a test of the patched weblogger.el I found on Friends of
Bart. It would be really cool if it worked, because emacs is like
a second home to me. :)