제발 도와주세요 ㅠㅠ 정보
제발 도와주세요 ㅠㅠ본문
하나의 게시판에서 사진에 보이는 [일일알바]면 일일알바만, [단기알바]면 단기 알바만 추출하여 최신글에 나오게 하는방법 부탁드려요 ~
최신글 스킨은 http://sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=66733&sca=&sfl=wr_subject&stx=%B1%B8%C0%CE&sop=and
이것입니다. 제발 부탁드려요 ㅠㅠ
최신글 스킨은 http://sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=66733&sca=&sfl=wr_subject&stx=%B1%B8%C0%CE&sop=and
이것입니다. 제발 부탁드려요 ㅠㅠ
댓글 전체
기본 스킨에서는 이렇게 하면 되겠네요
latest($skin_dir="", $bo_table, $rows=10, $subject_len=40, $options="")
위 함수에서 22행을 수정
if($option) $option=" and $option ";
$sql = " select * from $tmp_write_table where wr_is_comment = 0" .$option. " order by wr_num limit 0, $rows ";
출력은
latest($skin_dir="", $bo_table, $rows=10, $subject_len=40, "wr_subject='일일알바'")
latest($skin_dir="", $bo_table, $rows=10, $subject_len=40, "wr_subject='단기알바'")
latest($skin_dir="", $bo_table, $rows=10, $subject_len=40, $options="")
위 함수에서 22행을 수정
if($option) $option=" and $option ";
$sql = " select * from $tmp_write_table where wr_is_comment = 0" .$option. " order by wr_num limit 0, $rows ";
출력은
latest($skin_dir="", $bo_table, $rows=10, $subject_len=40, "wr_subject='일일알바'")
latest($skin_dir="", $bo_table, $rows=10, $subject_len=40, "wr_subject='단기알바'")
답변 감사합니다^^
latest.lib.php 파일 말씀 하신대로 수정하니 아래 같이 에러메세지가 나와요 ㅠㅠ
Parse error: syntax error, unexpected '=', expecting '&' or T_VARIABLE in C:\APM_Setup\htdocs\gnuboard4\lib\latest.lib.php on line 5
아래는 수정한 전체 소스 내용 입니다 부탁드려요~~~~
<?
if (!defined('_GNUBOARD_')) exit;
// 최신글 추출
function latest($skin_dir="", $bo_table, $rows=10, $subject_len=40, wr_subject="단기알바")
{
global $g4;
if ($skin_dir)
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/basic";
$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_is_comment = 0 order by wr_id desc limit 0, $rows ";
// 위의 코드 보다 속도가 빠름
if($option) $option=" and $option ";
$sql = " select * from $tmp_write_table where wr_is_comment = 0" .$option. " order by wr_num 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;
}
?>
latest.lib.php 파일 말씀 하신대로 수정하니 아래 같이 에러메세지가 나와요 ㅠㅠ
Parse error: syntax error, unexpected '=', expecting '&' or T_VARIABLE in C:\APM_Setup\htdocs\gnuboard4\lib\latest.lib.php on line 5
아래는 수정한 전체 소스 내용 입니다 부탁드려요~~~~
<?
if (!defined('_GNUBOARD_')) exit;
// 최신글 추출
function latest($skin_dir="", $bo_table, $rows=10, $subject_len=40, wr_subject="단기알바")
{
global $g4;
if ($skin_dir)
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/basic";
$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_is_comment = 0 order by wr_id desc limit 0, $rows ";
// 위의 코드 보다 속도가 빠름
if($option) $option=" and $option ";
$sql = " select * from $tmp_write_table where wr_is_comment = 0" .$option. " order by wr_num 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;
}
?>
function latest($skin_dir="", $bo_table, $rows=10, $subject_len=40, $options="") (o)
function latest($skin_dir="", $bo_table, $rows=10, $subject_len=40, wr_subject="단기알바") (x)
latest($skin_dir="", $bo_table, $rows=10, $subject_len=40, "wr_subject='일일알바'")
뭐가 다른지 보세요
기본값으로 단기알바 를 부여하고 싶으면
function latest($skin_dir="", $bo_table, $rows=10, $subject_len=40, $option="wr_subject='단기알바'")
이렇게 돼야 하는 겁니다
function latest($skin_dir="", $bo_table, $rows=10, $subject_len=40, wr_subject="단기알바") (x)
latest($skin_dir="", $bo_table, $rows=10, $subject_len=40, "wr_subject='일일알바'")
뭐가 다른지 보세요
기본값으로 단기알바 를 부여하고 싶으면
function latest($skin_dir="", $bo_table, $rows=10, $subject_len=40, $option="wr_subject='단기알바'")
이렇게 돼야 하는 겁니다
