12) { $newest_entry = mysql_fetch_assoc(mysql_query("SELECT e_id, date FROM bhost_entries WHERE w_id='$weblog_info[w_id]' AND draft='0' $privacy ORDER BY date DESC LIMIT 1")); $thism = cdate("n", $newest_entry[date]); } else { $thism = $m; } } else { $newest_entry = mysql_fetch_assoc(mysql_query("SELECT e_id, date FROM bhost_entries WHERE w_id='$weblog_info[w_id]' AND draft='0' $privacy ORDER BY date DESC LIMIT 1")); $thism = cdate("n", $newest_entry[date]); } if(isset($_GET['y'])) { $y = $_GET['y']; if((int)$y != $y | !is_numeric($y)) { $newest_entry = mysql_fetch_assoc(mysql_query("SELECT e_id, date FROM bhost_entries WHERE w_id='$weblog_info[w_id]' AND draft='0' $privacy ORDER BY date DESC LIMIT 1")); $thisy = cdate("Y", $newest_entry[date]); } else { $thisy = $y; } } else { $newest_entry = mysql_fetch_assoc(mysql_query("SELECT e_id, date FROM bhost_entries WHERE w_id='$weblog_info[w_id]' AND draft='0' $privacy ORDER BY date DESC LIMIT 1")); $thisy = cdate("Y", $newest_entry[date]); } // RETRIEVE TEMPLATE $template = $weblog_info[template]; $template = bh_engine($template); // REMOVE ANYTHING BETWEEN CONTAINERS $ifentrypagecount = occurrencecount("", "", $template, "0"); for($a=0;$a<$ifentrypagecount;$a++) { $template = str_replace("".between("", "", $template)."", "", $template); } // REMOVE ANYTHING BETWEEN CONTAINERS $ifentrypagecount = occurrencecount("", "", $template, "0"); for($a=0;$a<$ifentrypagecount;$a++) { $template = str_replace("".between("", "", $template)."", "", $template); } // REMOVE ANYTHING BETWEEN CONTAINERS $iffriendspagecount = occurrencecount("", "", $template, "0"); for($a=0;$a<$iffriendspagecount;$a++) { $template = str_replace("".between("", "", $template)."", "", $template); } // REMOVE ANYTHING BETWEEN CONTAINERS $ifpagescount = occurrencecount("", "", $template, "0"); for($a=0;$a<$ifpagescount;$a++) { $template = str_replace("".between("", "", $template)."", "", $template); } // REMOVE ENTRY CATEGORIES $ifcategoriesallowedcount = occurrencecount("", "", $template, "0"); for($a=0;$a<$ifcategoriesallowedcount;$a++) { $template = str_replace("".between("", "", $template)."", "", $template); } $template = str_replace("<%EntryCategory%>", "", $template); // REMOVE ANYTHING BETWEEN AND CONTAINERS $ifcommentsallowedcount = occurrencecount("", "", $template, "0"); for($a=0;$a<$ifcommentsallowedcount;$a++) { $template = str_replace("".between("", "", $template)."", "", $template); } $commentcontcount = occurrencecount("", "", $template, "0"); for($a=0;$a<$commentcontcount;$a++) { $template = str_replace("".between("", "", $template)."", "", $template); } // REMOVE ANYTHING BETWEEN CONTAINERS $ifpostcommentsallowedcount = occurrencecount("", "", $template, "0"); for($a=0;$a<$ifpostcommentsallowedcount;$a++) { $template = str_replace("".between("", "", $template)."", "", $template); } // REMOVE ANYTHING BETWEEN AND CONTAINERS $iftrackbacksallowedcount = occurrencecount("", "", $template, "0"); for($a=0;$a<$iftrackbacksallowedcount;$a++) { $template = str_replace("".between("", "", $template)."", "", $template); } $trackbackcontcount = occurrencecount("", "", $template, "0"); for($a=0;$a<$trackbackcontcount;$a++) { $template = str_replace("".between("", "", $template)."", "", $template); } // REMOVE ANYTHING BETWEEN CONTAINERS $entrycount = occurrencecount("", "", $template, "0"); for($i=0;$i<$entrycount;$i++) { $template = str_replace("".between("", "", $template)."", "", $template); } // BUILD ARCHIVES $archive_data = ""; $month_date = strtotime("$thism/1/$thisy 12:00:00 am"); //REPLACE WindowTitle VARIABLE $template = str_replace("<%WindowTitle%>", "$weblog_info[title] - $archive2 (".cdate("F Y", $month_date).") - BlogHoster", $template); if(cdate("n", $month_date) == 1 | cdate("n", $month_date) == 3 | cdate("n", $month_date) == 5 | cdate("n", $month_date) == 7 | cdate("n", $month_date) == 8 | cdate("n", $month_date) == 10 | cdate("n", $month_date) == 12) { $days = 31; } elseif(cdate("n", $month_date) == 4 | cdate("n", $month_date) == 6 | cdate("n", $month_date) == 9 | cdate("n", $month_date) == 11) { $days = 30; } elseif(cdate("n", $month_date) == 2) { $days = 28; } $next_month_date = $month_date+(60*60*24*$days); $month_entries = mysql_query("SELECT e_id, title, date FROM bhost_entries WHERE w_id='$weblog_info[w_id]' AND date >= '$month_date' AND date < '$next_month_date' AND draft='0' $privacy ORDER BY date DESC"); while($month_info = mysql_fetch_assoc($month_entries)) { if(str_replace(" ", "", $month_info[title]) == "") { $title = "$archive1"; } else { $title = $month_info[title]; } $title = str_replace("<", "<", $title); $title = str_replace(">", ">", $title); $archive_data .= "".cdate($weblog_info[format_date], $month_info[date]); if($weblog_info[showtitle] == "1") { $archive_data .= ": $title"; } $archive_data .= "
"; } $newest_entry = mysql_fetch_assoc(mysql_query("SELECT e_id, date FROM bhost_entries WHERE w_id='$weblog_info[w_id]' AND draft='0' $privacy ORDER BY date DESC LIMIT 1")); $newest_year = cdate("Y", $newest_entry[date]); $oldest_entry = mysql_fetch_assoc(mysql_query("SELECT e_id, date FROM bhost_entries WHERE w_id='$weblog_info[w_id]' AND draft='0' $privacy ORDER BY date ASC LIMIT 1")); $oldest_year = cdate("Y", $oldest_entry[date]); $loop = $newest_year - $oldest_year + 1; $year = $newest_year; for($a=0;$a<$loop;$a++) { $year_date = strtotime("1/1/$year 12:00:00 am"); $next_year_date = $year_date+(60*60*24*365) + cdate("L", $year_date)*60*60*24; if(mysql_num_rows(mysql_query("SELECT e_id FROM bhost_entries WHERE w_id='$weblog_info[w_id]' AND date >= '$year_date' AND date < '$next_year_date' AND draft='0' $privacy")) != 0) { $archive_data .= "
$year
"; if($year <= 1969) { $month_date = "0"; if(cdate("n", $month_date) == 1 | cdate("n", $month_date) == 3 | cdate("n", $month_date) == 5 | cdate("n", $month_date) == 7 | cdate("n", $month_date) == 8 | cdate("n", $month_date) == 10 | cdate("n", $month_date) == 12) { $days = 31; } elseif(cdate("n", $month_date) == 4 | cdate("n", $month_date) == 6 | cdate("n", $month_date) == 9 | cdate("n", $month_date) == 11) { $days = 30; } elseif(cdate("n", $month_date) == 2) { $days = 28; } $next_month_date = $month_date+(60*60*24*$days); if(mysql_num_rows(mysql_query("SELECT e_id, title, date FROM bhost_entries WHERE w_id='$weblog_info[w_id]' AND date >= '$month_date' AND date < '$next_month_date' AND draft='0' $privacy")) != 0) { $archive_data .= "".cdate("F Y", $month_date)."
"; } } else { for($c=12;$c>0;$c--) { $month_date = strtotime("$c/1/$year 12:00:00 am"); if(cdate("n", $month_date) == 1 | cdate("n", $month_date) == 3 | cdate("n", $month_date) == 5 | cdate("n", $month_date) == 7 | cdate("n", $month_date) == 8 | cdate("n", $month_date) == 10 | cdate("n", $month_date) == 12) { $days = 31; } elseif(cdate("n", $month_date) == 4 | cdate("n", $month_date) == 6 | cdate("n", $month_date) == 9 | cdate("n", $month_date) == 11) { $days = 30; } elseif(cdate("n", $month_date) == 2) { $days = 28; } $next_month_date = $month_date+(60*60*24*$days); if(mysql_num_rows(mysql_query("SELECT e_id, title, date FROM bhost_entries WHERE w_id='$weblog_info[w_id]' AND date >= '$month_date' AND date < '$next_month_date' AND draft='0' $privacy")) != 0) { $archive_data .= "".cdate("F Y", $month_date)."
"; } } } } $year = $year-1; } // INPUT ARCHIVES $template = str_replace("<%ArchiveInfo%>", "$archive_data", $template); $template = str_replace("<%CurrentPage%>", "1", $template); $template = str_replace("<%TotalPages%>", "1", $template); $search_vars = Array("", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "<%TrackbackRDF%>", "", ""); $template = str_replace($search_vars, "", $template); // OUTPUT WEBLOG echo $template; ?>