|
|
|
05-11-29
|
조회 1,698
|
|
|
|
05-11-29
|
조회 1,308
|
|
|
|
05-11-29
|
조회 1,595
|
|
|
|
05-11-29
|
조회 1,794
|
|
|
|
05-11-29
|
조회 1,580
|
|
|
|
05-11-29
|
조회 2,154
|
|
|
|
05-11-29
|
조회 1,610
|
|
|
|
05-11-29
|
조회 1,629
|
|
|
|
05-11-29
|
조회 1,701
|
|
|
|
05-11-29
|
조회 1,686
|
|
|
|
05-11-29
|
조회 1,618
|
|
|
|
05-11-29
|
조회 1,616
|
|
|
|
05-11-29
|
조회 1,689
|
|
|
|
05-11-29
|
조회 1,647
|
|
|
|
05-11-29
|
조회 2,567
|
|
|
|
05-11-29
|
조회 1,598
|
|
|
|
05-11-29
|
조회 1,634
|
|
|
|
05-11-28
|
조회 2,692
|
|
|
|
05-11-28
|
조회 1,636
|
|
|
|
05-11-28
|
조회 1,757
|
댓글 1개
======================== 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);?>
나머지는 설명 안해도 잘 아시리라 봅니다. ^^