Well, identi.ca has added a replies section, so I figured I should probably upgrade my tarball to have replies as well. At the same time, I didn’t want to lose any of my upgrades, so I would create a new tarball, which you can get here and describe what I went through to update my site, as well as the changes that I’ve made.
Upgrading
Assuming that you have a previous iteration of my tarball running, you should unzip the new tarball. Copy the config.php file into the new directory, as well as any modified themes, if you have them. You also need to edit the laconica.sql file to get the section of SQL code that creates the reply table and create the reply table. Then, you need to make sure that your ini file the classes directory is the most recent version. With that in place, the site should look pretty much the same with a few caveats.
First, for some reason, my avatars got lost, so I uploaded mine again. Second, the replies are not retroactive. I suppose if you can get fixup_replies.php to run, it will make them retroactive, but I couldn’t get it to run.
I also needed to rename xmpp.php to XMPP.php and the xmpphp directory to XMPPHP. This is in the tarball, so it shouldn’t affect you.
One other weirdness, when I didn’t have the proper reply table, I was getting syslogging errors.
[07-Jul-2008 18:14:18] PHP Warning: syslog() expects parameter 1 to be long, string given in /backup/tmphome/smartcam/laconica/lib/util.php on line 1033
I suspect there is an outstanding bug there, but I’ve gotten around it.
My patches
So far, I’ve done two patches. The first adds the ability to more easily customize the subscription notice email. In the actions/subscribe.php file, I added
require_once( theme_file("mail.tpl.php"));
to the top of the file, right after it checks to see if LACONIA is defined.
Then, the section of code that creates the $body is replace with
$body = notify_email_form($other);
The notify_email_form function is defined in the mail.tpl.php file. My sample mail.tpl.php file currently looks like
<?php
function notify_email_form($other) {
global $config;
$body =
($other->fullname) ?
($other->fullname . ' (' . $other->nickname . ')') : $other->nickname;$body .= _t(' is now listening to your notices on ') . $config['site']['name'] . '.';
$body .= "\n\n";$body .= "\t".$other->profileurl;
$body .= "\n\n";
$body .= _t('Faithfully yours, ');
$body .= "To subscribe to " . $other->nickname;
$body .= " click on the following link.\n";
$body .= "\t". common_local_url("subscribe",array("subscribeto"
=> $other->nickname));
$body .= "\n\n";
$body .= $config['site']['name'];
$body .= "\n";/* My added code */
$body .= "\n";
$body .= "Homepage = " . $other->homepage . "\n";
$body .= "bio = " . $other->bio . "\n";
$body .= "location = " . $other->location . "\n";
$body .= "created = " . $other->created . "\n";
$body .= "modified = " . $other->modified . "\n";return $body;
}
?>
The other change that I did was I created a favicon.ico file which I’ve added to the theme directory. In my case, I took the existing identi.ca favicon.ico file and changed the background to Orient Lodge Red. Then, I added the following lines to the lib/util.php file.
common_element('link', array('rel' => 'shortcut icon', 'type' => 'image/x-icon',
'href' => theme_path('favicon.ico')));
In the latest version, I added this at approximately line 160, right after the code to add the style sheet.
Submitted by
Rate on NewsTrust







Post new comment