최근게시물 스킨 v04 (도서게시판 v1.x 전용)
Skin 최근게시물 스킨
Version v04 (도서게시판 v1.x 전용)
Released on 2009/11/11
Modified on 2009/11/11
Made by Lovelet (http://www.lovelet.com)
Size 1.4 KB
Download(s) 92
View(s) 3054
  

[주의!] 최근게시물(영화게시판)을 적용하신 분께서는 outlogin.php파일을 수정하실 필요없습니다.

1. outlogin.php파일 수정하기

메모장 및 에디터플러스 등을 이용하여 위의 파일을 엽니다.
그 후에 맨 아랫부분의 ?> 바로 윗부분에 아래의 소스를 붙여넣기 합니다.

/*******************************************************
         * 최근 영화 목록 보여주기를 위한 함수 지정
******************************************************/
                function print_moviel($skinname, $title, $id, $num=5, $textlen=30, $memolen=130) {
                global $_zb_path, $_zb_url, $connect, $t_board, $admin_table;

                if(!$skinname||!$id||!$title) return;

                $str = zReadFile($_zb_path."latest_skin/".$skinname."/main.html");
                if(!$str) {
                        echo "지정하신 $skinname 이라는 최근목록 스킨이 존재하지 않습니다<br>";
                        return;
                }

                $setup = mysql_fetch_array(mysql_query("select use_alllist from $admin_table where name='$id'"));
                if($setup[use_alllist]) $target = "zboard.php?id=".$id;
                else $target = "view.php?id=".$id;

                $result = mysql_query("select * from $t_board"."_$id where is_secret=0 order by no desc limit $num", $connect) or die(mysql_error());

 

                $tmpStr = explode("[loop]",$str);
                $header = $tmpStr[0];
                $tmpStr2 = explode("[/loop]",$tmpStr[1]);
                $loop = $tmpStr2[0];
                $footer = $tmpStr2[1];

                $main_data = "";
                while($data=mysql_fetch_array($result)) {
                        $name = stripslashes($data[name]);
$memo = stripslashes($data[memo]);
if($data[use_html]<2) $memo = nl2br($memo);
else $memo = strip_tags($memo);


$no_img = $_zb_url."latest_skin/$skinname/images/no_img.gif";
$filename1 = $data[file_name1];
if(eregi("\.gif|\.jpg|\.jpeg",$filename1))$uploadimage1 = "<img src=".$_zb_url.$filename1." border=1  style='border-color:660524' height=144 width=100>"; else $uploadimage1="<img src=".$no_img." border=1 style='border-color:660524'>";

                        $subject = cut_str(stripslashes($data[subject]),$textlen)."</font></b>";
   $point = stripslashes($data[sitelink2]);
   
   $a=(int)($point/2);

   $rate = "";

   for($i=1;$i<=$a;$i++) {
     $rate.="<img src='$_zb_url/images/star_2.gif' align='absmiddle'>";
    }

   if($point%2 ==1) {
    $b=1;
    $rate.="<img src='$_zb_url/images/star_1.gif' align='absmiddle'>";
   } else {
    $b=0;
   }

   $c=5-$a-$b;

   for($i=1;$i<=$c;$i++) {
    $rate.="<img src='$_zb_url/images/star_0.gif' align='absmiddle'>";
   }                      

$m_memo = explode("||",$memo);
$lovelet1 = $m_memo[0];
$lovelet2 = $m_memo[1];
$lovelet3 = $m_memo[2];
$lovelet4 = $m_memo[3];   
$lovelet5 = $m_memo[4];
$lovelet6 = $m_memo[5];
$lovelet7 = $m_memo[6]; 
$lovelet8 = $m_memo[7];


$memolenx = cut_str(stripslashes($lovelet7),$memolen)."</font></b>";


                        $date = date($datetype, $data[reg_date]);
                        if($data[total_comment]) $comment = "[".$data[total_comment]."]"; else $comment="";

                        $main = $loop;
                        $main = str_replace("[name]",$name,$main);
                   $main = str_replace("[img]","<a href='".$_zb_url.$target."&no=$data[no]'>".$uploadimage1."</a>",$main);

$main = str_replace("[memo]",$memolenx,$main);
                   $main = str_replace("[subject]","<a href='".$_zb_url.$target."&no=$data[no]'>".$subject."</a>",$main);
                        $main = str_replace("[producer]",$lovelet1,$main);
                        $main = str_replace("[hero]",$lovelet2,$main);
                        $main = str_replace("[genre]",$lovelet3,$main);
                        $main = str_replace("[runtime]",$lovelet5,$main);
                        $main = str_replace("[moviedate]",$lovelet6,$main);
                        $main = str_replace("[comment]",$comment,$main);
                        $main = str_replace("[rate]",$rate,$main);
                        $main_data .= "\n".$main;
                }
                $list = $header.$main_data.$footer;
                $list = str_replace("[title]","<a href='".$_zb_url."zboard.php?id=".$id."'>".$title."</a>",$list);
                $list = str_replace("[dir]",$_zb_url."latest_skin/".$skinname."/images/",$list);
                $more="more..";
                $list = str_replace("[more]","<a href='".$_zb_url."zboard.php?id=".$id."'>".$more."</a>",$list);
                echo $list;
         }


 

2. 첨부된 파일을 latest_skin폴더에 압축해제후 업로드 합니다.

3. 러브렛과 같이 랜덤으로 게시물을 추출하려면 outlogin.php파일을 약간 수정하시면 됩니다.

$result = mysql_query("select * from $t_board"."_$id where is_secret=0 order by no desc limit $num", $connect) or die(mysql_error());
이 부분을
$result = mysql_query("select * from $t_board"."_$id where is_secret=0 order by rand() limit $num", $connect) or die(mysql_error());

4. 최근게시물에 사용되는 변수는 아래와 같습니다.

[subject] : 도서제목
[producer] : 지은이
[hero] : 옮긴이
[genre] : 펴낸곳
[moviedate] : 정가
[img] : 첨부된 이미지
[memo] : 책소개글
[rate] : 평점

5. 사용하실 때는 아래처럼 사용하시면 됩니다.

<? print_moviel("스킨명", "타이틀", "게시판 ID", 출력, 제목글 제한, 내용 제한)?>

예 : <? print_moviel("200905book", "Read Books", "books", 2, 30, 50)?>