도와주세요^^ 애혀~~ 정보
도와주세요^^ 애혀~~
본문
최신글 선택한것만나오게할려함니다,
아래와같은 latest_wr.lib.php에서 시간제한을 뺄려고 함니다,
어디를수정해야될까요?
혹시라도 체크의 여부에따라 나오고 안나오는것을제어가능하다면좋겟는데,
가능할까요?
<?
if (!defined('_GNUBOARD_')) exit;
if (!defined('_GNUBOARD_')) exit;
// ÃÖ½Å±Û ÃßÃâ
function latest_wr($skin_dir="", $bo_table, $rows=10, $subject_len=40, $wr="")
{
global $config;
global $g4;
function latest_wr($skin_dir="", $bo_table, $rows=10, $subject_len=40, $wr="")
{
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]";
$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);
$board = sql_fetch($sql);
$tmp_write_table = $g4[write_prefix] . $bo_table; // °Ô½ÃÆÇ Å×À̺í ÀüüÀ̸§
// wr ·Î ·£´ýÁ¤·Ä
if ($wr == "1"){
$sql = " select * from $tmp_write_table where wr_1 > 0 && wr_8 > '$g4[time_ymdhis]' order by rand() limit 0, $rows ";
} else if ($wr == "2"){
$sql = " select * from $tmp_write_table where wr_2 > 0 && wr_8 > '$g4[time_ymdhis]' order by rand() limit 0, $rows ";
} else if ($wr == "3"){
$sql = " select * from $tmp_write_table where wr_3 > 0 && wr_8 > '$g4[time_ymdhis]' order by rand() limit 0, $rows ";
} else {
$sql = " select * from $tmp_write_table where wr_comment > -1 order by wr_id 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();
// wr ·Î ·£´ýÁ¤·Ä
if ($wr == "1"){
$sql = " select * from $tmp_write_table where wr_1 > 0 && wr_8 > '$g4[time_ymdhis]' order by rand() limit 0, $rows ";
} else if ($wr == "2"){
$sql = " select * from $tmp_write_table where wr_2 > 0 && wr_8 > '$g4[time_ymdhis]' order by rand() limit 0, $rows ";
} else if ($wr == "3"){
$sql = " select * from $tmp_write_table where wr_3 > 0 && wr_8 > '$g4[time_ymdhis]' order by rand() limit 0, $rows ";
} else {
$sql = " select * from $tmp_write_table where wr_comment > -1 order by wr_id 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;
}
?>
}
?>
그누보드에 오시는분들모두 세해에는 모두 복많이 받으세요^^
댓글 전체

시간 제한을 없애는 것은 코드에서
&& wr_8 > '$g4[time_ymdhis]' 가 3번 들어갔는데,
이걸 삭제하면 되지 않을까 합니다.
체크여부에 따라 시간 제한을 두는 것은 우선 함수로 체크여부를 알리는 변수를 넘기고요,
function latest_wr($skin_dir="", $bo_table, $rows=10, $subject_len=40, $wr="", $ck_what)
{
변수에 따라서 && wr_8 > $g4[time_ymdhis]' 가 들어가고 안들어가게 하시면 되겠습니다.
예를 들면,
if($ch_what == 1) {
$my_condition = "&& wr_8 > '$g4[time_ymdhis]' "
}
else {
$my_condition = "";
}
하시고, && wr_8 > $g4[time_ymdhis]' 3개가 든 자리에는 ".$my_condition." 을 넣으시구요.
^ ^
&& wr_8 > '$g4[time_ymdhis]' 가 3번 들어갔는데,
이걸 삭제하면 되지 않을까 합니다.
체크여부에 따라 시간 제한을 두는 것은 우선 함수로 체크여부를 알리는 변수를 넘기고요,
function latest_wr($skin_dir="", $bo_table, $rows=10, $subject_len=40, $wr="", $ck_what)
{
변수에 따라서 && wr_8 > $g4[time_ymdhis]' 가 들어가고 안들어가게 하시면 되겠습니다.
예를 들면,
if($ch_what == 1) {
$my_condition = "&& wr_8 > '$g4[time_ymdhis]' "
}
else {
$my_condition = "";
}
하시고, && wr_8 > $g4[time_ymdhis]' 3개가 든 자리에는 ".$my_condition." 을 넣으시구요.
^ ^