최신글(lastest) 출력시 분류별 출력이 가능한지요? 정보
질문 최신글(lastest) 출력시 분류별 출력이 가능한지요?본문
혼자 해보려다 머리에 쥐가 나서;; 도움을 청해 봅니다.
메인화면에 최신글(lastest)을 출력하는 스킨이 많이 있지 않습니까?
이 글을 출력을 할때 게시물의 내용을 검색후..분류별로 출력이 가능 할까? 하는 것입니다.
예를 들면)
게시판 글을 작성할때 분류에 한국, 영국, 호주
이런식으로 국가별 이름을 넣고 메인에 최신글을 출력할때 해당 내용만 (선택한것) 출력이 되게 할수
있을까요??
스킨란에 보니 만도님께서 올려주신건 그룹별로 하는건던데요.. 그건 같은 그룹네 게시판의 글을
읽어 오는것 같더라구요..
전.. 한 테이블에서 분류에 따른 최신글을 불러 오고 싶은거구요....(분류의 내용만...)
몇일간을 골머리 돌리다가 질문 올려 봅니다.....
이제 피서철이 다가 오는거 같네요... 다들 피서계획 잘 들 세우시고^^
재미있는 피서들 보내세요^^
메인화면에 최신글(lastest)을 출력하는 스킨이 많이 있지 않습니까?
이 글을 출력을 할때 게시물의 내용을 검색후..분류별로 출력이 가능 할까? 하는 것입니다.
예를 들면)
게시판 글을 작성할때 분류에 한국, 영국, 호주
이런식으로 국가별 이름을 넣고 메인에 최신글을 출력할때 해당 내용만 (선택한것) 출력이 되게 할수
있을까요??
스킨란에 보니 만도님께서 올려주신건 그룹별로 하는건던데요.. 그건 같은 그룹네 게시판의 글을
읽어 오는것 같더라구요..
전.. 한 테이블에서 분류에 따른 최신글을 불러 오고 싶은거구요....(분류의 내용만...)
몇일간을 골머리 돌리다가 질문 올려 봅니다.....
이제 피서철이 다가 오는거 같네요... 다들 피서계획 잘 들 세우시고^^
재미있는 피서들 보내세요^^
댓글 전체
<? if ($is_category == 원하는분류) { ?>
<td style='word-break:break-all;'>
<?
echo $nobr_begin;
echo $list[$i][reply];
echo $list[$i][icon_reply];
echo "<a href='{$list[$i][href]}'>";
if ($list[$i][is_notice])
echo "<font color='#2C8CB9'><strong>{$list[$i][subject]}</strong></font>";
else
echo "{$list[$i][subject]}";
echo "</a>";
if ($list[$i][comment_cnt])
echo " <a href=\"{$list[$i][comment_href]}\"><span style='font-size:7pt;'>{$list[$i][comment_cnt]}</span></a>";
// if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }
// if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }
echo " " . $list[$i][icon_new];
echo " " . $list[$i][icon_file];
echo " " . $list[$i][icon_link];
echo " " . $list[$i][icon_hot];
echo " " . $list[$i][icon_secret];
echo $nobr_end;
?></td>
<td align="center"><?=$list[$i][name]?></td>
<td align="center"><?=$list[$i][datetime2]?></td>
<td align="center"><?=$list[$i][wr_hit]?></td>
<? if ($is_good) { ?><td align="center"><?=$list[$i][wr_good]?></td><? } ?>
<? if ($is_nogood) { ?><td align="center"><?=$list[$i][wr_nogood]?></td><? } ?>
<td></td>
<? } ?>
-- 위에서 카테고리가 원하는 분류이면 내용을 출력하게 잘 조정하세효~ ㅋ
<td style='word-break:break-all;'>
<?
echo $nobr_begin;
echo $list[$i][reply];
echo $list[$i][icon_reply];
echo "<a href='{$list[$i][href]}'>";
if ($list[$i][is_notice])
echo "<font color='#2C8CB9'><strong>{$list[$i][subject]}</strong></font>";
else
echo "{$list[$i][subject]}";
echo "</a>";
if ($list[$i][comment_cnt])
echo " <a href=\"{$list[$i][comment_href]}\"><span style='font-size:7pt;'>{$list[$i][comment_cnt]}</span></a>";
// if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }
// if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }
echo " " . $list[$i][icon_new];
echo " " . $list[$i][icon_file];
echo " " . $list[$i][icon_link];
echo " " . $list[$i][icon_hot];
echo " " . $list[$i][icon_secret];
echo $nobr_end;
?></td>
<td align="center"><?=$list[$i][name]?></td>
<td align="center"><?=$list[$i][datetime2]?></td>
<td align="center"><?=$list[$i][wr_hit]?></td>
<? if ($is_good) { ?><td align="center"><?=$list[$i][wr_good]?></td><? } ?>
<? if ($is_nogood) { ?><td align="center"><?=$list[$i][wr_nogood]?></td><? } ?>
<td></td>
<? } ?>
-- 위에서 카테고리가 원하는 분류이면 내용을 출력하게 잘 조정하세효~ ㅋ
전웅빈님 감사합니닷^^;; 제 나름대로 또 해결을 봐서.. 이렇게 적어 봅니다..
저와 비슷한 분이 계시지 않을까 해서..
lib/latest.lib.php 을 열어 저 문장을 넣어 줍니다.
function latest_ca($skin_dir="", $bo_table, $rows=10, $subject_len=40,$ca_name)
{
global $config;
global $g4;
if ($skin_dir)
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/$config[cf_latest_skin]";
$list = array();
$sql = " select * from {$g4[board_table]} where bo_table = '$bo_table'";
$board = sql_fetch($sql);
$tmp_write_table = $g4[write_prefix].$bo_table; // 게시판 테이블 전체이름
$sql = " select * from $tmp_write_table where wr_comment > -1 and ca_name='$ca_name' order by wr_id desc limit 0, $rows ";
//explain($sql);
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++)
$list[$i] = get_list($row, $board, $latest_skin_path, $subject_len);
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
return $content;
}
보시면 아시겠지만.. $ca_name을 변수로 불러와 작성을 한것입니다.
최근글을 불러 올실적에 <?=latest_ca("schedule", "m1", 50, 40,"월요일");?>
이런식으로 불러 오니;; 쉽게 되더라구요^^
저와 비슷한 분이 계시지 않을까 해서..
lib/latest.lib.php 을 열어 저 문장을 넣어 줍니다.
function latest_ca($skin_dir="", $bo_table, $rows=10, $subject_len=40,$ca_name)
{
global $config;
global $g4;
if ($skin_dir)
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/$config[cf_latest_skin]";
$list = array();
$sql = " select * from {$g4[board_table]} where bo_table = '$bo_table'";
$board = sql_fetch($sql);
$tmp_write_table = $g4[write_prefix].$bo_table; // 게시판 테이블 전체이름
$sql = " select * from $tmp_write_table where wr_comment > -1 and ca_name='$ca_name' order by wr_id desc limit 0, $rows ";
//explain($sql);
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++)
$list[$i] = get_list($row, $board, $latest_skin_path, $subject_len);
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
return $content;
}
보시면 아시겠지만.. $ca_name을 변수로 불러와 작성을 한것입니다.
최근글을 불러 올실적에 <?=latest_ca("schedule", "m1", 50, 40,"월요일");?>
이런식으로 불러 오니;; 쉽게 되더라구요^^
좋은정보 감사합니다.
스크랩해갑니다.
스크랩해갑니다.
감사합니다.
좋은 팁이네요, 감사합니다