Update to use real lists.

git-svn-id: https://develop.svn.wordpress.org/trunk@14 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Matt Mullenweg 2003-05-06 08:06:57 +00:00
parent e539444bfd
commit cb1635ed63
3 changed files with 33 additions and 36 deletions

View File

@ -763,8 +763,8 @@ function dropdown_cats($optionall = 1, $all = 'All') {
}
// out of the b2 loop
function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_order = 'asc', $file = 'blah') {
global $tablecategories,$querycount;
function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_order = 'asc', $file = 'blah', $list=true) {
global $tablecategories, $querycount;
global $pagenow;
global $querystring_start, $querystring_equal, $querystring_separator;
$file = ($file == 'blah') ? $pagenow : $file;
@ -774,13 +774,19 @@ function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_orde
$querycount++;
if (intval($optionall) == 1) {
$all = apply_filters('list_cats', $all);
echo "\t<a href=\"".$file.$querystring_start.'cat'.$querystring_equal.'all">'.$all."</a><br />\n";
if ($list) echo "\n\t<li><a href=\"".$file.$querystring_start.'cat'.$querystring_equal.'all">'.$all."</a></li>";
else echo "\t<a href=\"".$file.$querystring_start.'cat'.$querystring_equal.'all">'.$all."</a><br />\n";
}
while($row = mysql_fetch_object($result)) {
$cat_name = $row->cat_name;
$cat_name = apply_filters('list_cats', $cat_name);
echo "\t<a href=\"".$file.$querystring_start.'cat'.$querystring_equal.$row->cat_ID.'">';
echo stripslashes($cat_name)."</a><br />\n";
if ($list) {
echo "\n\t<li><a href=\"".$file.$querystring_start.'cat'.$querystring_equal.$row->cat_ID.'">';
echo stripslashes($cat_name)."</a></li>";
} else {
echo "\t<a href=\"".$file.$querystring_start.'cat'.$querystring_equal.$row->cat_ID.'">';
echo stripslashes($cat_name)."</a><br />\n";
}
}
}

View File

@ -8,9 +8,8 @@ require_once($b2inc.'/b2functions.php');
dbconnect();
// this is what will separate your archive links
$archive_line_separator = '<br />';
// this is what will separate dates on weekly archive links
$archive_week_separator = ' - ';
$archive_week_separator = '&#8211;';
// archive link url
@ -59,10 +58,9 @@ if ($archive_mode == 'monthly') {
while($arc_row = mysql_fetch_array($arc_result)) {
$arc_year = $arc_row['YEAR(post_date)'];
$arc_month = $arc_row['MONTH(post_date)'];
echo "<a href=\"$archive_link_m$arc_year".zeroise($arc_month,2).'">';
echo "<li><a href=\"$archive_link_m$arc_year".zeroise($arc_month,2).'">';
echo $month[zeroise($arc_month,2)].' '.$arc_year;
echo '</a>';
echo $archive_line_separator."\n";
echo "</a></li>\n";
}
} elseif ($archive_mode == 'daily') {
$arc_sql="SELECT DISTINCT YEAR(post_date), MONTH(post_date), DAYOFMONTH(post_date) FROM $tableposts WHERE post_date < '$now' AND post_category > 0 ORDER BY post_date DESC";
@ -72,11 +70,9 @@ if ($archive_mode == 'monthly') {
$arc_year = $arc_row['YEAR(post_date)'];
$arc_month = $arc_row['MONTH(post_date)'];
$arc_dayofmonth = $arc_row['DAYOFMONTH(post_date)'];
echo "<a href=\"$archive_link_m$arc_year".zeroise($arc_month,2).zeroise($arc_dayofmonth,2).'">';
echo "<li><a href=\"$archive_link_m$arc_year".zeroise($arc_month,2).zeroise($arc_dayofmonth,2).'">';
echo mysql2date($archive_day_date_format, $arc_year.'-'.zeroise($arc_month,2).'-'.zeroise($arc_dayofmonth,2).' 00:00:00');
# echo $month[zeroise($arc_month,2)]." $arc_year";
echo '</a>';
echo $archive_line_separator."\n";
echo "</a></li>\n";
}
} elseif ($archive_mode == 'weekly') {
if (!isset($start_of_week)) {
@ -95,10 +91,9 @@ if ($archive_mode == 'monthly') {
$arc_week = get_weekstartend($arc_ymd, $start_of_week);
$arc_week_start = date_i18n($archive_week_start_date_format, $arc_week['start']);
$arc_week_end = date_i18n($archive_week_end_date_format, $arc_week['end']);
echo "<a href=\"$siteurl/".$blogfilename."?m=$arc_year&amp;w=$arc_w\">";
echo "<li><a href=\"$siteurl/".$blogfilename."?m=$arc_year&amp;w=$arc_w\">";
echo $arc_week_start.$archive_week_separator.$arc_week_end;
echo '</a>';
echo $archive_line_separator."\n";
echo "</a></li>\n";
}
}
} elseif ($archive_mode == 'postbypost') {
@ -107,19 +102,18 @@ if ($archive_mode == 'monthly') {
$resultarc = mysql_query($requestarc);
while($row=mysql_fetch_object($resultarc)) {
if ($row->post_date != '0000-00-00 00:00:00') {
echo "<a href=\"$archive_link_p".$row->ID.'">';
echo "<li><a href=\"$archive_link_p".$row->ID.'">';
$arc_title = stripslashes($row->post_title);
if ($arc_title) {
echo strip_tags($arc_title);
} else {
echo $row->ID;
}
echo '</a>';
echo $archive_line_separator."\n";
echo "</a></li>\n";
}
}
}
#echo $querycount."<br />\n";
#timer_stop(1,8);
# echo $querycount."<br />\n";
# timer_stop(1,8);
?>

View File

@ -1,13 +1,11 @@
<?php /* Don't remove this line, it calls the b2 function files ! */ $blog=1; include ("blog.header.php"); ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php /* Don't remove this line, it calls the b2 function files ! */ $blog=1; include ('blog.header.php'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- layout credits goto http://bluerobot.com/web/layouts/layout2.html -->
<head>
<title><?php bloginfo('name') ?><?php single_post_title(' :: ') ?><?php single_cat_title(' :: ') ?><?php single_month_title(' :: ') ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="imagetoolbar" content="no" />
<style type="text/css" media="screen">
@import url( layout2b.css );
@ -32,7 +30,7 @@
<?php the_date('','<h2>','</h2>'); ?>
<h3 class="storyTitle"><?php the_title(); ?> <span class="storyCategory"><a href="?cat=<?php the_category_ID() ?>" title="Category: <?php the_category() ?>">[<?php the_category() ?>]</span></a> - <span class="storyAuthor"><?php the_author() ?></span> @ <a href="<?php permalink_link() ?>"><?php the_time() ?></a>
<h3 class="storyTitle"><a href="<?php permalink_link() ?>"><?php the_title(); ?></a> <a href="?cat=<?php the_category_ID() ?>" title="Category: <?php the_category() ?>" class="storyCategory">[<?php the_category() ?>]</a> - <span class="storyAuthor"><?php the_author() ?></span> @ <?php the_time() ?>
</h3>
<div class="storyContent">
@ -85,8 +83,9 @@
</ul>
</li>
<li>Categories:
<?php list_cats(0, 'All', 'name'); // fix this ?>
<ul>
<?php list_cats(0, 'All', 'name'); ?>
</ul>
</li>
<li>Search:
<form name="searchform" method="get" action="<?php echo $PHP_SELF; /*$siteurl."/".$blogfilename*/ ?>">
@ -97,7 +96,9 @@
</form>
</li>
<li>Archives:
<?php include("b2archives.php"); // fix this too ?>
<ul>
<?php include("b2archives.php"); // fix this too ?>
</ul>
</li>
<li>Other:
<ul>
@ -115,10 +116,6 @@
</div>
<div id="chaff">
<a href="mailto:abuse@[127.0.0.1]" title="anti sp@mbot addrss">4 sp@mbots e-mail me</a>
</div>
<!-- BlueRobot was here. -->
</body>
</html>
</body>
</html>