답변 3개
채택된 답변
+20 포인트
2021-04-02 (금) 14:12:00
2021-04-03 (토) 12:28:27
list.skin.php에서 shuffle()하셨다면
단지 첫 페이지에 나오는 목록을 섞었을 뿐입니다. 2페이지, 3페이지 내용은 안 나오는 것이죠.
bbs/list.php에서
조건을 걸어 order by rand()를 추가하는 것을 추천합니다.
마르스컴퍼니
2021-04-02 (금) 14:21:58
Copy
<?php
for ($i=0; $i<count($list); $i++) {
if ($list[$i]['notice'])
$last_notice = $i;
else
$list2[$i] = $list[$i];
}
shuffle($list2);
$arr_notice = array_splice($list, 0, $last_notice);
$list = array_merge($arr_notice, $list2);
for ($i=0; $i<count($list); $i++) {
}
?>
답변을 작성하려면 로그인이 필요합니다.