# ---- 在 加上 rel='lyteframe[booth]' title='{$number}' rev='width: 600px; height: 600px; scrolling: yes;' # ---- 在 head 加上 //--------------------- 引入jquery ------------------------------------- if(!file_exists(XOOPS_ROOT_PATH."/modules/tadtools/jquery.php")){ redirect_header("index.php",3, _TAD_NEED_TADTOOLS); } include_once XOOPS_ROOT_PATH."/modules/tadtools/jquery.php"; $jquery_path = get_jquery(); //一般只要此行即可 # -------- 燈箱---------------------------------------- $lytebox=" "; # -------------------------------------------------------- # ---- 在switch 加上 -------------------------------------------- //瀏覽單筆資料->燈箱 圖片 case "ugm_market_booth_view": echo show_lytebox_html(show_one_ugm_market_booth($sn),""); #秀單筆的程式碼 exit; # --------------------------------------------------------------- # ---- 在block_function ---------------------------------------- ################################################################################ # 燈箱打包碼(內容,標題) # # # ################################################################################ if(!function_exists("show_lytebox_html")){ function show_lytebox_html($content,$title){ global $xoopsModule; # ---- 取得模組目錄名稱 --------------- $MDIR=$xoopsModule->getVar('dirname'); # ------------------------------------- $main="{$title} {$content} "; return $main; } }{$title}
2013年9月25日 星期三
取得XOOPS內建表單語法
取得XOOPS內建表單語法
群組多選選單
群組多選選單
# ---- 引入XOOPS 內建表單物件 -------------------------------
include_once(XOOPS_ROOT_PATH."/class/xoopsformloader.php");
# ---- 預設值 -----------------------------------------------
$group=$xoopsModuleConfig['query_admin'];
# ---- XoopsFormSelectGroup('標題', 'name', 含訪客, '預設值', 高度 ,多選)
$form=new XoopsFormSelectGroup ("", "group", false, $group, 3, true);
# ---- 輸出HTML碼 ------------------------------------------
$main_form = $form->render();
# ----- 輸出驗證碼-----------------------------------------------------
$configs="";
$Captcha=new XoopsFormCaptcha ("請輸入驗證碼", 'xoopscaptcha', false, $configs);
# ---- 輸出HTML碼 ------------------------------------------
$form_Captcha = $Captcha->render();
2013年8月31日 星期六
bootstrap accordion-menu
bootstrap accordion-menu 架構
參考網站:http://kkbruce.tw/Bootstrap/JavaScript#collapse
<div class="accordion" id="menu_block_1">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#menu_block_1" href="#menu_sn_1">伸縮選單1</a>
</div>
<div id="menu_sn_1" class="accordion-body in collapse">
<div class="accordion-inner">
<ul>
<li>第一層21</li>
<li>第一層22</li>
<li>第一層2</li>
</ul>
</div>
</div>
</div>
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#menu_block_1" href="#menu_sn_2">伸縮選單2</a>
</div>
<div id="menu_sn_2" class="accordion-body in collapse">
<div class="accordion-inner">
<ul>
<li>第一層21</li>
<li>第一層22</li>
<li>第一層2</li>
</ul>
</div>
</div>
</div>
</div>
2013年8月15日 星期四
AJAX JQUERY
範例網址:http://www.tad0616.net/modules/tad_book3/page.php?tbdsn=746
ajax_utility.php
js
html
ajax_utility.php
<?php include_once "header.php"; $market_sn=$_REQUEST['market_sn']; echo get_market_fill($market_sn); ?>這裡直返回「填發人員」
js
<script>
//開啟表單時
$(document).ready(function(){
//由市場決定填發人員
$.post('ajax_utility.php' , {market_sn:$('#market_sn').val()},
function(data){
$('#fill').val(data);
});
//市場改變,填發人員改變
$('#market_sn').change(function(){
$.post('ajax_utility.php' , {market_sn: $('#market_sn').val()},
function(data){
$('#fill').val(data); //排序
});
});
//自動抓取年度
$('#limit_year').val($('#year').val()); //年度
$('#year').change(function(){
$('#limit_year').val($('#year').val()); //年度
});
//自動抓取月份
$('#limit_month').val($('#month').val()); //月份
$('#month').change(function(){
$('#limit_month').val($('#month').val()); //月份
});
});
</script>
取得值:$('#market_sn').val()
寫入值:$('#fill').val(data);
jQuery的.val ()方法
- $('#menu1').val()可以取得id="menu1"的網頁元件的值。
- $('#menu1').val('xxx')可以設定id="menu1"的網頁元件的值。
html
<select name='market_sn' size=1 id='market_sn'>{$market_select_option}</select>
<input type='text' name='fill' size='5' value='' id='fill' >
2013年8月5日 星期一
2013年8月3日 星期六
模組開發物件
按鈕
2.
$add_button="<a href='{$_SERVER['PHP_SELF']}?op=ugm_market_hire_form' class='Button'><span>按鈕</span></a>";
固定表格<table border='0' cellspacing='3' cellpadding='3' id='ugm_tb' style='word-wrap:break-word; word-break:break-all;table-layout:fixed;'>表單
<td><input type='text' name='hier[{$sn}][userfees]' value='{$userfees}' id='userfees_{$sn}' class='validate[required,custom[integer]]' style='width:60px'></td>
<td><input type='text' name='hier[{$sn}][cleaningfees]' value='{$cleaningfees}' id='cleaningfees_{$sn}' class='validate[required,custom[integer]]' style='width:60px'></td>
<td><input type='text' name='hier[{$sn}][delayfees]' value='{$delayfees}' id='delayfees_{$sn}' class='validate[custom[integer]]' style='width:60px'></td>
<td><input type='text' name='hier[{$sn}][ps]' value='{$ps}' id='ps_{$sn}' style='width:140px'></td>
接收foreach ($_REQUEST['hier'] as $sn => $data){
foreach ($data as $k => $v){
//以下會產生這些變數: $userfees, $cleaningfees,$delayfees,$ps
$$k=$v;
}
echo $sn."<br>";
echo $userfees."<br>";
echo $cleaningfees."<br>";
echo $delayfees."<br>";
echo $ps."<br>";
die();
}
2.
$last_button="上一步";
2013年7月25日 星期四
「UGM_自訂頁面」模組更新(2.0)
-
這一版的更新主要是將模組改為XOOPS 2.5.5的模組架構
示範網站:http://www.taytzang.com.tw/web/
請先上傳覆蓋模組,並執行模組更新:
- 檔案下載位置:
-
育將電腦工作室:XOOPS 模組開發及修改
聯絡:tawan158@gmail.com ugm
2013年7月22日 星期一
「UGM_自訂頁面」模組更新(1.8)增加英文語系
- 這次更新主要是增加英文語系。
示範網站:http://www.taytzang.com.tw/web
請先上傳覆蓋模組,並執行模組更新:
2.檔案下載位置:
3.育將電腦工作室:XOOPS 模組開發及修改
聯絡:tawan158@gmail.com ugm
聯絡:tawan158@gmail.com ugm
2013年7月8日 星期一
「UGM_自訂頁面」模組更新(1.8)增加佈景引入「下拉選單」、「圖片輪撥」功能
這次更新主要是增加增加佈景引入「下拉選單」、「圖片輪撥」功能。
2.請在佈景檔,適當位置加入下方語法
<div >
<{includeq file="$xoops_rootpath/modules/ugm_page/templates/ugm_page_block_slider.html"}> <!-- 引入ugm_page 自訂頁面第一個圖片輪撥 -->
</div>
<div>
<{includeq file="$xoops_rootpath/modules/ugm_page/templates/ugm_page_block_menu.html"}><!-- 引入ugm_page 自訂頁面第一個下拉選單 -->
<div class="clear"></div>
</div>
3.請建立下拉選單及圖片輪撥的資料
4.檔案下載位置:
2013年5月25日 星期六
XOOPS的時間函數運用(new)
本範例為「日期示範」
FORM_預設值:
//設定「start_date」欄位預設值
$start_date=(!isset($DBV['start_date']))?"":date("Y-m-d",xoops_getUserTimestamp($DBV['start_date']));
//設定「end_date」欄位預設值
$end_date=(!isset($DBV['end_date']))?"":date("Y-m-d",xoops_getUserTimestamp($DBV['end_date']));
INSERT_寫入資料庫:
# -------- 處理時間(日期格式->時間戳記) -------------------------------------- $_POST['start_date']=userTimeToServerTime(strtotime($_POST['start_date'])); $_POST['end_date']=userTimeToServerTime(strtotime($_POST['end_date'])); # -------------------------------------------------------------------------
LIST_從資料庫撈出:
# -------- 處理時間(時間戳記->日期格式) -------------------------------------
$start_date=date("Y-m-d",xoops_getUserTimestamp($start_date));
$end_date=date("Y-m-d",xoops_getUserTimestamp($end_date));
# ---------------------------------------------------------------------------
訂閱:
文章 (Atom)






