"; // archive link url $archive_link_m = "$siteurl/".$blogfilename."?m="; # monthly archive $archive_link_w = "$siteurl/".$blogfilename."?w="; # weekly archive $archive_link_p = "$siteurl/".$blogfilename."?p="; # post-by-post archive if (!isset($oldest_year)) { // your oldest archives are from year... $oldest_year = "2001"; } // --- // $pagenow = basename($PHP_SELF); if ($pagenow == "b2archives.php") { // are we running standalone include ("blog.header.php"); $archive_mode = "postbypost"; if(!$way) $way = "ID"; if(!$order) $order = "DESC"; //echo "Archives:"; ?> <?php echo $blogname ?>

Back to

Order by
=$oldest_year; $arc_year--) { for ($arc_month=12; $arc_month>0; $arc_month--) { $arc_sql="SELECT ID FROM $tableposts WHERE YEAR(post_date)='$arc_year' AND MONTH(post_date)='$arc_month' LIMIT 1"; $querycount++; $arc_result=mysql_query($arc_sql); if (mysql_num_rows($arc_result)) { echo ""; echo $month[zeroise($arc_month,2)]." $arc_year"; echo ""; echo $archive_separator."\n"; } } } } elseif ($archive_mode == "weekly") { for ($arc_year=date("Y"); $arc_year>=$oldest_year; $arc_year--) { for ($arc_week=53; $arc_week>0; $arc_week--) { $arc_sql="SELECT ID FROM $tableposts WHERE YEAR(post_date)='$arc_year' AND WEEK(post_date,$start_of_week)='$arc_week'"; $querycount++; $arc_result=mysql_query($arc_sql); if (mysql_num_rows($arc_result)) { echo ""; echo "week #$arc_week - $arc_year"; echo ""; echo $archive_separator."\n"; } } } } elseif ($archive_mode == "postbypost") { if ($pagenow == "b2archives.php") { // are we running standalone $request = " SELECT $tableposts.*, $tablecategories.cat_name as cat_name FROM $tableposts left join $tablecategories on $tableposts.post_category = $tablecategories.cat_ID ORDER BY $way $order"; $result = mysql_query($request); $indiv = false; while($row=mysql_fetch_object($result)) { $postdata = get_postdata2($row->ID); if ($way == "post_category") { $this_cat = $row->cat_name; if ($this_cat != $previous_cat) { echo "\n
\n

" . $row->cat_name; echo "

\n"; //echo "
"; } $previous_cat = $this_cat; } $thismonth=mysql2date("Y\-m", $postdata["Date"]); $linkmonth=mysql2date("Ym", $postdata["Date"]); $i = "/".$thismonth."/"; if ($thismonth != $previousmonth) { if (preg_match($i,$postdata["Date"])) { echo "\n
\n"; echo $month[substr($thismonth,5,2)]; echo ""; echo "
\n"; //if (!$indiv) { // echo "
"; // $indiv = true; //} } } $previousmonth = $thismonth; //} $postdata = get_postdata2($row->ID); $userinfo = get_userdata ($postdata["Author_ID"]); echo " " . $postdata["Date"]; echo " - ID."&c=1"."\">"; if ($postdata["Title"]) { $postdata["Title"] = stripslashes($postdata["Title"]); echo $postdata["Title"]; } else { echo $postdata["ID"]; } echo "
\n"; //echo " by " + $userinfo["user_nickname"]; //if ($indiv) { // echo "
\n"; // $indiv = false; //} } } else { $requestarc = " SELECT ID,post_date,post_title FROM $tableposts ORDER BY post_date DESC"; $querycount++; $resultarc = mysql_query($requestarc); while($row=mysql_fetch_object($resultarc)) { if ($row->post_date != "0000-00-00 00:00:00") { echo "ID."\">"; if (strip_tags($row->post_title)) { echo strip_tags($row->post_title); } else { echo $row->ID; } echo ""; echo $archive_separator."\n"; } } } } ?>