만도님의 그룹별 최신글 출력... 정보
그누보드 만도님의 그룹별 최신글 출력...본문
만도님의 그룹별 최신글 출력에서 최신글일 경우 new 아이콘을 출력하고 싶은데
어느 부분에 어떤 함수를 불러와야 할지 모르겠네요.. 아시는분 계시면 답변 부탁드립니다..
소스는 아래와 같습니다.
<?
if (defined(__FILE__)) return;
define(__FILE__, TRUE);
function threes_lcat($skin_dir, $bo_table, $is_space=0, $subject_len=40, $linum=10)
{
global $latest_skin, $cfg;
$tmp_latest_skin = $latest_skin;
// 스킨디렉토리값이 넘어왔다면
if ($skin_dir) $latest_skin = "./bbs/skin/latest/$skin_dir";
/************ 환경설정 시작 *************************/
//1. 카테고리별 글제목 색상 지정(카테고리갯수만큼 설정하시면 됩니다)
$subject_color = array ("#0066CC","#E66831","#968D00","#005D73","#C4168D","#5C4187","#0066CC","#E66831","#968D00","#005D73");
//2. 제목과 제목사이 구분자 처리값 지정, html 형식으로 처리 가능 ex>" , "
// font 관련 설정은 아래쪽에 이값을 설정하는 부분에서 직접 수정하셔야 합니다.(필요할경우)
// $subject_subj = " # "; // # 일반텍스트를 사용하고 싶을경우 설정방법
// 다음은 스킨디렉토리에 있는 icon_div.gif 이미지를 사용하기위한 방법
$subject_subj = " <img src=$latest_skin/icon_div.gif border=0> ";
//3. 글제목을 $subject_len 만큼으로 잘라내기했을때 글제목 뒤에 붙일 문자
$subject_end = "+"; // KSN님은 디폴트가 "+++" 였었습니다.
//4. $is_space=0;일 경우 $subject_end를 붙일것인지 말것인지
$is_subject_end = 1; // "1"이면 붙이고, "0"이면 안붙인다
//5. 제목과 제목사이 구분자의 폰트색을 제목색과 동일하게 처리할것인지 여부
$is_subject_color = 0; // "1" 이면 글제목과 같은 색으로, "0" 이면 폰트색 적용안함
//6. 제목의 글자수를 자를때 글자수로 할것인지 스페이스로 할것인지 판단
// ex) $subject_len이 2이고 글제목이 다음과 같을때 => "우리나라 대한 민국"
// $is_space = 1; 이면 글제목은 : "우리나라 대한"
// $is_space = 0; 이면 글제목은 : "우리"
//$is_space = 0; // "1"이면 스페이스로 구분하고, "0"이면 글자수로 구분한다.
//이것은 호출하는 부분에서 설정하도록 변경합니다.
/************ 환경설정 끝 ***************************/
$sqlt = " select * from $cfg[table_board] where bo_table = '$bo_table' ";
$bo = sql_fetch($sqlt);
$table_name = $cfg[write_table_prefix].$bo_table;
$sql = " select * from {$table_name}_cat order by ca_id ";
$result = sql_query($sql);
//$bo_subject = conv_subject($bo[bo_subject], $subject_len, $subject_end);
$bo_subject = $bo[bo_subject]; // 게시판명 이름을 있는그대로 사용하도록 한다.
for ($k=0; $row = mysql_fetch_array($result); $k++){
$catcaid[$k] = $row[ca_id];
$catname[$k] = get_category_name($table_name,$row[ca_id]);
$sqlc = " select wr_id, wr_subject
from {$cfg[write_table_prefix]}{$bo_table}
where wr_comment = 0 and ca_id={$row[ca_id]}
order by wr_id desc limit $linum ";
$resultc = sql_query($sqlc);
for ($i=0; $rowc = mysql_fetch_array($resultc); $i++) {
$wr_subject = "";
if($is_space) {
$wr_subject_array = explode(" ", $rowc[wr_subject]);
for($m=0; $m<=$subject_len-1; $m++) {
$wr_subject .= " $wr_subject_array[$m]";
}
} else {
$wr_subject = conv_subject($rowc[wr_subject], $subject_len, $subject_end);
}
if($i > 0) { // 제목과 제목사이 구분자 처리
if($is_subject_color)
$list[$k][$i] = "<font color=$subject_color[$k]>$subject_subj</font>";
else
$list[$k][$i] = $subject_subj;
}
$list[$k][$i] .= "<a href='./?doc=bbs/gnuboard.php&bo_table=".$bo_table."&wr_id=".$rowc[wr_id]."'><font color=$subject_color[$k] style='font-family:돋움;'>".$wr_subject."</font></a>";
}
mysql_free_result($resultc);
}
mysql_free_result($result);
include "$latest_skin/latest.skin.php";
$latest_skin = $tmp_latest_skin;
}
?>
어느 부분에 어떤 함수를 불러와야 할지 모르겠네요.. 아시는분 계시면 답변 부탁드립니다..
소스는 아래와 같습니다.
<?
if (defined(__FILE__)) return;
define(__FILE__, TRUE);
function threes_lcat($skin_dir, $bo_table, $is_space=0, $subject_len=40, $linum=10)
{
global $latest_skin, $cfg;
$tmp_latest_skin = $latest_skin;
// 스킨디렉토리값이 넘어왔다면
if ($skin_dir) $latest_skin = "./bbs/skin/latest/$skin_dir";
/************ 환경설정 시작 *************************/
//1. 카테고리별 글제목 색상 지정(카테고리갯수만큼 설정하시면 됩니다)
$subject_color = array ("#0066CC","#E66831","#968D00","#005D73","#C4168D","#5C4187","#0066CC","#E66831","#968D00","#005D73");
//2. 제목과 제목사이 구분자 처리값 지정, html 형식으로 처리 가능 ex>" , "
// font 관련 설정은 아래쪽에 이값을 설정하는 부분에서 직접 수정하셔야 합니다.(필요할경우)
// $subject_subj = " # "; // # 일반텍스트를 사용하고 싶을경우 설정방법
// 다음은 스킨디렉토리에 있는 icon_div.gif 이미지를 사용하기위한 방법
$subject_subj = " <img src=$latest_skin/icon_div.gif border=0> ";
//3. 글제목을 $subject_len 만큼으로 잘라내기했을때 글제목 뒤에 붙일 문자
$subject_end = "+"; // KSN님은 디폴트가 "+++" 였었습니다.
//4. $is_space=0;일 경우 $subject_end를 붙일것인지 말것인지
$is_subject_end = 1; // "1"이면 붙이고, "0"이면 안붙인다
//5. 제목과 제목사이 구분자의 폰트색을 제목색과 동일하게 처리할것인지 여부
$is_subject_color = 0; // "1" 이면 글제목과 같은 색으로, "0" 이면 폰트색 적용안함
//6. 제목의 글자수를 자를때 글자수로 할것인지 스페이스로 할것인지 판단
// ex) $subject_len이 2이고 글제목이 다음과 같을때 => "우리나라 대한 민국"
// $is_space = 1; 이면 글제목은 : "우리나라 대한"
// $is_space = 0; 이면 글제목은 : "우리"
//$is_space = 0; // "1"이면 스페이스로 구분하고, "0"이면 글자수로 구분한다.
//이것은 호출하는 부분에서 설정하도록 변경합니다.
/************ 환경설정 끝 ***************************/
$sqlt = " select * from $cfg[table_board] where bo_table = '$bo_table' ";
$bo = sql_fetch($sqlt);
$table_name = $cfg[write_table_prefix].$bo_table;
$sql = " select * from {$table_name}_cat order by ca_id ";
$result = sql_query($sql);
//$bo_subject = conv_subject($bo[bo_subject], $subject_len, $subject_end);
$bo_subject = $bo[bo_subject]; // 게시판명 이름을 있는그대로 사용하도록 한다.
for ($k=0; $row = mysql_fetch_array($result); $k++){
$catcaid[$k] = $row[ca_id];
$catname[$k] = get_category_name($table_name,$row[ca_id]);
$sqlc = " select wr_id, wr_subject
from {$cfg[write_table_prefix]}{$bo_table}
where wr_comment = 0 and ca_id={$row[ca_id]}
order by wr_id desc limit $linum ";
$resultc = sql_query($sqlc);
for ($i=0; $rowc = mysql_fetch_array($resultc); $i++) {
$wr_subject = "";
if($is_space) {
$wr_subject_array = explode(" ", $rowc[wr_subject]);
for($m=0; $m<=$subject_len-1; $m++) {
$wr_subject .= " $wr_subject_array[$m]";
}
} else {
$wr_subject = conv_subject($rowc[wr_subject], $subject_len, $subject_end);
}
if($i > 0) { // 제목과 제목사이 구분자 처리
if($is_subject_color)
$list[$k][$i] = "<font color=$subject_color[$k]>$subject_subj</font>";
else
$list[$k][$i] = $subject_subj;
}
$list[$k][$i] .= "<a href='./?doc=bbs/gnuboard.php&bo_table=".$bo_table."&wr_id=".$rowc[wr_id]."'><font color=$subject_color[$k] style='font-family:돋움;'>".$wr_subject."</font></a>";
}
mysql_free_result($resultc);
}
mysql_free_result($result);
include "$latest_skin/latest.skin.php";
$latest_skin = $tmp_latest_skin;
}
?>
댓글 전체
위링크 소스중
//$list = $i++%2;
$value->bo_subject = cut_str($value->bo_subject, 20);
$list = $i++%2;
$icon_new = ""; <-- 요기하고
if ($value->wr_datetime >= $intime) {
$icon_new = "<img src='./$cfg[bbs_dir]/imgs/icon_new.gif' border=0 align='absmiddle'>";
}
echo "
<tr class='list$list' height=22>
<td>
<table width=98% cellpadding=0 cellspacing=0 align=center>
<tr>
<td width=17% nowrap>$icon_tip [<a href='./?doc=$cfg[bbs_dir]/gnuboard.php&bo_table=".$value->bo_table."'>".$value->bo_subject."</a>]</td>
<td width=''><a href='./?doc=$cfg[bbs_dir]/gnuboard.php&bo_table=".$value->bo_table."&wr_id=".$value->wr_parent_id."$atag_comment'>{$value->wr_subject} {$commentcnt}$icon_new</a> <-- 요기 아닌가요?
</td>
</tr>";
if( $k==1){
원하시던 결과를 얻으시길....
//$list = $i++%2;
$value->bo_subject = cut_str($value->bo_subject, 20);
$list = $i++%2;
$icon_new = ""; <-- 요기하고
if ($value->wr_datetime >= $intime) {
$icon_new = "<img src='./$cfg[bbs_dir]/imgs/icon_new.gif' border=0 align='absmiddle'>";
}
echo "
<tr class='list$list' height=22>
<td>
<table width=98% cellpadding=0 cellspacing=0 align=center>
<tr>
<td width=17% nowrap>$icon_tip [<a href='./?doc=$cfg[bbs_dir]/gnuboard.php&bo_table=".$value->bo_table."'>".$value->bo_subject."</a>]</td>
<td width=''><a href='./?doc=$cfg[bbs_dir]/gnuboard.php&bo_table=".$value->bo_table."&wr_id=".$value->wr_parent_id."$atag_comment'>{$value->wr_subject} {$commentcnt}$icon_new</a> <-- 요기 아닌가요?
</td>
</tr>";
if( $k==1){
원하시던 결과를 얻으시길....
위소스는 제가 올린것이 아니고 루트님의 카테고리별 최신글입니다.
아이콘뉴를 뽑아오는 그런것은 없군요.. 소스상에요..
아이콘뉴를 뽑아오는 그런것은 없군요.. 소스상에요..
이게 안먹네요.. 만도님 그룹별 형식이 <?=$list[$k][$i][icon_new]?> 이렇게인거 같은데...
이렇게 해도 안됩니다. 누구 해결책 좀 주세요..
이렇게 해도 안됩니다. 누구 해결책 좀 주세요..
<?=$list[$i][icon_new]?>를 넣어 보세요
예진맘님 저기에다가 뭘 넣죠?? 그것까지 좀 가르켜 주시면 감사하겠습니다. ^^;
$list[$k][$i] .= "<a href='./?doc=bbs/gnuboard.php&bo_table=".$bo_table."&wr_id=".$rowc[wr_id]."'><font color=$subject_color[$k] style='font-family:돋움;'>".$wr_subject."</font></a>요기에다 넣으세요";
}
mysql_free_result($resultc);
}
mysql_free_result($result);
include "$latest_skin/latest.skin.php";
$latest_skin = $tmp_latest_skin;
}
?>
}
mysql_free_result($resultc);
}
mysql_free_result($result);
include "$latest_skin/latest.skin.php";
$latest_skin = $tmp_latest_skin;
}
?>