Posts

Showing posts from September, 2013

Drupal : 如何使用同個資料庫但套用不同的 Theme ?

你會不會有這樣的需求? 當這個網站要讓電腦跟手機看到 雖然說 Responsive Design 可以解決大部分的問題 這邊 Subsite 不適用的原因是 雖然 users、roles、sessions 可以共用 但我要的不是另外架一個子站 整個站的資料不要跟主站有所分離 說白了就是 同一個網站要有不同的 view by device 如果你遇到這個問題你會怎麼處理? mobile app 嵌入的 web view 讀到的網頁不要 header 跟 footer (只要 content) 但如果你在 mobile 上瀏覽的網站卻要是正常的(有 header & footer) 其實如果只有單一個網頁個別處理是 ok 的 可以在路徑上面多個參數 搭配 theme function 或 template 去做變化 如果該頁是 view 又有 intra link 可能就會破功 來試試看「 Themekey 」吧! Themekey 就好像是個 for theme 的 Rules 他內建可以 trigger 的 event 相當多 不像 Rules 在不熟悉的時後會覺得使用上沒有頭緒 Themekey 的運作很簡單 先挑選一個 Properties(event),然後在選擇 Operator,再設定 Value 即可 現在假設我要的目的是 電腦跟手機連到同個網站在資料需要一致下,你打算怎麼做? 我一開始想說在網址列多個參數做識別 例如 http://www.facebook.com 跟 http://www.facebook.com/ ?device=mobile 這時候我選的 PROPERTIES 是 SYSTEM:QUERY_STRING Operator 選擇 = Value 設成成 device=mobile 這是 work 的 但有 intra link 的頁面會遇到上面說的問題 後來又想說如果說取得網址時在 meta data 塞些資料識別 但這樣似乎又太麻煩 其實他的 Properties 裡面還有 SYSTEM:USER_AGENT 可以直接針對不同 device 導到不同 Theme 去 後來看到 SYSTEM:HOST 有種一語驚醒夢中人的感覺 直接設定如果

如何找到之前 compile 的指令

因為手殘的關係 不小心把之前紀錄 compile 指令的檔案砍了 想說原本的 compile 的 source 裡面應該有當時下的 compile 參數 果不其然! 在 source 的 config.nice 裡面 #! /bin/sh # # Created by configure './configure' \ '--prefix=/usr/local/php5' \ '--with-apxs2=/usr/local/apache2/bin/apxs' \ '--with-mysql=/usr/local/mysql' \ '--with-mysqli=/usr/local/mysql/bin/mysql_config' \ '--with-config-file-path=/usr/local/php5' \ '--enable-mbstring' \ '--enable-ftp' \ '--with-zlib' \ '--with-regex=php' \ '--with-xmlrpc' \ '--with-gd' \ '--enable-gd-native-ttf' \ '--enable-exif' \ '--with-jpeg-dir=/usr/lib' \ '--with-png-dir=/usr/lib' \ '--with-freetype-dir=/usr/lib' \ '--with-xpm-dir=/usr/lib' \ '--with-gettext' \ '--enable-soap' \ '--with-pdo-mysql=/usr/local/mysql' \ '--with-mhash' \ '--with-mcrypt' \ '--with-openssl' \ '--with-curl' \ '--enabl

The cmdb add entry failed

剛想對 VPN User 做刪除或編輯的動作 但系統會跳出「The cmdb add entry failed」 查了一下有人說重開可能會解決 (大概有十個月沒重開了) 果然就解決了! PS. 要刪除 VPN User 需要先把他所屬的 group 移除 環境: Fortigate 80C