tag출력갯수 제한하기

tag출력갯수 제한하기

QA

tag출력갯수 제한하기

본문

tag기능을 아래처럼 쓰고 있는데 태그의 입력갯수대로 출력되는것을

몇개만 출력되도록 하고 싶은데 가능할까요?

 


<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
if (!$board['bo_use_tag']) return;

if(!sql_query(" DESC ".COMP_TAG, false)) {
    $que = "
        create table ".COMP_TAG."(
        ct_idx  int not null auto_increment,
        bo_table varchar(20) not null default '' comment '게시판코드',
        wr_id int not null default '0' comment '게시판시퀀스', 
        ct_tag varchar(100) not null default '' comment '태그', 
        ct_ip varchar(25) not null default '' comment 'ip', 
        ct_regdate datetime not null default '0000-00-00 00:00:00', 
        primary key( ct_idx ) , 
        index ".COMP_TAG."_index1(ct_tag) 
        ) comment '태그테이블'";
    sql_query( $que, false );
}
$que    =    "alter table ".$write_table." add column tags varchar(200) default '' comment '태그'";
sql_query( $que , false );    
$arrtag = explode(",", $list[$i]['tags']);
if( $list[$i]['tags'] ){
?>
<style>
.comp_tags_view {
    -moz-border-bottom-colors: none;
    -moz-border-left-colors: none;
    -moz-border-right-colors: none;
    -moz-border-top-colors: none;
    /*background: #f7f7f7 url("<?php echo G5_TAG_URL?>/img/tag.jpg") no-repeat scroll 15px 50%;*/
    border-color: -moz-use-text-color #e4e4e4 #e4e4e4;
    border-image: none;
    border-style: #ccc solid;
    border-width: medium 1px 1px;
    /*padding: 15px 37px;*/
}
.comp_tags_view a {
    border: 1px solid #ffc740;
    border-radius:3px;
    color: #9db4c2;
    display: inline-block;
    font-size: 0.92em;
    letter-spacing: -1px;
    padding: 3px 5px;
}
.comp_tags_view a:hover {
    background: #3baeff none repeat scroll 0 0;
    border: 1px solid #3baeff;
    color: #fff;
    text-decoration: none;
}
</style>
<!-- 태그목록 -->
<div class="comp_tags comp_tags_view">  
    <?php foreach( $arrtag as $key => $val ){ $val = trim($val);?>
    
    <a href="<?php echo G5_BBS_URL?>/board.php?bo_table=<?php echo $bo_table?>&sfl=tags&stx=<?php echo $val?>">
        <?php echo $val?>
    </a>
    
    <?php }?>
</div>
<!-- //태그목록 -->
<? } else { ?>
<div class="comp_tags comp_tags_view"><a>no tag</a></div>
<? } ?>

이 질문에 댓글 쓰기 :

답변 1

몇개의 태그를 노출하고자 하는건지 정확한 답변이 파악이 되지 않습니다.

정확히 원하시는 내용을 기입해 주셔야 정확한 답변을 얻으실수 있을듯 합니다.

답변을 작성하시기 전에 로그인 해주세요.
전체 179
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT