二月
16
2009
0

使用者選單套用 javascript dynamic menu

- create XOOPS_TRUST_PATH/cache
- chmod 777 XOOPS_TRUST_PATH/cache
- download xugj_assign.php
http://www.peak.ne.jp/support/xoops/xugj_assign.zip
- put xugj_assign.php into the same directory as theme.html you use
- edit your theme.html
– insert this line in the top
<{include_php file=”file:$xoops_rootpath/themes/$xoops_theme/xugj_assign.php”}>
– insert this code into the appropriate place

<div id="dhtmlgoodies_menu">
<{$xugj_menu_uls}>
</div>

- install “DHTML menu” as instructed in http://www.dhtmlgoodies.com/
- modify XOOPS_TRUST_PATH/cache/theme_xugj_assign.php if you want

參考來源:

http://xoops.peak.ne.jp/md/d3forum/index.php?post_id=10737

Written by jason in: 未分類 |
二月
11
2009
0

安裝 PHP 時出現error: Cannot find MySQL header files under yes的錯誤訊息

安裝 PHP 時,剛執行 ./configure –with-apxs2=/usr/local/Apache2/bin/apxs –with-mysql
就出現以下錯誤訊息:

…..
checking for mSQL support… no
checking for MSSQL support via FreeTDS… no
checking for MySQL support… yes
checking for specified location of the MySQL UNIX socket… no
checking for MySQL UNIX socket location… /tmp/mysql.sock
configure: error: Cannot find MySQL header files under yes.
Note that the MySQL client library is not bundled anymore.

解法:
o 如果不知道 header file 在哪,用 「find / -name mysql.h」命令找出其位置;
o 如果是自己也有手動安裝 MySQL 套件的話,直接指定該位置。

在 ./configure 下參數指定 header file 的位置,如下:

./configure –with-apxs2=/usr/local/Apache2/bin/apxs –with-mysql=/usr/local/mysql –with-mysqli=/usr/local/mysql/bin/mysql_config

若是使用 fedora 的話要安裝 mysql-devel 再下參數 –with-mysql=/usr/include/mysql

Written by jason in: 未分類 |
二月
03
2009
0

使用 Informix First N 的句型列出資料

用法

SELECT FIRST N fieldname FROM tablename WHERE clause ORDER BY clause DESC;

其中N是前幾筆資料

Written by jason in: 未分類 |
一月
22
2009
0

[原創]透過WMI取得本機或遠端電腦開機時間

底下為程式碼範例

Option Explicit
Dim objWMIService As Object
Dim objSWbemDateTime As Object
Dim colItems As Object
Dim objItem As Object
Dim strMoniker As String
Dim strSQL As String
Dim strComputer As String

Private Sub Form_Load()
    On Error Resume Next
    strSQL = "SELECT LastBootUpTime FROM Win32_OperatingSystem"
    strComputer = InputBox("輸入主機名稱或網路位址", "遠端連線")
    strMoniker = "WinMgmts:{ImpersonationLevel=Impersonate, " _
                        & "AuthenticationLevel=PktPrivacy}!" _
                        & "//" & strComputer & "/root/cimv2"
    Set objSWbemDateTime = CreateObject("WbemScripting.SWbemDateTime")
    Set objWMIService = CreateObject(strMoniker)
    Set colItems = objWMIService.ExecQuery(strSQL, , 48)
    For Each objItem In colItems
        objSWbemDateTime.Value = objItem.LastBootUpTime
    Next
    txtLastBootUpTime.Text = objSWbemDateTime.GetVarDate(False)
    Set objSWbemDateTime = Nothing
    Set objWMIService = Nothing
End Sub

說明如下:

繼續閱讀 »

Written by jason in: 未分類 |

Powered by WordPress | Aeros Theme | TheBuckmaker.com WordPress Themes