Exemplo n.º 1
0
 /**
  * GET 话题详细信息
  */
 public function ajax_themeinfoOp()
 {
     $model = Model();
     $m_theme = $model->table('circle_theme');
     $theme = $m_theme->where(array("theme_id" => $this->t_id))->select();
     $this->c_id = $theme['circle_id'];
     // 话题信息
     $this->themeInfo();
     $data = $this->theme_info;
     $model = Model();
     // 访问数增加
     $model->table('circle_theme')->update(array('theme_id' => $this->t_id, 'theme_browsecount' => array('exp', 'theme_browsecount+1')));
     $data['theme_content'] = ubb($data['theme_content']);
     if ($data['theme_edittime'] != '') {
         $data['theme_edittime'] = @date('Y-m-d H:i', $data['theme_edittime']);
     }
     $data['member_avatar'] = getMemberAvatarForID($data['member_id']);
     // 是否赞过话题
     $data['theme_nolike'] = 1;
     if (!empty($this->member_info['member_id'])) {
         // 是否赞过话题
         $like_info = $model->table('circle_like')->where(array('theme_id' => $this->t_id, 'member_id' => $this->member_info['member_id']))->find();
         if (empty($like_info)) {
             $data['theme_nolike'] = 1;
         } else {
             $data['theme_nolike'] = 0;
         }
     }
     if (strtoupper(CHARSET) == 'GBK') {
         $data = Language::getUTF8($data);
     }
     output_data(array('theme_info' => $data));
     die;
 }
Exemplo n.º 2
0
 function parseSmileys($str = '', $image_url = '', $ubb = true)
 {
     global $cfg_smileys;
     if ($image_url == '') {
         return $str;
     }
     $image_url = preg_replace("/(.+?)\\/*\$/", "\\1/", $image_url);
     foreach ($cfg_smileys as $key => $val) {
         $str = str_replace($key, "<img src=\"" . $image_url . $cfg_smileys[$key][0] . "\" width=\"" . $cfg_smileys[$key][1] . "\" height=\"" . $cfg_smileys[$key][2] . "\" alt=\"" . $cfg_smileys[$key][3] . "\"/>", $str);
     }
     return $ubb ? ubb($str) : $str;
 }
Exemplo n.º 3
0
 /**
  * ajax获取话题详细信息 话题列表页使用
  */
 public function ajax_themeinfoOp()
 {
     // 话题信息
     $this->themeInfo();
     $data = $this->theme_info;
     $model = Model();
     // 话题商品
     $goods_list = $model->table('circle_thg')->where(array('theme_id' => $this->t_id, 'reply_id' => 0))->select();
     $goods_list = tidyThemeGoods($goods_list, 'themegoods_id');
     $data['goods_list'] = $goods_list;
     // 附件
     $affix_list = $model->table('circle_affix')->where(array('affix_type' => 1, 'theme_id' => $this->t_id))->select();
     if (!empty($affix_list)) {
         foreach ($affix_list as $key => $val) {
             $affix_list[$key]['affix_filename'] = themeImageUrl($val['affix_filename']);
             $affix_list[$key]['affix_filethumb'] = themeImageUrl($val['affix_filethumb']);
         }
     }
     $data['affix_list'] = $affix_list;
     // 访问数增加
     $model->table('circle_theme')->update(array('theme_id' => $this->t_id, 'theme_browsecount' => array('exp', 'theme_browsecount+1')));
     $data['theme_content'] = ubb($data['theme_content']);
     if ($data['theme_edittime'] != '') {
         $data['theme_edittime'] = @date('Y-m-d H:i', $data['theme_edittime']);
     }
     // 是否赞过话题
     $data['theme_nolike'] = 1;
     if (isset($_SESSION['member_id'])) {
         // 是否赞过话题
         $like_info = $model->table('circle_like')->where(array('theme_id' => $this->t_id, 'member_id' => $_SESSION['member_id']))->find();
         if (empty($like_info)) {
             $data['theme_nolike'] = 1;
         } else {
             $data['theme_nolike'] = 0;
         }
     }
     if (strtoupper(CHARSET) == 'GBK') {
         $data = Language::getUTF8($data);
     }
     echo json_encode($data);
     exit;
 }
Exemplo n.º 4
0
 public function index()
 {
     if (IS_CLI) {
         $data = M('Content')->field("id,content")->select();
         foreach ($data as $value) {
             $value['content'] = ubb($value['content']);
             M('Content')->save($value);
         }
     } else {
         $category = D('Category')->getTree();
         $lists = D('Document')->lists(null);
         $this->assign('category', $category);
         //栏目
         $this->assign('lists', $lists);
         //列表
         $this->assign('page', D('Document')->page);
         //分页
         $this->display();
     }
 }
Exemplo n.º 5
0
    $start = ($page - 1) * $index_num;
    $query = $db->query("SELECT * FROM et_content WHERE privacy=0 && replyshow=1 ORDER BY posttime DESC LIMIT {$start},{$index_num}");
    while ($data = $db->fetch_array($query)) {
        $indexnum++;
        $content[] = array('content_id' => $data['content_id'], 'user_id' => $data['user_id'], 'user_name' => $data['user_name'], 'user_nickname' => $data['user_nickname'], 'user_head' => $data['user_head'], 'content_body' => ubb($data['content_body']), 'posttime' => timeop($data['posttime']), 'type' => $data['type'], 'status_id' => $data['status_id'], 'status_uname' => $data['status_uname'], 'status_unickname' => $data['status_unickname'], 'replytimes' => $data['replytimes'], 'zftimes' => $data['zftimes']);
    }
    echo loadindex($content);
    exit;
}
//新信息
if ($act == 'getupdate') {
    $lastid = $_GET['lastid'];
    if ($lastid > 0) {
        $query = $db->query("SELECT * FROM et_content WHERE privacy=0 && replyshow=1 && content_id>'{$lastid}'");
        while ($data = $db->fetch_array($query)) {
            $content[] = array('content_id' => $data['content_id'], 'user_id' => $data['user_id'], 'user_name' => $data['user_name'], 'user_nickname' => $data['user_nickname'], 'user_head' => $data['user_head'], 'content_body' => ubb($data['content_body']), 'posttime' => timeop($data['posttime']), 'type' => $data['type'], 'status_id' => $data['status_id'], 'status_uname' => $data['status_uname'], 'status_unickname' => $data['status_unickname'], 'replytimes' => $data['replytimes'], 'zftimes' => $data['zftimes']);
        }
    }
    echo loadindex($content);
    exit;
}
//上榜
$query = $db->query("SELECT user_name,nickname,user_head FROM et_users WHERE indextop=1 ORDER BY rand() LIMIT 7");
while ($data = $db->fetch_array($query)) {
    $data['user_head'] = $data['user_head'] ? "{$webaddr}/attachments/head/" . $data['user_head'] : "{$webaddr}/images/noavatar.jpg";
    $indextop[] = array('user_name' => $data['user_name'], 'nickname' => $data['nickname'], 'user_head' => $data['user_head']);
}
//在线用户 放入memcache 半小时更新
$query = $db->query("SELECT user_id,user_name,nickname,user_head FROM et_users WHERE last_login>='" . ($addtime - 600) . "' ORDER BY last_login DESC LIMIT 12");
while ($data = $db->fetch_array($query)) {
    $uhead = $data[user_head] ? "{$webaddr}/attachments/head/" . $data[user_head] : "{$webaddr}/images/noavatar.jpg";
Exemplo n.º 6
0
function str($msg)
{
    global $admin;
    if (!$admin[html]) {
        $msg = htmlspecialchars($msg);
    }
    if ($admin[ubb]) {
        $msg = ubb($msg);
    }
    $msg = nl2br($msg);
    #处理message
    $msg = str_replace("\n", "", $msg);
    #处理message
    $msg = str_replace("\r", "", $msg);
    #处理message
    return $msg;
}
Exemplo n.º 7
0
function iCMS_comment($vars, &$iCMS)
{
    if (!$iCMS->config['iscomment']) {
        return false;
    }
    $mid = isset($vars['mid']) ? (int) $vars['mid'] : "0";
    if (isset($vars['call'])) {
        $iCMS->assign('mid', $mid);
        if (in_array($vars['call'], array('js', 'frame'))) {
            echo $iCMS->iPrint("iSYSTEM", "comment_show_" . $vars['call']);
        }
    } else {
        if (isset($vars['editor']) && $iCMS->config['iscomment']) {
            $width = $vars['width'] ? $vars['width'] : '98%';
            $height = $vars['height'] ? $vars['height'] : '140';
            if ($vars['editor'] == 'yes') {
                $iCMS->assign('iseditor', true);
            } else {
                $iCMS->assign('iseditor', false);
                $iCMS->assign('style', array('width' => $width, 'height' => $height));
            }
            $iCMS->assign('isanonymous', $iCMS->config['anonymous']);
            $iCMS->assign('title', $iCMS->get['title']);
            $iCMS->assign('aid', (int) $iCMS->get['id']);
            echo $iCMS->iPrint("iSYSTEM", "comment.editor");
        } else {
            $cacheTime = isset($vars['time']) ? (int) $vars['time'] : -1;
            $maxperpage = isset($vars['row']) ? (int) $vars['row'] : "10";
            $whereSQL = "`mid`='{$mid}' and `isexamine`='1'";
            isset($vars['sortid']) && ($whereSQL .= " and `sortid`='" . (int) $vars['sortid'] . "'");
            $iCMS->get['id'] && $vars['type'] != 'all' && ($whereSQL .= " AND `aid`='" . (int) $iCMS->get['id'] . "'");
            switch ($vars['orderby']) {
                case "hot":
                    $orderSQL = " ORDER BY up+against DESC";
                    break;
                case "new":
                    $orderSQL = " ORDER BY `addtime` DESC";
                    break;
                default:
                    $orderSQL = " ORDER BY `id` DESC";
            }
            $total = $iCMS->db->getValue("SELECT count(*) FROM `#iCMS@__comment` WHERE {$whereSQL}");
            $offset = 0;
            if ($vars['page']) {
                $pagenav = isset($vars['pagenav']) ? $vars['pagenav'] : "pagenav";
                $pnstyle = isset($vars['pnstyle']) ? $vars['pnstyle'] : 0;
                $offset = $iCMS->multi(array('total' => $total, 'perpage' => $maxperpage, 'unit' => $iCMS->language('page:comment'), 'url' => $iCMS->url, 'nowindex' => $GLOBALS['page'], 'pagenav' => $pagenav, 'pnstyle' => $pnstyle));
            }
            if ($vars['cache'] == false || isset($vars['page'])) {
                $iCMS->config['iscache'] = false;
                $rs = '';
            } else {
                $iCMS->config['iscache'] = true;
                $cacheName = 'comment/' . md5($whereSQL . $orderSQL);
                $rs = $iCMS->cache($cacheName);
            }
            if (empty($rs)) {
                include_once iPATH . 'include/ubb.fun.php';
                $rs = $iCMS->db->getArray("SELECT * FROM `#iCMS@__comment` WHERE {$whereSQL}{$orderSQL} LIMIT {$offset},{$maxperpage}");
                //echo $iCMS->db->last_query;
                //$iCMS->db->last_query='explain '.$iCMS->db->last_query;
                //$explain=$iCMS->db->getRow($iCMS->db->last_query);
                //var_dump($explain);
                $_count = count($rs);
                $ln = $GLOBALS['page'] - 1 < 0 ? 0 : $GLOBALS['page'] - 1;
                for ($i = 0; $i < $_count; $i++) {
                    $rs[$i]['title'] = $rs[$i]['atitle'];
                    $rs[$i]['url'] = ($iCMS->config['ishtm'] ? $iCMS->config['url'] . '/' : $iCMS->dir) . 'comment.php?aid=' . $rs[$i]['aid'] . '&mid=' . $rs[$i]['mid'] . '&sortid=' . $rs[$i]['sortid'];
                    $rs[$i]['lou'] = $total - ($i + $ln * $maxperpage);
                    $rs[$i]['content'] = ubb($rs[$i]['contents']);
                    $rs[$i]['contents'] = cQuote($rs[$i]['quote']) . $rs[$i]['content'];
                    if ($rs[$i]['reply']) {
                        $reply = explode('||', $rs[$i]['reply']);
                        $rs[$i]['reply'] = $reply[0] == 'admin' ? '<strong>' . $iCMS->language('reply:admin') . '</strong>' . $reply[1] : '<strong>' . $iCMS->language('reply:author') . '</strong>' . $reply[1];
                    }
                }
                $iCMS->cache(false)->addcache($cacheName, $rs, $cacheTime);
            }
            $iCMS->assign('title', $iCMS->get['title']);
            return $rs;
        }
    }
}
Exemplo n.º 8
0
function readFiles($a)
{
    $fname = explode("/", $a);
    $fnameNums = count($fname);
    $fname = $fname[$fnameNums - 1];
    if (strcmp($fname, "loaddir.php") == 0) {
        echo "<script>alert('不能编辑该文件!');location.href='loaddir.php';</script>";
    }
    //$exts=substr($a,-3);
    $exts = explode(".", $a);
    $extsNums = count($exts);
    $exts = $exts[$extsNums - 1];
    if ($exts == "php" || $exts == "asp" || $exts == "txt" || $exts == "html" || $exts == "aspx" || $exts == "jsp" || $exts == "htm") {
        $handle = @fOpen($a, "r");
        if ($handle) {
            echo "<h3>修改文件:{$a}</h3>";
            echo "<form action='loaddir.php?action=doedit&urlstr={$a}' method='post'><textarea style='width:99%;height:300px;margin-left:auto;margin-right:auto;' name='content'>";
            while (!fEof($handle)) {
                //$buffer=fGets($handle);
                //echo ubb(mb_convert_variables(fGets($handle),"gb2312","gb2312,utf-8"));
                //echo ubb(mb_convert_encoding(fGets($handle),"gb2312","utf-8,gb2312"));
                echo ubb(mb_convert_encoding(fGets($handle), "utf-8", "auto"));
                //echo ubb(iconv("utf-8,gb2312","gb2312",fGets($handle)));
                //echo ubb(fGets($handle));
            }
            fClose($handle);
            echo "</textarea><h3><input type='submit' value='修改' /></h3></form>";
        } else {
            //echo "文件不存在或不可用";
            echo "<script>alert('文件不存在或不可用');location.href='loaddir.php';</script>";
        }
    } else {
        //echo "不能编辑该文件";
        echo "<script>alert('不能编辑该文件');location.href='loaddir.php';</script>";
    }
}
Exemplo n.º 9
0
        echo "信息删除失败,可能网络错误或者您没有删除的权限!";
        exit;
    }
}
$i = 0;
$start = ($page - 1) * $home_num;
$sql = "SELECT s.content_id,s.content_body,s.posttime,s.type,s.status_id,s.status_uname,s.status_type,u.user_id,u.user_name,u.user_head,t.topic_id,t.topic_body,t.open FROM et_users AS u,et_content AS s left join et_topic AS t on s.topicid=t.topic_id && t.open=1 where s.user_id=u.user_id && s.user_id='{$user['user_id']}' order by s.content_id desc limit {$start},{$home_num}";
$query = $db->query($sql);
while ($data = $db->fetch_array($query)) {
    $i = $i + 1;
    $contentid = $data['content_id'];
    $home_uid = $data['user_id'];
    $home_uname = $data['user_name'];
    $home_uhead = $data['user_head'] ? "{$webaddr}/attachments/head/" . $data['user_head'] : "{$webaddr}/images/noavatar.jpg";
    $content = $data['content_body'];
    $content = ubb($content);
    $posttime = timeop($data['posttime']);
    $statusid = $data['status_id'];
    $status_uname = $data['status_uname'];
    $status_type = $data['status_type'];
    $type = $data['type'];
    $topic_body = $data['topic_body'] ? "<a href='{$webaddr}/op/topic/{$data['topic_id']}' style='text-decoration:none;'><font color='red'>[" . $data['topic_body'] . "]</font></a>&nbsp;" : "";
    $home[] = array("contentid" => $contentid, "home_uid" => $home_uid, "home_uname" => $home_uname, "home_uhead" => $home_uhead, "content" => $content, "posttime" => $posttime, "type" => $type, "statusid" => $statusid, "status_uname" => $status_uname, "status_type" => $status_type, "topic_body" => $topic_body);
}
$sql = "select count(*) AS count from et_content where user_id='{$user['user_id']}'";
$query = $db->query($sql);
$row = $db->fetch_array($query);
$total = $row['count'];
$pg_num = $total / $home_num;
$pg_num = intval($pg_num);
if ($total != $pg_num * $home_num) {
Exemplo n.º 10
0
function artikelInOrde($artikel)
{
    $artikel = stripslashes($artikel);
    $artikel = ubb($artikel);
    $artikel = nl2br($artikel);
    return $artikel;
}
                ?>
<a href="mailto:<?php 
                echo $data['email'];
                ?>
"><?php 
            }
            echo stripslashes($data['name']);
            if ($data['showEmail'] == 1) {
                ?>
</a><?php 
            }
            ?>
 wrote <?php 
            $date = new DateTime($data['time']);
            echo 'on ' . $date->format("l") . " the " . $date->format("jS") . " around " . $date->format("h:s a") . "</div>";
            $message = ubb(nl2br(stripslashes(htmlentities(valid($data['message'])))));
            echo '<div class="content">';
            if ($data['enableEmoticons'] == 1) {
                echo emoticons($message);
            }
            if ($data['enableEmoticons'] == 0) {
                echo $message;
            }
            echo '</div>';
            ?>
   	</div>
    <?php 
        }
        echo '</div>';
        echo "<div id='pagination'>";
        if ($pid > 1) {
Exemplo n.º 12
0
        $content = $back['content'];
        $uids = $back['uids'];
        $content = daddslashes($content);
        $content = $content . $morecontent;
        $db->query("INSERT INTO et_content (user_id,user_name,user_nickname,user_head,content_body,posttime,privacy) VALUES ('{$my['user_id']}','{$my['user_name']}','{$my['nickname']}','{$my['user_head']}','{$content}','{$addtime}','{$privacy}')");
        $insertid = mysql_insert_id();
        if ($insertid) {
            for ($i = 0; $i < count($uids); $i++) {
                $db->query("UPDATE et_users SET replyread = replyread+1 WHERE user_id='{$uids[$i]}'");
                $db->query("INSERT INTO et_replyto (user_id,content_id) VALUES ('{$uids[$i]}','{$insertid}')");
            }
            if ($privacy == 0) {
                $db->query("UPDATE et_users SET msg_num=msg_num+1,lastcontent='{$content}',lastconttime='{$addtime}' WHERE user_id='{$my['user_id']}'");
            }
        }
        echo loadoneli($insertid, $my[user_name], $my[user_id], $my[nickname], $my[user_head], ubb($content), '刚才', '网页', 0, 0, $privacy, 0, 0, 0, $privacy);
        exit;
    } else {
        echo 'error';
        exit;
    }
}
//上传照片
if ($action == 'uploadphoto') {
    tologin();
    if ($_FILES['photo']['name']) {
        include ET_ROOT . "/include/uploadpic.func.php";
        $ptname = date(YmdHms);
        $upname = UploadImage("photo", 1, 200, 0, ET_ROOT . "/attachments/photo/user_" . $my[user_id] . "/", ET_ROOT . "/attachments/photo/user_" . $my[user_id] . "/", $ptname, $ptname . "_thumb");
        $phototitle = $phototitle ? $phototitle : "{$ptname}";
        $suffix = getfiletype($upname);
Exemplo n.º 13
0
 /**
  * GET 问题详情
  */
 public function questionOp()
 {
     // 问题信息
     $question_id = intval($_GET['q_id']);
     if ($question_id > 0) {
         $this->questionInfo($question_id);
         $data = $this->question_info;
         $model = Model();
         // 访问数增加
         $model->table('circle_theme')->update(array('theme_id' => $question_id, 'theme_browsecount' => array('exp', 'theme_browsecount+1')));
         $data['theme_content'] = ubb($data['theme_content']);
         if ($data['theme_edittime'] != '') {
             $data['theme_edittime'] = @date('Y-m-d H:i', $data['theme_edittime']);
         }
         $data['member_avatar'] = getMemberAvatarForID($data['member_id']);
         if (strtoupper(CHARSET) == 'GBK') {
             $data = Language::getUTF8($data);
         }
         output_data(array('questionInfo' => $data));
         die;
     } else {
         output_error("问题id错误");
         die;
     }
 }
Exemplo n.º 14
0
<div class="top"></div>
<div class="cont">
<?php 
    $replys = array();
    $rnum = 0;
    $query = $db->query("SELECT * FROM et_content WHERE status_id='{$cid}' ORDER BY content_id");
    while ($data = $db->fetch_array($query)) {
        $rep = '';
        $rnum++;
        if ($my['user_id'] && $my['user_id'] != $data['user_id']) {
            $rep = "<a href='javascript:void(0)' style='float:right' onclick=\"replyajaxin('{$cid}','{$data[user_nickname]}')\">回复</a>";
        }
        if ($my['user_id'] && $my['user_id'] == $data['user_id']) {
            $rep = '<a href="javascript:void(0)" style="float:right" onclick="delmsg(\'' . $webaddr . '/index.php?act=del&cid=' . $data[content_id] . '\',\'确实要删除此条TALK吗?\',this.parentNode.parentNode.parentNode.parentNode)">删除</a>';
        }
        $content = ubb($data['content_body']);
        $replys[] = '<li class="lire">
        <div class="images"><a href="' . $webaddr . '/' . $data['user_name'] . '"><img src="' . $data['user_head'] . '" width="30px"></a></div>
        <div class="info">
            <p><a class="username" href="' . $webaddr . '/' . $data['user_name'] . '">' . $data['user_nickname'] . '</a><span class="setgray">' . timeop($data['posttime']) . '&nbsp;' . $rep . '</span></p>
            <p>' . $content . '</p>
        </div>
        </li>';
    }
    $replynums = count($replys);
    $replyshow = implode(' ', $replys);
    if ($replynums > 5) {
        $allreply = '<div id="all_' . $cid . '" style="display:none">' . $replyshow . '</div>';
        $showall = '<li style="padding-bottom:0px"><a href="##" onclick="showallreply(\'' . $cid . '\')">显示中间 ' . ($replynums - 4) . ' 条消息</a></li>' . $allreply;
        $replyshow = $replys[0] . $replys[1] . $showall . $replys[$replynums - 2] . $replys[$replynums - 1];
    }
tologin();
if ($action == 'follow') {
    $follow = $_POST['follow'];
    $follownew = array();
    for ($i = 0; $i < count($follow); $i++) {
        $isfriend = isfriend($follow[$i], $my[user_id]);
        if ($isfriend == 0 && $follow[$i] != $my[user_id]) {
            $follownew[] = $follow[$i];
        }
    }
    if ($follownew) {
        for ($j = 0; $j < count($follownew); $j++) {
            $db->query("INSERT INTO et_friend  (fid_jieshou,fid_fasong) VALUES ('{$follownew[$j]}','{$my['user_id']}')");
            frinum($my[user_id]);
            frinum($follownew[$j]);
        }
    }
    header("location: {$webaddr}/op/setting");
    exit;
}
$query = $db->query("SELECT * FROM et_users WHERE user_id=1 || (followme_num>0 && lastconttime>0) ORDER BY followme_num DESC LIMIT 10");
while ($data = $db->fetch_array($query)) {
    $uhead = $data['user_head'] ? "{$webaddr}/attachments/head/" . $data['user_head'] : "{$webaddr}/images/noavatar.jpg";
    $follows[] = array('user_id' => $data['user_id'], 'user_name' => $data['user_name'], 'nickname' => $data['nickname'], 'user_head' => $uhead, 'lastcontent' => ubb($data['lastcontent']), 'lastconttime' => timeop($data['lastconttime']), 'followme_num' => $data['followme_num'], 'msg_num' => $data['msg_num']);
}
//模板和Foot
$web_name3 = "新来乍到";
$sqlnum = $db->querynum;
$mtime = explode(' ', microtime());
$loadtime = $mtime[1] + $mtime[0] - $starttime;
include $template->getfile('op_guide.htm');
Exemplo n.º 16
0
<h1>gastenboek</h1>
<?php 
$mapSmileys = "../images/smileys/";
if (isset($_GET['action'])) {
    $toegelaten = array('gastenboek_verwijderen', 'gastenboek_meer');
    if (in_array($_GET['action'], $toegelaten) && file_exists($_GET['action'] . '.php')) {
        include $_GET['action'] . '.php';
    } else {
        include '../error.php';
    }
} else {
    $query = mysql_query("SELECT * FROM gastenboek ORDER BY id DESC") or die(mysql_error());
    if (mysql_num_rows($query) < 1) {
        echo '<h6>Er zijn nog geen berichten in het gastenboek aanwezig</h6>';
    } else {
        $nummer = 1;
        echo '<div class="gbItem">';
        echo '<table border="0" cellpadding="0" cellspacing="0" style="width: 574px;">';
        while ($rij = mysql_fetch_array($query)) {
            $color = $nummer % 2 == 0 ? 'E5E5E5' : 'DFDFDF';
            echo '<tr>';
            echo '<td style="border-bottom: 1px dashed #B0B0B0; background-color: #' . $color . '; width: 170px; padding: 5px;">' . $rij['naam'] . '</td>';
            echo '<td style="border-bottom: 1px dashed #B0B0B0; background-color: #' . $color . '; padding: 5px;"><a href="?pagina=gastenboek&amp;action=gastenboek_meer&amp;gastenboekId=' . $rij['id'] . '">' . ubb(afkorten($rij['bericht'], 50), $mapSmileys) . '</a></td>';
            echo '<td style="border-bottom: 1px dashed #B0B0B0; background-color: #' . $color . '; width: 10px; text-align: center; padding: 5px;"><a href="?pagina=gastenboek&amp;action=gastenboek_verwijderen&amp;gastenboekId=' . $rij['id'] . '" onclick="javascript:return confirm(\'Weet u zeker dat u het bericht van persoon \\n \\t' . $rij['naam'] . '\\n definitief wilt verwijderen? \\n Deze actie is onomkeerbaar!\')"><img src="../images/delete.png" width="15" height="15" border="0" alt="delete" title="delete" /></a></td>';
            echo '</tr>';
            $nummer++;
        }
        echo '</table></div>';
    }
}
    $db->query("DELETE FROM et_messages WHERE (senduid ='{$my['user_id']}' || sendtouid ='{$my['user_id']}') && message_id='{$_GET['mid']}'");
    echo "success";
    exit;
}
$i = 0;
$start = ($page - 1) * $home_num;
if ($pm == "my") {
    $sql = "SELECT * FROM et_messages WHERE sendtouid='{$my['user_id']}' order by message_id desc limit {$start},{$home_num}";
} elseif ($pm == "send") {
    $sql = "SELECT * FROM et_messages WHERE senduid='{$my['user_id']}' order by message_id desc limit {$start},{$home_num}";
}
$query = $db->query($sql);
while ($data = $db->fetch_array($query)) {
    $i++;
    $sendhead = $data['sendhead'] ? $data['sendhead'] : "{$webaddr}/images/noavatar.jpg";
    $messagebody = ubb($data['messagebody']);
    $isread = $data['isread'] ? 1 : 2;
    $mymsg[] = array("message_id" => $data['message_id'], "senduid" => $data['senduid'], "sendname" => $data['sendname'], "sendnickname" => $data['sendnickname'], "sendhead" => $sendhead, "messagebody" => $messagebody, "sendtouid" => $data['sendtouid'], "sendtoname" => $data['sendtoname'], "sendtonickname" => $data['sendtonickname'], "sendtime" => timeop($data['sendtime']), "isread" => $isread);
}
if ($my['priread'] != 0) {
    $db->query("UPDATE et_users SET priread = 0 WHERE user_id='{$my['user_id']}'");
    $db->query("UPDATE et_messages SET isread = 1 WHERE sendtouid='{$my['user_id']}'");
}
if ($pm == "my") {
    $total = getcount('et_messages', array('sendtouid' => $my[user_id]));
} elseif ($pm == "send") {
    $total = getcount('et_messages', array('senduid' => $my[user_id]));
}
$pg_num = ceil($total / $home_num);
//模板和Foot
$web_name3 = '我的私信';
Exemplo n.º 18
0
        $reply_content = $dataInfo['author'] . " {$strSideBarGuestBook}:<br /><br />" . ubb($dataInfo['content']);
    } else {
        $reply_content = "";
    }
    include "comments_add.inc.php";
} else {
    if ($action == "edit" && $mark_id != "") {
        //编辑信息类别。
        $title = "{$strGuestBookBrowse} - {$strRecordID}: {$mark_id}";
        $dataInfo = $DMC->fetchArray($DMC->query("select * from " . $DBPrefix . "guestbook where id='{$mark_id}'"));
        if ($dataInfo) {
            $logContent = str_replace("<br />", "", dencode($dataInfo['content']));
            //原内容
            $dataInfo = $DMC->fetchArray($DMC->query("select * from " . $DBPrefix . "guestbook where id='" . $dataInfo['parent'] . "'"));
            if ($dataInfo) {
                $reply_content = $dataInfo['author'] . " {$strSideBarGuestBook}:<br /><br />" . ubb($dataInfo['content']);
            } else {
                $reply_content = "";
            }
            include "comments_add.inc.php";
        } else {
            $error_message = $strNoExits;
            include "error_web.php";
        }
    } else {
        //查找和浏览
        $title = "{$strGuestBookBrowse}";
        if ($order == "") {
            $order = "postTime";
        }
        //Find condition
Exemplo n.º 19
0
    }
    ?>
 [<?php 
    echo $rs[$i]['ip'];
    ?>
]</th>
      <th width="47">时间:</th>
      <th width="390"><?php 
    echo get_date($rs[$i]['addtime'], 'Y-m-d H:i:s');
    ?>
</th>
      </tr>
    <tr>
      <td>评论:</td>
      <td colspan="4"><?php 
    echo ubb($rs[$i]['contents']);
    ?>
        <?php 
    if ($rs[$i]['reply']) {
        ?>
        <blockquote style="background-color:#F7F7F7;border:#E5E5E5 solid 1px; padding:4px;">
          <?php 
        echo $rs[$i]['reply'];
        ?>
        </blockquote>
      <?php 
    }
    ?>
<blockquote id="reply<?php 
    echo $rs[$i]['id'];
    ?>
        ?>
				<div style="padding-left:10px;word-break:break-all; table-layout: fixed;"><?php 
        echo $value['isSecret'] == 1 && $_SESSION['rights'] != "admin" ? $strGuestBookHidden : $gContent;
        ?>
 </div>
			<?php 
    }
    ?>
		</div>
		<?php 
    //取得回复
    $sub_sql = "select distinct a.*,b.id as member_id,b.nickname,b.isHiddenEmail,b.email as member_email,b.homePage as member_homepage from " . $DBPrefix . "guestbook as a left join " . $DBPrefix . "members as b on a.author=b.username where parent='" . $value['id'] . "' order by postTime";
    $query_result = $DMC->query($sub_sql);
    $arr_sub = $DMC->fetchQueryAll($query_result);
    foreach ($arr_sub as $fa) {
        $rContent = ubb($fa['content']);
        $icon_path = $fa['isSecret'] == 1 ? "images/icon_lock.gif" : "images/icon_reply.gif";
        //头像
        if ($settingInfo['gbface'] == 1) {
            $myIcons = empty($fa['face']) ? "images/avatars/1.gif" : "images/avatars/" . $fa['face'] . ".gif";
        } else {
            $myIcons = "";
        }
        if ($fa['member_id'] > 0) {
            $authorname = $fa['nickname'] != "" ? $fa['nickname'] : $fa['author'];
            $guestemail = $fa['isHiddenEmail'] == 0 || !empty($_SESSION['rights']) && $_SESSION['rights'] == 'admin' ? str_replace("@", "#", $fa['member_email']) : "";
            $guestemail = $guestemail != "" ? "<a href=\"mailto:{$guestemail}\" title=\"{$guestemail}\" target=\"_blank\">{$strShowEmail}</a>" : "";
            $guesthomeurl = $fa['member_homepage'] != "" ? "<a href=\"{$fa['member_homepage']}\" target=\"_blank\">{$strShowHomepage}</a>" : "";
            if (!empty($fa['member_homepage'])) {
                $fa['homepage'] = $fa['member_homepage'];
            }
Exemplo n.º 21
0
			<?php 
    if (isset($_COOKIE['username'])) {
        ?>
			<span>[<a href="#ree" name="reply_re" title="回复<?php 
        echo $i + ($page - 1) * $pagesize;
        ?>
楼的<?php 
        echo $re['username'];
        ?>
">回复</a>]</span></h3>
			<?php 
    }
    ?>
			<div class="detail">
				<?php 
    echo ubb($re['content']);
    ?>
			</div>
		
		</div>
	</div>
	<div id="line">
	</div>
<?php 
    $i++;
}
?>
	<div id="page_text">
		<ul>
			<li><?php 
echo $page;
Exemplo n.º 22
0
		<tr>
			<td valign="top" style="text-align: right;" class="gbHead"><strong>
				<?php 
        echo $rij['naam'];
        // verkorte if constructie
        // indien email en website zijn opgegeven worden ze weergegeven, anders niet
        // stripslashes zorgt voor het verwijderen van overbodige backslashes die voor
        // de escapes zorgden bij het in de tabel steken.
        echo $rij['email'] != '-' ? '<br />' . afkorten(stripslashes($rij['email']), 27) : '';
        echo $rij['website'] != '-' ? '<br /><a href="' . stripslashes($rij['website']) . '" target="_blank">' . afkorten(stripslashes($rij['website']), 27) . '</a>' : '';
        echo '<br />' . $rij['datum'];
        ?>
</strong>
			</td>
			<td valign="top" style="background-image: url('images/gastenboek.png'); background-position: 336px 0px; background-repeat: no-repeat;" class="gbBody"><?php 
        echo ubb(stripslashes($rij['bericht']), $mapSmileys);
        ?>
</td>
		</tr>
	</table>
</div>
		
<div class="gbItem">
	<table border="0" cellpadding="0" cellspacing="0" style="width: 574px;">
		<tr>
			<td>
				<a href="?pagina=gastenboek">Keer terug naar de index</a>
			</td>
			<td style="width: 10px; text-align: center; padding: 5px;">
				<a href="?pagina=gastenboek&amp;action=gastenboek_verwijderen&amp;gastenboekId=<?php 
        echo $rij['id'];
Exemplo n.º 23
0
 public function comment()
 {
     $Comment = D('Comment');
     if ($comment = $Comment->create()) {
         //dump($comment);
         $list = $Comment->add();
         if ($list) {
             // 更新评论数
             $objDao = D("Blog");
             $objDao->setInc('commentCount', "id='" . $comment["recordId"] . "'");
             // 返回客户端数据
             $comment["content"] = nl2br(ubb(trim($comment["content"])));
             $comment["id"] = $list;
             $this->ajaxReturn($comment, "评论成功!", 1);
         } else {
             $this->error("评论失败!");
         }
     } else {
         $this->error($Comment->getError());
     }
 }
Exemplo n.º 24
0
    } else {
        echo "ºÜ±§Ç¸£¬É¾³ýÆÀÂÛʧ°ÜÁË£¬";
        exit;
    }
}
$i = 0;
$start = ($page - 1) * $home_num;
$sql = "SELECT r.*,u.user_id,u.user_name,u.user_head FROM et_users AS u,et_sharereply AS r where r.user_id=u.user_id && r.share_id='{$sid}' order by r.shre_id desc limit {$start},{$home_num}";
$query = $db->query($sql);
while ($data = $db->fetch_array($query)) {
    $i = $i + 1;
    $shre_id = $data['shre_id'];
    $reuid = $data['user_id'];
    $reuname = $data['user_name'];
    $reuhead = $data['user_head'] ? "{$webaddr}/attachments/head/" . $data['user_head'] : "{$webaddr}/images/noavatar.jpg";
    $reply_body = ubb($data['reply_body']);
    $reply_time = timeop($data['reply_time']);
    $reply[] = array("shre_id" => $shre_id, "reuid" => $reuid, "reuname" => $reuname, "reuhead" => $reuhead, "reply_body" => $reply_body, "reply_time" => $reply_time);
}
$query = $db->query("select count(*) as count from et_sharereply where share_id='{$sid}'");
$row = $db->fetch_array($query);
$total = $row['count'];
$pg_num = $total / $index_num;
$pg_num = intval($pg_num);
if ($total != $pg_num * $index_num) {
    $pg_num = $pg_num + 1;
}
$np = $page + 1;
$pp = $page - 1;
if ($pg_num > 8) {
    if ($pg_num - $page <= 6) {
Exemplo n.º 25
0
				<tr>
					<td valign="top" style="text-align: right;" class="gbHead"><strong>
						<?php 
        echo $rij['naam'];
        // verkorte if constructie
        // indien email en website zijn opgegeven worden ze weergegeven, anders niet
        // stripslashes zorgt voor het verwijderen van overbodige backslashes die voor
        // de escapes zorgden bij het in de tabel steken.
        echo $rij['email'] != '-' ? '<br /><abbr title="' . $rij['email'] . '">' . afkorten($rij['email'], 27) : '</abbr>';
        echo $rij['website'] != '-' ? '<br /><a href="' . $rij['website'] . '" target="_blank"><abbr title="' . $rij['website'] . '">' . afkorten($rij['website'], 27) . '</abbr></a>' : '';
        echo '<br />' . $rij['datum'];
        ?>
</strong>
					</td>
					<td valign="top" style="background-image: url('images/gastenboek.png'); background-position: 336px 0px; background-repeat: no-repeat;" class="gbBody"><?php 
        echo ubb($rij['bericht'], $mapSmileys);
        ?>
</td>
				</tr>
			</table>
		</div>
	<?php 
        $nummer++;
    }
}
// NAVIGATIE
// enkel wanneer het aantal entries groter is dan het max aantal te tonen berichten
// moet de navigatie weergegeven worden
if ($aantalRijen > $max) {
    echo '<div class="gbPaginasOuter"><div class="gbPaginasInner" style="font-size: 12px;">';
    echo '<table border="0" cellspacing="0" cellpadding="0" style="width: 100%;"><tr><td style="width: 80px; text-align: left;" valign="top">';
Exemplo n.º 26
0
      </tbody>
      <?php 
}
?>
      <thead>
        <tr class="space">
          <th colspan="3"><?php 
echo $lang['circle_theme_content'];
?>
</th>
        </tr>
      </thead>
      </tbody>
        <tr class="noborder">
          <td colspan="3"><?php 
echo ubb($output['theme_info']['theme_content']);
?>
</td>
        </tr>
      </tbody>
      <tfoot>
        <tr class="space">
          <th colspan="3"><?php 
echo $lang['nc_handle'];
?>
</th>
        </tr>
        <tr class="tfoot">
          <td colspan="3">
            <a href="index.php?act=circle_theme&op=theme_reply&t_id=<?php 
echo $output['theme_info']['theme_id'];
Exemplo n.º 27
0
function formatBlogContent($content, $attr, $logId, $statichtml = 0)
{
    global $settingInfo, $DMC;
    $content = str_replace("../attachments", "attachments", $content);
    $content = str_replace("../editor", "editor", $content);
    $content = preg_replace("/alt=\"open_img\\(&#39;(.+?)&#39;\\)\"/is", "style=\"cursor:pointer;\" onclick=\"open_img(&#39;\\1&#39;)\" alt=\"\\1\"", $content);
    $content = preg_replace("/alt=\"open_img\\(&amp;#39(.+?)&amp;#39\\)\"/is", "style=\"cursor:pointer;\" onclick=\"open_img(&#39;\\1&#39;)\" alt=\"\\1\"", $content);
    $content = preg_replace("/alt=\"open_img\\('(.+?)'\\)\"/is", "style=\"cursor:pointer;\" onclick=\"open_img(&#39;\\1&#39;)\" alt=\"\\1\"", $content);
    if ($attr == 0) {
        //展开与隐藏,首页才隐藏,阅读的时候全展开。
        $content = preg_replace("/<!--hideBegin-->(.+?)<!--hideEnd-->/ie", "makeMoreLess('\\1')", $content);
    }
    if (preg_match("/\\[.+?\\]/i", $content)) {
        $content = ubb($content);
    }
    if (preg_match("/<!--(.*?)Begin-->(.+?)<!--(.*?)End-->/i", $content)) {
        $reg_search = array("/<!--musicBegin-->(.+?)<!--musicEnd-->/ie", "/<!--galleryBegin-->(.+?)<!--galleryEnd-->/ie", "/<!--mfileBegin-->(.+?)<!--mfileEnd-->/ie", "/<!--fileBegin-->(.+?)<!--fileEnd-->/ie", "/<!--fileBegin-->(.+?)<!--fileEnd-->/ie");
        $reg_replace = array("makemusic('\\1')", "makegallery('\\1')", "makemfile('\\1',{$statichtml})", "makefile('\\1',{$statichtml})");
        $content = preg_replace($reg_search, $reg_replace, $content);
    }
    //插件
    $content = do_filter("f2_content", $content, $logId);
    //自动转换连接,非常耗时
    if ($settingInfo['autoUrl'] == 1) {
        $content = preg_replace("/([^\\/\"\\'\\=\\>&#39;&quot;])(mms|http|ftp|telnet)\\:\\/\\/(.[^ \r\n\\<\"\\'\\)]+)/is", "\\1<a href=\"\\2://\\3\" target=\"_blank\">\\2://\\3</a>", $content);
    }
    //显示关键字,非常耗时
    if ($settingInfo['showKeyword'] == 1) {
        $content = repKeyword($content);
    }
    //mysql4.0下
    if ($DMC->getServerInfo() < '4.1') {
        $content = stripslashes($content);
    }
    return $content;
}
Exemplo n.º 28
0

				</td>
				<td nowrap align="center" class="subcontent-td" valign="top">
				  <?php 
            echo $imgHidden;
            ?>
				</td>
				<td nowrap align="center" class="subcontent-td" valign="top">
				  <?php 
            echo format_time("L", $fa['postTime']);
            ?>
				</td>
				<td class="subcontent-td" valign="top">
				  <?php 
            echo ubb($fa['content']);
            ?>
				</td>
				<td nowrap class="subcontent-td" valign="top">
				  <?php 
            echo $fa['author'];
            ?>
				</td>
				<td align="center" nowrap class="subcontent-td" valign="top">
				  <?php 
            echo $fa['ip'];
            ?>
				</td>
			  </tr>
			  <?php 
        }
Exemplo n.º 29
0
        ?>
')){location.href='index.php?act=circle_theme&op=theme_replydel&t_id=<?php 
        echo $output['t_id'];
        ?>
&r_id=<?php 
        echo $val['reply_id'];
        ?>
';}else{return false;}"><?php 
        echo $lang['nc_del'];
        ?>
</a></td>
        </tr>
        <tr style="display: none">
          <td></td>
          <td colspan="20"><?php 
        echo ubb($val['reply_content']);
        ?>
</td>
        </tr>
        <?php 
    }
    ?>
        <?php 
} else {
    ?>
        <tr class="no_data">
          <td colspan="10"><?php 
    echo $lang['nc_no_record'];
    ?>
</td>
        </tr>
Exemplo n.º 30
-1
 function insert()
 {
     $userId = Session::get(C('USER_AUTH_KEY'));
     $recordId = intval($_POST['recordId']);
     if ($_POST['module'] == "Blog") {
         $dao = D('Blog');
         if ($blog = $dao->getById($recordId)) {
             $toUserId = $blog->userId;
             $blogTitle = $blog->title;
         } else {
             $this->error("文章不存在,无法回复!", false);
         }
     } else {
         if ($_POST['module'] == "Photo") {
             $dao = D('Photo');
             if ($photo = $dao->getById($recordId)) {
                 $toUserId = $photo->userId;
                 $photoPath = $photo->imagePath;
             } else {
                 $this->error("图片不存在,无法回复!", false);
             }
         }
     }
     $dao = D("Comment");
     $vo = $dao->create();
     $vo->cTime = time();
     $vo->userId = $userId;
     if ($result = $dao->add($vo)) {
         if ($vo->replyType == 0) {
             $map = new HashMap();
             $map->put('replyId', $result);
             $replyId = $dao->save($map, "id='{$result}'");
         }
         $content = ubb($vo->content);
         if ($_POST['module'] == 'Blog') {
             /* add_user_feed */
             $feedTitle = "评论了日志:<a href=\"/blog/{$recordId}\">{$blogTitle}</a>";
             $feedInfo = '<div class="share-comment"><p>' . $content . '</p></div>';
             $this->addUserFeed($userId, 'add', 'comment', $recordId, $feedTitle, $feedInfo);
             /* /add_user_feed */
             $this->addUserAlert($toUserId, "reply" . $_POST['module'], $_POST['recordId']);
         } elseif ($_POST['module'] == 'Photo') {
             /* add_user_feed */
             $feedTitle = "评论了照片:";
             $feedInfo = "<p class=\"image\"><a href=\"/photo/{$recordId}\"><img src=\"" . WEB_PUBLIC_URL . "/Thumb/?w=100&h=100&url={$photoPath}\" alt=\"照片\" /></a></p>" . '<div class="share-comment"><p>' . $content . '</p></div>';
             $this->addUserFeed($userId, 'add', 'comment', $recordId, $feedTitle, $feedInfo);
             /* /add_user_feed */
             $this->addUserAlert($toUserId, "reply" . $_POST['module'], $_POST['recordId']);
         }
         //$this->success('回复成功!');
         if ($_POST['module'] == 'Board') {
             header("Location:" . __APP__ . "/Board");
         } else {
             echo $result;
         }
     } else {
         //$this->error('回复失败!');
         echo false;
     }
 }