|
Wednesday, April 4
If you build it
Seeing as I'm anal retentive, it's making me nuts that I have to support two discussion systems. I can't just shut off Blogvoices, or all my old posts will be inaccessible. Converting them by hand will be hugely time consuming, especially if I do it for my various affiliated sites, Clan Lord Journal and Rock Out With Your Flock Out. The obvious solution is to write some scripts to convert it. Since I'm surely not the only one with this problem, it makes sense to provide a web-based tool that will help people convert. It's also a great excuse to do more work with PHP. As soon as I have the script done, I'll make it available. '; } else { if(stristr($filename,"archive")) { $dir=$_SERVER['DOCUMENT_ROOT']; $template='_01_archive.html'; $tail=strlen($template); $thisArchive=$filename; //$files=scandir($dir); $dh = opendir($dir); while (false !== ($filename = readdir($dh))) { $files[] = $filename; } sort($files); $earlyarch=""; $laterarch=""; $prevarch=""; $next=0; foreach($files as $file) { if (substr($file,-$tail)==$template) { if ($next==1) { $laterarch=$file; $earlyarch=$prevarch; $next=0; } if ($file==$thisArchive) { $next=1; } else { $prevarch=$file; $earlyarch=$prevarch; } } } $link=''; $divider=''; if(file_exists($earlyarch)) { $link='< Earlier Archive'; $divider=" | "; } if(file_exists($laterarch)) { $link=$link.$divider.'Later Archive >'; } $link=$link.' '; } } echo($link); ?> |