tag:blogger.com,1999:blog-44908246221370298822024-03-14T16:49:13.920+08:00育將電腦工作室記錄一些與電腦有關的事項ugmhttp://www.blogger.com/profile/05956734290689814110noreply@blogger.comBlogger142125tag:blogger.com,1999:blog-4490824622137029882.post-13477283535214767182018-03-11T10:26:00.005+08:002018-03-11T10:34:32.364+08:00沒有執行自動安裝的功能<br />
<ol>
<li>從<a href="https://github.com/webugm/xm250" target="_blank">空白模組</a>,複製開發案子,但模組執行安裝,一直沒有出「自動安裝的功能」</li>
<li>結果是「xoops_version.php」<br /><br />//---模組自動功能---//<br />// $modversion['onInstall'] = "include/onInstall.php";<br />// $modversion['onUpdate'] = "include/onUpdate.php";<br />// $modversion['onUninstall'] = "include/onUninstall.php";<br /><br />這裡的檔名,沒有對應到,include/ 底下的檔名<br />已修正</li>
<li>若有執行成功,則會出現</li>
</ol>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://4.bp.blogspot.com/-6UORvcMbUDc/WqSTpCBpu4I/AAAAAAAAidk/tz34bhssU8Q5yysBLfHiyVBhcltfjxRAQCLcBGAs/s1600/%25E6%259C%2589%25E5%259F%25B7%25E8%25A1%258C%25E8%2587%25AA%25E5%258B%2595%25E5%258A%259F%25E8%2583%25BD.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="196" data-original-width="400" height="156" src="https://4.bp.blogspot.com/-6UORvcMbUDc/WqSTpCBpu4I/AAAAAAAAidk/tz34bhssU8Q5yysBLfHiyVBhcltfjxRAQCLcBGAs/s320/%25E6%259C%2589%25E5%259F%25B7%25E8%25A1%258C%25E8%2587%25AA%25E5%258B%2595%25E5%258A%259F%25E8%2583%25BD.JPG" width="320" /></a></div>
ugmhttp://www.blogger.com/profile/05956734290689814110noreply@blogger.com0tag:blogger.com,1999:blog-4490824622137029882.post-14542621509974457112018-02-28T14:09:00.002+08:002018-02-28T14:09:50.058+08:00使用 Hexo 打造部落格卡斯伯:https://www.facebook.com/WccCasper/<br />
<iframe allowfullscreen="true" allowtransparency="true" frameborder="0" height="448" scrolling="no" src="https://www.facebook.com/plugins/video.php?href=https%3A%2F%2Fwww.facebook.com%2FWccCasper%2Fvideos%2F486603828402512%2F&show_text=1&width=560" style="border: none; overflow: hidden;" width="560"></iframe>ugmhttp://www.blogger.com/profile/05956734290689814110noreply@blogger.com0tag:blogger.com,1999:blog-4490824622137029882.post-58704566730830167062018-02-09T13:16:00.002+08:002018-02-09T13:32:41.820+08:00$xoopsModule模組物件$xoopsModule模組物件<br />
$xoopsModule->mid() 取得模組代號<br />
$xoopsModule->dirname() 取得模組目錄名稱<br />
$xoopsModule->name() 取得模組名稱<br />
$xoopsModule->getInfo($name=null) 取得模組所有訊息,是個陣列<br />
在這裡你一樣可以用$xoopsModule->getVar('mid')的方式取得存在的相關資料,mid可以換成你想要取得的資料,如<br />
$xoopsModule->getVar('isactive') 判斷模組是否啟用<br />
取得目前的所有模組<br />
$module_handler = & xoops_gethandler('module');<br />
$modules=$module_handler->getList();<br />
根據目錄名稱顯示模組資訊<br />
$module_handler = & xoops_gethandler('module');<br />
$module=$module_handler->getByDirName($dirname);<br />
<br />
//判斷是否為管理員<br />
if ($xoopsUser) {<br />
$isAdmin = $xoopsUser->isAdmin($module_id);<br />
}ugmhttp://www.blogger.com/profile/05956734290689814110noreply@blogger.com0tag:blogger.com,1999:blog-4490824622137029882.post-21981152886456714252014-01-14T18:49:00.000+08:002014-01-14T18:51:06.410+08:00區塊ID<pre class="brush:php;">
$options[0]=$_REQUEST["bid"];//ID
<tr>
<th>1.</th><th>ID</th>
<td>
<input type='text' name='options[0]' value='{$options[0]}' size=12 readonly>
</td>
</tr>
</pre>ugmhttp://www.blogger.com/profile/05956734290689814110noreply@blogger.com1tag:blogger.com,1999:blog-4490824622137029882.post-92200496956134020872013-12-18T19:45:00.000+08:002013-12-18T19:51:54.484+08:00ugm_contact_us 20131218<h3 style="background-color: white; margin: 10px 0px; text-rendering: optimizelegibility;">
<span style="color: #333399; font-family: Helvetica Neue, Helvetica, Arial, 微軟正黑體, sans-serif; font-size: large;"><span style="line-height: 40px;">【關於 </span></span><span style="color: #333399; font-family: Helvetica Neue, Helvetica, Arial, 微軟正黑體, sans-serif;"><span style="font-size: 25px; line-height: 40px;">ugm_contact_us</span></span><span style="color: #333399; font-family: Helvetica Neue, Helvetica, Arial, 微軟正黑體, sans-serif; font-size: large;"><span style="line-height: 40px;"> 聯絡我們 2.0】</span></span></h3>
<div style="background-color: white; margin-bottom: 10px;">
<a href="http://2.bp.blogspot.com/-8FVc5EM8NZA/UrGKSVq7ZWI/AAAAAAAAKB4/UvomFH1Ea6c/s1600/logo.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="http://2.bp.blogspot.com/-8FVc5EM8NZA/UrGKSVq7ZWI/AAAAAAAAKB4/UvomFH1Ea6c/s1600/logo.png" /></a><span style="color: #111111; font-family: Helvetica Neue, Helvetica, Arial, 微軟正黑體, sans-serif;"><span style="font-size: 15px; line-height: 29.328125px;"> 1.後台界面全面重寫,套入BootStrap界面</span></span></div>
<div style="background-color: white; margin-bottom: 10px;">
<span style="color: #111111; font-family: Helvetica Neue, Helvetica, Arial, 微軟正黑體, sans-serif;"><span style="font-size: 15px; line-height: 29.328125px;"> 2.增加「聯絡單位」</span></span></div>
<div style="background-color: white; margin-bottom: 10px;">
<span style="color: #111111; font-family: Helvetica Neue, Helvetica, Arial, 微軟正黑體, sans-serif;"><span style="font-size: 15px; line-height: 29.328125px;"> 3.改變mail通知方式(使用xoops內建的xoopsMailer物件)、</span></span></div>
<div style="background-color: white; margin-bottom: 10px;">
<span style="color: #111111; font-family: Helvetica Neue, Helvetica, Arial, 微軟正黑體, sans-serif;"><span style="font-size: 15px; line-height: 29.328125px;"> 4.加入xoops 「Token」安全機制及使用xoops內建圖型驗證、</span></span></div>
<h3 style="background-color: white; color: #111111; font-family: 'Helvetica Neue', Helvetica, Arial, 微軟正黑體, sans-serif; font-size: 24.5px; line-height: 40px; margin: 10px 0px; text-rendering: optimizelegibility;">
<span style="color: #333399;"><br /></span></h3>
<h3 style="background-color: white; color: #111111; font-family: 'Helvetica Neue', Helvetica, Arial, 微軟正黑體, sans-serif; font-size: 24.5px; line-height: 40px; margin: 10px 0px; text-rendering: optimizelegibility;">
<span style="color: #333399;"><br /></span></h3>
<h3 style="background-color: white; color: #111111; font-family: 'Helvetica Neue', Helvetica, Arial, 微軟正黑體, sans-serif; font-size: 24.5px; line-height: 40px; margin: 10px 0px; text-rendering: optimizelegibility;">
<span style="color: #333399;">【關於 </span><span style="color: #333399; font-family: Helvetica Neue, Helvetica, Arial, 微軟正黑體, sans-serif;">ugm_contact_us</span><span style="color: #333399; font-family: Helvetica Neue, Helvetica, Arial, 微軟正黑體, sans-serif; font-size: large;"> 聯絡我們</span><span style="color: #333399; font-size: 24.5px;">】</span></h3>
<div style="background-color: white; color: #111111; font-family: 'Helvetica Neue', Helvetica, Arial, 微軟正黑體, sans-serif; font-size: 15px; line-height: 29.328125px; margin-bottom: 10px;">
這是一個小型的模組,主要用來與訪客聯絡事誼。</div>
<div style="background-color: white; color: #111111; font-family: 'Helvetica Neue', Helvetica, Arial, 微軟正黑體, sans-serif; font-size: 15px; line-height: 29.328125px; margin-bottom: 10px;">
它是小弟我的第一個開發的模組,架構是用tad老師的「XOOPS 模組製造機」所產生。</div>
<div style="background-color: white; color: #111111; font-family: 'Helvetica Neue', Helvetica, Arial, 微軟正黑體, sans-serif; font-size: 15px; line-height: 29.328125px; margin-bottom: 10px;">
它也可以用來當做小型的購物車,</div>
<div style="background-color: white; color: #111111; font-family: 'Helvetica Neue', Helvetica, Arial, 微軟正黑體, sans-serif; line-height: 29.328125px; margin-bottom: 10px;">
<span style="font-size: 15px;">範例網站:</span><span style="color: black; font-family: monospace; font-size: large; line-height: normal; white-space: pre-wrap;"><a href="http://www.sscgoose.com/modules/ugm_contact_us/" target="_blank">新享城鵝肉店</a></span></div>
<h3 style="background-color: white; color: #111111; font-family: 'Helvetica Neue', Helvetica, Arial, 微軟正黑體, sans-serif; font-size: 24.5px; line-height: 40px; margin: 10px 0px; text-rendering: optimizelegibility;">
<span style="color: #333399;">【更新資訊】</span></h3>
<div style="margin-bottom: 10px;">
<span style="background-color: yellow;"><span style="font-size: 15px; line-height: 29.328125px;"><span style="color: #111111; font-family: Helvetica Neue, Helvetica, Arial, 微軟正黑體, sans-serif;"><b>ugm_contact_us 2.0</b></span></span><strong style="color: #111111; font-family: 'Helvetica Neue', Helvetica, Arial, 微軟正黑體, sans-serif; font-size: 15px; line-height: 29.328125px;"> 版更新項目(2013-12-18 釋出)</strong></span></div>
<ol style="background-color: white; color: #111111; font-family: 'Helvetica Neue', Helvetica, Arial, 微軟正黑體, sans-serif; font-size: 15px; line-height: 29.328125px; list-style-image: initial; list-style-position: outside; margin: 0px 0px 10px 25px; padding: 0px;">
<li style="color: #233d5e; line-height: 20px; margin-left: 2px;"><span style="color: #111111; line-height: 29.328125px;">增加「聯絡單位」,可以設定多個管理員,每一個聯絡單位,可以設定多個收信信箱</span></li>
<li style="color: #233d5e; line-height: 20px; margin-left: 2px;">寄信工具使用使用xoops內建的xoopsMailer物件,只要xoops可以寄信,本模組亦可。</li>
<li style="color: #233d5e; line-height: 20px; margin-left: 2px;">全面導入BoootStrap</li>
</ol>
<h3 style="background-color: white; color: #111111; font-family: 'Helvetica Neue', Helvetica, Arial, 微軟正黑體, sans-serif; font-size: 24.5px; line-height: 40px; margin: 10px 0px; text-rendering: optimizelegibility;">
<span style="color: maroon;">【下載檔案】</span></h3>
<div style="background-color: white; margin-bottom: 10px;">
<a href="http://www.ugm.com.tw/modules/tad_uploader/index.php?of_cat_sn=12" target="_blank"><span style="background-color: transparent; font-size: 15px; line-height: 29.328125px;"><span style="color: #43597c; font-family: Helvetica Neue, Helvetica, Arial, 微軟正黑體, sans-serif;"><b>ugm_contact_us 2.0</b></span></span><strong style="color: #111111; font-family: 'Helvetica Neue', Helvetica, Arial, 微軟正黑體, sans-serif; font-size: 15px; line-height: 29.328125px;"><span style="color: #43597c;">模組 2.0 正式版(2013-12-18)</span></strong></a><span style="color: #111111; font-family: Helvetica Neue, Helvetica, Arial, 微軟正黑體, sans-serif;"><span style="font-size: 15px; line-height: 29.328125px;">(需搭配 </span></span><strong style="color: #111111; font-family: 'Helvetica Neue', Helvetica, Arial, 微軟正黑體, sans-serif; font-size: 15px; line-height: 29.328125px;"><span style="color: red;">Tad Tools 1.18</span></strong><span style="color: #111111; font-family: Helvetica Neue, Helvetica, Arial, 微軟正黑體, sans-serif;"><span style="font-size: 15px; line-height: 29.328125px;"> 以上版本)</span></span></div>
<h3 style="background-color: white; color: #111111; font-family: 'Helvetica Neue', Helvetica, Arial, 微軟正黑體, sans-serif; font-size: 24.5px; line-height: 40px; margin: 10px 0px; text-rendering: optimizelegibility;">
<span style="color: maroon;">【環境需求】</span></h3>
<ol style="background-color: white; color: #111111; font-family: 'Helvetica Neue', Helvetica, Arial, 微軟正黑體, sans-serif; font-size: 15px; line-height: 29.328125px; list-style-image: initial; list-style-position: outside; margin: 0px 0px 10px 25px; padding: 0px;">
<li style="color: #233d5e; line-height: 20px; margin-left: 2px;">XOOPS 2.0.x~2.5.x 都可安裝</li>
<li style="color: #233d5e; line-height: 20px; margin-left: 2px;">PHP 5 以上</li>
<li style="color: #233d5e; line-height: 20px; margin-left: 2px;">需要 <a href="http://www.tad0616.net/modules/tad_uploader/index.php?of_cat_sn=50" style="color: #43597c; text-decoration: none;"><strong>Tad Tools 工具包</strong></a></li>
</ol>
<h3 style="background-color: white; color: #111111; font-family: 'Helvetica Neue', Helvetica, Arial, 微軟正黑體, sans-serif; font-size: 24.5px; line-height: 40px; margin: 10px 0px; text-rendering: optimizelegibility;">
<span style="color: maroon;">【安裝方法】</span></h3>
<ol style="background-color: white; color: #111111; font-family: 'Helvetica Neue', Helvetica, Arial, 微軟正黑體, sans-serif; font-size: 15px; line-height: 29.328125px; list-style-image: initial; list-style-position: outside; margin: 0px 0px 10px 25px; padding: 0px;">
<li style="color: #233d5e; line-height: 20px; margin-left: 2px;">將新模組解壓,把ugm_contact_us 目錄上傳到modules下。</li>
<li style="color: #233d5e; line-height: 20px; margin-left: 2px;">需搭配<span style="color: red;"> Tad Tools工具包</span>,<a href="http://www.tad0616.net/modules/tad_uploader/index.php?of_cat_sn=50" style="color: #43597c; text-decoration: none;" target="_blank">詳細安裝方法請按此連結</a>。</li>
<li style="color: #233d5e; line-height: 20px; margin-left: 2px;">進入後台「模組→系統」進行模組安裝。</li>
</ol>
<h3 style="background-color: white; color: #111111; font-family: 'Helvetica Neue', Helvetica, Arial, 微軟正黑體, sans-serif; font-size: 24.5px; line-height: 40px; margin: 10px 0px; text-rendering: optimizelegibility;">
<span style="color: maroon;">【更新方法】</span></h3>
<ol style="background-color: white; color: #111111; font-family: 'Helvetica Neue', Helvetica, Arial, 微軟正黑體, sans-serif; font-size: 15px; line-height: 29.328125px; list-style-image: initial; list-style-position: outside; margin: 0px 0px 10px 25px; padding: 0px;">
<li style="color: #233d5e; line-height: 20px; margin-left: 2px;">更新時,<span style="color: red;">請先登入,並進到「模組管理」畫面</span>,以便上傳完後,可以立即進行更新動作。</li>
<li style="color: #233d5e; line-height: 20px; margin-left: 2px;">將新模組解壓,把ugm_contact_us 目錄上傳到modules下,直接覆蓋即可(<span style="background-color: #ffff99;">把舊的ugm_contact_us 整個刪除,上傳新的,這樣更好</span>)。</li>
<li style="color: #233d5e; line-height: 20px; margin-left: 2px;">若沒有<span style="color: red;"> Tad Tools工具包 </span>或版本太舊,則需下載安裝<span style="color: red;"> Tad Tools工具包</span>,<a href="http://www.tad0616.net/modules/tad_uploader/index.php?of_cat_sn=50" style="color: #43597c; text-decoration: none;" target="_blank">詳細安裝方法請按此連結</a>。</li>
<li style="color: #233d5e; line-height: 20px; margin-left: 2px;">進入後台「模組→系統」進行模組更新。</li>
</ol>
<h3 style="background-color: white; color: #111111; font-family: 'Helvetica Neue', Helvetica, Arial, 微軟正黑體, sans-serif; font-size: 24.5px; line-height: 40px; margin: 10px 0px; text-rendering: optimizelegibility;">
</h3>
ugmhttp://www.blogger.com/profile/05956734290689814110noreply@blogger.com0tag:blogger.com,1999:blog-4490824622137029882.post-48996361482625548162013-11-15T20:36:00.003+08:002013-11-15T20:56:59.533+08:00chainedSelects 連動選單<a href='http://www.script-tutorials.com/creating-ajaxy-chained-selects-with-jquery/'>參考網站</a><br>
<a href='http://tad0616.net/modules/tad_book3/page.php?tbdsn=242'>參考網站</a>
<p>連動選單</p>
<p>script</p>
<pre class="brush:php;">
//---引入Js
<script type='text/javascript' src='class/chainedSelects/jquery.chainedSelects.js'></script>
//-----------------------------------------------------------
<script language='JavaScript' type='text/javascript'>
$(function(){
$('#kind_sn').chainSelect('#class_sn','{$_SERVER['PHP_SELF']}?op=get_ugm_search_class_json',{
before:function (target){
$('#loading').css('display','block');
$(target).css('display','block');
},
after:function (target){
$('#loading').css('display','none');
$(target).css('display','block');
}
}).change();
});
</script>
<style>
#loading
{
position:absolute;
top:0px;
left:0px;
background:#ff0000;
color:#fff;
font-size:14px;
font-familly:Arial;
padding:2px;
display:none;
}
</style>
</pre>
<p> OP </p>
<pre class="brush:php;">
//連動選單
case "get_ugm_search_class_json":
$get_ugm_search_class_json[] = get_ugm_search_class_json($_GET['_value']);
echo json_encode($get_ugm_search_class_json);
exit;
# ------------------------------------------------------------------------
//選項
function get_ugm_search_class_json($kind_sn="0"){
global $xoopsDB;
$sql = "select * from ".$xoopsDB->prefix("ugm_search_class")." where `kind_sn`='{$kind_sn}' order by `sn`";
$result = $xoopsDB->query($sql) or redirect_header($_SERVER['PHP_SELF'],3, mysql_error());
//$opt[]="請選擇";
while(list($sn,$kind_sn,$title)=$xoopsDB->fetchRow($result)){
$opt[$sn]=$title;
}
return $opt;
}
</pre>
<p>html</p>
<pre class="brush:php;">
$main="
<!-- 動物類型 -->
<tr class='alt'>
<th>"._MA_UGMSEARCH_KIND_SN."</th>
<td>
<select name='kind_sn' size=1 id='kind_sn'>
$kind_sn_select_option
</select>
</td>
</tr>
<!-- 動物品種 -->
<tr class='alt'>
<th>"._MA_UGMSEARCH_CLASS_SN."</th>
<td>
<select name='class_sn' size=1 id='class_sn'>
</select>
</td>
</tr>"
</pre>ugmhttp://www.blogger.com/profile/05956734290689814110noreply@blogger.com0tag:blogger.com,1999:blog-4490824622137029882.post-46838397262686196292013-11-03T20:59:00.001+08:002013-11-03T20:59:26.956+08:00PHP EXCEL 匯出<p>設定寬度</p>
<pre class="brush:php;">
# 設定 A 欄 寬度(一次只能一個欄)
$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn(0)->setWidth(20);
$objPHPExcel->getActiveSheet()->getColumnDimension("A")->setWidth(20);
</pre>ugmhttp://www.blogger.com/profile/05956734290689814110noreply@blogger.com0tag:blogger.com,1999:blog-4490824622137029882.post-41318506798282457392013-11-01T20:10:00.002+08:002013-11-01T20:14:09.191+08:00MYSQL 排名參考來源:<a href="http://www.1keydata.com/tw/sql/sql-rank.html">http://www.1keydata.com/tw/sql/sql-rank.html</a><br />
<br />
<br />
<br />
<pre class="brush:php;">SELECT a1.Name, a1.Sales, COUNT(a2.Sales) Sales_Rank
FROM Total_Sales a1, Total_Sales a2
WHERE a1.Sales < a2.Sales OR (a1.Sales=a2.Sales AND a1.Name = a2.Name)
GROUP BY a1.Name, a1.Sales
ORDER BY a1.Sales DESC, a1.Name DESC;
</pre>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-rv2uCyDMo2Y/UnOavnDCHrI/AAAAAAAAJhw/rYzPKHPUHas/s1600/1_%E6%8E%92%E5%90%8D.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-rv2uCyDMo2Y/UnOavnDCHrI/AAAAAAAAJhw/rYzPKHPUHas/s1600/1_%E6%8E%92%E5%90%8D.jpg" /></a></div>
<br />
<pre class="brush:php;"> # -------------------------------------------
$sql="
select a.term_class_student_sn, a.avg1, count(b.avg1) rank
from
(select sn as term_class_student_sn ,avg1
from ".$xoopsDB->prefix("ugm_scroeqry_term_class_student")."
where term_class_sn='{$term_class_sn}' and enable='1') a,
(select sn as term_class_student_sn ,avg1
from ".$xoopsDB->prefix("ugm_scroeqry_term_class_student")."
where term_class_sn='{$term_class_sn}' and enable='1') b
where a.avg1 < b.avg1 or (a.avg1=b.avg1 and a.term_class_student_sn = b.term_class_student_sn)
group by a.term_class_student_sn, a.avg1
order by a.avg1 desc, a.term_class_student_sn desc;
";die($sql);
# ----http://www.1keydata.com/tw/sql/sql-rank.html
</pre>
ugmhttp://www.blogger.com/profile/05956734290689814110noreply@blogger.com0tag:blogger.com,1999:blog-4490824622137029882.post-89361702465549109452013-10-30T13:33:00.000+08:002013-10-30T13:53:22.294+08:00編輯器_插入圖片<h2>
1.在新增文章/編輯文章,選擇「影像」工具鈕</h2>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-AyHG0bdJc0A/UnCau2mO9KI/AAAAAAAAJgg/IBRCVK3J6Lo/s1600/%E6%8F%92%E5%85%A5%E5%9C%96%E7%89%87_1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-AyHG0bdJc0A/UnCau2mO9KI/AAAAAAAAJgg/IBRCVK3J6Lo/s1600/%E6%8F%92%E5%85%A5%E5%9C%96%E7%89%87_1.jpg" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<h2>
2.如圖 </h2>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-Q594Mhak0hc/UnCav3O153I/AAAAAAAAJgw/zPiKSIDbZAY/s1600/%E6%8F%92%E5%85%A5%E5%9C%96%E7%89%87_2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-Q594Mhak0hc/UnCav3O153I/AAAAAAAAJgw/zPiKSIDbZAY/s1600/%E6%8F%92%E5%85%A5%E5%9C%96%E7%89%87_2.jpg" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<h2>
3.如圖 </h2>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-982cJ1APleE/UnCav65O6PI/AAAAAAAAJgo/yabxE4hdBvg/s1600/%E6%8F%92%E5%85%A5%E5%9C%96%E7%89%87_3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-982cJ1APleE/UnCav65O6PI/AAAAAAAAJgo/yabxE4hdBvg/s1600/%E6%8F%92%E5%85%A5%E5%9C%96%E7%89%87_3.jpg" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<h2>
4.可拖曳上傳數個圖檔,請先將檔名更換為英文檔名 </h2>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-fC4qK4WT6Pw/UnCawJ0GEuI/AAAAAAAAJgs/0GGU6gSJ02k/s1600/%E6%8F%92%E5%85%A5%E5%9C%96%E7%89%87_4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-fC4qK4WT6Pw/UnCawJ0GEuI/AAAAAAAAJgs/0GGU6gSJ02k/s1600/%E6%8F%92%E5%85%A5%E5%9C%96%E7%89%87_4.jpg" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<h2>
5.挑選圖片</h2>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-UcFW4Ik80r0/UnCawvl5RaI/AAAAAAAAJg8/a91y6fut8vs/s1600/%E6%8F%92%E5%85%A5%E5%9C%96%E7%89%87_5.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-UcFW4Ik80r0/UnCawvl5RaI/AAAAAAAAJg8/a91y6fut8vs/s1600/%E6%8F%92%E5%85%A5%E5%9C%96%E7%89%87_5.jpg" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<h2>
6.如圖 </h2>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-GPFCiWMg7JI/UnCaxIpyw1I/AAAAAAAAJhE/MLIs0t33OBQ/s1600/%E6%8F%92%E5%85%A5%E5%9C%96%E7%89%87_6.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-GPFCiWMg7JI/UnCaxIpyw1I/AAAAAAAAJhE/MLIs0t33OBQ/s1600/%E6%8F%92%E5%85%A5%E5%9C%96%E7%89%87_6.jpg" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<h2>
7.編輯圖片:對圖片按右鍵</h2>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-QFvS8IXDNdM/UnCaxaiwpyI/AAAAAAAAJhM/45WUciAT4JY/s1600/%E6%8F%92%E5%85%A5%E5%9C%96%E7%89%87_7.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-QFvS8IXDNdM/UnCaxaiwpyI/AAAAAAAAJhM/45WUciAT4JY/s1600/%E6%8F%92%E5%85%A5%E5%9C%96%E7%89%87_7.jpg" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<h2>
8.可調整寬度、高度、邊框,靠右 ....</h2>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-N7aH1MxVTa0/UnCaxpEkjOI/AAAAAAAAJhU/ve4-MFsNZZI/s1600/%E6%8F%92%E5%85%A5%E5%9C%96%E7%89%87_8.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-N7aH1MxVTa0/UnCaxpEkjOI/AAAAAAAAJhU/ve4-MFsNZZI/s1600/%E6%8F%92%E5%85%A5%E5%9C%96%E7%89%87_8.jpg" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
ugmhttp://www.blogger.com/profile/05956734290689814110noreply@blogger.com0tag:blogger.com,1999:blog-4490824622137029882.post-71803682735929816572013-10-19T10:34:00.002+08:002013-10-19T10:36:51.921+08:00更新資料結構 (模組更新)市場攤販管理,更改資料表結構
<pre class="brush:php;">
function xoops_module_update_ugm_market(&$module, $old_version) {
GLOBAL $xoopsDB;
if(!chk_ugm1()) go_ugm1(); # ---- 更改結構為 `e_last` -> DECIMAL( 10, 2 )
if(!chk_ugm2()) go_ugm2(); # ---- 更改結構為 `e_now` -> DECIMAL( 10, 2 )
return true;
}
# -------------------- ugm --------------------------------------------------*/
# ---- 更改結構 ugm_market_utility_main `e_last` 120->130----
function chk_ugm1(){
global $xoopsDB;
$sql="select `e_last` from ".$xoopsDB->prefix("ugm_market_utility_main")."";
$result = $xoopsDB->query($sql) or redirect_header($_SERVER['PHP_SELF'],3, mysql_error());
if(mysql_field_type($result,0)=='int')return false ;
return true;
}
function go_ugm1(){
global $xoopsDB;
$sql="ALTER TABLE ".$xoopsDB->prefix("ugm_market_utility_main")." CHANGE `e_last` `e_last` DECIMAL( 10, 2 ) UNSIGNED NOT NULL COMMENT '上期用電度數'";
$xoopsDB->queryF($sql) or redirect_header($_SERVER['PHP_SELF'],3, mysql_error());
return true;
}
# -----------------------------------------
# ---- 更改結構 ugm_market_utility_main `e_now` 120->130-----
function chk_ugm2(){
global $xoopsDB;
$sql="select `e_now` from ".$xoopsDB->prefix("ugm_market_utility_main")."";
$result = $xoopsDB->query($sql) or redirect_header($_SERVER['PHP_SELF'],3, mysql_error());
if(mysql_field_type($result,0)=='int')return false ;
return true;
}
function go_ugm2(){
global $xoopsDB;
$sql="ALTER TABLE ".$xoopsDB->prefix("ugm_market_utility_main")." CHANGE `e_now` `e_now` DECIMAL( 10, 2 ) UNSIGNED NOT NULL COMMENT '本期用電度數'";
$xoopsDB->queryF($sql) or redirect_header($_SERVER['PHP_SELF'],3, mysql_error());
return true;
}
# -----------------------------------------
</pre>
ugmhttp://www.blogger.com/profile/05956734290689814110noreply@blogger.com0tag:blogger.com,1999:blog-4490824622137029882.post-63645588664683609642013-10-17T00:14:00.005+08:002014-01-14T18:17:55.035+08:00高亮度語法:<pre class="brush:xml;"><!-- 高亮度語法:-->
<pre class="brush:xml;"></pre>
</pre>
ugmhttp://www.blogger.com/profile/05956734290689814110noreply@blogger.com0tag:blogger.com,1999:blog-4490824622137029882.post-18735931951467073152013-09-25T21:40:00.000+08:002013-09-25T21:40:09.417+08:00燈箱<pre class="brush:xml;"># ---- 在<a href=""> 加上
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="
<script .xoops_url.="" language="javascript" lytebox.js="" lytebox="" modules="" src="" tadtools="" type="text/javascript"></script>
<link .xoops_url.="" href="" lytebox.css="" lytebox="" media="screen" modules="" rel="stylesheet" tadtools="" type="text/css"></link>";
# --------------------------------------------------------
# ---- 在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="
<html>
<head>
<link .xoops_url.="" href="" media="screen" module.css="" modules="" rel="stylesheet" type="text/css"></link>
<title>{$title}</title>
</head>
<body>
<div style="text-align: center;">
<h2>
{$title}</h2>
</div>
{$content}
</body></html>
";
return $main;
}
}
</a></pre>
ugmhttp://www.blogger.com/profile/05956734290689814110noreply@blogger.com0tag:blogger.com,1999:blog-4490824622137029882.post-30550887090763789322013-09-25T15:50:00.002+08:002013-11-15T10:24:23.100+08:00取得XOOPS內建表單語法取得XOOPS內建表單語法<br />
群組多選選單<br />
<pre class="brush:xml;"># ---- 引入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();
</pre>ugmhttp://www.blogger.com/profile/05956734290689814110noreply@blogger.com0tag:blogger.com,1999:blog-4490824622137029882.post-2698455460744100332013-08-31T02:19:00.004+08:002013-08-31T02:32:08.624+08:00bootstrap accordion-menu<div class="separator" style="clear: both; text-align: left;">
<span style="font-size: large;">bootstrap accordion-menu 架構</span></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="http://4.bp.blogspot.com/-G1a7fuMuYEw/UiDh4lkX3FI/AAAAAAAAJVs/MmLQFk-Pu10/s1600/%E6%8A%98%E7%96%8A%E9%81%B8%E5%96%AE.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-G1a7fuMuYEw/UiDh4lkX3FI/AAAAAAAAJVs/MmLQFk-Pu10/s1600/%E6%8A%98%E7%96%8A%E9%81%B8%E5%96%AE.jpg" /></a></div>
<br />
參考網站:<a href="http://kkbruce.tw/Bootstrap/JavaScript#collapse">http://kkbruce.tw/Bootstrap/JavaScript#collapse</a>
<br />
<pre class="brush:xml;"><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></pre>
ugmhttp://www.blogger.com/profile/05956734290689814110noreply@blogger.com0tag:blogger.com,1999:blog-4490824622137029882.post-29340853242209431522013-08-15T21:00:00.002+08:002013-08-15T21:19:19.825+08:00AJAX JQUERY 範例網址:<a href="http://www.tad0616.net/modules/tad_book3/page.php?tbdsn=746">http://www.tad0616.net/modules/tad_book3/page.php?tbdsn=746</a><br />
<br />
ajax_utility.php<br />
<pre class="brush:php;"><?php
include_once "header.php";
$market_sn=$_REQUEST['market_sn'];
echo get_market_fill($market_sn);
?></pre>
這裡直返回「填發人員」<br />
js<br />
<pre class="brush:php;"> <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></pre>
取得值:<br />
<pre class="brush:php;">$('#market_sn').val()</pre>
寫入值:<br />
<pre class="brush:php;">$('#fill').val(data);</pre>
<h3 style="color: #317eac; font-family: Telex, sans-serif; font-size: 24.5px; line-height: 40px; margin: 10px 0px; text-rendering: optimizelegibility;">
jQuery的.val ()方法</h3>
<ol style="color: #111111; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; line-height: 27px; list-style-image: none; list-style-position: outside; margin: 0px; padding-left: 0px; padding-right: 0px;">
<li style="color: #141414; list-style: decimal outside none; margin: 0px 0px 0px 2em; padding: 0px;">
$('#menu1').val()可以取得id="menu1"的網頁元件的值。</li>
<li style="color: #141414; list-style: decimal outside none; margin: 0px 0px 0px 2em; padding: 0px;">
$('#menu1').val('xxx')可以設定id="menu1"的網頁元件的值。</li>
</ol>
<br />
html<br />
<br />
<pre class="brush:php;"><select name='market_sn' size=1 id='market_sn'>{$market_select_option}</select>
<input type='text' name='fill' size='5' value='' id='fill' ></pre>
<br />
ugmhttp://www.blogger.com/profile/05956734290689814110noreply@blogger.com0tag:blogger.com,1999:blog-4490824622137029882.post-58270264320536438862013-08-05T13:39:00.001+08:002013-08-05T13:39:27.602+08:00保留修改報名表單的網址<div class="separator" style="clear: both; text-align: left;">
1.報名完成後,按「修改回覆內容」</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-T8IUqt0vsbw/Uf858BBDZvI/AAAAAAAAJSo/ifjdGTCYJuQ/s1600/1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-T8IUqt0vsbw/Uf858BBDZvI/AAAAAAAAJSo/ifjdGTCYJuQ/s1600/1.jpg" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
2.請將「網址」,反白->複製->保存。若有需要修改時,則把網址貼至「網址列」即可修改</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-ofVK-V7kJIU/Uf858mWhqYI/AAAAAAAAJSw/H9tlCGUptlw/s1600/2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-ofVK-V7kJIU/Uf858mWhqYI/AAAAAAAAJSw/H9tlCGUptlw/s1600/2.jpg" /></a></div>
<br />ugmhttp://www.blogger.com/profile/05956734290689814110noreply@blogger.com0tag:blogger.com,1999:blog-4490824622137029882.post-8422997133314189352013-08-03T11:26:00.002+08:002013-10-17T00:20:01.702+08:00模組開發物件按鈕<br />
<pre class="brush:php;">$add_button="<a href='{$_SERVER['PHP_SELF']}?op=ugm_market_hire_form' class='Button'><span>按鈕</span></a>";</pre>
固定表格<br />
<pre class="brush:php;"><table border='0' cellspacing='3' cellpadding='3' id='ugm_tb' style='word-wrap:break-word; word-break:break-all;table-layout:fixed;'></pre>
表單<br />
<pre class="brush:php;"><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></pre>
接收<br />
<pre class="brush:php;">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();
}</pre>
<br />
2.
<br />
<pre class="brush:xml;">
<!-- 上一步 -->
$last_button="<a class="Button" href="" onclick="history.back()">上一步</a>";
</pre>ugmhttp://www.blogger.com/profile/05956734290689814110noreply@blogger.com0tag:blogger.com,1999:blog-4490824622137029882.post-49940945447221429212013-07-25T16:02:00.002+08:002013-07-25T16:22:03.404+08:00「UGM_自訂頁面」模組更新(2.0) <ol>
<li>
這一版的更新主要是將模組改為XOOPS 2.5.5的模組架構<br />
示範網站:<a href="http://www.taytzang.com.tw/web/">http://www.taytzang.com.tw/web/</a> <br />
請先上傳覆蓋模組,並執行模組更新:<br /><br />
<img src="http://1.bp.blogspot.com/-Yk1nqx0XSYU/UfDfLdeTFII/AAAAAAAAJBM/0H8pv-nvAX8/s1600/xoops25.png" />
</li>
<li>檔案下載位置:<br />
<a href="https://dl.dropboxusercontent.com/u/19064696/module/ugm_page/ugm_page_2.0_20130725_xoops_2.5x.zip">
<img src="http://2.bp.blogspot.com/-iPj_S_xE_Ds/ULlQUX86g4I/AAAAAAAAHog/1n2yv-L9Ln0/s1600/download_button.png" />
</a>
</li>
<li>
育將電腦工作室:XOOPS 模組開發及修改<br />
聯絡:tawan158@gmail.com ugm
</li>
</ol>
ugmhttp://www.blogger.com/profile/05956734290689814110noreply@blogger.com1tag:blogger.com,1999:blog-4490824622137029882.post-82206577555794279832013-07-22T15:50:00.002+08:002013-07-22T15:58:55.661+08:00「UGM_自訂頁面」模組更新(1.8)增加英文語系<br />
<ol>
<li>這次更新主要是增加英文語系。<br /> 示範網站:<a href="http://www.taytzang.com.tw/web" target="_blank">http://www.taytzang.com.tw/web</a>
<br />請先上傳覆蓋模組,並執行模組更新:</li>
</ol>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-TmhVE55VoHg/UezlFPF52zI/AAAAAAAAJAo/F7AB_ebNRgs/s1600/20130722.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-TmhVE55VoHg/UezlFPF52zI/AAAAAAAAJAo/F7AB_ebNRgs/s1600/20130722.jpg" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="background-color: #f6f6f6; color: #4b4b4b; font-family: Georgia, Utopia, 'Palatino Linotype', Palatino, serif; font-size: 15px; line-height: 21px;">2</span><span style="background-color: #f6f6f6; color: #4b4b4b; font-family: 'Trebuchet MS', Trebuchet, Verdana, sans-serif; font-size: 13px;">.檔案下載位置:</span></div>
<div class="post-body entry-content" id="post-body-2648055260962399753" style="background-color: #f6f6f6; color: #4b4b4b; font-family: 'Trebuchet MS', Trebuchet, Verdana, sans-serif; font-size: 13px; line-height: 1.4; position: relative; width: 680px;">
<br /></div>
<div class="separator" style="background-color: #fff9f2; clear: both; color: #4b4b4b; font-family: Georgia, Utopia, 'Palatino Linotype', Palatino, serif; font-size: 15px; line-height: 21px; text-align: center;">
<a href="https://dl.dropboxusercontent.com/u/19064696/module/ugm_page/ugm_page_1.8_20130722_en_language.zip" target="_blank"><img border="0" src="http://2.bp.blogspot.com/-iPj_S_xE_Ds/ULlQUX86g4I/AAAAAAAAHog/1n2yv-L9Ln0/s1600/download_button.png" style="-webkit-box-shadow: rgba(0, 0, 0, 0.0980392) 1px 1px 5px; background-color: white; border: 1px solid rgb(240, 240, 240); box-shadow: rgba(0, 0, 0, 0.0980392) 1px 1px 5px; padding: 5px; position: relative;" /></a></div>
<div class="separator" style="background-color: #fff9f2; clear: both; color: #4b4b4b; font-family: Georgia, Utopia, 'Palatino Linotype', Palatino, serif; font-size: 15px; line-height: 21px; text-align: center;">
<br /></div>
<div class="separator" style="background-color: #fff9f2; clear: both; color: #4b4b4b; font-family: Georgia, Utopia, 'Palatino Linotype', Palatino, serif; font-size: 15px; line-height: 21px; text-align: center;">
<br /></div>
<div class="separator" style="background-color: #fff9f2; clear: both; color: #4b4b4b; font-family: Georgia, Utopia, 'Palatino Linotype', Palatino, serif; font-size: 15px; line-height: 21px; text-align: left;">
3.育將電腦工作室:XOOPS 模組開發及修改<br /> 聯絡:tawan158@gmail.com ugm</div>
ugmhttp://www.blogger.com/profile/05956734290689814110noreply@blogger.com0tag:blogger.com,1999:blog-4490824622137029882.post-75745948848541183642013-07-08T00:12:00.002+08:002013-07-08T00:41:16.898+08:00「UGM_自訂頁面」模組更新(1.8)增加佈景引入「下拉選單」、「圖片輪撥」功能<br />
<div>
<br /></div>
<div>
<div class="" style="clear: both; font-family: 'Trebuchet MS', Trebuchet, Verdana, sans-serif; font-size: 13px;">
這次更新主要是增加增加佈景引入「下拉選單」、「圖片輪撥」功能。</div>
<div style="font-family: 'Trebuchet MS', Trebuchet, Verdana, sans-serif; font-size: 13px;">
<span style="font-size: xx-small;"><br /></span>示範網站:<a href="http://www.dawandrive.com.tw/index.php">http://www.dawandrive.com.tw/index.php</a><br />
<br />
<br />
1.請先上傳覆蓋模組,並執行模組更新,然後至偏好設定,設定「圖片輪撥」、「下拉選單」佈景的設定</div>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-RneTaS3Lurc/UdmVAXAibnI/AAAAAAAAI_g/hb0pvfIs5Sg/s1600/%E5%81%8F%E5%A5%BD%E8%A8%AD%E5%AE%9A.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-RneTaS3Lurc/UdmVAXAibnI/AAAAAAAAI_g/hb0pvfIs5Sg/s1600/%E5%81%8F%E5%A5%BD%E8%A8%AD%E5%AE%9A.jpg" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
2.請在佈景檔,適當位置加入下方語法</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<pre class="brush:php;"> <div >
<{includeq file="$xoops_rootpath/modules/ugm_page/templates/ugm_page_block_slider.html"}> <!-- 引入ugm_page 自訂頁面第一個圖片輪撥 -->
</div></pre>
<pre class="brush:php;"><div>
<{includeq file="$xoops_rootpath/modules/ugm_page/templates/ugm_page_block_menu.html"}><!-- 引入ugm_page 自訂頁面第一個下拉選單 -->
<div class="clear"></div>
</div> </pre>
3.請建立下拉選單及圖片輪撥的資料
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-DriceiBov_A/UdmZi3HhFjI/AAAAAAAAI_0/WVMHgqwvCfk/s1600/%E4%B8%8B%E6%8B%89%E9%81%B8%E5%96%AE.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-DriceiBov_A/UdmZi3HhFjI/AAAAAAAAI_0/WVMHgqwvCfk/s1600/%E4%B8%8B%E6%8B%89%E9%81%B8%E5%96%AE.jpg" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-wD08UjNoUU0/UdmZizPeV9I/AAAAAAAAI_w/lyr3yA5pq8Q/s1600/%E5%9C%96%E7%89%87%E8%BC%AA%E6%92%A5.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-wD08UjNoUU0/UdmZizPeV9I/AAAAAAAAI_w/lyr3yA5pq8Q/s1600/%E5%9C%96%E7%89%87%E8%BC%AA%E6%92%A5.jpg" /></a></div>
<span style="background-color: #f6f6f6;">4</span><span style="background-color: #f6f6f6; font-family: 'Trebuchet MS', Trebuchet, Verdana, sans-serif; font-size: 13px;">.檔案下載位置:</span><br />
<div class="post-body entry-content" id="post-body-2648055260962399753" style="background-color: #f6f6f6; font-family: 'Trebuchet MS', Trebuchet, Verdana, sans-serif; font-size: 13px;">
<br />
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://dl.dropboxusercontent.com/u/19064696/module/ugm_page/ugm_page_1.8_20130708.zip" target="_blank"><img border="0" src="http://2.bp.blogspot.com/-iPj_S_xE_Ds/ULlQUX86g4I/AAAAAAAAHog/1n2yv-L9Ln0/s1600/download_button.png" /></a></div>
ugmhttp://www.blogger.com/profile/05956734290689814110noreply@blogger.com0tag:blogger.com,1999:blog-4490824622137029882.post-65829351214788451002013-05-25T23:05:00.001+08:002013-05-25T23:05:24.599+08:00XOOPS的時間函數運用(new)<p>
本範例為「日期示範」</p>
<p>
FORM_預設值:<br />
</p>
<pre class="brush:php;">
//設定「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']));
</pre>
<p>
</p>
<p>
INSERT_寫入資料庫:</p>
<pre class="brush:php;">
# -------- 處理時間(日期格式->時間戳記) --------------------------------------
$_POST['start_date']=userTimeToServerTime(strtotime($_POST['start_date']));
$_POST['end_date']=userTimeToServerTime(strtotime($_POST['end_date']));
# -------------------------------------------------------------------------</pre>
<p>
</p>
<p>
LIST_從資料庫撈出:</p>
<pre class="brush:php;">
# -------- 處理時間(時間戳記->日期格式) -------------------------------------
$start_date=date("Y-m-d",xoops_getUserTimestamp($start_date));
$end_date=date("Y-m-d",xoops_getUserTimestamp($end_date));
# ---------------------------------------------------------------------------</pre>
<p>
</p>
ugmhttp://www.blogger.com/profile/05956734290689814110noreply@blogger.com0tag:blogger.com,1999:blog-4490824622137029882.post-50774957416753323012013-05-19T08:42:00.002+08:002013-05-19T08:42:43.598+08:00收合插件<ul>
<li>
將「ddaccordion」資料夾放入 「class」</li>
<li>
ddaccordion() 函數放入「block_function.php」</li>
</ul>
<pre class="brush:php;">#--------------------- 引入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(); //一般只要此行即可
#-------- jquery 收合 --------------------------------
$ddaccordion=ddaccordion();
# 收合內容
$main_body="
<!-- 有標題、內容 -->
<a class='menuitem submenuheader' href='#' >物品類別2</a>
<div class='submenu'>
<table border='0' cellspacing='3' cellpadding='3' id='ugm_tb' style='word-wrap:break-word; word-break:break-all'>
<tr class='alt'><td>1111</td></tr>
<tr class='alt'><td>1111</td></tr>
<tr class='alt'><td>1111</td></tr>
<tr class='alt'><td>1111</td></tr>
</table>
</div>
<!-- 有標題、內容 -->
<a class='menuitem submenuheader' href='#' >物品類別2</a>
<div class='submenu'>
<table border='0' cellspacing='3' cellpadding='3' id='ugm_tb' style='word-wrap:break-word; word-break:break-all'>
<tr class='alt'><td>1111</td></tr>
<tr class='alt'><td>1111</td></tr>
<tr class='alt'><td>1111</td></tr>
<tr class='alt'><td>1111</td></tr>
</table>
</div>
<!-- 有標題、內容 -->
<a class='menuitem ' href='#' >物品類別2</a>
";
$main=$jquery_path.ugm_javascript(1).$ddaccordion."
<form action='{$_SERVER['PHP_SELF']}' method='post' id='myForm' enctype='multipart/form-data'>
<div class='glossymenu'>
{$main_body}
</div>
</form>";
$main=ugm_div("管理主頁",$main,"","width:500px");</pre>
ugmhttp://www.blogger.com/profile/05956734290689814110noreply@blogger.com0tag:blogger.com,1999:blog-4490824622137029882.post-39045509004572105372013-05-01T13:10:00.002+08:002013-05-01T13:10:48.679+08:00dropbox<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-yvkZcH75A28/UYCjak8YrUI/AAAAAAAAIcY/iVwmkQGUXb8/s1600/grassbox-vflL1PPHI.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="160" src="http://3.bp.blogspot.com/-yvkZcH75A28/UYCjak8YrUI/AAAAAAAAIcY/iVwmkQGUXb8/s640/grassbox-vflL1PPHI.png" width="640" /></a></div>
<span style="background-color: white;"><span style="color: #333333; font-family: lucida grande, tahoma, verdana, arial, sans-serif;"><span style="font-size: 14px; line-height: 18px;">申請帳號:<a href="http://db.tt/z5mauB9b">http://db.tt/z5mauB9b</a></span></span><br /><br /></span><br />
<span style="background-color: white; color: #333333; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 14px; line-height: 18px;">把dropbox當「圖床」或放js、html,然後連結blog</span><br style="background-color: white; color: #333333; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 14px; line-height: 18px;" /><br style="background-color: white; color: #333333; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 14px; line-height: 18px;" /><span style="background-color: white; color: #333333; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 14px; line-height: 18px;">只要把檔案放在dropbox的「Public」資料夾,</span><br style="background-color: white; color: #333333; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 14px; line-height: 18px;" /><br style="background-color: white; color: #333333; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 14px; line-height: 18px;" /><span style="background-color: white; color: #333333; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 14px; line-height: 18px;">然後執行「copy public link」取得網址即完成。</span><br style="background-color: white; color: #333333; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 14px; line-height: 18px;" /><br style="background-color: white; color: #333333; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 14px; line-height: 18px;" /><span style="background-color: white; color: #333333; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 14px; line-height: 18px;">例如:</span><br style="background-color: white; color: #333333; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 14px; line-height: 18px;" /><br style="background-color: white; color: #333333; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 14px; line-height: 18px;" /><a href="http://www.shanmei.info/" rel="nofollow nofollow" style="background-color: white; color: #3b5998; cursor: pointer; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 14px; line-height: 18px; text-decoration: none;" target="_blank">http://www.shanmei.info/</a><span style="background-color: white; color: #333333; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 14px; line-height: 18px;"> 這個網站的slide</span><br style="background-color: white; color: #333333; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 14px; line-height: 18px;" /><span class="text_exposed_show" style="background-color: white; color: #333333; display: inline; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 14px; line-height: 18px;"><br />是放在:<br /><br /><a href="https://dl.dropbox.com/u/61459273/www/shanmei/slide/index.html" rel="nofollow nofollow" style="color: #3b5998; cursor: pointer; text-decoration: none;" target="_blank">https://dl.dropbox.com/u/61459273/www/shanmei/slide/index.html</a><br /><br />很簡單吧~~~</span>ugmhttp://www.blogger.com/profile/05956734290689814110noreply@blogger.com0tag:blogger.com,1999:blog-4490824622137029882.post-222771955959143332013-04-28T00:26:00.000+08:002013-04-28T00:31:39.669+08:00連動選單<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-yero0QEVFjg/UXv71LQ4HFI/AAAAAAAAIB0/YNzRdrmDyn0/s1600/fb.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-yero0QEVFjg/UXv71LQ4HFI/AAAAAAAAIB0/YNzRdrmDyn0/s1600/fb.png" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-yCY4oUkY-1Q/UXv77Oy83qI/AAAAAAAAIB8/oUXNLRZj4bw/s1600/%E4%BD%BF%E7%94%A8%E8%80%85%E9%80%A3%E5%8B%95%E9%81%B8%E5%96%AE.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-yCY4oUkY-1Q/UXv77Oy83qI/AAAAAAAAIB8/oUXNLRZj4bw/s1600/%E4%BD%BF%E7%94%A8%E8%80%85%E9%80%A3%E5%8B%95%E9%81%B8%E5%96%AE.png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<h2>html</h2>
<pre class="brush:php;">
$select_uint_form="
單位:<select name='unit' size=1 id='unit'>".get_units_select_option($unit)."</select>";
$select_user_form="
使用者:<select name='user' size=1 id='user'></select>";
</pre>
<h2>javascript</h2>
<pre class="brush:php;">
<script type='text/javascript'>
$(document).ready(function(){
//頁面準備好
$.post('ajax.php', {op: 'get_user' , unit: $('#unit').val()} , function(data) {
$('#user').html(data);
//單位有改變
$('#unit').change(function(){
$.post('ajax.php', {op: 'get_user' , unit: $('#unit').val()} , function(data) {
$('#user').html(data);
});
});
});
});
</script>
</pre>
<h2>ajax.php</h2>
<pre class="brush:php;">
include_once "header.php";
$op=(empty($_REQUEST['op']))?"main":$_REQUEST['op'];
$unit=intval($_REQUEST['unit']);
switch($op){
//
case "get_user":
echo get_user_form_unit($unit);
//echo json_encode(array("prod_sort"=>$main['prod_sort'],"total"=>$main['total']));
break;
//預設動作
default:
$main="";
break;
}
#################################################################################
# 以單位取得使用者的選單
#
#
#
#
#
################################################################################
function get_user_form_unit($unit_sn){
global $xoopsDB;
$sql="select a.* ,b.`name`,b.`uname` from ".$xoopsDB->prefix("ugm_apply_users")." as a left join ".$xoopsDB->prefix("users")." as b on a.`uid`=b.`uid` where a.`unit_sn`='{$unit_sn}' ";
$result = $xoopsDB->query($sql) or redirect_header($_SERVER['PHP_SELF'],3, mysql_error());
$main="<option value='-1'>全部</option>";
while($all=$xoopsDB->fetchArray($result)){
foreach($all as $k=>$v){
$$k=$v;
}
$uid_name=$name?$name:$uname;
$main.="<option value='{$uid}'>{$uid_name}</option>";
}
return $main;
}
</pre>ugmhttp://www.blogger.com/profile/05956734290689814110noreply@blogger.com0tag:blogger.com,1999:blog-4490824622137029882.post-51160883172567365802013-04-27T10:59:00.002+08:002013-04-27T11:00:34.342+08:00涷結窗格<pre class="brush:php;">
$main=$jquery_path.ugm_javascript(1)."
<link href='class/ScrollTable/superTables.css' rel='Stylesheet' type='text/css' />
<script type='text/javascript' src='class/ScrollTable/superTables.js'></script>
<style>
.fakeContainer {
margin: 20px;
padding: 0px;
border: none;
width: 95%;
height: 300px;
overflow: hidden;
}
</style>
<div class='fakeContainer'>
<table id='ugm_tb' border='0' cellspacing='3' cellpadding='3'>
<tr><th>標題</th>{$main_head}</tr>
{$main_body}
</table>
</div>
<script type='text/javascript'>
(function() {
new superTable('ugm_tb', {
cssSkin : 'sSky', //颜色方案
fixedCols : 1 //固定几列
});
})();
</script>
";
# 這裡若用「%」設寬度且標題過長,則垂直捲軸失效
$main=$select_form.ugm_div($xoopsModuleConfig['statements_title']." - {$year} 年 {$month} 月份 各單位領用消耗品統計表",$main,"","width:95%;");
return $main;</pre>
<p>
</p>
ugmhttp://www.blogger.com/profile/05956734290689814110noreply@blogger.com0