:::

16-4 上課範例:include/notification.inc.php

01<?php
02if (!defined('XOOPS_ROOT_PATH')) {
03    die("XOOPS root path not defined");
04}
05 
06function get_tad_note($category, $item_id)
07{
08    if ($category=='global') {
09        $item['name'] = '';
10        $item['url'] = '';
11        return $item;
12    }
13 
14    global $xoopsDB;
15    if ($category=='cate') {
16        $sql = 'SELECT cate_title FROM ' . $xoopsDB->prefix('tad_note_cate') . ' WHERE cate_sn = '.$item_id;
17        $result = $xoopsDB->query($sql); // TODO: error check
18        $result_array = $xoopsDB->fetchArray($result);
19        $item['name'] = $result_array['cate_title'];
20        $item['url'] = XOOPS_URL . '/modules/tad_note/index.php?cate_sn=' . $item_id;
21        return $item;
22    }
23}
24?>

:::

搜尋

QR Code 區塊

https%3A%2F%2Ftad0616.net%2Fmodules%2Ftad_book3%2Fpage.php%3Ftbdsn%3D657%26tbsn%3D22

書籍目錄

展開 | 闔起

線上使用者

29人線上 (15人在瀏覽線上書籍)

會員: 0

訪客: 29

更多…