本文整理汇总了PHP中add_javascript函数的典型用法代码示例。如果您正苦于以下问题:PHP add_javascript函数的具体用法?PHP add_javascript怎么用?PHP add_javascript使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了add_javascript函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mw_script
function mw_script($src)
{
global $html_process;
if (!@is_file(G5_PATH . $src)) {
return;
}
$mtime = filemtime(G5_PATH . $src);
$src = G5_URL . $src . "?" . $mtime;
add_javascript("<script src=\"{$src}\"></script>");
}
示例2: geo_init
function geo_init($f = 'geo_basic_load', $latlng = false, $zoom = 7, $icontype = 'user')
{
global $globals;
if (!$globals['google_maps_api']) {
return false;
}
array_push($globals['extra_js'], 'http://maps.google.com/maps?file=api&v=2&key=' . $globals['google_maps_api']);
array_push($globals['extra_js'], 'geo.js');
if ($f) {
if ($latlng) {
add_javascript($f . '(' . $latlng->lat . ',' . $latlng->lng . ', ' . $zoom . ', \'' . $icontype . '\');');
$globals['body_args'] = 'onunload="GUnload()"';
} else {
add_javascript($f . '(false, false, ' . $zoom . ', \'' . $icontype . '\');');
$globals['body_args'] = 'onunload="GUnload()"';
}
} else {
$globals['body_args'] = 'onunload="GUnload()"';
}
return true;
}
示例3: sql_query
if (!isset($mb['mb_addr3'])) {
sql_query(" ALTER TABLE {$g5['member_table']} ADD `mb_addr3` varchar(255) NOT NULL DEFAULT '' AFTER `mb_addr2` ", false);
}
// 중복가입 확인필드 추가
if (!isset($mb['mb_dupinfo'])) {
sql_query(" ALTER TABLE {$g5['member_table']} ADD `mb_dupinfo` varchar(255) NOT NULL DEFAULT '' AFTER `mb_adult` ", false);
}
if ($mb['mb_intercept_date']) {
$g5['title'] = "차단된 ";
} else {
$g5['title'] .= "";
}
$g5['title'] .= '회원 ' . $html_title;
include_once './admin.head.php';
// add_javascript('js 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_javascript(G5_POSTCODE_JS, 0);
//다음 주소 js
?>
<form name="fmember" id="fmember" action="./member_form_update.php" onsubmit="return fmember_submit(this);" method="post" enctype="multipart/form-data">
<input type="hidden" name="w" value="<?php
echo $w;
?>
">
<input type="hidden" name="sfl" value="<?php
echo $sfl;
?>
">
<input type="hidden" name="stx" value="<?php
echo $stx;
?>
示例4: add_javascript
<?php
include_once './_common.php';
// add_javascript('js 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_javascript(G5_POSTCODE_JS, 0);
//다음 주소 js
// 주문상품 재고체크 js 파일
add_javascript('<script src="' . G5_JS_URL . '/shop.order.js"></script>', 0);
if (G5_IS_MOBILE) {
include_once G5_MSHOP_PATH . '/orderform.php';
return;
}
set_session("ss_direct", $sw_direct);
// 장바구니가 비어있는가?
if ($sw_direct) {
$tmp_cart_id = get_session('ss_cart_direct');
} else {
$tmp_cart_id = get_session('ss_cart_id');
}
if (get_cart_count($tmp_cart_id) == 0) {
alert('장바구니가 비어 있습니다.', G5_SHOP_URL . '/cart.php');
}
$g5['title'] = '주문서 작성';
// 전자결제를 사용할 때만 실행
if ($default['de_iche_use'] || $default['de_vbank_use'] || $default['de_hp_use'] || $default['de_card_use']) {
switch ($default['de_pg_service']) {
case 'lg':
$g5['body_script'] = ' onload="isActiveXOK();"';
break;
case 'inicis':
$g5['body_script'] = ' onload="javascript:enable_click()"';
示例5: apms_script
function apms_script($name)
{
if ($name == 'code') {
if (!defined('APMS_CODE')) {
define('APMS_CODE', true);
add_stylesheet('<link rel="stylesheet" href="' . APMS_PLUGIN_URL . '/syntaxhighlighter/styles/shCoreDefault.css">', -1);
$code_script = '<script src="' . APMS_PLUGIN_URL . '/syntaxhighlighter/scripts/shCore.js"></script>' . PHP_EOL;
$code_script .= '<script src="' . APMS_PLUGIN_URL . '/syntaxhighlighter/scripts/shBrushJScript.js"></script>' . PHP_EOL;
$code_script .= '<script src="' . APMS_PLUGIN_URL . '/syntaxhighlighter/scripts/shBrushPhp.js"></script>' . PHP_EOL;
$code_script .= '<script src="' . APMS_PLUGIN_URL . '/syntaxhighlighter/scripts/shBrushCss.js"></script>' . PHP_EOL;
$code_script .= '<script src="' . APMS_PLUGIN_URL . '/syntaxhighlighter/scripts/shBrushXml.js"></script>' . PHP_EOL;
$code_script .= '<script>var is_SyntaxHighlighter = true; SyntaxHighlighter.all(); </script>';
add_javascript($code_script, 99);
}
} else {
if ($name == 'imagesloaded') {
if (!defined('APMS_IMAGESLOADED')) {
define('APMS_IMAGESLOADED', true);
add_javascript('<script src="' . APMS_PLUGIN_URL . '/js/imagesloaded.pkgd.min.js"></script>', 0);
}
} else {
if ($name == 'infinite') {
if (!defined('APMS_INFINITESCROLL')) {
define('APMS_INFINITESCROLL', true);
add_javascript('<script src="' . APMS_PLUGIN_URL . '/js/jquery.infinitescroll.min.js"></script>', 0);
}
} else {
if ($name == 'masonry') {
if (!defined('APMS_MASONRY')) {
define('APMS_MASONRY', true);
add_javascript('<script src="' . APMS_PLUGIN_URL . '/js/masonry.pkgd.min.js"></script>', 0);
}
} else {
if ($name == 'swipe') {
if (!defined('APMS_SWIPE')) {
define('APMS_SWIPE', true);
add_javascript('<script src="' . APMS_PLUGIN_URL . '/js/jquery.mobile.swipe.min.js"></script>', 0);
}
} else {
if ($name == 'touch') {
if (!defined('APMS_TOUCH')) {
define('APMS_TOUCH', true);
add_javascript('<script src="' . APMS_PLUGIN_URL . '/js/jquery.touchwipe.min.js"></script>', 0);
}
} else {
if ($name == 'height') {
if (!defined('APMS_MATCHHEIGHT')) {
define('APMS_MATCHHEIGHT', true);
add_javascript('<script src="' . APMS_PLUGIN_URL . '/js/jquery.matchHeight-min.js"></script>', 0);
}
} else {
if ($name == 'modal') {
if (!defined('APMS_MODAL')) {
define('APMS_MODAL', true);
include_once G5_LIB_PATH . '/apms.modal.lib.php';
}
return ' onclick="view_modal(this.href); return false;"';
} else {
if ($name == 'lazy') {
if (!defined('APMS_LAZY')) {
define('APMS_LAZY', true);
add_javascript('<script src="' . APMS_PLUGIN_URL . '/js/jquery.lazyload.min.js"></script>', 0);
echo '<script>' . PHP_EOL;
echo '$(function(){' . PHP_EOL;
echo '$("img.alazy").lazyload({ effect : "fadeIn" });' . PHP_EOL;
echo '});' . PHP_EOL;
echo '</script>' . PHP_EOL;
}
} else {
if ($name == 'swiper') {
if (!defined('APMS_SWIPER')) {
define('APMS_SWIPER', true);
add_stylesheet('<link rel="stylesheet" href="' . APMS_PLUGIN_URL . '/swiper/css/swiper.css">', -1);
add_javascript('<script src="' . APMS_PLUGIN_URL . '/swiper/js/swiper.jquery.min.js"></script>', 0);
}
} else {
if ($name == 'datepicker') {
if (!defined('APMS_DATEPICKER')) {
define('APMS_DATEPICKER', true);
add_stylesheet('<link rel="stylesheet" href="' . APMS_PLUGIN_URL . '/datepicker/css/bootstrap-datetimepicker.min.css">', -1);
$datepicker_script = '<script src="' . APMS_PLUGIN_URL . '/datepicker/js/moment-with-locales.min.js"></script>' . PHP_EOL;
$datepicker_script .= '<script src="' . APMS_PLUGIN_URL . '/datepicker/js/bootstrap-datetimepicker.js"></script>';
add_javascript($datepicker_script, 0);
}
} else {
if ($name == 'scrollbar') {
if (!defined('APMS_SCROLLBAR')) {
define('APMS_SCROLLBAR', true);
add_stylesheet('<link rel="stylesheet" href="' . APMS_PLUGIN_URL . '/perfect-scrollbar/perfect-scrollbar.min.css">', -1);
add_javascript('<script src="' . APMS_PLUGIN_URL . '/perfect-scrollbar/perfect-scrollbar.jquery.min.js"></script>', 0);
}
} else {
if ($name == 'accordion') {
if (!defined('APMS_ACCORDION')) {
define('APMS_ACCORDION', true);
add_stylesheet('<link rel="stylesheet" href="' . APMS_PLUGIN_URL . '/accordion/accordion.css">', -1);
add_javascript('<script src="' . APMS_PLUGIN_URL . '/accordion/accordion.js"></script>', 0);
}
} else {
if ($name == 'lightbox') {
//.........这里部分代码省略.........
示例6: array
}
}
// 효과 목록
$effects = array();
$effects_path = scandir('./templates/effects/');
foreach ($effects_path as $effect) {
if (!preg_match('/^\\./', $effect)) {
$effects[] = $effect;
}
}
$g5['title'] = '이미지 슬라이드 관리';
include_once G5_ADMIN_PATH . '/admin.head.php';
include_once G5_PLUGIN_PATH . '/jquery-ui/datepicker.php';
add_stylesheet('<link rel="stylesheet" href="' . G5_WS_ADMIN_URL . '/styles/style.css">', 0);
add_javascript('<script src="' . G5_WS_ADMIN_URL . '/scripts/jquery.form.min.js"></script>', 0);
add_javascript('<script src="' . G5_WS_ADMIN_URL . '/scripts/common.js"></script>', 0);
$pg_anchor = '<ul class="anchor">
<li><a href="#anc_ws_basic">기본환경</a></li>
<li><a href="#anc_ws_design">테마/효과</a></li>
<li><a href="#anc_ws_images">이미지</a></li>
</ul>';
if ($w == 'u') {
$sql = 'select * from `' . $g5['ws_master_table'] . '` where ws_id = "' . $ws_id . '"';
$ws = sql_fetch($sql);
$ws_id = $ws['ws_id'];
$ws_auto_play = $ws['ws_auto_play'] == 'Y' ? ' checked="checked" ' : '';
$ws_pause_on_mouseover = $ws['ws_pause_on_mouseover'] == 'Y' ? ' checked="checked" ' : '';
$ws_stop_slideshow = $ws['ws_stop_slideshow'] == 'Y' ? ' checked="checked" ' : '';
$ws_random_order = $ws['ws_random_order'] == 'Y' ? ' checked="checked" ' : '';
$ws_pause_play_button = $ws['ws_pause_play_button'] == 'Y' ? ' checked="checked" ' : '';
$ws_full_screen_button = $ws['ws_full_screen_button'] == 'Y' ? ' checked="checked" ' : '';
示例7: add_javascript
<?php
include_once './_common.php';
// add_javascript('js 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_javascript(G5_POSTCODE_JS, 0);
//다음 주소 js
// 주문상품 재고체크 js 파일
add_javascript('<script src="' . G5_JS_URL . '/shop.order.js"></script>', 0);
add_javascript('<script src="' . G5_JS_URL . '/shop.cart_time.js"></script>', 0);
if (G5_IS_MOBILE) {
include_once G5_MSHOP_PATH . '/orderform.php';
return;
}
set_session("ss_direct", $sw_direct);
// 장바구니가 비어있는가?
if ($sw_direct) {
$tmp_cart_id = get_session('ss_cart_direct');
} else {
$tmp_cart_id = get_session('ss_cart_id');
}
if (get_cart_count($tmp_cart_id) == 0) {
alert('상품이 없습니다.', G5_SHOP_URL);
}
$g5['title'] = '주문서 작성';
// 전자결제를 사용할 때만 실행
if ($default['de_iche_use'] || $default['de_vbank_use'] || $default['de_hp_use'] || $default['de_card_use']) {
switch ($default['de_pg_service']) {
case 'lg':
$g5['body_script'] = ' onload="isActiveXOK();"';
break;
case 'inicis':
示例8: init_js
/**
* Init eventual Javascript useful for the application.
* Extends the class Loader if you have to load more javascript
*/
function init_js()
{
add_javascript("var url = '" . URL . "';");
}
示例9: _word
function _word($name, $value, $param)
{
add_script("jquery.tinymce.js", LIBRARY_DIR . "Form/plugins/tiny_mce/");
$mode = isset($param['mode']) && $param['mode'] == 'simple' ? 'simple' : 'advanced';
$css = isset($param['css']) ? ',content_css:"' . $param['css'] . '"' : null;
if (!isset($param['rows']) and !isset($param['height'])) {
$param['rows'] = $mode == 'simple' ? 8 : 18;
}
$param['rows'] = isset($param['rows']) ? $param['rows'] : '';
$param['cols'] = isset($param['cols']) ? $param['cols'] : '';
/* autoresize */
if ($mode == 'advanced') {
// add plugin: ,rain
$tinymce_param = '
plugins: "safari,fullscreen,searchreplace,media,paste,autosave,inlinepopups,print,pagebreak",
theme_advanced_buttons1 : "bold,italic,underline,|,justifyleft,justifycenter,justifyright,justifyfull,fontsizeselect,|,forecolor,backcolor,|,fullscreen,pagebreak",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,replace,|,bullist,numlist,|,undo,redo,|,link,unlink,image,media,code,|,hr,removeformat,|,charmap",
theme_advanced_buttons3 : "",
paste_auto_cleanup_on_paste : true,
theme_advanced_toolbar_location: "top",
theme_advanced_toolbar_align: "left",
theme_advanced_path_location: "bottom",
theme_advanced_resizing : true,
theme_advanced_resize_horizontal : false,
theme_advanced_resizing_use_cookie : false,
valid_elements: "*[*]",
pagebreak_separator : "<!-- page break -->"' . $css;
} else {
$tinymce_param = '
theme_advanced_buttons1 : "bold,italic,underline, strikethrough, separator,justifyleft, justifycenter,justifyright,justifyfull",
theme_advanced_buttons2: "",
theme_advanced_buttons3: "",
paste_auto_cleanup_on_paste : true,
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_resize_vertical : true,
theme_advanced_path_location: "bottom",
theme_advanced_resizing : true,
theme_advanced_resize_horizontal : false,
theme_advanced_resizing_use_cookie : false,
auto_resize : true,
valid_elements: "*[*]"' . $css;
}
add_javascript('$("textarea.mce_' . $name . '").tinymce({
theme: "advanced",
language: "' . LANG_ID . '",
mode: "exact",
elements: "' . $name . '",
force_br_newlines: true,
tab_focus: ":prev,:next",
convert_fonts_to_spans: false,
onchange_callback: function(editor) {
tinyMCE.triggerSave();
$("#" + editor.id).valid();
},
' . $tinymce_param . '
})
', $onload = true);
$attributes = "";
if (is_array($param)) {
foreach ($param as $attr => $val) {
if ($attr != 'css' && $attr != 'mode') {
$attributes .= " {$attr}=\"{$val}\"";
}
}
}
$this->tiny_mce = true;
return "<textarea name=\"{$name}\" id=\"{$name}\" class=\"textarea mce_{$name}\" {$attributes}>{$value}</textarea>";
}
示例10: add_stylesheet
<?php
if (!defined("_GNUBOARD_")) {
exit;
}
// 개별 페이지 접근 불가
global $mwus;
global $theme_path;
if (function_exists("mw_css")) {
//mw_css($popular_skin_url.'/style.php');
add_stylesheet("<link rel=\"stylesheet\" href=\"{$popular_skin_url}/style.php\">");
mw_script($theme_path . '/js/mw.slider.js');
} else {
add_stylesheet("<link rel=\"stylesheet\" href=\"{$popular_skin_url}/style.php\">");
add_javascript("<script src=\"" . G5_URL . "/js/mw.slider.js\"></script>");
}
$href = G5_BBS_URL . "/search.php?stx=";
if ($mwus['path']) {
$href = $mwus['path'] . "/?stx=";
}
?>
<div class="scroll">
<ul>
<?php
for ($i = 0; $i < $pop_cnt; $i++) {
if (!is_array($list[$i])) {
continue;
}
$str = urlencode($list[$i]['pp_word']);
$gap = '';
if ($list[$i][icon] != "new" && $list[$i][icon] != "nogap") {
示例11: add_stylesheet
if (defined("_MW_MOBILE_")) {
echo "<link rel=\"stylesheet\" href=\"{$c}\"></script>" . PHP_EOL;
} else {
if (is_g5()) {
add_stylesheet("<link rel=\"stylesheet\" href=\"{$c}\"/>");
} else {
echo "<link rel=\"stylesheet\" href=\"{$c}\"></script>" . PHP_EOL;
}
}
}
foreach ($script as $s) {
if (defined("_MW_MOBILE_")) {
echo "<script src=\"{$s}\"></script>" . PHP_EOL;
} else {
if (is_g5()) {
add_javascript("<script src=\"{$s}\"></script>");
} else {
echo "<script src=\"{$s}\"></script>" . PHP_EOL;
}
}
}
if ($is_admin == "super") {
?>
<script>
function mw_config() {
var url = "<?php
echo $board_skin_path;
?>
/mw.adm/mw.config.php?bo_table=<?php
echo $bo_table;
?>
示例12: auth_check
auth_check($auth[$sub_menu], 'r');
// http://www.jqplot.com/
add_stylesheet('<link rel="stylesheet" href="' . G5_PLUGIN_URL . '/jqplot/jquery.jqplot.css">', 0);
add_javascript('<script src="' . G5_PLUGIN_URL . '/jqplot/jquery.jqplot.js"></script>', 0);
add_javascript('<script src="' . G5_PLUGIN_URL . '/jqplot/plugins/jqplot.canvasTextRenderer.min.js"></script>', 0);
add_javascript('<script src="' . G5_PLUGIN_URL . '/jqplot/plugins/jqplot.categoryAxisRenderer.min.js"></script>', 0);
add_javascript('<script src="' . G5_PLUGIN_URL . '/jqplot/plugins/jqplot.pointLabels.min.js"></script>', 0);
add_javascript('<!--[if lt IE 9]><script src="' . G5_PLUGIN_URL . '/jqplot/excanvas.js"></script><![endif]-->', 0);
if (!($graph == 'line' || $graph == 'bar')) {
$graph = 'line';
}
if ($graph == 'bar') {
// 바 타입으로 사용하는 코드입니다.
add_javascript('<script src="' . G5_PLUGIN_URL . '/jqplot/jqplot.barRenderer.min.js"></script>', 0);
add_javascript('<script src="' . G5_PLUGIN_URL . '/jqplot/jqplot.categoryAxisRenderer.min.js"></script>', 0);
add_javascript('<script src="' . G5_PLUGIN_URL . '/jqplot/jqplot.pointLabels.min.js"></script>', 0);
}
$g5['title'] = '글,댓글 현황';
include_once './admin.head.php';
$period_array = array('오늘' => array('시간', 0), '어제' => array('시간', 0), '7일전' => array('일', 7), '14일전' => array('일', 14), '30일전' => array('일', 30), '3개월전' => array('주', 90), '6개월전' => array('주', 180), '1년전' => array('월', 365), '2년전' => array('월', 365 * 2), '3년전' => array('월', 365 * 3), '5년전' => array('년', 365 * 5), '10년전' => array('년', 365 * 10));
$is_period = false;
foreach ($period_array as $key => $value) {
if ($key == $period) {
$is_period = true;
break;
}
}
if (!$is_period) {
$period = '오늘';
}
$day = $period_array[$period][0];
示例13: add_stylesheet
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
if (!defined("_GNUBOARD_")) {
exit;
}
// 개별 페이지 접근 불가
add_stylesheet(get_skin_stylesheet($outlogin_skin_path));
add_javascript(get_skin_javascript($outlogin_skin_path));
?>
<div class="outlogin">
<form name="foutlogin" action="<?php
echo $outlogin_action_url;
?>
" method="post" autocomplete="off">
<input type="hidden" name="url" value="<?php
echo $outlogin_url;
?>
"/>
<div class="func">
<a href="<?php
echo G5_BBS_URL;
?>
/register.php"><strong><i class="fa fa-user"></i> 회원가입</strong></a>
示例14: fread
$co['co_content'] = fread($fp, $flength);
fclose($fp);
}
if (file_exists($contentpath . "/mobile/" . $co['co_id'] . ".php") && ($fp = fopen($contentpath . "/mobile/" . $co['co_id'] . ".php", 'rb'))) {
$flength = filesize($contentpath . "/mobile/" . $co['co_id'] . ".php") > 0 ? filesize($contentpath . "/mobile/" . $co['co_id'] . ".php") : 1024;
$co['co_mobile_content'] = fread($fp, $flength);
fclose($fp);
}
} else {
$html_title .= ' 입력';
$co['co_html'] = 2;
$co['co_skin'] = 'basic';
$co['co_mobile_skin'] = 'basic';
}
include_once G5_ADMIN_PATH . '/admin.head.php';
add_javascript('<script type="text/javascript" src="' . G5_PLUGIN_URL . '/ace-builds/src-min-noconflict/ace.js" charset="utf-8"></script>', 0);
?>
<style type="text/css" media="screen">
textarea.co_content { display: none; }
#co_content_editor, #co_mobile_content_editor {
width: 100%;
height: 400px;
}
</style>
<form name="frmcontentform" action="./contentformupdate.php" onsubmit="return frmcontentform_check(this);" method="post" enctype="MULTIPART/FORM-DATA" >
<input type="hidden" name="w" value="<?php
echo $w;
?>
">
<input type="hidden" name="co_html" value="1">
示例15: add_javascript
<?php
if (!defined("_GNUBOARD_")) {
exit;
}
add_javascript("<script src='" . G5_URL . "/plugin/login-background/jquery.backstretch.min.js'></script>");
?>
<script>
function shuffle(o){ //v1.0
for(var j, x, i = o.length; i; j = Math.floor(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);
return o;
};
var images = [
<?php
for ($i = 1; $i <= 16; ++$i) {
?>
"<?php
echo G5_URL;
?>
/plugin/login-background/<?php
echo $i;
?>
.jpg",
<?php
}
?>
];
shuffle(images);
$.backstretch(images, {
fade: 1000,