/** * 코멘트 최근리스트 표시 by emc * * 2012.04.02 자유게시판 이하 게시판들 추가 by 웅파 * * @access private : 접근형태 * @return String $return_val : 문자렬 */ function comment_list() { // 2011-09-30 order by limit 추가 6초대에서 0.03초대로.. by 웅파 $this->db->cache_on(); $sql = "SELECT b.nickname, a.table, a.tbn, a.no, a.original_no, a.contents, a.user_name, a.user_id, a.reg_date from ( "; $sql .= "(SELECT 'CI 묻고 답하기' as 'table', 'qna' as 'tbn', no, original_no, contents, user_name, user_id, reg_date FROM board_qna WHERE is_delete = 'N' and original_no != '0' order by no desc limit 7 ) UNION "; $sql .= "(SELECT 'TIP게시판' as 'table', 'tip' as 'tbn', no, original_no, contents, user_name, user_id, reg_date FROM board_tip WHERE is_delete = 'N' and original_no != '0' order by no desc limit 7 ) UNION "; $sql .= "(SELECT '강좌게시판' as 'table', 'lecture' as 'tbn', no, original_no, contents, user_name, user_id, reg_date FROM board_lecture WHERE is_delete = 'N' and original_no != '0' order by no desc limit 7 ) UNION "; $sql .= "(SELECT 'CI 코드' as 'table', 'source' as 'tbn', no, original_no, contents, user_name, user_id, reg_date FROM board_source WHERE is_delete = 'N' and original_no != '0' order by no desc limit 7 ) UNION "; $sql .= "(SELECT 'CI 뉴스' as 'table', 'news' as 'tbn', no, original_no, contents, user_name, user_id, reg_date FROM board_news WHERE is_delete = 'N' and original_no != '0' order by no desc limit 7 ) UNION "; $sql .= "(SELECT '공지사항' as 'table', 'notice' as 'tbn', no, original_no, contents, user_name, user_id, reg_date FROM board_notice WHERE is_delete = 'N' and original_no != '0' order by no desc limit 7 ) UNION "; $sql .= "(SELECT '자유게시판' as 'table', 'free' as 'tbn', no, original_no, contents, user_name, user_id, reg_date FROM board_free WHERE is_delete = 'N' and original_no != '0' order by no desc limit 7 ) UNION "; $sql .= "(SELECT 'CI외 질문게시판' as 'table', 'etc_qna' as 'tbn', no, original_no, contents, user_name, user_id, reg_date FROM board_etc_qna WHERE is_delete = 'N' and original_no != '0' order by no desc limit 7 ) UNION "; $sql .= "(SELECT 'CI 사이트 소개' as 'table', 'ci_make' as 'tbn', no, original_no, contents, user_name, user_id, reg_date FROM board_ci_make WHERE is_delete = 'N' and original_no != '0' order by no desc limit 7 ) UNION "; $sql .= "(SELECT '구인구직' as 'table', 'job' as 'tbn', no, original_no, contents, user_name, user_id, reg_date FROM board_job WHERE is_delete = 'N' and original_no != '0' order by no desc limit 7 ) UNION "; $sql .= "(SELECT '광고 홍보' as 'table', 'ad' as 'tbn', no, original_no, contents, user_name, user_id, reg_date FROM board_ad WHERE is_delete = 'N' and original_no != '0' order by no desc limit 7 ) "; if ($this->session->userdata('auth_code') >= '7') { $sql .= " UNION (SELECT '개발자게시판' as 'table', 'ci' as 'tbn', no, original_no, contents, user_name, user_id, reg_date FROM board_ci WHERE is_delete = 'N' and original_no != '0' order by no desc limit 7 ) "; } $sql .= ") as a, users b where a.user_id=b.userid order by reg_date desc limit 7"; $rs = $this->db->query($sql); $this->db->cache_off(); $return_val = ' <div class="q_latest"> <ol class="q_latest_ol"> <li> <h4><a href="/search/recent_comment">최근 코멘트</a></h4> </li> <ul>'; foreach ($rs->result_array() as $list) { if ($list['nickname']) { $name = $list['nickname']; } else { $name = $list['user_name']; } $return_val .= ' <li> <div style="float:left;"> <img src="/images/main/arrow.gif"> <a href="/' . $list['tbn'] . '/view/' . $list['original_no'] . '/page/1#row_num_' . $list['no'] . '"> ' . strcut_utf8(strip_tags($list['contents']), 21) . ' </a>'; $return_val .= ' </div> <div style="float:right;">' . substr($list['reg_date'], 0, 10) . '</div> <div class="q_latest_line"></div> </li>'; } $return_val .= ' </ul> </ol>'; if ($rs->num_rows() == 0) { $return_val .= ' <div><br> 게시물이 없습니다. </div>'; } $return_val .= '</div><br>'; return $return_val; }
function GetPostList($board_Id, $pId, $pNo, $PPP, $tag, $searchParam, $searchOptions) { // Posts Per Page if ($pId == null || $pId == '') { $pId = -1; } $rawList = DBGetPostList($board_Id, $PPP, $pId, $pNo, $postCount, $newPage, $tag, GenerateSearchParam($searchOptions, $searchParam), $searchOptions); // all posts from DB $returnList; $permission = DBCheckBoardAccessibility($board_Id, $_SESSION['UserLevel']); $result['listSize'] = $PPP; $result['postCount'] = $postCount; $result['canPost'] = $permission; $result['canPin'] = $_SESSION['UserLevel'] < exec_level; $result['availableTags'] = DBGetBoardTags($board_Id); // Fill in $returnList for ($i = 0; $i < sizeof($rawList); $i++) { /* BEGIN BY: content cut fix */ $htmlContent = $rawList[$i]['content_original']; $htmlContentShortened = strcut_utf8($htmlContent, 1000); $pureContent = strcut_utf8(strip_tags($rawList[$i]['content_original']), 200); $pureContent = str_replace(' ', ' ', $pureContent); //$contentComplete = $rawList[$i]['content_original']; //$pureContentComplete = strcut_utf8($contentComplete, 1000); //$contentShortened = strcut_utf8($contentComplete, 1000); //$pureContentShortened = strcut_utf8(strip_tags($contentComplete), 1000); /* END BY */ $dateFormatted = format_date($rawList[$i]['date']); $returnList[$i]['postId'] = $rawList[$i]['post_no']; $returnList[$i]['canEdit'] = $rawList[$i]['user_id'] == $_SESSION['UserID']; $returnList[$i]['canComment'] = $_SESSION['UserLevel'] <= new_user_level; $returnList[$i]['authorUserId'] = $rawList[$i]['user_id']; $returnList[$i]['author'] = $rawList[$i]['user_name']; $returnList[$i]['authorEmail'] = $rawList[$i]['user_email']; $returnList[$i]['title'] = $rawList[$i]['title']; $returnList[$i]['date'] = $rawList[$i]['date']; $returnList[$i]['pinned'] = $rawList[$i]['pinned']; $returnList[$i]['date'] = $dateFormatted[0]; $returnList[$i]['epochtime'] = $rawList[$i]['date']; $returnList[$i]['fullDate'] = $dateFormatted[1]; if ($rawList[$i]['post_no'] == $pId) { // pId is specified and matched // - get content regardless of its length // - get all comments $returnList[$i]['comments'] = ListifyComments(DBGetUserComments($pId), -1); $returnList[$i]['content'] = $htmlContent; // BY: was $contentComplete; $returnList[$i]['pureContent'] = $pureContent; // BY: was $pureContentComplete; $returnList[$i]['isContentComplete'] = true; } else { if ($pId == -1 && $i == 0) { $returnList[$i]['comments'] = ListifyComments(DBGetUserComments($returnList[$i]['postId']), -1); $returnList[$i]['content'] = $htmlContent; // BY: was $contentComplete; $returnList[$i]['pureContent'] = $pureContent; // BY: was $pureContentComplete; $returnList[$i]['isContentComplete'] = true; } else { // pId does not match // - do not fetch comments // - isContentComplete is true ONLY when comments.count==0 and content.length<100 $returnList[$i]['comments'] = array(); $returnList[$i]['content'] = $htmlContentShortened; // BY: was $pureContentShortened; $returnList[$i]['pureContent'] = $pureContent; // BY: strip_tags($contentComplete); $isContentShortEnough = strlen($htmlContent) == strlen($htmlContentShortened); // BY: was (strlen($contentComplete)==strlen($contentShortened)); if ($isContentShortEnough == true && $rawList[$i]['comments'] == 0) { $returnList[$i]['isContentComplete'] = true; } else { $returnList[$i]['isContentComplete'] = false; } } } $returnList[$i]['commentCount'] = $rawList[$i]['comments']; $returnList[$i]['selectedTags'] = DBGetPostTags($returnList[$i]['postId']); } $result['currentPage'] = $newPage; $result['postPreviews'] = $returnList; /*for ($j = 0; $j < sizeof($returnList); $j ++) { echo $returnList[$j]['content']; echo " <p> "; }*/ return json_encode_unescaped($result); //return json_encode($result, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT); }
/<?php echo $lt['id']; ?> /page/<?php echo $page_account; ?> /<?php echo $search_url; echo $search_sfl; ?> " title="<?php echo $bubble_title; ?> "><?php echo $bl1; echo strcut_utf8(strip_tags($lt['subject']), 30); echo $bl2; ?> </a></a> </td> <td ><?php if ($lt['nickname']) { echo $lt['nickname']; } else { echo $lt['user_name']; } ?> </td> <td><?php echo substr($lt['reg_date'], 0, 10); ?>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="main_border"><tr><td> <table width="100%" border="0" cellspacing="1" cellpadding="0" id="inner_table"> <colgroup> <col width="50%" /> <col width="50%" /> </colgroup> <thead> <tr> <th><a href="<?php echo $view_prev['wr_subject']['href']?>">«이전글</a></th> <th><a href="<?php echo $view_next['wr_subject']['href']?>">다음글»</a></th> </tr> </thead> <tbody> <tr class="std_1"> <td class="center"><a href="<?php echo $view_prev['wr_subject']['href']?>"><strong><?php echo $view_prev['wr_subject']['text']?></strong> <?php echo strcut_utf8(strip_tags($view_prev['wr_content']),120)?></a></td> <td class="center"><a href="<?php echo $view_next['wr_subject']['href']?>"><strong><?php echo $view_next['wr_subject']['text']?></strong> <?php echo strcut_utf8(strip_tags($view_next['wr_content']),120)?></a></td> </tr> </tbody> </table> </td></tr></table> </div> </div><!--End Blog Div--> </div><!--End Blog Content--> <?php include $this->path_view('side.php')?> </div><!--End Blogs Container Bottom--> </div><!--End Blogs Container Top--> </div><!--End Blogs Container--> </div><!--End Blogs Container 5-->
<ul> <?php foreach($v['children'] as $vv) {?> <li><a href="<?php echo $vv['link']?>" <?php echo $vv['active']?'class="subcategory_active"':''?>><?php echo $vv['data']?> <span class="cnt">(<?php echo $vv['cnt']?>)</span></a></li> <?php }?> </ul> <?php }?> </li> <?php }?> </ul> </div><!-- .blog_right_links --> <h2>최근 댓글</h2> <div class="blog_right_links"> <ul> <?php foreach($comment as $v) {?> <li><a href="<?php echo Url::Get(array('wr_no'=>$v['wr_no']))?>"><?php echo strcut_utf8(strip_tags($v['cmt_content']), 50)?></a> <?php }?> </ul> </div><!-- .blog_right_links --> <h2>최신글</h2> <div class="blog_right_links"> <?php echo $latest?> </div><!-- .blog_right_links --> <h2>태그구름</h2> <div class="blog_right_links"><?php echo $tags?></div><!-- .blog_right_links --> <h2>게시글 저장소</h2> <div class="blog_right_links"> <ul>