Archive for the ‘Code Monkey’ Category

Installing Get Satisfaction’s Help Center

Friday, May 30th, 2008

Just found out about Get Satisfaction’s brand new Help Center and tried to install it? No doubt you’ll run into a few bugs along the way. However, follow this guide and you should be fine.

Install Smarty into an include directory
  1. This is most easily done by extracting the lib/ directory from the Smarty package into a new directory called includes/
  2. Rename the lib/ directory to smarty/
  3. Add the following line to your Help Center’s config file:
    set_include_path(get_include_path() . PATH_SEPARATOR . '/path/to/includes/');
Install the HTTP_Request PEAR library
Install this like any other PEAR library. If you don’t have PEAR, download the archive and extract the HTTP_Request-* into the previously created includes directory. Then rename the HTTP_Request-* to HTTP
Setup the database
  1. Create a database called “sprinkles”
  2. Import the schema from the included SQL file, sprinkles-schema.sql
Create a folder for compiled templates
Create the templates_c/ directory in the Help Center directory to hold the compiled templates for Smarty and make sure it is writable.
Edit your config
Edit config.php in your Help Center installation and add the following, replacing “root” and “password” with your respective database username and password:
$mysql_username = 'root';
$mysql_password = 'password';
Run the web installer
Head to your installation of Help Center in your browser and the web installer will kick in.

Hopefully this process becomes easier in the future. I would recommend to the Get Satisfaction developers to include HTTP_Request and Smarty with the Help Center package.

FeedParser Test Suite - Now with OPML!

Sunday, December 30th, 2007

As a developer of an aggregator, I test against different types of exploits that users may experience. Up until now, I’ve been adding singular feeds by themselves. However, it’s always irritated me that there was never an OPML file to import them all at once.

Et viola. I wrote myself a simple PHP program to convert a list of URLs into an OPML file (the code’s free for any use, should you find a use for it) and used a list of URLs I had obtained by doing mass copies from the directory pages.

Enjoy :)

(As a side note, there are 3325 different test feeds.)

Upgrading MediaWiki 1.4.8 to 1.11.0

Tuesday, December 11th, 2007

The WordPress Codex site’s MediaWiki installation is currently on 1.4.8. I was listening to some discussion on the wp-hackers list, so I thought I’d present my guide to upgrading. I must warn you first though, I personally use DokuWiki when I need a wiki, as it’s simpler. Without further adieu…

  1. Extract everything in mediawiki-1.11.0/ into your current MediaWiki folder (i.e. replace the files)
  2. Delete the following files:
    • .cvsignore
    • Version.php
    • irc/
    • docs/deferred.doc
    • docs/design.doc
    • docs/globals.doc
    • docs/hooks.doc
    • docs/language.doc
    • docs/linkcache.doc
    • docs/memcached.doc
    • docs/schema.doc
    • docs/skin.doc
    • docs/title.doc
    • docs/user.doc
    • docs/html/.cvsignore
    • images/.cvsignore
    • includes/BlockCache.php
    • includes/CacheManager.php
    • includes/DatabasePostgreSQL.php
    • includes/FulltextStoplist.php
    • includes/Group.php
    • includes/Image.php
    • includes/Interwiki.php
    • includes/killthread.php
    • includes/MessageCacheHints.php
    • includes/ParserXML.php
    • includes/Profiling.php
    • includes/SearchMySQL3.php
    • includes/SiteStatsUpdate.php
    • includes/SkinPHPTal.php
    • includes/SpecialAsksql.php
    • includes/SpecialDebug.php
    • includes/SpecialGeo.php
    • includes/SpecialListadmins.php
    • includes/SpecialMaintenance.php
    • includes/SpecialMakesysop.php
    • includes/SpecialSitesettings.php
    • includes/SpecialUserlevels.php
    • includes/SpecialValidate.php
    • includes/UpdateClasses.php
    • includes/normal/.cvsignore
    • languages/Language*.php
    • maintenance/build-intl-wiki.sql
    • maintenance/changeuser.sql
    • maintenance/checktrans.php
    • maintenance/cleanupDupes.php
    • maintenance/compressOld.inc
    • maintenance/compressOld.php
    • maintenance/database.sql
    • maintenance/DiffLanguage.php
    • maintenance/dumpMessages.php
    • maintenance/dumpRev.php
    • maintenance/importPhase2.php
    • maintenance/InitialiseMessages.inc
    • maintenance/liveCmdLine.inc
    • maintenance/rebuildMessages.php
    • maintenance/recount.sql
    • maintenance/redundanttrans.php
    • maintenance/remove-brokenlinks.php
    • maintenance/trivialCmdLine.php
    • maintenance/postgresql/
    • maintenance/archives/convertdb.php
    • maintenance/archives/moveCustomMessages.inc
    • maintenance/archives/moveCustomMessages.php
    • maintenance/archives/patch-curid-covering.sql
    • maintenance/archives/patch-list.txt
    • maintenance/archives/patch-rename-user_rights.sql
    • math/.cvsignore
    • skins/amethyst/
    • skins/wikimania/
    • skins/common/common.css
    • skins/common/images/favicon.ico
    • skins/common/images/fileicon-mid.png
    • skins/common/images/fileicon-ogg.png
    • skins/common/images/fileicon-ogg.xcf
    • skins/common/images/fileicon.png
    • skins/common/images/magnify-clip.png.old
    • skins/common/images/redirect.png
    • skins/common/images/valid-html401.png
    • skins/disabled/Amethyst.php
    • skins/disabled/Amethyst.pt
    • skins/disabled/Chick.php
    • skins/disabled/Chick.pt
    • skins/disabled/MonoBook.pt
    • skins/disabled/MonoBookTal.php
    • skins/disabled/Wikimania.php
    • skins/disabled/WikimediaWiki.php
    • skins/disabled/WikimediaWiki.pt
    • tests/.cvsignore
    • tests/RunTests.php
    • tests/SearchMySQL3Test.php
  3. Rename LocalSettings.php to LocalSettings.old.php (Important: maintenance/upgrade.php will not work)
  4. Run the installer again, with the same options as before
  5. Delete config/LocalSettings.php
  6. Rename LocalSettings.old.php back to LocalSettings.php
  7. Done!

Damn that YaBB!

Saturday, May 5th, 2007

I have recently been using a 404 notifier plugin, however the links to mark a comment as spam don’t work. So, I resorted to doing it the PHP and Apache way.
All the spam was coming from bots trying to access a YaBB script. This was located (or so they thought) at /cgi-bin/yabb2/YaBB.pl
I decided that I’d use some htaccess and some PHP. So here it is:

The .htaccess

RewriteEngine On
RewriteRule ^cgi-bin/yabb2/YaBB.pl$ /damnthatyabb.php [L,NC]

The PHP

<?php
if ($_GET['msg']) {
	echo 'Thanks for posting, spammer.';
}
else {
	echo '<form action="/cgi-bin/yabb2/YaBB.pl" method="GET"> <textarea name="msg"></textarea><input type="submit" /></form>';
}

What it does

It basically takes their input and does nothing with it, but gives them a sense of achievement. We don’t want to disappoint our guests now, do we?

Hi. I live here to keep the peace. You can ignore me now :)