Skip to content
This repository has been archived by the owner on Jun 24, 2021. It is now read-only.

Commit

Permalink
JS CSS 버전상수 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
chicpro committed Oct 17, 2016
1 parent 4d60395 commit 34853ca
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion adm/admin.tail.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<!-- <p>실행시간 : <?php echo get_microtime() - $begin_time; ?> -->

<script src="<?php echo G5_ADMIN_URL ?>/admin.js"></script>
<script src="<?php echo G5_ADMIN_URL ?>/admin.js<?php echo G5_JS_VER; ?>"></script>
<script>
$(function(){
var hide_menu = false;
Expand Down
2 changes: 1 addition & 1 deletion adm/board_copy.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
include_once(G5_PATH.'/head.sub.php');
?>

<script src="<?php echo G5_ADMIN_URL ?>/admin.js"></script>
<script src="<?php echo G5_ADMIN_URL ?>/admin.js<?php echo G5_JS_VER; ?>"></script>

<div class="new_win">
<h1><?php echo $g5['title']; ?></h1>
Expand Down
6 changes: 6 additions & 0 deletions extend/version.extend.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가

define('G5_JS_VER', '161020');
define('G5_CSS_VER', '161020');
?>
9 changes: 8 additions & 1 deletion lib/common.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -2423,6 +2423,8 @@ function run()
if(!trim($link[1]))
continue;

$link[1] = preg_replace('#\.css([\'\"]?>)$#i', '.css?ver='.G5_CSS_VER.'$1', $link[1]);

$stylesheet .= PHP_EOL.$link[1];
}
}
Expand All @@ -2447,6 +2449,8 @@ function run()
if(!trim($js[1]))
continue;

$js[1] = preg_replace('#\.js([\'\"]?>)$#i', '.js?ver='.G5_JS_VER.'$1', $js[1]);

$javascript .= $php_eol.$js[1];
$php_eol = PHP_EOL;
}
Expand All @@ -2464,7 +2468,10 @@ function run()
<body>
전에 스킨의 자바스크립트가 위치하도록 하게 한다.
*/
$buffer = preg_replace('#(</head>[^<]*<body[^>]*>)#', "$javascript\n$1", $buffer);
$nl = '';
if($javascript)
$nl = "\n";
$buffer = preg_replace('#(</head>[^<]*<body[^>]*>)#', "$javascript{$nl}$1", $buffer);

return $buffer;
}
Expand Down

0 comments on commit 34853ca

Please sign in to comment.