function insertOrUpdateCat($insert_arr, $update_arr)
 {
     $r = $this->odb->insertOrUpdate($this->tblName, $insert_arr, $update_arr);
     if (!$r) {
         action_public::turnPage('index.php', '更新数据时,出错!请联系我们!');
     }
 }
Exemple #2
0
 public function getReply($field, $aid, $limit = 10)
 {
     $page = isset($_GET['page']) ? intval($_GET['page']) : 1;
     $total_num = $this->odb->getRowsCount($this->tblName, "tid='0' AND aid = '{$aid}'");
     $tota_page = ceil($total_num / $limit);
     if ($page < 1) {
         $page = 1;
     }
     if ($page > $tota_page) {
         $page = $tota_page;
     }
     $start = ($page - 1) * $limit;
     $sql = "select {$field} from {$this->tblName} where tid in (SELECT id from (SELECT id FROM {$this->tblName} WHERE tid = '0' AND aid = '{$aid}' limit {$start},{$limit} ) as temp)union all(SELECT {$field} FROM {$this->tblName} WHERE tid = '0' AND aid = '{$aid}' limit {$start},{$limit}) order by id asc";
     $temp = $this->odb->getRows($sql);
     $result = array();
     if (!empty($temp)) {
         foreach ($temp as $v) {
             if ($v['tid'] == 0) {
                 $result[$v['id']][] = $v;
             } else {
                 $result[$v['tid']][] = $v;
             }
         }
     }
     $link_str = action_public::listPage($tota_page, $limit, $page);
     return array($result, $link_str);
 }
 function updateStop($aid)
 {
     $sql = "UPDATE {$this->tblName} SET isstop=1-isstop WHERE aid='{$aid}';";
     $r = $this->odb->execSql($sql);
     if (!$r) {
         action_public::turnPageAdmin('index.php', '更新帖子状态出错,请联系我们!!');
     }
 }
Exemple #4
0
 public function get_user_info()
 {
     if (!isset($_COOKIE['login_username']) || !isset($_COOKIE['login_password'])) {
         $this->userid = null;
         $this->groupid = null;
         return;
     } else {
         $user = db_user::getInstance();
         $userinfo = $user->getDataLimit('password,userid,groupid', "username='******'login_username']}'");
         if (empty($userinfo) || md5($userinfo[0]['password'] . $GLOBALS['config']['cookie_password']) != $_COOKIE['login_password']) {
             action_public::turnPage($GLOBALS['config']['site_url'] . 'index.php?case=user&act=login', '用户不存在!');
         }
     }
     $this->userid = $userinfo[0]['userid'];
     $this->groupid = $userinfo[0]['groupid'];
 }
        action_public::turnPageAdmin('admin-list-archive.php', '操作未成功,请联系CMSEASY官方!!');
    }
}
if (isset($_POST['submit'])) {
    if (!$roles['bbs_archive_edit']) {
        action_public::turnPageAdmin($_SERVER['REQUEST_URI'], '无操作权限!!');
    }
    unset($_POST['submit']);
    if ($archive->updateData($_POST, 'aid=' . $aid)) {
        action_public::turnPageAdmin('admin-list-archive.php', '修改成功!');
    } else {
        action_public::turnPageAdmin('admin-list-archive.php', '修改失败,请联系我们!');
    }
}
if (!isset($_GET['action']) && $_GET['action'] != 'edit') {
    action_public::turnPageAdmin('admin-list-cat.php', '参数错误!');
}
$archive_data = $archive->getDataLimit('*', 'aid=' . $aid);
$category = db_bbs_category::getInstance();
$category_data = $category->getAll();
$label = db_bbs_label::getInstance();
$lable_data = $label->getAll();
include_once "admin-header.php";
?>
<script type="text/javascript" language="javascript" src="<?php 
echo $GLOBALS['config']['site_url'];
?>
js/script.js"></script>
<style type="text/css">
* {font-size:12px;}
a {color:#435884;text-decoration:none;}
Exemple #6
0
<?php

error_reporting(E_ALL & ~E_NOTICE);
if ($_GET['case'] == 'file') {
    echo "<script>window.location.href='" . str_replace('/bbs', '', $_SERVER['REQUEST_URI']) . "';</script>";
}
require_once 'bbs_public.php';
$category = db_bbs_category::getInstance();
$category_data = $category->getAll('order by listorder asc');
$archive = db_bbs_archive::getInstance();
$label = db_bbs_label::getInstance();
$lable_data = $label->getAll();
$lable_data_arr = action_public::formatToIndex('lid', $lable_data);
include 'header.php';
?>
<div class="main">

<?php 
foreach ($category_data as $v) {
    $archive_arr = $archive->getDataLimit('aid,cid,lid,title,username,replynum,click,addtime', "cid='{$v['cid']}' AND isstop='0' order by aid desc limit 10 ");
    ?>






<div class="title">
<h3>
<a href="category-display.php?cid=<?php 
    echo $v['cid'];
$category = db_bbs_category::getInstance();
$category_data = $category->getAll();
if (isset($_POST['update'])) {
    if (!$roles['bbs_category_add']) {
        action_public::turnPageAdmin($_SERVER['REQUEST_URI'], '无操作权限!!');
    }
    foreach ($_POST['listorder'] as $k => $v) {
        if ($_POST['typename'][$k] == '新专题名称') {
            continue;
        }
        $category->insertOrUpdateCat(array('cid' => isset($_POST['cid'][$k]) ? $_POST['cid'][$k] : '', 'listorder' => $_POST['listorder'][$k], 'typename' => $_POST['typename'][$k]), array('listorder' => $_POST['listorder'][$k], 'typename' => $_POST['typename'][$k]));
    }
    action_public::turnPageAdmin($_SERVER['REQUEST_URI'], '修改成功!!');
}
if (!$roles['bbs_category_list']) {
    action_public::turnPageAdmin($_SERVER['REQUEST_URI'], '无操作权限!!');
}
include_once "admin-header.php";
?>
<script type="text/javascript" language="javascript" src="<?php 
echo $GLOBALS['config']['site_url'];
?>
js/script.js"></script>
<style type="text/css">
* {font-size:12px;}

/* 提示框 */
.hotspot { cursor:pointer}
#tt {position:absolute; display:block; background:url(<?php 
echo $GLOBALS['config']['site_url'];
?>
$lable_data = $label->getAll();
if (isset($_POST['submit'])) {
    if (strtolower(trim($_POST['verify'])) != strtolower($_SESSION['verify'])) {
        action_public::turnPage('index.php', '验证码输入错误!');
    }
    $archive = db_bbs_archive::getInstance();
    unset($_POST['submit']);
    unset($_POST['verify']);
    $_POST['username'] = $_COOKIE['login_username'];
    $_POST['userid'] = $admin->userid;
    $_POST['ip'] = $_SERVER['REMOTE_ADDR'];
    $_POST['addtime'] = mktime();
    if ($id = $archive->inserData($_POST)) {
        action_public::turnPage('archive-display.php?aid=' . $id, '文章添加成功');
    } else {
        action_public::turnPage('index.php', '添加失败,请联系我们!');
    }
}
include 'header.php';
?>

<style type="text/css">
#table tr td {line-height:38px;}
</style>



<div class="title">
<h3>
<a>请填写帖子相关内容</a>/<span>Release</span></h3>
</div>
<?php

require_once 'bbs_public.php';
$cid = isset($_GET['cid']) ? intval($_GET['cid']) : action_public::turnPage('index.php', '参数错误,即将跳回主页!');
$category = db_bbs_category::getInstance();
$category_data = $category->getDataLimit('*', 'cid=' . $cid);
$archive = db_bbs_archive::getInstance();
$archive_data = $archive->getArchive('aid,cid,lid,title,username,replynum,click,addtime', $cid, 20);
include 'header.php';
?>


<div class="title">
<h3>
<a><?php 
echo $category_data[0]['typename'];
?>
</a>/<span>Type</span></h3>
<a href="add-archive.php?cid=<?php 
echo $cid;
?>
" class="action"></a>
</div>



<table border="0" cellspacing="0" cellpadding="0" name="table" id="table" width="100%">
<thead>
<tr class="th">
<th width="8"></th>
<th width="50%">版块主题</th>
    $username = trim($_POST['username']);
    $where = "cid='{$cid}' AND addtime>'{$start}' AND addtime<'{$end}'";
    if (empty($username) && empty($ip)) {
        action_public::turnPageAdmin($_SERVER['REQUEST_URI'], '用户名和ip不能同时为空!');
    }
    if (!empty($username)) {
        $where .= "AND username='******'";
    }
    if (!empty($ip)) {
        $where .= "AND ip='{$ip}'";
    }
    $archive = db_bbs_archive::getInstance();
    if ($archive->deleteData($where)) {
        action_public::turnPageAdmin($_SERVER['REQUEST_URI'], '已删除符合条件的帖子!');
    } else {
        action_public::turnPageAdmin($_SERVER['REQUEST_URI'], '未找到符合要求的帖子!');
    }
}
include_once "admin-header.php";
?>
<script type="text/javascript" language="javascript" src="<?php 
echo $GLOBALS['config']['site_url'];
?>
js/script.js"></script>
<style type="text/css">
* {font-size:12px;}
a {color:#435884;text-decoration:none;}
a:link {color:#333;text-decoration:none;}
a:hover{color:#3399FF;text-decoration:none;}
/* 提示框 */
.hotspot { cursor:pointer}