DEV Community

웹학교
웹학교

Posted on

3 3

그누보드5 - 최신글 반영하기

그누보드5에서 최신글은 제공되는 스킨을 이용하여 쉽게 반영할 수 있습니다.

최신글은 그누보드5의 핵심인 게시판의 최신글을 몇 개 지정하여 목록으로 보여주는 기능입니다.

최신글은 대부분 홈페이지 첫페이지(메인)에 반영됩니다.

하지만 어느 페이지, 어느 위치에나 반영이 가능합니다.

latest.lib.php

최신글을 반영하기 위해서는 latest.lib.php 파일이 먼저 include되어야 합니다.

include_once(G5_LIB_PATH.'/latest.lib.php');
Enter fullscreen mode Exit fullscreen mode

대부분의 그누보드5페이지에는 기본으로 위 파일이 head.php에 반영되어 있습니다.
다만, 편집기를 이용해 새로 페이지를 만들었을 경우 또는 특별한 경우 위 파일이 빠져 있을 수 있습니다.
혹, 최신글이 반영이 안된다면 위 파일이 head.php상단에 include되었는지 확인하면 됩니다.

최신글 반영하기

이제 원하는 위치에 최신글을 반영할 수 있습니다.

echo latest('pic_list', 'free', 4, 23); // latest(스킨, 게시판아이디, 출력라인, 글자수);
Enter fullscreen mode Exit fullscreen mode

여기서 스킨은 그누보드5에서 배포되는 기본 스킨과 커뮤니티 회원이 제공하는 스킨 그리고 직접 만들어 사용하는 스킨 모두 가능합니다.

그누보드5강좌

Top comments (0)

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay