<?php
function tt_article_Filter_Plugin_Admin_Begin(){
global $zbp;
if($zbp->user->Level==1){
$action = GetVars('act', 'GET');
if($action=='ArticleMng'){
Redirect($zbp->host.'zb_users/plugin/tt_article/tt_article_ArticleMng.php');
}
}
}
function tt_article_Admin_ArticleMng()
{
global $zbp;
global $zbp;
echo '<style>
.tt_article_div{
float:right;
font-size: 16px;
}
.tt_article_div a{
color: #fff!important;
}
.SubMenu{display:block!important}
</style>';
echo '<script src="'.$zbp->host.'zb_users/plugin/tt_article/com.js" type="text/javascript"></script>';
echo '<div class="divHeader">批量文章管理</div>';
echo '<div class="SubMenu">
'.tt_article_SubMenu(1).'';
foreach ($GLOBALS['hooks']['Filter_Plugin_Admin_ArticleMng_SubMenu'] as $fpname => &$fpsignal) {
$fpname();
}
echo '</div>';
echo '<style>
.tt_article_bo {
overflow: hidden;
background: #3a6ea5;
color: white;
}
.tt_article_bo li{float:left;padding: 0 5px; margin: 5px 0;
}
input#delAll,input#tt_article_All{
height: 33px;
padding: 5px 10px; border: 1px solid #ffffff;
}
#cmbIsTop{margin-right:10px}
.fixed_act{position: fixed;
top: 0;
width: 100%;
z-index: 99999;}
</style>';
echo '<div class="tt_article_bo" id="tt_article_bo">';
echo'<li>分类:<select style="width:140px;" class="edit" size="1" id="cmbCateID"><option value="">任意</option>'.OutputOptionItemsOfCategories('99999').'</select></th>';
echo'<li>置顶:<select style="width:100px;" class="edit" size="1" id="cmbIsTop"><option value="">任意</option><option value="1">不置顶</option><option value="2">置顶</option></select><select style="width:100px;" class="edit" size="1" id="cmbtop_status"><option value="index">首页</option><option value="global">全局</option><option value="category">分类</option></select></th>';
echo'<li>类型:<select style="width:140px;" class="edit" size="1" id="cmbStatus"><option value="">任意</option>'.OutputOptionItemsOfPostStatus('5').'</select></th>';
echo'<li>作者:<select style="width:140px;margin-right:10px" class="edit" size="1" id="cmbMem"><option value="">任意</option>'.OutputOptionItemsOfMember('99999').'</select>';
echo '<li>发布时间:<input type="text" name="PostTime" id="edtDateTime" value="" style="width:180px;" autocomplete="off" /></li>';
echo '<li><input type="button" value="批量执行更改" id="tt_article_All"></th></li>';
echo'<li><input type="button" value="批量删除" id="delAll"></li>';//ok
echo'<li></li>';
echo '</div>';
echo '<div id="divMain2">';
echo '<form class="search" id="search" method="post" action="#">';
echo '<p>' . $zbp->lang['msg']['search'] . ': ' . $zbp->lang['msg']['category'] . ' <select class="edit" size="1" name="category" style="width:140px;" ><option value="">' . $zbp->lang['msg']['any'] . '</option>';
foreach ($zbp->categoriesbyorder as $id => $cate) {
echo '<option value="' . $cate->ID . '">' . $cate->SymbolName . '</option>';
}
echo '</select> ' . $zbp->lang['msg']['type'] . ' <select class="edit" size="1" name="status" style="width:100px;" ><option value="">' . $zbp->lang['msg']['any'] . '</option> <option value="0" >' . $zbp->lang['post_status_name']['0'] . '</option><option value="1" >' . $zbp->lang['post_status_name']['1'] . '</option><option value="2" >' . $zbp->lang['post_status_name']['2'] . '</option></select>
<label><input type="checkbox" name="istop" value="True"/> ' . $zbp->lang['msg']['top'] . '</label>
<input name="search" style="width:250px;" type="text" value="" /> <input type="submit" class="button" value="' . $zbp->lang['msg']['submit'] . '"/></p>';
echo '</form>';
$search = GetVars('search');
$order_get = GetVars('order', 'GET');
// $p = new Pagebar('{%host%}zb_system/cmd.php?act=ArticleMng{&status=%status%}{&istop=%istop%}{&category=%category%}{&search=%search%}{&order=%order%}{&page=%page%}', false);
$p = new Pagebar('{%host%}zb_users/plugin/tt_article/tt_article_ArticleMng.php?{&page=%page%}{&status=%status%}{&istop=%istop%}{&category=%category%}{&search=%search%}{&order=%order%}', false);
// $p->PageCount = $zbp->managecount;
$p->PageCount = $zbp->Config('tt_article')->num;
$p->PageNow = (int) GetVars('page', 'GET') == 0 ? 1 : (int) GetVars('page', 'GET');
if (GetVars('search') !== GetVars('search', 'GET')) {
$p->PageNow = 1;
}
$p->PageBarCount = $zbp->pagebarcount;
$p->UrlRule->Rules['{%category%}'] = GetVars('category');
$p->UrlRule->Rules['{%search%}'] = rawurlencode($search);
$p->UrlRule->Rules['{%status%}'] = GetVars('status');
$p->UrlRule->Rules['{%istop%}'] = (bool) GetVars('istop');
$p->UrlRule->Rules['{%order%}'] = $order_get;
$w = array();
$w[] = array('=', 'log_Type', 0);
if (!$zbp->CheckRights('ArticleAll')) {
$w[] = array('=', 'log_AuthorID', $zbp->user->ID);
}
if (GetVars('search')) {
$w[] = array('search', 'log_Content', 'log_Intro', 'log_Title', $search);
}
if (GetVars('istop')) {
$w[] = array('<>', 'log_Istop', '0');
}
if (GetVars('status') !== null && GetVars('status') !== '') {
$w[] = array('=', 'log_Status', (int) GetVars('status'));
}
if (GetVars('category')) {
$w[] = array('=', 'log_CateID', GetVars('category'));
}
$s = '';
if ($order_get == 'id_desc') {
$or = array('log_ID' => 'DESC');
} elseif ($order_get == 'id_asc') {
$or = array('log_ID' => 'ASC');
} elseif ($order_get == 'cateid_desc') {
$or = array('log_CateID' => 'DESC');
} elseif ($order_get == 'cateid_asc') {
$or = array('log_CateID' => 'ASC');
} elseif ($order_get == 'authorid_desc') {
$or = array('log_AuthorID' => 'DESC');
} elseif ($order_get == 'authorid_asc') {
$or = array('log_AuthorID' => 'ASC');
} elseif ($order_get == 'posttime_desc') {
$or = array('log_PostTime' => 'DESC');
} elseif ($order_get == 'posttime_asc') {
$or = array('log_PostTime' => 'ASC');
} elseif ($order_get == 'updatetime_desc') {
$or = array('log_UpdateTime' => 'DESC');
} elseif ($order_get == 'updatetime_asc') {
$or = array('log_UpdateTime' => 'ASC');
} else {
//插手排序
$or = array($zbp->manageorder => 'DESC');
if($zbp->Config('tt_article')->order==2){
$or = array('log_ID' => 'ASC');
}elseif($zbp->Config('tt_article')->order==3){
$or = array('log_ID' => 'DESC');
}
}
$l = array(($p->PageNow - 1) * $p->PageCount, $p->PageCount);
$op = array('pagebar' => $p);
$type = null;
//1.7新加入的接口
foreach ($GLOBALS['hooks']['Filter_Plugin_Admin_ArticleMng_Core'] as $fpname => &$fpsignal) {
$fpreturn = $fpname($s, $w, $or, $l, $op);
}
foreach ($GLOBALS['hooks']['Filter_Plugin_LargeData_Article'] as $fpname => &$fpsignal) {
$fpreturn = $fpname($s, $w, $or, $l, $op, $type);
}
$array = $zbp->GetPostList(
$s,
$w,
$or,
$l,
$op
);
echo '<form method="post" action="' . $zbp->host . 'zb_system/cmd.php?act=PostBat&type=' . ZC_POST_TYPE_ARTICLE . '">';
echo '<table border="1" class="tableFull tableBorder table_hover table_striped tableBorder-thcenter">';
echo '<tr>';
echo'<th class="tdCenter"><input type="button" id="checkAll" value="全选" /></th>';
echo'<th><input type="button" id="removeAll" value="取消全部" /></th>';
echo'<th><input type="button" id="reverse" value="反选" /></th>';
echo'<th></th>';
echo'<th></th>';
echo'<th></th>';
i
评论1