PHP/LJ Link Code
Free to use, but please give credit where it's due.

It can be a pain to make [info]gravecat-style links to LiveJournals if you're not actually using an LJ, and writing the code by hand each time is just annoying. Enter my little link code segment, which does the hard work for you.

It's fairly simplistic, but I thought I'd share it, as it might make some blogger's lives easier. It requires PHP to work, and I wouldn't recommend using it at all unless you're already familiar with using PHP. To use it, simply insert this code at the top of your page (it will be invisible to viewers):

<?php
function ljuser($arg) {
echo("<a href=\"http://www.livejournal.com/userinfo.bml?user=$arg\"><img src=\"http://stat.livejournal.com/img/userinfo.gif\" alt=\"[info]\" width=\"17\" height=\"17\" border=\"0\" align=\"bottom\"/></a><a href=\"http://www.livejournal.com/users/$arg\"><b>$arg</b></a>");
}
function ljcomm($arg) {
echo("<a href=\"http://www.livejournal.com/userinfo.bml?user=$arg\"><img src=\"http://stat.livejournal.com/img/community.gif\" alt=\"[info]\" width=\"17\" height=\"17\" border=\"0\" align=\"bottom\"/></a><a href=\"http://www.livejournal.com/community/$arg\"><b>$arg</b></a>");
}
?>

From then on, if you want to link to a LiveJournal or LJ community, instead of having to type a mass of HTML by hand, you can simply type: <?php ljuser("name");?> for a user, or <?php ljcomm("name");?> for a community (replacing 'name' with the name of the journal or community to link to).

Assuming you have PHP working correctly, every time someone views your page, it will automatically replace the code with a graphic and link to the LJ, saving you the effort of doing it yourself.

If you like this code and use it in your own blog, I'd appreciate a link back to wolfcat.org. But I'm not going to be a dick about it -- it's not required if you don't want to do it.