<?php include('./fancyurls.config.php'); include('./config.php'); $data = explode("/",serverVar('PATH_INFO')); //$blogid = intval($data[1]); if (count($data) == 5) { $year = intval($data[1]); $month = intval($data[2]); $day = intval($data[3]); $title = $data[4]; // get the itemid from the name and date. (Note, if you have two posts with the same name on the same day, it'll be screwed up.) $query = 'SELECT iblog, inumber FROM '.sql_table('item').' WHERE iurltitle=\'' . $title . '\' '; $query .= "AND (YEAR(itime) = $year AND MONTH(itime) = $month AND DAYOFMONTH(itime) = $day)"; $res = sql_query($query); $obj = mysql_fetch_object($res); $blogid = $obj->iblog; $itemid = $obj->inumber; } else { $itemid = intval($data[1]); } selector(); ?>