또 질문을 하게 됩니다. > Forum

본문 바로가기

사이트 내 전체검색

Forum

또 질문을 하게 됩니다.

페이지 정보

작성자 규범~* 작성일 05-06-03 00:40 조회 491 댓글 0 제로보드

본문

일단 제가 소개해 드린 팁에서는 임시로 db를 만들어서 그 안에서 작업이 이루어 지게 됩니다.
헌데 article.php파일의 맨 하단부분에는 실제로 headnum(제로보드에서는 이녀석을 기준으로 공지 또는 일반글)을 구분하게 되는데, article로 뽑은 게시물에서는 headnum자체가 생성되지 않아서 결국엔 공지와 일반글을 구분할 수가 없게 됩니다.
이를 수정하려면 article.php파일의 db생성부분을 약간 수정하셔야 하는데
이 부분은 저도 확실치 않아(php에 대해서 잘 모릅니다;;) 일단 답변은 드립니다만 정확한 답변을 얻으시려면 해당 팁을 제공하신 분께 질문하시는 분이 빠르실 겁니다.


article.php파일의 아랫부분에서


name varchar(20) not null,
subject varchar(250) not null,
use_html char(1) default '0',
is_secret char(1) not null default '0',
file_name1 varchar(255),
file_name2 varchar(255),
download1 int(11) default '0' not null,
download2 int(11) default '0' not null,
reg_date int(13) not null default '0',
hit int(11) not null default '0',
vote int(11) not null default '0',
total_comment int(11) not null default '0',


division int(10) default 1 not null,
headnum int(20) default 0 not null,
arrangenum int(20) default 0 not null,


KEY headnum (division, headnum,arrangenum),
KEY name (name),
KEY board (board),
KEY reg_date (reg_date),
KEY hit (hit),
KEY vote (vote),
KEY download1 (download1),
KEY download2 (download2)


중략..


$insert=mysql_query("insert into zetyx_$table_name
(board,no,ismember,memo,name,subject,use_html,is_secret,file_name1,file_name2,download1,download2,reg_date,hit,vote,total_comment,division,headnum,arrangenum)
values
('$board[$i]','$row[no]','$row[ismember]','$row[memo]','$row[name]','$row[subject]','$row[use_html]','$row[is_secret]','$row[file_name1]','$row[file_name2]','$row[download1]','$row[download2]','$row[reg_date]','$row[hit]','$row[vote]','$row[total_comment]','$row[division]','$row[headnum]','$row[arrangenum]')
");


중략..


이렇게 추가하시구요.


result = mysql_query("select * from zetyx_tmp where is_secret=0 and headnum >-2000000000 order by rand() limit $num", $connect) or die(mysql_error());


이 구문을 다시 적용시켜보세요.



2.article.php 파일내용중에..


while($data=mysql_fetch_array($result)) {
$name = stripslashes($data[name]);
$subject = cut_str(stripslashes($data[subject]),$textlen)."";
$date = date($datetype, $data[reg_date]);


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


if($data[total_comment]) $comment = "+".$data[total_comment].""; else $comment="";


$main = $loop;
$main = str_replace("[name]",$name,$main);
$main = str_replace("[date]",$date,$main);
$main = str_replace("[id]",$id,$main);


자료실로 넣으시면 안되고 위와 같이 변수를 넣어주셔야합니다.

0 Comments

등록된 댓글이 없습니다.

Copyright ⓒ 2003-2024 LOVELET.COM. All rights reserved.
PC 버전으로 보기