[심심풀이] 회사 연혁 부분을 플러그인으로..
https://sir.kr/g5_skin/571?sfl=wr_subject%7C%7Cwr_content&stx=%EC%97%B0%ED%98%81
회사 연혁 부분을 플러그인으로 변경
-게시판 형식으로 회사연혁 보여주는 부분이 몬가 보기가 좀 그래서 ...
127.0.0.1/history

관리자 로그인

관리자 페이지 수정 가능


data/dbconfig.php 한줄 추가
$g5['history_table'] = G5_TABLE_PREFIX.'history'; //회사연혁
adm //관리자 페이지 부분
extend // 관리자 메뉴 추가
plugin // 플러그 리스트 보는 부분
history //폴더 index.php 파일 ($g5['title'] = "연혁"; //타이틀 변경 가능)
history/index.php
[code]
<?php
include_once('_common.php');
$g5['title'] = "회사연혁"; // Title 명칭 변경 이쪽에서..
include_once('../_head.php');
if(defined('G5_THEME_PATH')) {
require_once(G5_THEME_PATH.'/head.php');
require_once(G5_PLUGIN_PATH.'/history/index.php');
require_once(G5_THEME_PATH.'/tail.php');
return;
}
include_once('../_tail.php');
?>
[/code]
extend
[code]
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
// 아래 return 주석을 풀면 사용안함
//return;
class history {
public $admin_number = 200900; // 관리자모드 출력 장소
public static function getInstance()
{
static $instance = null;
if (null === $instance) {
$instance = new self();
}
return $instance;
}
public static function singletonMethod()
{
return self::getInstance();
}
public function __construct() {
$this->add_hooksv();
}
public function add_hooksv(){
// 관리자 메뉴 추가
add_replace('admin_menu', array($this, 'add_admin_menu'), 1, 1);
}
public function add_admin_menu($admin_menu){
// 관리자 -> 게시판관리 메뉴의 기본키는 menu300 입니다. ( adm/admin.menu300.php 파일을 참고)
//관리자 메뉴 나오는 부분 설정란
$admin_menu['menu200'][] = array(
200900, '회사연혁', G5_ADMIN_URL.'/historylist.php', 'bbs_num_reorder'
);
return $admin_menu;
}
}
$GLOBALS['history'] = history::getInstance();
[/code]
plugin/history/index.php
[code]
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$history_url = G5_PLUGIN_URL."/history";
add_stylesheet('<link rel="stylesheet" href="'.$history_url.'/css/style.css">', 20);
if ($is_admin)
echo '<div class="ctt_admin"><a href="'.G5_ADMIN_URL.'/historylist.php" class="btn_admin btn"><span class="sound_only">내용 수정</span><i class="fa fa-cog fa-spin fa-fw"></i></a></div>';
?>
<div class="sub_con widthfix">
<div class="history_div mt55">
<!-- 목록 시작 -->
<?php
$sql = " SELECT * FROM $g5[history_table] ORDER BY co_year desc ";
$result=sql_query($sql);
$count = 0;
while($data=sql_fetch_array($result)) {
$count++;
$hList[]=$data;
if($preYear != $data['co_year']) {
$preYear = $data['co_year'];
if($count > 1) {
$cicle_img = '<div class="year_body"><span>'.$data['co_year'].'</span></div>';
} else if($count == 1){
$cicle_img = '<div class="year_body first"><span>'.$data['co_year'].'</span></div>';
}
echo ' <div class="p_box '.$margin_top.'">';
echo ' <div class="history_img">'.$cicle_img.'</div>';
echo ' <div class="history_txt">';
$sql_detail = " select * from $g5[history_table] where co_year = $data[co_year] order by co_year desc ";
$result_detail = sql_query($sql_detail);
$history_icon = '';
for ($i=0; $hList = sql_fetch_array($result_detail); $i++) {
if($i == 0) {
if($i > -1) $margin_top = "mt30";
echo '<div class="tit">';
echo ' <h4>'.$hList['co_year'].'</h4>';
echo ' <div class="bar"></div>';
echo '</div>';
}
$disp_month = $hList['co_month'];
$disp_day = $hList['co_day'];
$display = $disp_month.".".$disp_day." ";
echo '<p class="mt5">';
echo $display.rtrim(nl2br($hList['co_content']));
if($thumb['src']) {
$history_icon .= '<div class="history_icon">';
$history_icon .= '<strong>'.$hList[co_year].'</strong>';
$history_icon .= '<p class="tit">'.$thumb['alt'].'</p>';
$history_icon .= '</div>';
}
}
echo ' </div>';
echo $history_icon;
echo ' </div>';
}
}
?>
<div class="p_box">
<div class="history_img"><img src="<?php echo $history_url;?>/css/img/history_start.gif" style="position:absolute;bottom:0;left:83px;" alt="history_start"></div>
<div class="history_txt">
</div>
</div>
</div>
<div class="mt40"></div>
</div>
<script type="text/javascript">
var num = 0;
jQuery(document).ready(function(){
jQuery(".history_img").animate({opacity:0, marginTop:"120px"}, 0);
jQuery(".history_txt").animate({opacity:0, marginTop:"-50px"}, 0);
$(".history_icon").animate({opacity:0, marginTop:"-50px"}, 0);
})
jQuery(window).load(function(){
jQuery(".history_img").each(function(index){
jQuery.easing.def = "easeOutQuart";
num++;
jQuery(".history_img").eq(index).delay((450 * num)).animate({opacity:1, marginTop:"0px"}, 900);
jQuery(".history_txt").eq(index).delay((650 * num)).animate({opacity:1, marginTop:"0px"}, 900);
$(".history_icon").eq(index).delay((650 * num)).animate({opacity:1, marginTop:"0px"}, 600);
})
})
</script>
<!-- } 목록 끝 -->
[/code]
data\dbconfig.php
[code]
$g5['menu_table'] = G5_TABLE_PREFIX.'menu'; // 메뉴관리 테이블
$g5['social_profile_table'] = G5_TABLE_PREFIX.'member_social_profiles'; // 소셜 로그인 테이블
$g5['history_table'] = G5_TABLE_PREFIX.'history'; //회사연혁 한줄 추가해주세요
[/code]
adm/historylist.php
[code]
//DB 추가됩니다. dbconfig.php에 $g5['history_table'] = G5_TABLE_PREFIX.'history'; 추가되야지 작동됩니다.
$query_cp = sql_query(" CREATE TABLE IF NOT EXISTS `{$g5['history_table']}` (
`co_id` int(11) NOT NULL AUTO_INCREMENT,
`co_html` tinyint(4) NOT NULL DEFAULT '0',
`co_year` int(4) NOT NULL DEFAULT '0',
`co_month` int(2) NOT NULL DEFAULT '0',
`co_day` int(2) NOT NULL DEFAULT '0',
`co_content` longtext NOT NULL,
PRIMARY KEY (`co_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ", true);
[/code]
플러그인 특성 기능에 아니라 생각하시면 바로 삭제합니다.
2021.4.2 20:28 버그 수정
history_21-6-21.7z 더 최적화 버전입니다.
그냥 파일 업로드 하면 끝
data/dbconfig.php 파일에
$g5['history_table'] = G5_TABLE_PREFIX.'history'; //회사연혁
추가 초 간단..
댓글 30개
추천 꾹 눌러드렸어요~ :)
사실 제가 잘 몰라서요
Warning: Use of undefined constant bo_1 - assumed 'bo_1' (this will throw an Error in a future version of PHP) in /host/home2/daekyng/html/skin/board/history_edit/board_head.skin.php on line 2
Warning: Use of undefined constant bo_2 - assumed 'bo_2' (this will throw an Error in a future version of PHP) in /host/home2/daekyng/html/skin/board/history_edit/board_head.skin.php on line 5
Warning: Use of undefined constant bo_3 - assumed 'bo_3' (this will throw an Error in a future version of PHP) in /host/home2/daekyng/html/skin/board/history_edit/board_head.skin.php on line 9
Warning: Use of undefined constant bo_4 - assumed 'bo_4' (this will throw an Error in a future version of PHP) in /host/home2/daekyng/html/skin/board/history_edit/board_head.skin.php on line 12
회사연혁
Fatal error: Uncaught Error: Call to undefined function mysql_num_rows() in /host/home2/daekyng/html/skin/board/history_edit/list.skin.php:43 Stack trace: #0 /host/home2/daekyng/html/bbs/list.php(255): include_once() #1 /host/home2/daekyng/html/bbs/board.php(237): include_once('/host/home2/dae...') #2 {main} thrown in /host/home2/daekyng/html/skin/board/history_edit/list.skin.php on line 43
[http://sir.kr/data/editor/2106/d835e8b7be318dbad587d6293275cb51_1624254191_2216.png]
ㅠㅠ 하고싶은데 할줄몰아서요
두번째 파일( history_21-6-21.7z (10.3K) 0회 2021-06-21 21:50:42) 다운로드 받아보세요
이제 수정도해서 배경도 넣기도 하고..
일까지는 필요없어서 월까지만 넣어봤어요..
어려운 시간 내주셔서 감사합니다.
[http://sir.kr/data/editor/2106/a6ef6bc65783294f578781235fd4132e_1624623809_774.png]
아직 포인트가 없어서 설치는 못하지만!
1146 : Table 'saimdangsilver.g5_history' doesn't exist
error file : /sid/adm/historywrite.php
테이블생성이 안될때는 어떻게 하면 될런지요??
$g5['history_table'] = G5_TABLE_PREFIX.'history'; //회사연혁
추가하셨나요?
게시판 목록
그누보드5 플러그인
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 645 |
비버팩토리
|
2개월 전 | 253 | |
| 644 |
|
2개월 전 | 447 | |
| 643 |
11qkr
|
2개월 전 | 363 | |
| 642 | 2개월 전 | 543 | ||
| 641 |
|
2개월 전 | 414 | |
| 640 |
|
2개월 전 | 496 | |
| 639 | 3개월 전 | 502 | ||
| 638 | 3개월 전 | 471 | ||
| 637 | 3개월 전 | 688 | ||
| 636 | 3개월 전 | 889 | ||
| 635 | 4개월 전 | 792 | ||
| 634 |
비버팩토리
|
4개월 전 | 798 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기