<?php
require ('authentication_manager.php');
?>
<style type="text/css">
<!--
.column__ { margin-bottom:10px; line-height:39px; text-align:left; clear:both; background-color:#ECECEC; }
-->
</style>
<?php

/* 编辑页脚 */
/* 162100源码 - 162100.com */

$text = $text__ = $err = '';
if (isset($_GET['mode']) && $_GET['mode'] && file_exists('inc/css/'.$_GET['mode'])) { 
  echo '<div class="list_title"><a href="?get=foot">&lt;&lt;返回</a><a class="list_title_in">页脚编辑</a></div>
<ul class="manager_menu">所属模板：'.substr($_GET['mode'], 0, 1).''.str_pad('', strlen($_GET['mode'])-1, '*').' ['.file_get_contents('inc/css/'.$_GET['mode'].'/title.txt').'] </ul>
';

$editstr = @file_get_contents('inc/css/'.$_GET['mode'].'/foot.txt');
$editstr = str_replace("'", "\'", $editstr);
$editstr = preg_replace('/<\?(php)?.*\?>/iU', '', $editstr);
$editstr = preg_replace('/[\r\n]+/', '', $editstr);
$editstr = preg_replace('/<script/i', '<sc\'+\'ri\'+\'pt', $editstr);
$editstr = preg_replace('/<\/script/i', '</sc\'+\'ri\'+\'pt', $editstr);
//$editstr = str_replace('&', '&amp;', $editstr);
//$editstr = str_replace('<', '&lt;', $editstr);
//$editstr = str_replace('>', '&gt;', $editstr);
?>
<iframe id="lastFrame" name="lastFrame" frameborder="0" style="display:none"></iframe>
<script language="JavaScript" type="text/javascript">
<!--
var eXSize = 588;       //编辑器宽度，最小宽度限588px
var formU = '?post=foot&mode=<?php echo $_GET['mode']; ?>';
var formT = '<div class="column">在下面编辑器中填写页脚代码吧！如备案号或统计代码等。<br /><br />提示：如果页脚加入第三方统计代码，如51.la或cnzz统计，因为含&lt;script&gt;标签，务必点选下面“不用过滤…”，否则&lt;script&gt;标签会被过滤掉，统计代码失效。<br /><br /><input type="radio" class="radio" name="filter" value="yes" checked />请系统自动过滤代码<span class="grayword">（点选此项可能会过滤掉不希望过滤的代码，否则请点选下面的。）</span><br /><input type="radio" class="radio" name="filter" value="no" />不用过滤，我相信自己所写的代码规范（填写JS等代码如统计代码时）。<b>注意此项每次提交前要仔细校对代码</b><br /><b class="redword">提交前请确定inc/css/<?php echo $_GET['mode']; ?>目录具备写权限</b><div align="right"><button type="button" class="botton" onclick="toDefault()"><b>恢复默认值</b></button></div></div>';
var contT = '<?php echo addslashes($editstr); ?>';
document.write('<'+'sc'+'ript language="javascript" src="inc/js/editor.js?'+new Date().getTime()+'" type="text/javascript"></'+'sc'+'ript>');


function toDefault() {
  try {
    e162100T.value = e162100I.document.body.innerHTML = '<a href="http://info.162100.com/list.php?area_id=96">留言交流</a> - 2010 162100.COM All Rights Reserved - <a style="COLOR: #666666" href="http://www.miibeian.gov.cn/" target="_blank">网站ICP备案号</a>';
  } catch (err) {
  }
}
-->
</script>
<?php

} else {
  $_GET['mode'] = $web['sitemode'];
  if ($m_arr = @glob('./inc/css/*', GLOB_ONLYDIR)) {
    foreach ($m_arr as $m_f) {
      $base_index_mode = basename($m_f);
	  $title = @file_get_contents($m_f.'/title.txt');
      if (file_exists('./inc/css/'.$base_index_mode.'/index.php') && file_exists('./inc/css/'.$base_index_mode.'/list.php') && file_exists('./inc/css/'.$base_index_mode.'/article.php')) {
       $text .= '<div class="column__"><a href="?mode='.$base_index_mode.'&get=foot">'.substr($base_index_mode, 0, 1).'*** ['.$title.'] 的页脚编辑</a></div>';
      } else {
        $text__ .= '<div class="column__">'.substr($base_index_mode, 0, 1).'*** ['.$title.'] 该风格尚未安装，请<a href="http://wpa.qq.com/msgrd?v=3&uin=184830962&site=qq&menu=yes" target="_blank">QQ联系程序作者</a>定制</div>';
      }
      unset($base_index_mode, $title);
    }
  } else {
    $err .= '没有任何模板，也无法进行页脚管理！';
  }
}


echo $text, $text__, $err;


?>
