랜덤인가? 슬라이드인가? 로테션되는것? (요청)



위와 같이 최근게시물을 만들고 싶은데 실력이 딸리네요..
고수님들 부탁드립니다.

[wr_subject][wr_1] [wr_2] [wr_3]가 들어갔으며 합니다.

뭐 안그러시면 대충돌아가게만 해주시면 ... 제가 나머진...
|

댓글 1개

1. 임의의 파일을 만들어서 extend 디렉토리에 넣습니다.

======================== random.lib.php ==================
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

function r_latest($skin_dir="", $bo_table, $rows=10, $subject_len=40)
{
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
order by rand() 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;
}
?>
==================================================

2. 적용하고자 하는 곳에 아래와 같이 적어줍니다.
<?=r_latest('gd_latest2',photo, 2, 20);?>

나머지는 설명 안해도 잘 아시리라 봅니다. ^^
댓글을 작성하시려면 로그인이 필요합니다. 로그인

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
20년 전 조회 1,716
20년 전 조회 1,499
20년 전 조회 2,062
재롱
20년 전 조회 1,523
20년 전 조회 1,541
20년 전 조회 1,603
20년 전 조회 1,604
20년 전 조회 1,523
20년 전 조회 1,526
20년 전 조회 1,601
20년 전 조회 1,562
20년 전 조회 2,470
20년 전 조회 1,511
20년 전 조회 1,546
20년 전 조회 2,606
20년 전 조회 1,548
20년 전 조회 1,656
BB-Gril
20년 전 조회 1,958
20년 전 조회 1,522
20년 전 조회 1,525
🐛 버그신고