Toggle main menu visibility
新聞
下載
教材
影音
討論
其他選單
好站連結
行事曆
電子相簿
常見問題
萬用表單
即時留言簿
友站消息
社大學員
:::
登入
登入
帳號
密碼
登入
重整畫面
:::
所有書籍
「[981]PHP入門+XOOPS模組設計」目錄
MarkDown
15. 製作XOOPS區塊
1. 相見歡
1-1 index.php 內容
2. PHP與表單
2-1 contact/index.php
3. 讓程式聰明又乾淨
3-1 index.php 原始語法
4. 寫入資料庫
4-1 index.php
5. 撈取資料庫資料
5-1 index.php
6. 把資料庫資料作成列表
6-1 index.php
7. 讓程式套用佈景
7-1 index.php
8. 加入修改刪除功能
8-1 index.php
9. 上傳檔案並做縮圖
9-1 index.php
10. 安裝XOOPS
10-1 index.php
11. XOOPS模組架構
11-1 index.php
11-2 index2.php
12. $xoopsUser應用
12-1 index.php
13. 分頁與搜尋
13-1 include/search.php
13-2 index.php
14. 樣板及評論
14-1 view.php
14-2 index.php
14-3 comment_new.php
15. 製作XOOPS區塊
15-1 blocks/new_contact.php
16. 偏好設定與所見即所得
16-1 view.php
17. 多國語系與圖形驗證
17-1 index.php
17-2 [語系]language/tchinese_utf8/modinfo.php
17-3 [語系]xoops_version.php
17-4 [語系]admin/menu.php
17-5 [sprintf示範]index.php
17-6 [sprintf示範]main.php
18. 模組自動功能
18-1 include/onUninstall.php
18-2 include/onUpdate.php
16. 偏好設定與所見即所得
\[981\]PHP入門+XOOPS模組設計 ====================== <?php //顯示最新的通訊錄項目 function new\_contact($options){ global $xoopsDB,$xoopsUser; define("\_DIR",XOOPS\_ROOT\_PATH."/uploads/tad\_contact"); $i=0; $tbl=$xoopsDB->prefix('contact'); $sql="
select \* from $tbl order by post\_date desc limit 0,{$options\[0\]}"
; $result=$xoopsDB->query($sql) or die(mysql\_error());
$photo\_th=($options\[1\]=='1')?"<th>相片</th>":"";
$main="<table border=1 style='width:100%;'> <tr>
$photo\_th
<th>姓名</th></tr>"; while($data=$xoopsDB->fetchArray($result)){ $color=($i % 2)?"white":"#f0f0f0"; $i++; $photo=\_DIR."/{$data\['sn'\]}\_s.png"; $show\_photo=XOOPS\_URL."/uploads/tad\_contact/{$data\['sn'\]}\_s.png"; $pic=(file\_exists($photo))?"<img src='$show\_photo'>":"沒有圖";
$photo\_td=($options\[1\]=='1')?"<td>$pic</td>":"";
$main.= " <tr bgcolor='$color'>
$photo\_td
<td><a href='".XOOPS\_URL."/modules/tad\_contact/view.php?sn={$data\['sn'\]}'>{$data\['name'\]}</a></td> </tr>"; } $main.="</table>"; return $main; } //編輯最新的通訊錄項目 function new\_contact\_edit($options){ $checked\_0=($options\[1\]=='0')?"checked":""; $checked\_1=($options\[1\]=='1')?"checked":""; $main=" <p> 秀出幾筆資料?<input type='text' name='options\[0\]' value='{$options\[0\]}'> </p> <p> 是否秀出圖片? <input type='radio' name='options\[1\]' value='0' $checked\_0>不秀出 <input type='radio' name='options\[1\]' value='1' $checked\_1>秀出 </p>"; return $main; } ?>
:::
搜尋
search
進階搜尋
QR Code 區塊
快速登入
所有討論區
「PHP全端開發」線上課程討論區
XOOPS使用討論區
一般研習學員
社大學員專用
路過哈啦區
XOOPS佈景設計
XOOPS模組開發
Tad書籍區
即時留言簿
書籍目錄
展開
|
闔起
線上使用者
111
人線上 (
68
人在瀏覽
線上書籍
)
會員: 0
訪客: 111
更多…