function insertOrUpdateCat($insert_arr, $update_arr)
 {
     $r = $this->odb->insertOrUpdate($this->tblName, $insert_arr, $update_arr);
     if (!$r) {
         action_public::turnPage('index.php', '更新数据时,出错!请联系我们!');
     }
 }
 function updateClickReply($aid, $field)
 {
     $aid = intval($aid);
     $sql = "UPDATE {$this->tblName} SET {$field}={$field}+1 WHERE `aid`={$aid}";
     $r = $this->odb->execSql($sql);
     if (!$r) {
         action_public::turnPage('index.php', '更新文章点击数出错,请联系我们!');
     }
 }
Exemple #3
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'];
 }
$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>
<?php 
require_once 'bbs_public.php';
$aid = isset($_GET['aid']) ? intval($_GET['aid']) : action_public::turnPage('index.php', '参数错误,即将跳回主页!');
$archive = db_bbs_archive::getInstance();
$archive->updateClickReply($aid, 'click');
$archive_info = $archive->getDataLimit('*', "aid = '{$aid}' AND isstop='0'");
if (empty($archive_info)) {
    action_public::turnPage('index.php', '该帖子不存在,或已被删除!');
}
$label = db_bbs_label::getInstance();
$lable_data = $label->getAll();
$lable_data_arr = action_public::formatToIndex('lid', $lable_data);
$reply = db_bbs_reply::getInstance();
$reply_data = $reply->getReply('id,tid,username,content,addtime', $aid, 10);
$admin = new action_admin();
include 'header.php';
?>



<table border="0" cellspacing="0" cellpadding="0" name="table" id="table" width="100%">
<thead>
<tr class="th">
<th>
主题&nbsp;[<?php 
echo $lable_data_arr[$archive_info[0]['cid']]['labelname'];
?>
]:</th>
<th width="60%" align="left">&nbsp;&nbsp;<strong><?php 
echo $archive_info[0]['title'];
?>