<?php

/* 列表页 - 简约论坛风格模式 */
/* 162100源码 - 162100.com - download.162100.com */

$GLOBALS['this_mode'] = 'f';

$text_city = $city_sql = '';
$city_sql_pre = '';
@ include ('inc/city/getcity.php');
if (file_exists('inc/css/'.$GLOBALS['this_mode'].'/city.php')) {
  @ include ('inc/css/'.$GLOBALS['this_mode'].'/city.php');
}

function get_area_logo($area_id, $column_key) {
  static $step = 0;
  static $step2 = 0;
  if (file_exists('inc/css/'.$GLOBALS['this_mode'].'/area_logo_'.$area_id.'.gif')) {
    return '<img src="inc/css/'.$GLOBALS['this_mode'].'/area_logo_'.$area_id.'.gif" width="36" height="36" />';
  } else {
    $bg = array("#CC6633", "#CCCC00", "#66CC99", "#6699CC", "Plum", "LightBlue", "Silver","YellowGreen", "DarkSlateBlue", "Gray");
    //$bg = array_rand(array("Black" => "黑色", "Sienna" => "赭色", "DarkOliveGreen" => "暗橄榄绿色", "DarkGreen" => "暗绿色", "DarkSlateBlue" => "暗灰蓝色", "Navy" => "海军色", "Indigo" => "靛青色", "DarkSlateGray" => "墨绿色", "DarkRed" => "暗红色", "DarkOrange" => "暗桔黄色", "Olive" => "橄榄色", "Green" => "绿色", "Teal" => "水鸭色", "Blue" => "蓝色", "SlateGray" => "灰石色", "DimGray" => "暗灰色", "Red" => "红色", "SandyBrown" => "沙褐色", "YellowGreen" => "黄绿色", "SeaGreen" => "海绿色", "MediumTurquoise" => "间绿宝石", "RoyalBlue" => "皇家蓝", "Purple" => "紫色", "Gray" => "灰色", "Magenta" => "红紫色", "Orange" => "橙色", "Yellow" => "黄色", "Lime" => "酸橙色", "Cyan" => "青色", "DeepSkyBlue" => "深天蓝色", "DarkOrchid" => "暗紫色", "Silver" => "银色", "Pink" => "粉色", "Wheat" => "浅黄色", "PaleGreen" => "苍绿色", "PaleTurquoise" => "苍宝石绿", "LightBlue" => "亮蓝色", "Plum" => "洋李色"));
    if (!isset($GLOBALS['color'][$column_key])) {
      $GLOBALS['color'][$column_key] = $bg[$step2 % 9];
      $step2++;
    }
    $step++;
    
    return'<span class="area_logo_mark" style="width:24px; height:24px; line-height:24px;background-color:'.$GLOBALS['color'][$column_key].'; color:#FFF;">'.$step.'</span>';
  }
}

function get_list_mode_0($row) {
  global $article_url, $AREA_READ_POWER, $now_time, $area_id_root;
  $herf = $_GET['list_type'] == 'pass' ? 'javascript:void(0)" onclick="alert(\'已过期！\');return false;" style="text-decoration:line-through;' : eval('return '.$article_url.';');

  $text = '
<div class="li">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="li_subject">'.$row['title_mark'].'<a'.$AREA_READ_POWER[$area_id_root].' href="'.$herf.'" class="li_a" target="_blank"'.$row['title_style'].'>'.$row['title'].'</a>'.$row['area_name_'].'</td>
    <td class="li_views_reply"><a href="'.eval('return '.$article_url.';').'#reply_area">'.$row['reply'].'</a><br />'.$row['views'].'</td>
    <td class="li_date">'.(strstr((string)$row['author_ip'], '.') ? hidden_ip($row['author_ip']) : '<a href="user.php?get=card&username='.urlencode($row['author_ip']).'" target="_blank" title="点击查看发布人名片">'.$row['author_ip'].'</a>').'<br />
'.get_date_c($row['date']).'</td><td class="li_update">';

  if (!empty($row['other'])) {
    $text .= strstr((string)$row['other'], '.') ? hidden_ip($row['other']) : '<a href="user.php?get=card&username='.urlencode($row['other']).'" target="_blank" title="点击查看回复人名片">'.$row['other'].'</a>';
    $text .= '<br />'.get_date_c($row['topdate']);
  } else {
    $text .= substr($row['topdate'], 0, 10) > $now_time ? '<span title="置顶至：'.$row['topdate'].'" class="li_update_mark li_update_mark_is"></span><span class="redword">'.substr($row['topdate'], 0, 10).'</span>' : '';
  }
  $text .= '
</td>
    <td class="li_power_read"><a class="add_collect" href="member.php?post=unity_run&dataname=myaccount&id[]='.$row['id'].'&limit=collect_listdata&m=1" target="lastFrame" title="加入“我的收藏”"></a></td>
  </tr>
</table>
</div>
';
  return $text;
}

function get_list_mode_10($row) {
  global $web, $article_url, $list_mode_userface, $AREA_READ_POWER, $now_time, $area_id_root;
  $herf = $_GET['list_type'] == 'pass' ? 'javascript:void(0)" onclick="alert(\'已过期！\');return false;" style="text-decoration:line-through;' : eval('return '.$article_url.';');
  $text = '
<div class="li_face">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td class="li_subject">'.$row['title_mark'].'<a'.$AREA_READ_POWER[$area_id_root].' href="'.$herf.'" class="li_a" target="_blank"'.$row['title_style'].'>'.$row['title'].'</a>'.$row['area_name_'].'
	  <div class="li_">
	  发表 '.(strstr((string)$row['author_ip'], '.') ? '<span title="匿名用户">'.hidden_ip($row['author_ip']).'</span>' : '<a href="user.php?get=card&username='.urlencode($row['author_ip']).'" target="_blank" title="点击查看发布人名片"><img src="inc/images/card.gif" />'.$row['author_ip'].'</a>').'（'.get_date_c($row['date']).'）';

  if (!empty($row['other'])) {
    $text .= '<span class="li_update_mark" title="更新"></span>';
    $text .= strstr((string)$row['other'], '.') ? hidden_ip($row['other']) : '<a href="user.php?get=card&username='.urlencode($row['other']).'" target="_blank" title="点击查看回复人名片">'.$row['other'].'</a>';
    $text .= '（'.get_date_c($row['topdate']).'）';
  } else {
    $text .= substr($row['topdate'], 0, 10) > $now_time ? '（<span title="置顶至：'.$row['topdate'].'" class="li_update_mark li_update_mark_is"></span><span class="redword">'.substr($row['topdate'], 0, 10).'</span>）' : '';
  }
  $text .= '
      </div></td>
      <td class="li_views_reply">回复/阅览<br /><a href="'.eval('return '.$article_url.';').'#reply_area">'.$row['reply'].'</a>/'.$row['views'].'</td>
      <td class="li_power_read"><a class="add_collect" href="member.php?post=unity_run&dataname=myaccount&id[]='.$row['id'].'&limit=collect_listdata&m=1" target="lastFrame" title="加入“我的收藏”"></a></td>
    </tr>
  </table>
</div>
';
  return $text;
}

function get_list_mode_1($row) {
  global $web, $article_url, $list_mode_userface, $AREA_READ_POWER, $now_time, $area_id_root;
  if (!isset($list_mode_userface[$row['author_ip']])) {
    $list_mode_userface[$row['author_ip']] = '<span class="iface_s"><img src="obj.php?title=face-'.urlencode($row['author_ip']).'.'.$web['img_up_format'].'" width="'.$web['img_w_s'].'" height="'.$web['img_h_s'].'" /></span>';
  }
  $herf = $_GET['list_type'] == 'pass' ? 'javascript:void(0)" onclick="alert(\'已过期！\');return false;" style="text-decoration:line-through;' : eval('return '.$article_url.';');
  $text = '
<div class="li_face">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td class="list_mode_logo">'.$list_mode_userface[$row['author_ip']].'</td>
      <td class="li_subject">'.$row['title_mark'].'<a'.$AREA_READ_POWER[$area_id_root].' href="'.$herf.'" class="li_a" target="_blank"'.$row['title_style'].'>'.$row['title'].'</a>'.$row['area_name_'].'
	  <div class="li_">
	  发表 '.(strstr((string)$row['author_ip'], '.') ? '<span title="匿名用户">'.hidden_ip($row['author_ip']).'</span>' : '<a href="user.php?get=card&username='.urlencode($row['author_ip']).'" target="_blank" title="点击查看发布人名片"><img src="inc/images/card.gif" />'.$row['author_ip'].'</a>').'（'.get_date_c($row['date']).'）';

  if (!empty($row['other'])) {
    $text .= '<span class="li_update_mark" title="更新"></span>';
    $text .= strstr((string)$row['other'], '.') ? hidden_ip($row['other']) : '<a href="user.php?get=card&username='.urlencode($row['other']).'" target="_blank" title="点击查看回复人名片">'.$row['other'].'</a>';
    $text .= '（'.get_date_c($row['topdate']).'）';


  } else {
    $text .= substr($row['topdate'], 0, 10) > $now_time ? '（<span title="置顶至：'.$row['topdate'].'" class="li_update_mark li_update_mark_is"></span><span class="redword">'.substr($row['topdate'], 0, 10).'</span>）' : '';
  }
  $text .= '
      </div></td>
      <td class="li_views_reply"><span>回复/阅览<br /><a href="'.eval('return '.$article_url.';').'#reply_area">'.$row['reply'].'</a>/'.$row['views'].'</span></td>
      <td class="li_power_read"><a class="add_collect" href="member.php?post=unity_run&dataname=myaccount&id[]='.$row['id'].'&limit=collect_listdata&m=1" target="lastFrame" title="加入“我的收藏”"></a></td>
    </tr>
  </table>
</div>
';
  return $text;
}

function get_list_mode_2($row) {
  global $article_url, $AREA_READ_POWER, $now_time, $area_id_root;
  if (strstr($row['title_mark'], '文中含图')) {
    $list_index_tuijian = '<td width="130"><div class="e_thumb"><a href="'.eval('return '.$article_url.';').'" target="_blank"><img src="obj.php?title=thuml-'.$row['id'].'.jpg" /></a></div></td>';
    $etext = '<div class="e_text">'.cutstr(strip_tags($row['text']), 160).'</div>';
  }
  $herf = $_GET['list_type'] == 'pass' ? 'javascript:void(0)" onclick="alert(\'已过期！\');return false;" style="text-decoration:line-through;' : eval('return '.$article_url.';');
  $text = '
<div class="li">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
      '.$list_index_tuijian.'
    <td class="li_subject">'.$row['title_mark'].'<a'.$AREA_READ_POWER[$area_id_root].' href="'.$herf.'" class="li_a" target="_blank"'.$row['title_style'].'>'.$row['title'].'</a>'.$row['area_name_'].''.$etext.'</td>
    <td class="li_views_reply"><a href="'.eval('return '.$article_url.';').'#reply_area">'.$row['reply'].'</a><br />'.$row['views'].'</td>
    <td class="li_date">'.(strstr((string)$row['author_ip'], '.') ? hidden_ip($row['author_ip']) : '<a href="user.php?get=card&username='.urlencode($row['author_ip']).'" target="_blank" title="点击查看发布人名片">'.$row['author_ip'].'</a>').'<br />
'.get_date_c($row['date']).'</td><td class="li_update">';

  if (!empty($row['other'])) {
    $text .= strstr((string)$row['other'], '.') ? hidden_ip($row['other']) : '<a href="user.php?get=card&username='.urlencode($row['other']).'" target="_blank" title="点击查看回复人名片">'.$row['other'].'</a>';
    $text .= '<br />'.get_date_c($row['topdate']);

  } else {
    $text .= substr($row['topdate'], 0, 10) > $now_time ? '<span title="置顶至：'.$row['topdate'].'" class="li_update_mark li_update_mark_is"></span><span class="redword">'.substr($row['topdate'], 0, 10).'</span>' : '';
  }
  $text .= '
</td>
    <td class="li_power_read"><a class="add_collect" href="member.php?post=unity_run&dataname=myaccount&id[]='.$row['id'].'&limit=collect_listdata&m=1" target="lastFrame" title="加入“我的收藏”"></a></td>
  </tr>
</table>
</div>
';
  return $text;
}

function get_list_mode_20($row) {
  global $web, $article_url, $list_mode_userface, $AREA_READ_POWER, $now_time, $area_id_root;
  if (strstr($row['title_mark'], '文中含图')) {
    $list_index_tuijian = '<td width="130"><div class="e_thumb"><a href="'.eval('return '.$article_url.';').'" target="_blank"><img src="obj.php?title=thuml-'.$row['id'].'.jpg" /></a></div></td>';
    $etext = '<div class="e_text">'.cutstr(strip_tags($row['text']), 160).'</div>';
  }
  $herf = $_GET['list_type'] == 'pass' ? 'javascript:void(0)" onclick="alert(\'已过期！\');return false;" style="text-decoration:line-through;' : eval('return '.$article_url.';');
  $text = '
<div class="li_face">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      '.$list_index_tuijian.'
      <td class="li_subject">'.$row['title_mark'].'<a'.$AREA_READ_POWER[$area_id_root].' href="'.$herf.'" class="li_a" target="_blank"'.$row['title_style'].'>'.$row['title'].'</a>'.$row['area_name_'].''.$etext.'
	  <div class="li_">
	  发表 '.(strstr((string)$row['author_ip'], '.') ? '<span title="匿名用户">'.hidden_ip($row['author_ip']).'</span>' : '<a href="user.php?get=card&username='.urlencode($row['author_ip']).'" target="_blank" title="点击查看发布人名片"><img src="inc/images/card.gif" />'.$row['author_ip'].'</a>').'（'.get_date_c($row['date']).'）';

  if (!empty($row['other'])) {
    $text .= '<span class="li_update_mark" title="更新"></span>';
    $text .= strstr((string)$row['other'], '.') ? hidden_ip($row['other']) : '<a href="user.php?get=card&username='.urlencode($row['other']).'" target="_blank" title="点击查看回复人名片">'.$row['other'].'</a>';
    $text .= '（'.get_date_c($row['topdate']).'）';

  } else {
    $text .= substr($row['topdate'], 0, 10) > $now_time ? '（<span title="置顶至：'.$row['topdate'].'" class="li_update_mark li_update_mark_is"></span><span class="redword">'.substr($row['topdate'], 0, 10).'</span>）' : '';
  }
  $text .= '
      </div></td>
      <td class="li_views_reply"><span>回复/阅览<br /><a href="'.eval('return '.$article_url.';').'#reply_area">'.$row['reply'].'</a>/'.$row['views'].'</span></td>
      <td class="li_power_read"><a class="add_collect" href="member.php?post=unity_run&dataname=myaccount&id[]='.$row['id'].'&limit=collect_listdata&m=1" target="lastFrame" title="加入“我的收藏”"></a></td>
    </tr>
  </table>
</div>
';
  return $text;
}

function get_list_mode_3($row) {
  global $web, $article_url, $list_mode_userface, $AREA_READ_POWER, $now_time, $area_id_root;
  if (!isset($list_mode_userface[$row['author_ip']])) {
    $list_mode_userface[$row['author_ip']] = '<span class="iface_s"><img src="obj.php?title=face-'.urlencode($row['author_ip']).'.'.$web['img_up_format'].'" width="'.$web['img_w_s'].'" height="'.$web['img_h_s'].'" /></span>';
  }
  if (strstr($row['title_mark'], '文中含图')) {
    $list_index_tuijian = '<td width="130"><div class="e_thumb"><a href="'.eval('return '.$article_url.';').'" target="_blank"><img src="obj.php?title=thuml-'.$row['id'].'.jpg" /></a></div></td>';
    $etext = '<div class="e_text">'.cutstr(strip_tags($row['text']), 160).'</div>';
  }
  $herf = $_GET['list_type'] == 'pass' ? 'javascript:void(0)" onclick="alert(\'已过期！\');return false;" style="text-decoration:line-through;' : eval('return '.$article_url.';');
  $text = '
<div class="li_face">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td class="list_mode_logo">'.$list_mode_userface[$row['author_ip']].'</td>'.$list_index_tuijian.'
      <td class="li_subject">'.$row['title_mark'].'<a'.$AREA_READ_POWER[$area_id_root].' href="'.$herf.'" class="li_a" target="_blank"'.$row['title_style'].'>'.$row['title'].'</a>'.$row['area_name_'].''.$etext.'
	  <div class="li_">
	  发表 '.(strstr((string)$row['author_ip'], '.') ? '<span title="匿名用户">'.hidden_ip($row['author_ip']).'</span>' : '<a href="user.php?get=card&username='.urlencode($row['author_ip']).'" target="_blank" title="点击查看发布人名片"><img src="inc/images/card.gif" />'.$row['author_ip'].'</a>').'（'.get_date_c($row['date']).'）';

  if (!empty($row['other'])) {
    $text .= '<span class="li_update_mark" title="更新"></span>';
    $text .= strstr((string)$row['other'], '.') ? hidden_ip($row['other']) : '<a href="user.php?get=card&username='.urlencode($row['other']).'" target="_blank" title="点击查看回复人名片">'.$row['other'].'</a>';
    $text .= '（'.get_date_c($row['topdate']).'）';

  } else {
    $text .= substr($row['topdate'], 0, 10) > $now_time ? '（<span title="置顶至：'.$row['topdate'].'" class="li_update_mark li_update_mark_is"></span><span class="redword">'.substr($row['topdate'], 0, 10).'</span>）' : '';
  }
  $text .= '
      </div></td>
      <td class="li_views_reply"><span>回复/阅览<br /><a href="'.eval('return '.$article_url.';').'#reply_area">'.$row['reply'].'</a>/'.$row['views'].'</span></td>
      <td class="li_power_read"><a class="add_collect" href="member.php?post=unity_run&dataname=myaccount&id[]='.$row['id'].'&limit=collect_listdata&m=1" target="lastFrame" title="加入“我的收藏”"></a></td>
    </tr>
  </table>
</div>
';
  return $text;
}
function get_list_mode_4($row) {
  global $web, $article_url, $list_mode_userface, $AREA_READ_POWER, $now_time;
  $herf = $_GET['list_type'] == 'pass' ? 'javascript:void(0)" onclick="alert(\'已过期！\');return false;" style="text-decoration:line-through;' : eval('return '.$article_url.';');
  $text = '';
  $text .= '
<div class="listp"><div class="listp_in">
  <h4><a class="add_collect" href="member.php?post=unity_run&dataname=myaccount&id[]='.$row['id'].'&limit=collect_listdata&m=1" target="lastFrame" title="加入“我的收藏”"></a> <a'.$AREA_READ_POWER[$area_id_root].' href="'.$herf.'" class="li_a" target="_blank"'.$row['title_style'].'>'.$row['title'].'</a></h4>
  <div class="listp_date">['.get_date_c($row['date']).' by '.(strstr((string)$row['author_ip'], '.') ? '<span title="匿名用户">'.hidden_ip($row['author_ip']).'</span>' : '<a href="user.php?get=card&username='.urlencode($row['author_ip']).'" target="_blank" title="点击查看发布人名片"><img src="inc/images/card.gif" />'.$row['author_ip'].'</a>').']</div>';
  $text .= '
<div class="text">';
  if (preg_match('/<img [^>]*src[\s\r\n]*=(?![\s\r\n]*\"?('.preg_quote($web['path'], '/').')?inc\/images\/)[^>]*>/i', $row['text'], $m) || preg_match('/<object.+<\/object>/isU', $row['text'], $m) || preg_match('/<embed.+<\/embed>/isU', $row['text'], $m)) {
    $po = stripos($row['text'], $m[0]);
    $text .= cutstr(strip_tags(substr($row['text'], 0, $po)), 200); //截取多少字
    $text .= '<center style="margin:20px 0;">'.$m[0].'</center>';
    $text .= cutstr(strip_tags(substr($row['text'], $po + strlen($m[0]))), 200); //截取多少字
  }
  $text .= '
</div>';

  $text .= '
<h4>&gt;&gt; <a href="'.eval('return '.$article_url.';').'" class="li_a" target="_blank"'.$row['title_style'].$row['t_this'].'>阅读全文</a></h4>
<div class="listp_under">分类：'.$row['area_name_'].' | 回复（'.$row['reply'].'）| 阅读（'.$row['views'].'）</div>
</div></div>

';

  return $text;
}

function get_list_title_0() {
  return '
  <div class="list_title_">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <th class="li_subject">标&nbsp;&nbsp;&nbsp;&nbsp;题</th>
        <th class="li_views_reply">回复/阅读</th>
        <th class="li_date"><button type="button" class="small"'.($_GET['list_sort'] == 'id' ? ' title="当前按发表时间排序" disabled="disabled"><b class="grayword">发表︾' : ' title="点此按发表时间排序" onclick="location.href=location.search.replace(/&?list_sort=(id|topdate)?/,\'\').replace(/\??/,\'?list_sort=id&\').replace(/&+/,\'&\');"><b>发表︽').'</b></button></th>
        <th class="li_update"><button type="button" class="small"'.($_GET['list_sort'] != 'id' ? ' title="当前按更新时间排序" disabled="disabled"><b class="grayword">更新︾' : ' title="点此按更新时间排序" onclick="location.href=location.search.replace(/&?list_sort=(id|topdate)?/,\'\').replace(/\??/,\'?list_sort=topdate&\').replace(/&+/,\'&\');"><b>更新︽').'</button></th>
        <th class="li_power_read">&nbsp;</th>
      </tr>
    </table>
  </div>
';
}

function get_list_title_10() {
  return '';
}
function get_list_title_1() {
  return '';
}
function get_list_title_2() {
  return get_list_title_0();
}
function get_list_title_20() {
  return '';
}
function get_list_title_3() {
  return '';
}
function get_list_title_4() {
  return '';
}

function get_list_sort_mark_0_id() {
  return '';
}
function get_list_sort_mark_0_topdate() {
  return '';
}
function get_list_sort_mark_2_id() {
  return '';
}
function get_list_sort_mark_2_topdate() {
  return '';
}

function get_list_sort_mark_1_id() {
  return '<a class="li_order li_order_write filter" title="当前按发表时间排序"></a> <a class="li_order li_order_reset" title="点此按更新时间排序" onclick="location.href=location.search.replace(/&?list_sort=(id|topdate)?/,\'\').replace(/\??/,\'?list_sort=topdate&\').replace(/&+/,\'&\');" href="javascript:void(0)"></a>';
}
function get_list_sort_mark_1_topdate() {
  return '<a class="li_order li_order_write" title="点此按发表时间排序" onclick="location.href=location.search.replace(/&?list_sort=(id|topdate)?/,\'\').replace(/\??/,\'?list_sort=id&\').replace(/&+/,\'&\');" href="javascript:void(0)"></a> <a class="li_order li_order_reset filter" title="当前按更新时间排序"></a>';
}
function get_list_sort_mark_3_id() {
  return get_list_sort_mark_1_id();
}
function get_list_sort_mark_3_topdate() {
  return get_list_sort_mark_1_topdate();
}
function get_list_sort_mark_4_id() {
  return get_list_sort_mark_1_id();
}
function get_list_sort_mark_4_topdate() {
  return get_list_sort_mark_1_topdate();
}


function get_power_read($power_read) {
  if ($power_read > 0) {
    $text .= '限积分达到'.$power_read.'';
  } elseif ($power_read == '-1') {
    $text .= '限注册成员';
  } else {
    $text .= '公开';
  }
  return ' title="浏览权限：'.$text.'"';
}

$_GET = preg_replace('/[^\w-]/', '', $_GET);

//精华记录
if ($_GET['list_type'] == 'ess') {
  $sqlt .= ' AND title_mark LIKE "[荐]%"';
  $list_title = '"<a href=\"".$list_url."\">".$rec."记录</a><a href=\"".$list_url_img."\">图片文章</a><a class=\"list_title_in\">推荐<span>（".$n."）</span></a><a href=\"".$list_url."&list_type=reward\">悬赏</a>".$list_title_pass.""';

//悬赏记录
} elseif ($_GET['list_type'] == 'reward') {
  $sqlt .= ' AND reward>0';
  $list_title = '"<a href=\"".$list_url."\">".$rec."记录</a><a href=\"".$list_url_img."\">图片文章</a><a href=\"".$list_url."&list_type=ess\">推荐</a><a class=\"list_title_in\">悬赏<span>（".$n."）</span></a>".$list_title_pass.""';

//过期记录
} elseif ($_GET['list_type'] == 'pass') {
  $list_title = '"<a href=\"".$list_url."\">".$rec."记录</a><a href=\"".$list_url_img."\">图片文章</a><a href=\"".$list_url."&list_type=ess\">推荐</a><a href=\"".$list_url."&list_type=reward\">悬赏</a><a class=\"list_title_in\">过期主题".$no_pass."<span>（".$n."）</span></a>"';

//全部记录
} else {
  if ($_GET['list_mode'] == 4) {
    $sqlt .= ' AND (title_mark LIKE "[荐]<img src=\"inc/images/picye.gif\" title=\"文中含图%" OR title_mark LIKE "<img src=\"inc/images/picye.gif\" title=\"文中含图%")';
    $list_title = '"<a href=\"".$list_url."\">".$rec."记录</a><a class=\"list_title_in\">图片文章<span>（".$n."）</span></a><a href=\"".$list_url."&list_type=ess\">推荐</a><a href=\"".$list_url."&list_type=reward\">悬赏</a>".$list_title_pass.""';
  } else {
    $thumb_area = array();
    $list_title = '"<a class=\"list_title_in\">".$rec."记录<span>（".$n."）</span></a><a href=\"".$list_url_img."\">图片文章</a><a href=\"".$list_url."&list_type=ess\">推荐</a><a href=\"".$list_url."&list_type=reward\">悬赏</a>".$list_title_pass.""';
  }
}

//处理伪静态
if ($web['url_html_list'] == 1) {
  $list_           = 'list.'.$GLOBALS['this_mode'].'...1.html';
  $list_url        = 'list.'.$GLOBALS['this_mode'].'.'.$_GET['area_id'].'..1.html';
  $list_url_img    = 'list.'.$GLOBALS['this_mode'].'.'.$_GET['area_id'].'.4.1.html';
  $list_url_area   = '"list.'.$GLOBALS['this_mode'].'.".$row["area_id"]."..1.html"';
  $page_url_before = '"list.'.$GLOBALS['this_mode'].'.'.$_GET['area_id'].'.".$_GET["list_mode"]."."';
  $page_url_after  = '".html&list_type=".$_GET["list_type"]."&list_sort=".$_GET["list_sort"].""';
  $GLOBALS['option_eval'] = '[^>]+list.'.$GLOBALS['this_mode'].'.([\d\_\-]+)';

} else {
  $list_           = 'list.php?mode='.$GLOBALS['this_mode'].'';
  $list_url        = 'list.php?mode='.$GLOBALS['this_mode'].'&area_id='.$_GET['area_id'].'';
  $list_url_img    = 'list.php?mode='.$GLOBALS['this_mode'].'&list_mode=4&area_id='.$_GET['area_id'].'';
  $list_url_area   = '"list.php?mode='.$GLOBALS['this_mode'].'&area_id=".$row["area_id"].""';
  $page_url_before = '"list.php?mode='.$GLOBALS['this_mode'].'&area_id='.$_GET['area_id'].'&list_mode=".$_GET["list_mode"]."&list_type=".$_GET["list_type"]."&list_sort=".$_GET["list_sort"]."&p="';
  $page_url_after  = '';
  $GLOBALS['option_eval'] = '[^>]+area_id=([\d\_\-]+)';
}
if ($web['url_html_article'] == 1) {
  $article_url     = '"article.'.$GLOBALS['this_mode'].'.".$row["id"].".1.html"';
} else {
  $article_url     = '"article.php?mode='.$GLOBALS['this_mode'].'&id=".$row["id"].""';
}

//runtime();

$n = $mess = 0;
$area_power = $arr_area_title = $arr_area_child = $arr_area_child_ = $AREA_READ_POWER = $ROW_AREA_EXPIRES = array();
$date = gmdate('md', time() + (floatval($web['time_pos']) * 3600));
$text = $text_area_index = '';

@ require ('inc/function/get_date.php'); //时间

if (!isset($sql['db_err'])) {
  db_conn();
}
if ($sql['db_err'] != '') {
  die($sql['db_err']);
}

$_GET['list_sort'] = ($_GET['list_sort'] != 'id' && $_GET['list_sort'] != 'topdate') ? 'topdate' : $_GET['list_sort'];

if (preg_match('/^(\d+\-\d+)(\_\d+)*$/', $_GET['area_id'], $area_m)) {
  $area_id_root = $area_m[1];
  $rec = '有效';
  $area_there = '本版';
  //在线reg待优化
  $reg_online = 'position REGEXP "(area_id='.$_GET['area_id'].'(_[0-9]+)*|[a-zA-Z\.]+\.('.$_GET['area_id'].'(_[0-9]+)*))"';

  $mark_child = ' 该标签仍可细分：';
  $base_title = $_GET['area_id'];
  $eval_title = 'area_id="'.$_GET['area_id'].'"';
  $area_title = 'strip_tags($arr_area_title[\''.$_GET['area_id'].'\']).\'\'.$arr_area_title_[\''.$_GET['area_id'].'\']';
  while (strpos($base_title, '_') !== false) {
    $base_title = preg_replace('/\_\d+$/', '', $base_title);
    $eval_title .= ' OR area_id="'.$base_title.'"';
    $area_title = '$arr_area_title[\''.$base_title.'\'].\' &gt; \'.'.$area_title.'';}
  //栏目属性
  $result = @mysql_query('SELECT * FROM '.$sql['pref'].''.$sql['data']['承载版区分类的表名'].' WHERE '.$eval_title.' OR area_id REGEXP "^'.$_GET['area_id'].'_[0-9]+$"', $db);
  if (@mysql_num_rows($result) > 0) {
    $q_l = strlen($_GET['area_id']);
    while ($row = @mysql_fetch_assoc($result)) {
      if ($row['area_id'] == $area_id_root) {
        $AREA_READ_POWER[$area_id_root] = get_power_read($row['area_power_read']);
        $AREA_MARK = $row['area_mark'];
        $AREA_MODE[$row['area_id']] = $row['area_mode'];
        if ($row['area_expires'] > 0) {
          $AREA_EXPIRES_data_type .= ' AND NOT (topdate'.($_GET['list_type'] == 'pass' ? '>' : '<').'"'.(gmdate('Y-m-d H:i:s', time() + floatval($web['time_pos']) * 3600 - $row['area_expires'] * 24 * 60 * 60)).'") ';
        }
        /*
        if ($row['area_check'] == '1') {
          $AREA_CHECK_data_type .= ' AND area_check="0"';
        }
        */
        if (substr($row['area_today'], 0, 4) == $date) {
          $row['area_today_this'] = substr($row['area_today'], 4);
        } else {
          $row['area_today_this'] = 0;
        }
  $title1__ = '<span class="num_count">（<a title="今日文章" class="grayword'.($row['area_today_this']>0?' redword" href="'.eval('return '.$list_url_area.';').'&list_type=today"':'"').'>'.$row['area_today_this'].'</a>/<a title="文章总计"'.($row['area_total']>0?' href="'.eval('return '.$list_url_area.';').'&list_type=total"':'').'>'.$row['area_total'].'</a>）</span>';

        if (!empty($row['area_index']) && !strstr($row['area_index'], $GLOBALS['this_mode'])) {
          $sitemode = false;
          if (strstr($row['area_index'], $web['sitemode'])) {
            $sitemode = $web['sitemode'];
          } else {
            foreach (@explode('|', $row['area_index']) as $mode) {
              if (file_exists('inc/css/'.$mode.'/index.php') && file_exists('inc/css/'.$mode.'/list.php') && file_exists('inc/css/'.$mode.'/article.php')) {
                $sitemode = $mode == $web['sitemode'] ? $web['sitemode'] : $mode;
                break;
              }
            }
          }
          if ($sitemode ==false) {
            $text_area_index .= '<div class="red_err">以下内容所属栏目分类并没有分配至当前模板！但是可以借此模板正常显示</div>';
          } else {
            header('location: '.($web['url_html_list'] == 1 ? 'list.'.$sitemode.'.'.$_GET['area_id'].'..1.html' : 'list.php?mode='.$sitemode.'&area_id='.$_GET['area_id'].''));
          }
          unset($sitemode, $mode);
        }
      }
      if ($q_l >= strlen($row['area_id'])) {
        $arr_area_title[$row['area_id']] = '<a href="'.eval('return '.$list_url_area.';').'"'.$row['area_style'].'>'.$row['area_name'].'</a> ';
        $arr_area_title_[$row['area_id']] = $title1__;

        if ($q_l == strlen($row['area_id'])) {
          $keywords = $row['area_keywords'] != '' ? '<meta name="keywords" content="'.$row['area_keywords'].'" />
' : '';
          $description = $row['area_description'] != '' ? '<meta name="Description" content="'.$row['area_description'].'" />
' : '';
        }

      } else/*if (strrpos($row['area_id'], '_') == $q_l)*/ {
        $arr_area_child[$row['area_id']] = 
        $arr_area_child_[$row['area_id']] = '<a href="'.eval('return '.$list_url_area.';').'"'.($row['area_description']?' title="'.$row['area_description'].'"':'').''.$row['area_style'].'>'.$row['area_name'].'</a>';
      }
      unset($row, $title1__);
    }
    @uksort($arr_area_child_, 'strnatcmp');
    $area_list = '<div class="column_in"><span class="redword">'.$AREA_MARK.'</span> '.@implode(' &nbsp; ', $arr_area_child_).'</div>';
  }
  @mysql_free_result($result);
  eval('
$title1 = \'<a href="./'.$list_.'">全部根目</a> &gt; \'.'.$area_title.';
unset($arr_area_title_);
$title = strip_tags('.preg_replace('/<\!-- \/?tj -->/i', '', $area_title).');
  ');


  if (empty($arr_area_title[$_GET['area_id']])) {
    die('&#26631;&#31614;&#38169;&#35823;&#65281;&#35831;&#20174;<a href="./'.$index_url.'">&#39318;&#39029;</a>&#37325;&#26032;&#24320;&#22987;');
  }

  $data_type_base = ' WHERE '.(!empty($arr_area_child) ? 'B.area_id LIKE "'.$_GET['area_id'].'\_%"' : 'B.area_id="'.$_GET['area_id'].'"').'';
  $data_type = ' WHERE '.(!empty($arr_area_child) ? 'area_id LIKE "'.$_GET['area_id'].'\_%"' : 'area_id="'.$_GET['area_id'].'"').'';
  $data_type .= $sqlt;
  if (!empty($AREA_EXPIRES_data_type)) {
    $list_title_pass = '<a href="'.$list_url.'&list_type=pass">过期主题</a>';
    if ($_GET['list_type'] != 'today') {
      $data_type .= $AREA_EXPIRES_data_type;
    }
  } else {
    $no_pass = '<span class="redword"> - 没有过期记录！显示全部记录</span>';
  }
  //$data_type .= $AREA_CHECK_data_type;
  $data_type .= ' AND area_check="0"';

  //$base_option = get_option($arr_area_title[$_GET['area_id']]);
  $arspit='if($row["area_id"] != $_GET["area_id"]){
               $a_id=$_GET["area_id"]."_".abs(substr($row["area_id"], strlen($_GET["area_id"]."_")));
               $row[\'area_name_\']=" <span class=\"ar\">[".$arr_area_child[$a_id]."".($a_id == $row["area_id"] ? "" : "/…")."]</span>";
           }';

  $list_mode = (isset($_GET['list_mode']) && is_numeric($_GET['list_mode']) && $_GET['list_mode']>=0 && $_GET['list_mode']<=4) ? $_GET['list_mode'] : $AREA_MODE[$area_id_root];
  $function_list_title_ = 'get_list_title_'.eval('return '.$list_mode.';').'';
  $function_list_sort_mark = 'get_list_sort_mark_'.eval('return '.$list_mode.';').'_'.$_GET['list_sort'].'';

} else {
  $_GET['area_id'] = '';
  $rec = '全部';
  $area_there = '';
  $mark_child = ''; //全部根类目
  $title = $title1 = '全部根目';
  $keywords = '<meta name="keywords" content="'.$web['keywords'].'" />
';
  $description = '<meta name="Description" content="'.$web['description'].'" />
';


  $result = @mysql_query('SELECT * FROM '.$sql['pref'].''.$sql['data']['承载版区分类的表名'].' WHERE area_id REGEXP "^[0-9]+\-[0-9]+$" AND area_index LIKE "%'.$GLOBALS['this_mode'].'%"', $db);
  if (@mysql_num_rows($result) > 0) {
    while ($row = @mysql_fetch_assoc($result)) {
      //$area_id_root = get_arearoot($row['area_id']);
      $area_id_root = $row['area_id'];
      $area_sql_forlistdata[abs($area_id_root)] = 1;
      $AREA_MODE[$area_id_root] = ($row['area_mode'] == 0 ? 10 : ($row['area_mode'] == 2 ? 20 : $row['area_mode']));
      $AREA_READ_POWER[$area_id_root] = get_power_read($row['area_power_read']);
      if ($row['area_expires'] > 0) {
        if ($_GET['list_type'] == 'pass') {
          $AREA_EXPIRES_data_type .= ' (area_id LIKE "'.$area_id_root.'\_%" AND topdate<"'.(gmdate('Y-m-d H:i:s', time() + floatval($web['time_pos']) * 3600 - $row['area_expires'] * 24 * 60 * 60)).'") AND ';
        } else {
          if ($_GET['list_type'] != 'today') {
            $AREA_EXPIRES_data_type .= ' AND NOT (area_id LIKE "'.$area_id_root.'\_%" AND topdate<"'.(gmdate('Y-m-d H:i:s', time() + floatval($web['time_pos']) * 3600 - $row['area_expires'] * 24 * 60 * 60)).'") ';
          }
        }
      }
     /*
      if ($row['area_check'] == '1') {
        //$AREA_CHECK_data_type .= ' AND (area_id LIKE "'.$area_id_root.'\_%" AND area_check="0")'; //严格来讲用这个，不过检索条件太烦琐了
        $AREA_CHECK_data_type .= ' AND area_check="0"';
      }
      */
      if (substr($row['area_today'], 0, 4) == $date) {
        $row['area_today_this'] = substr($row['area_today'], 4);
      } else {
        $row['area_today_this'] = 0;
      }
      $arr_area_child[$row['area_id']] = '<a href="'.eval('return '.$list_url_area.';').'"'.($row['area_description']?' title="'.$row['area_description'].'"':'').''.$row['area_style'].'>'.$row['area_name'].'</a>';
      $arr_area_child_[$row['area_id']] = ' <span class="area_statistics">'.$arr_area_child[$row['area_id']].'<br />（<a title="今日主题" class="hand'.($row['area_today_this']>0?' redword" href="'.eval('return '.$list_url_area.';').'&list_type=today"':'"').'>'.$row['area_today_this'].'</a>/<a title="主题总计" class="hand"'.($row['area_total']>0?' href="'.eval('return '.$list_url_area.';').'&list_type=total"':'').'>'.$row['area_total'].'</a>）</span>';
      unset($row, $area_id_root);
    }
    @uksort($arr_area_child_, 'strnatcmp');

  }
  @mysql_free_result($result);

  $area_list = '<div class="column_in">';
  if (count((array)$arr_area_child_) > 0) {
  $area_list .= '<span class="redword">'.$mark_child.'</span>';
  foreach ((array)$arr_area_child_ as $row['area_id'] => $row['area_text']) {
    $column_key = ltrim(strrchr($row['area_id'], '-'), '-');
    if (strlen($column_key) >= 3) {
      $column_key = substr($column_key, 0, -2);
    } else {
      $column_key = 0;
    }
    $area_list_[$column_key] .= $GLOBALS['br'][$column_key].' <span class="area_statistics_out"><a href="'.eval('return '.$list_url_area.';').'">'.get_area_logo($row['area_id'], $column_key).'</a> '.$row['area_text'].'</span> '.$GLOBALS['br2'][$column_key];

    unset($column_key);
  }
  $area_list .= @implode('<hr class="column_hr">', $area_list_);
  } else {
  $area_list .= '没有论坛分类！';
  }
  $area_list .= '</div>';

  $data_type_base = ' WHERE (B.area_id LIKE "'.@implode('-%" OR B.area_id LIKE "', array_keys($area_sql_forlistdata)).'-%") ';
  $data_type = ' WHERE (area_id LIKE "'.@implode('-%" OR area_id LIKE "', array_keys($area_sql_forlistdata)).'-%") ';
  $data_type .= $sqlt;
  if (!empty($AREA_EXPIRES_data_type)) {
    $list_title_pass = '<a href="'.$list_url.'&list_type=pass">过期主题</a>';
    if ($_GET['list_type'] == 'pass') {
      $data_type = ' WHERE '.trim(trim($AREA_EXPIRES_data_type), 'AND');
    } else {
      $data_type .= $AREA_EXPIRES_data_type;
    }
  } else {
    $no_pass = '<span class="redword"> - 没有过期记录！显示全部记录</span>';
  }
  //$data_type .= $AREA_CHECK_data_type;
  $data_type .= ' AND area_check="0"';

  $base_option = '<option value="all">所有类目</option>';
  $arspit = '$row[\'area_name_\']=" <span class=\"ar\">[".$arr_area_child[$area_id_root]."/…]</span>";';

  @uksort($area_root, 'strnatcmp');

  $list_mode = (isset($_GET['list_mode']) && is_numeric($_GET['list_mode']) && $_GET['list_mode'] == 0) ? 10 : ($_GET['list_mode'] == 2 ? 20 : $_GET['list_mode']);
  $list_mode = ($list_mode==10 || $list_mode==20 || $list_mode==1 || $list_mode==3 || $list_mode==4) ? $list_mode : '"".$AREA_MODE[$area_id_root].""';
  $function_list_title_ = 'get_list_title_1';
  $function_list_sort_mark = 'get_list_sort_mark_1_'.$_GET['list_sort'].'';

}
if ($_GET['list_type'] == 'total' || $_GET['list_type'] == 'today') {
  if ($city_sql != '') {
    $arspit .= '$row[\'area_name_\'].=!empty($row["city"])?" <span class=\"ar\">[".$row["city"]."]</span>":" <img src=\"inc/images/po.gif\" title=\"此条未指定地区\" />";';
  }
  if ($_GET['list_type'] == 'today') {
    $data_type .= ' AND date LIKE "'.gmdate('Y-m-d', time() + (floatval($web['time_pos']) * 3600)).'%"';
  }
} else {
  if ($city_sql != '') {
    $arspit .= '$row[\'area_name_\'].=empty($row["city"])?" <img src=\"inc/images/po.gif\" title=\"此条未指定地区\" />":"";';
    $data_type .= $city_sql;
  }
}

//$function_list_sort_mark = 'get_list_sort_mark_'.$_GET['list_mode'].'_'.$_GET['list_sort'].'';
$result = @mysql_query('SELECT COUNT(id) AS total FROM '.$sql['pref'].''.$sql['data']['承载主题文章的表名'].''.$data_type.'', $db);
$row = @mysql_fetch_assoc($result);
$n = abs($row['total']);
@mysql_free_result($result);
unset($row);

if ($n > 0) {
  $text .= $function_list_title_();
  $p = get_page($n); //页数
  $seek = $web['pagesize'] * ($p-1);
  $result = @mysql_query('SELECT * FROM '.$sql['pref'].''.$sql['data']['承载主题文章的表名'].''.$data_type.' ORDER BY '.$_GET['list_sort'].' DESC LIMIT '.$seek.','.$web['pagesize'].'', $db); //,TIMESTAMPDIFF(SECOND,DATE_ADD(UTC_TIMESTAMP(), INTERVAL '.floatval($web['time_pos']).' HOUR),`topdate`) AS t
  while ($row = @mysql_fetch_assoc($result)) {
    $area_id_root = get_arearoot($row['area_id']);
    
    eval($arspit);
    eval($AREA_EXPIRES_EVAL[$area_id_root]);
    $function_list_mode = 'get_list_mode_'.eval('return '.$list_mode.';').'';
    $text .= $function_list_mode($row);
    unset($row, $area_id_root);
  }
  @mysql_free_result($result);

} else {
  $err .= '<div class="text_err">暂无记录！</div>';
}


//本版阅读排行 10条
$count = 10;
$text_readrank = '<div class="side"><div class="title">'.$area_there.'阅览排行</div><ul class="text">';
$result = @mysql_query('SELECT B.id,B.title,B.city,B.area_id,C.area_name FROM `'.$sql['pref'].''.$sql['data']['承载主题文章的表名'].'` B LEFT JOIN `'.$sql['pref'].''.$sql['data']['承载版区分类的表名'].'` C ON B.area_id=C.area_id '.$data_type_base.' ORDER BY B.views DESC LIMIT '.$count.'', $db);
if (@mysql_num_rows($result) > 0) {
  $step_readrank = 0;
  while ($row = @mysql_fetch_assoc($result)) {
    $step_readrank++;
    $text_readrank .= '<li><b style="color:'.($step_readrank <= 3 ? '#FF9900;' : '#9999FF;').';">'.$step_readrank.'.</b> <a href="'.eval('return '.$article_url.';').'" title="'.$row['title'].'" target="_blank">'.cutstr($row['title'], 45).'</a> <span class="ar">[<a href="'.eval('return '.$list_url_area.';').'">'.$row['area_name'].'</a> '.$row['city'].']</span></li>';
    unset($row);
  }
} else {
  $text_readrank .= '没有记录';
}
$text_readrank .= '</ul></div>';
@mysql_free_result($result);

//回复排行 10条
$count = 10;
$text_reply = '<div class="side"><div class="title">'.$area_there.'回复排行</div><ul class="text">';
$result = @mysql_query('SELECT B.id,B.title,B.city,B.area_id,C.area_name FROM `'.$sql['pref'].''.$sql['data']['承载主题文章的表名'].'` B LEFT JOIN `'.$sql['pref'].''.$sql['data']['承载版区分类的表名'].'` C ON B.area_id=C.area_id '.$data_type_base.' ORDER BY B.reply DESC LIMIT '.$count.'', $db);
if (@mysql_num_rows($result) > 0) {
  $step_reply = 0;
  while ($row = @mysql_fetch_assoc($result)) {
    $step_reply++;
    $text_reply .= '<li><b style="color:'.($step_reply <= 3 ? '#FF9900;' : '#9999FF;').';">'.$step_reply.'.</b> <a href="'.eval('return '.$article_url.';').'" title="'.$row['title'].'" target="_blank">'.cutstr($row['title'], 45).'</a> <span class="ar">[<a href="'.eval('return '.$list_url_area.';').'">'.$row['area_name'].'</a> '.$row['city'].']</span></li>';
    unset($row);
  }
} else {
  $text_reply .= '没有记录';
}
$text_reply .= '</ul></div>';
@mysql_free_result($result);

//取短信
if (POWER >= 1) {
  $result = @mysql_query('SELECT mess_num FROM `'.$sql['pref'].''.$sql['data']['承载成员档案的表名'].'` WHERE username="'.$session[0].'" LIMIT 1', $db); //短信
  $row_member = @mysql_fetch_assoc($result);
  $mess = '<span class="area_statistics">'.preg_replace('/^\d+/', '<span>$0</span>', $row_member['mess_num']).'</span>';
  @mysql_free_result($result);
  unset($row_member);
}

@ require ('inc/function/add_online.php'); //在线
//总数
$result = mysql_query('SELECT COUNT(id) AS total FROM '.$sql['pref'].''.$sql['data']['承载在线统计的表名'].''.(!empty($reg_online) ? ' WHERE '.$reg_online : '').'',$db);
$row = @mysql_fetch_assoc($result);
$n_online = abs($row['total']);
@mysql_free_result($result);
unset($row);

$n_online_member = 0;
$text_online .= '';
$result = mysql_query('SELECT * FROM `'.$sql['pref'].''.$sql['data']['承载在线统计的表名'].'` WHERE memberye>0'.(!empty($reg_online) ? ' AND '.$reg_online : '').' ORDER BY memberye DESC', $db); //,utime DESC
while ($row = @mysql_fetch_assoc($result)) {
  $n_online_member++;
  $text_online .= '<span><a href="user.php?get=card&username='.urlencode($row['username']).'" target="_blank">'.$row['username'].' '.$row['userface'].'</a></span>';
}
$text_online = $n_online_member > 0 ? '<div id="li_online" class="li">'.$text_online.'</div>' : '';
@mysql_free_result($result);
unset($row);

$sql['sql_version'] = @mysql_get_server_info();
@mysql_close();

?><!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $title; ?> - <?php echo $web['sitename2'], $web['code_author']; ?></title>
<?php echo $keywords, $description; ?>
<link id="my_style" rel="stylesheet" type="text/css" href="inc/css/<?php echo $GLOBALS['this_mode']; ?>/style.css">
<script language="javascript" src="inc/js/main.js" type="text/javascript"></script>
<?php if (isset($_GET['list_mode']) && (string)$_GET['list_mode'] == '4') {
$div_p_1 = '<div id="wrap" class="wrap">';
$div_p_2 = '</div>';
?>
<script type="text/javascript">
function Sort(wrap) {
  var n = 3; //列数。必须大于0的整数
  var columnW = wrap.offsetWidth/n; //列宽
  var icolumnT = [];
  for (var k = 0; k < n; k++) {
    icolumnT[k] = 0;
  }
  var minHK;
  var box = wrap.childNodes;
  if (box.length > 0) {
    for(var i = 0; i < box.length; i++) {
	  if (box[i].nodeType == 1) {
		minHK = MK(icolumnT);
		icolumnT[minHK[0]] = minHK[1];
        box[i].style.position = 'absolute';
        box[i].style.top = icolumnT[minHK[0]] + 'px';
        box[i].style.left = (minHK[0] * columnW) + 'px';
        icolumnT[minHK[0]] += box[i].offsetHeight;
	  }
	}
    wrap.style.height = (Math.max.apply({},icolumnT))+'px';
  }
};

function MK(arr) {
  var minArr;
  var minV = arr[0];
  minArr = new Array(0, minV);
  for(var i=1; i<arr.length; i++) {
    if (arr[i] < minV) {
	  minV = arr[i];
	  minArr = new Array(i, arr[i]);
	}
  }
  return minArr;
}



window.onload = function() {
  Sort($("wrap"));
};
</script>
<?php } ?>
</head>
<body>
<div id="session" class="session"><div id="city"><?php
echo $text_city;
?></div><?php
@ include ('inc/require/head.txt'); ?></div>
<?php
if ($web['siteclose'] > 1) {
  @include ('inc/require/siteclose_why.txt');
}
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" id="logo">
  <tr>
    <td width="200"><a href="<?php echo $web['path']; ?>"><img src="<?php echo $web['sitelogo']; ?>" /></a></td>
    <td width="400" align="center"><?php @include ('inc/css/'.$GLOBALS['this_mode'].'/ad_list_logoside.txt'); ?></td>
    <td align="right"><form id="searchform" action="search.php?action=search" method="get" title="搜索<?php echo $area_there; ?>文章" onsubmit="return $('keyword').value!=''||false;">
      <input type="hidden" name="area_id" value="<?php echo $_GET['area_id']; ?>" />
      <input type="hidden" name="action" value="search" />
      <input name="keyword" id="keyword" class="large" type="text" />
      <input type="submit" name="submit" id="submit" class="search_member search_article" value="" />
    </form></td>
  </tr>
</table>
<div id="banner"> <a href="./">首页</a> <a class="column_is">文章列表</a> <a href="list_company.php">商号</a> <a href="list_member.php">成员</a> <a href="list_online.php">在线</a> <a href="help.php">帮助</a>
    <?php @include ('inc/css/'.$GLOBALS['this_mode'].'/banner.txt'); ?>
</div>
<?php echo $text_area_index; ?>
<div class="column">
  <h5><a href="rss.php?mode=<?php echo $GLOBALS['this_mode']; ?>&area_id=<?php echo $_GET['area_id']; ?>" class="dingyue"><img src="inc/images/rss.gif" width="14" height="14" /> 订阅</a>
    
    <?php echo $title1; ?></h5>
    <?php echo $area_list; ?>
</div>
<?php @include ('inc/css/'.$GLOBALS['this_mode'].'/ad_list_top.txt'); ?>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="page_table">
  <tr>
    <td width="190" align="left"><button class="large" type="button" onclick="window.open('write.php?mode=<?php echo $GLOBALS['this_mode']; ?>&area_id=<?php echo $_GET['area_id']; ?>','_blank');" style="float:left;"><b><div class="send_write">发布主题</div></b></button> <?php echo $send; ?></td>
    <td align="right"><?php echo $text_page = get_page_foot($n, $web['pagesize'], $p, eval('return '.$page_url_before.';'), eval('return '.$page_url_after.';')); ?></td>
  </tr>
</table>
<div class="body">
  <div class="list_title"><?php if (function_exists($function_list_sort_mark)) echo $function_list_sort_mark(); ?><?php echo eval('return '.$list_title.';'); ?></div>
  <div class="body_in"><?php
if (isset($sql['sql_version']) && $sql['sql_version'] < '5.0') {
  echo '<div class="red_err">服务器数据库版本（'.$sql['sql_version'].'）太低！数据可能显示不正常。本程序建设基于MySQL版本5.0以上</div>';
}
?>
<?php
echo $div_p_1, $text, $err, $div_p_2;
?>
  </div>
</div>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="page_table">
  <tr>
    <td width="190" align="left"><button class="large" type="button" onclick="window.open('write.php?mode=<?php echo $GLOBALS['this_mode']; ?>&area_id=<?php echo $_GET['area_id']; ?>','_blank');" style="float:left;"><b><div class="send_write">发布主题</div></b></button> <?php echo $send; ?></td>
    <td align="right"><?php echo preg_replace('/<style.+\/style>/isU', '', $text_page); ?></td>
  </tr>
</table>

<div class="body">
  <table width="100%" border="0" cellspacing="0" cellpadding="0" class="bottom">
    <tr valign="top">
      <td width="375" style="padding-right:10px;"><?php echo $text_readrank; unset($text_readrank); ?></td>
      <td style="padding-right:10px;"><?php echo $text_reply; unset($text_reply); ?><?php //@include ('inc/require/company_update.txt'); ?></td>
      <td width="220"><div class="hot"><div class="title">热门标签</div><div class="text">
      <?php
      @include ('inc/require/hot_mark.txt');
	  ?></div>
    </div></td>
    </tr>
  </table>
</div>

<div class="body">
  <div class="list_title"><?php echo '<a href="list_online.php" class="list_title_in" target="_blank">'.$area_there.'用户在线<span>（'.$n_online.'）</span></a>'; ?>&nbsp;&nbsp;</div>
  <div class="body_in">
    <!--div class="list_title_">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <th><img src="inc/images/manager_base.gif" width="18" height="16" />&nbsp;&nbsp;基础管理员</th>
          <th><img src="inc/images/manager.gif" width="18" height="16" />&nbsp;&nbsp;管理员</th>
          <th><img src="inc/images/admin_big.gif" width="16" height="16" />&nbsp;&nbsp;版主</th>
          <th><img src="inc/images/admin.gif" width="16" height="16" />&nbsp;&nbsp;当前版主</th>
          <th><img src="inc/images/diamond.gif" width="16" height="16" />&nbsp;&nbsp;钻级成员</th>
          <th><img src="inc/images/gold.gif" width="12" height="16" />&nbsp;&nbsp;金级成员</th>
          <th><img src="inc/images/silver.gif" width="12" height="16" />&nbsp;&nbsp;银级成员</th>
          <th><img src="inc/images/iron.gif" width="12" height="16" />&nbsp;&nbsp;铁级成员</th>
        </tr>
      </table>
    </div-->
    <?php echo $text_online; ?> <?php echo $n_online - $n_online_member > 0 ? '<div id="li_online" class="li"><span><a href="list_online.php?act=guest" target="_blank">'.($n_online - $n_online_member).'位访客…</a></span></div>' : ''; ?> </div>
</div>

<div class="friend_link"> <a class="greenword"><b>常用工具</b></a>
    <?php @include ('inc/css/'.$GLOBALS['this_mode'].'/tools.txt'); ?>
</div>
<script language="JavaScript" type="text/javascript">
<!--
try{$('new_mess').innerHTML='<?php echo $mess; ?>';}catch(err){}
-->
</script>

<?php @include ('inc/css/'.$GLOBALS['this_mode'].'/ad_list_bottom.txt'); ?>
<div id="foot">
  <?php @include ('inc/css/'.$GLOBALS['this_mode'].'/foot.txt'); ?>
</div>


</body>
</html>