[심심풀이] 회사 연혁 부분을 플러그인으로.. 정보
[심심풀이] 회사 연혁 부분을 플러그인으로..
첨부파일
본문
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
<?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');
?>
extend
<?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();
plugin/history/index.php
<?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>
<!-- } 목록 끝 -->
data\dbconfig.php
$g5['menu_table'] = G5_TABLE_PREFIX.'menu'; // 메뉴관리 테이블
$g5['social_profile_table'] = G5_TABLE_PREFIX.'member_social_profiles'; // 소셜 로그인 테이블
$g5['history_table'] = G5_TABLE_PREFIX.'history'; //회사연혁 한줄 추가해주세요
adm/historylist.php
//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);
플러그인 특성 기능에 아니라 생각하시면 바로 삭제합니다.
2021.4.2 20:28 버그 수정
!-->!-->!-->!-->!-->댓글 전체


추천 꾹 눌러드렸어요~ :)



