require_once('../Connections/bob.php');
if (isset($_POST['action'])){
$action=(get_magic_quotes_gpc()) ? $_POST['action'] : addslashes($_POST['action']);
}
if (isset($_GET['action'])){
$action=(get_magic_quotes_gpc()) ? $_GET['action'] : addslashes($_GET['action']);
}
if(is_numeric($action)){
$query_suffix = "WHERE potw_no='$action'";
}else{
$query_suffix = "ORDER BY potw_no DESC";
if ($action!="list"){
$query_suffix .= " LIMIT 1";
}
}
if ($action=="list"){
if(isset($_POST['order'])){
$order=(get_magic_quotes_gpc()) ? $_POST['order'] : addslashes($_POST['order']);
}else{
$order="potw_no";
}
if($order=="potw_no"){
$dir="DESC";
}else{
$dir="ASC";
}
mysql_select_db($database_bob, $bob);
$query_potw = "SELECT `annos_archive`.`id` AS archive_id, `annos_archive`.`song_title`, date_format(`annos_archive`.`date`, '%d-%m-%Y') AS `written`, `annos_archive`.`date_accuracy`, `annos_archive`.`ab_code`,`annos_archive`.`extra_inf`, `PotW`.* FROM `annos_archive`, `PotW` WHERE (`annos_archive`.`id` = `PotW`.`potw`) ORDER BY $order $dir";
$potw = mysql_query($query_potw,$bob) or die(mysql_error());
$row_potw = mysql_fetch_assoc($potw);
}else{
mysql_select_db($database_bob, $bob);
$query_potw_vars = "SELECT *, date_format(`updated`, '%W, %D %M, %Y')`last_update` FROM PotW $query_suffix";
$potw_vars = mysql_query($query_potw_vars, $bob) or die(mysql_error());
$row_potw_vars = mysql_fetch_assoc($potw_vars);
$totalRows_potw_vars = mysql_num_rows($potw_vars);
$id=$row_potw_vars['potw'];
$query_potw = "SELECT * FROM annos_archive WHERE id = $id";
$potw = mysql_query($query_potw,$bob) or die(mysql_error());
$row_potw = mysql_fetch_assoc($potw);
$query_comments = "SELECT id FROM archive_comments WHERE archive_comments.entry_id = $id";
$comments = mysql_query($query_comments, $bob) or die(mysql_error());
$row_comments = mysql_fetch_assoc($comments);
$totalRows_comments = mysql_num_rows($comments);
}
$title = str_replace(array("{","}","*"),"",$row_potw['song_title']);
//file variables
$root_path="/home/lwm/public_html/annosite/";
$file_path="archivefiles/".$row_potw['file_type']."/".substr($row_potw['date'],0,4)."/".substr($row_potw['date'],5,2)."/";
$file=$file_path.$row_potw['date']."_".$row_potw['file'].".".$row_potw['file_type'];
$thumb=$file_path."th_".$row_potw['date']."_".$row_potw['file'].".jpg";
for ($file_no=$row_potw_vars['potw_no']; strlen($file_no)<3; $file_no="0".$file_no){}
$potw_file="images/poetry/fix_".$file_no.".jpg";
?>
ANNO
include("../js.shtml");?>
include("../contents.shtml");?>
|
if ($action=="list"){?>
| # |
Title |
Date |
# Comments |
View |
AB Ref |
$q=0;
do{
?>
| | |