顯示具有 php 標籤的文章。 顯示所有文章
顯示具有 php 標籤的文章。 顯示所有文章

2012年4月27日 星期五

【OpenCart】Add new language

Go to open cart  homepage,select 【Extension】

image

1.Select catalog lanaguage 2.Input what your language 3.Select your OpenCart version and License

finally choose favorite pack

image

Download it(mine is 1.5.2.1)

image

Unzip the file,you will see two folders as below

 

image

Copy the these folder to your OpenCart folder,you can overwrite them directly

image

Please check  language folder in admin folder or catalog folder,please remember the folder name and the file name

,we will use the data later(e.g. zh-HK and zh-HK.php)

image image

Go to admin link and select menu to 【System】=>【Location】=>【Language】and 【Insert】 an option

image

Fill each column(* is required Directory fill above directory name ,Filename fill above filename don’t need extension)

and should select status to enabled,and save

 

image

Then select menu 【System】=>【Setting】and edit the only one option

image

 

Then select【Local】and choose your language on Language and Admin Language,finally save.

image

So your site chage to your language

image

image

2011年12月10日 星期六

mongoDB setup php module

上一篇簡單的試了一下mongoDB

接著這篇我們用PHP做為我的開發環境

在官網中 http://www.mongodb.org/display/DOCS/PHP+Language+Center

主要就是把mongoDB的modue加到php的extension上

目前選擇了mac做為安裝環境

於是再參考了

http://www.php.net/manual/en/mongo.installation.php#mongo.installation.osx

報行了 

sudo /Applications/XAMPP/xamppfiles/bin/pecl install mongo 


(當然要先安裝XAMPP,XAMPP會先預裝pecl可以減少安裝的 pecl的麻煩) 


不過遇到了一個錯誤


running: phpize-5.3.1



sh: phpize-5.3.1: command not found



ERROR: `phpize' failed



從網上找了大部都說是要使用PHP5-DEV,看起來都是太舊的資訊了



在 /Applications/XAMPP/xamppfiles/bin/ 裡也有了phpize-xxx的檔案



phpize會去讀取 .m5做為build的規則



於是到pecl官網直接抓取tar包 http://pecl.php.net/get/mongo-1.2.6.tar



tar開後(tar zxvf mongo-1.2.6.tar)看到其目錄有一個 .m5的檔案



先行使用phpize去執行build的動作



不過仍又在遇到另一個問題,再來出現的是找不到相關的header file



grep: /Applications/XAMPP/xamppfiles/include/php/php-5.3.1/php/main/php.h: No such file or directory



grep: /Applications/XAMPP/xamppfiles/include/php/php-5.3.1/php/Zend/zend_modules.h: No such file or directory



grep: /Applications/XAMPP/xamppfiles/include/php/php-5.3.1/php/Zend/zend_extensions.h: No such file or directory



Configuring for:



PHP Api Version:       



Zend Module Api No:    



Zend Extension Api No:




接著看到其實這的包裡有一般unix的build的內容



所以立即執行




  1.    ./configure 


  2.    ./make



完成後在build的目錄下即可找到mongo.so的lib了



最後把這個檔案複製至  Lib下



再把 php.ini在 extesion段加上  extension=mongo.so再重啟apache即可 



在php的code裡



$conn = new Mongo()



echo   ‘conn’. $conn;



即可正確印出  connection id



記得要把 mongoDB啟動(mongod)

2010年4月6日 星期二

Flex3 搭配amfphp










2009年5月17日 星期日

使用Flex Code Generator開發Flex+PHP

為加速開發Flex+PHP,於是使用了
FCG : a Flex Code Generator
  • 過往在Java的經驗,寫ORM的model及DAO是最沒價值又費時間的,所以會較依賴generator
  • 此程式在產生對應java的as model時,會有型態無法直接轉換的問題 e.g.java中 BigDecimal 轉到as仍是BigDecimal但as裡沒有BigDecimal型態,不過己可減少蠻多這種重覆又沒義意的工作了
建立過程會分二個階段,我們先來介紹過PHP的部份
  1. 首先直接在該網站使用線上安裝(會直接偵測是否有安裝AIR)
  2. 裝好後先在MySQL建立好了幾張table,再將script export出來
  3. 啟動FCG後在【Main Package Name】輸入自己的full package name <= 這個階段可暫不輸入
  4. 接著選擇【Project Type】 選擇【PHP】 => 【Start Project】
  5. 【Import SQL】 選擇己export出來的table script <= 只可包含Create Table的script
  6. Finish後即可出現即可出現所有的VO及DAO PHP程式
  7. 內容中有一個header.php ,請自行建立所需資料庫相關資訊
待續.......

2009年3月22日 星期日

WordPress 多語系

最近在幫User找WordPress多語系問題
找了一下使用 xlanguage plug-in應該可以解決這個問題
http://wordpress.org/extend/plugins/xlanguage/
下載好了xlanguage後解壓到 [WordPress安裝目錄]\wp-content\plugins下
再進入管理者介面後在Setting就會出現這個plugin的選項











點選進入後最主要的是就是 Language及Lauguage這二個項目












設好各個語系的名稱及Locale後
在新增或編寫文章時使用編輯器右上方的1、2、3.....
做不同語系的設定














看一下html,原來是使用了在tag上加上attribute的做法來逹到多語系
(註:可以考慮用在Java的作法哦,以往接觸到的i18N都只有LABEL有多語系)











最後再點 Apperance的Widgets









再把xlanguage加到畫面上就完工了
完成如下所示
繁體:












簡體:












英文:













考慮把這邊的內容搬到WordPress平台ing.......

2008年10月21日 星期二

使用nusoap 將你的php程式供其它系統取用資料

因為所使用的PHP系統有需供給Flex程式來提取資料
所以使用了 nusoap來建置 webservice
以下是在 php 程式定義的二個function
第一個function getMember 取得單一筆member資料
第二個function getMembers取出一堆member資料