[PHOTO CMS] 利用Dural來架設相簿網站與支援多重相片上傳

其實之前就有在使用4images來架設相簿,不過由於本人喜歡一次選取多個相片上傳,所以有使用Jupload的Java Applet,偏偏最近IE更新與Java更新後一直無法正常作用,看來得更換新的相簿管理網站。 期間也是有試用過其他的相簿網站: ZenPhoto 看起來不錯,但是由於AppServ版本有點舊,無法正常安裝。可能晚些時間再研究。 Gallery 3.0 不支援AppServ,安裝2.X之後整體功能完整。但是由於上傳界面還是屬於醜醜的Java Applet可能先當成備案,再看看有沒有其他的網站軟體。 Dural: 算是老牌的CMS軟體,而且跟我覺得多重像片上傳的API Plupload整合的很好,現在可能會開始研究這個。 接下來就記錄一下如何利用Dural來架設相簿網站,我的環境有點舊,有需要的人再看吧: 環境說明: Win7 SP1 32 bit AppServ 2.2 (PHP, MySQL版本參照2.2的版本) Dural 相關套件: 主程式: drupal-7.14 主要的模組(其他細節看安裝流程): Media: media-7.x-1.2 PlUpload: 7.x-1.0 Media Gallery 7.x-1.0-beta8 安裝流程: Dural7 下載drupal-7.14後解開來,並且把權限改成666,或是改成不是唯讀即可。 直接跑該目錄來執行安裝 再選資料庫的時候,會發現只有SQLite可以選,點下去後,這時候會跳出一個問題: SQlite問題 In order for Drupal to work, and to continue with the installation process, you must resolve all issues reported below. For more help with configuring your database server, see the installation handbook. If you are unsure what any of this means you should probably contact your hosting provider. The database version 3.3.7undefined is less than the minimum required version 3.3.7. 找到解決方法,因為使用AppServ 2.2,參考這裡。 修改php.ini,打開extension=php_pdo_mysql.dll 改完之後重新跑安裝網頁,會發現有MySQL可以選 這樣就可以順利安裝完drupal 7 安裝 Dural 相關 mudule extension: (安裝module流程,參考這裡) 點選 “Module” –> “Install new module” 將Meida找到的檔案鏈結填上~然後下載安裝。 要啟用(Enable newly added modules)之前,會發現有一堆的相關module需要安裝。 下載並安裝CTools 啟用File Entity 啟用Media與Media Internet Sources 開始安裝PlUpload extension (7.x-1.0) 安裝前先去PlUpload 下載library 解壓縮到安裝目錄/site/all/libraries/plupload 參考這裡 安裝multiform extension (7.x-1.0) 安裝Media Gallery extension (7.x-1.0-beta8) 接下來你到你的首頁,應該有看到”Galleries”的Tab,就可以開始使用了。 參考資料: 如何使用 Media Gallery: http://www.drupalgardens.com/documentation/feature/media-gallery 架設相簿網站,建議相關安裝module...
繼續閱讀

[iOS][Three20]Mac Blog App 使用心得與 Three20 初體驗

從上個禮拜MBA入手之後,就開始研究關於Mac OS上面的一些操作。 首先要先弄好的就是撰寫Blog的系統,以下是一些研究心得:   Mac上撰寫Blog系統使用心得: Ecto: 其實很好用,但是有著致命的空行問題,看來不會修。放棄! Qumana: 對於貼上程式碼支援不好,貼圖也不方便。 Blogo: 連Launch都不行,應該跟我的版本有關,繼續找找。 ScriptFile:不算是App因為是Chrome extension (Filefox也有),支援算差! MarsEdit: 用到現在最佳的,不可以編輯隱藏blog,但是貼程式碼相當順暢! 參考文章: http://macoolife.com/blog/2/ http://www.pjhome.net/article/Diary/1034.html http://www.icyif.com/archives/1699.html http://atlasweng.blogspot.tw/2010/02/mac.html   這些試用過後,應該會繼續使用MarsEdit當作目前的方案 如果真的遇到無法解決的問題,灌VirtualBox弄個Win7來寫Blog也是有可能的。   以下是整理Three20的初步體驗心得: 下載Three20 程式碼 http://three20.info/roadmap/1.0.6.2 在Xcode建立一個View base App 使用終端機輸入以下指令去把Framework加入 python three20/src/scripts/ttmodule.py -p Three20Test1/Three20Test1.xcodeproj Three20 –xcode-version=4 注意相關的路徑 打開專案會看到相關Framework 加好了,接下來你需要的是找一些範例來展示Three20的火力 參考以下網頁找範例: http://www.haogongju.net/art/1473534 http://www.xuanyusong.com/archives/652 http://c.gzl.name/archives/tag/three20
繼續閱讀

[iOS]在iPHONE上使用MEDIA PLAYER播放的相關程式碼

在iOS要撥放影片其實有兩種播放器的source可以使用。 一個就是Media Player (MPMoviePlayerController),另一個是AVPlayer (AV Foundation)。 這裡會介紹一些簡單使用Media Player的相關程式碼。 主要有幾個部分,第一個部份就是設定撥放來源,在這裡是使用網路上的檔案。 接下來的部分就是關於撥放得相關設定 //強迫旋轉你的iDevice (這裡是橫放) [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:YES]; // 設定撥放器的外觀 [WebPlayer setControlStyle:MPMovieControlStyleFullscreen]; [WebPlayerr setFullscreen:YES]; //設定影片比例的縮放、重複、控制列等參數 //影片旋轉90度 WebPlayer.view.transform = CGAffineTransformMakeRotation(1.5707964); WebPlayer.scalingMode = MPMovieScalingModeAspectFit; WebPlayer.repeatMode = MPMovieRepeatModeNone; //將影片加至主畫面上 WebPlayer.view.frame = self.view.bounds; [self.view addSubview:WebPlayer.view]; //開始播放 [WebPlayer play]; 這樣其實就可以撥放全螢幕的影片並且將手機橫放 如果播放完影片要可以回到原來的畫面,則要多接收一個Observer. // 註冊endPlay 當撥放完畢的時候,會收回傳的通知 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(endPlay:) name:MPMoviePlayerPlaybackDidFinishNotification object:WebPlayer]; 最後就是放endPlay的所有內容,裡面的重點在釋放撥放器與回到iDevice相關設定 -(void)endPlay: (NSNotification*)notification { //解除註冊回傳 [[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackDidFinishNotification object:WebPlayer]; //將你的iDevice 轉回來 [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait animated:YES]; //停止播放 [WebPlayer stop]; //Release control [WebPlayer release]; //現在的view 移除~ 回到原本的view [WebPlayer.view removeFromSuperview]; } 參考文章: Furnace iOS 程式設計中文學習網站: 使用_MPMoviePlayerController_ MPMoviePlayerController 與MPMoviePlayerViewController [Iphone中利用_MPMoviePlayerController_線上播放視頻(轉) @ OPEN](http://fecbob.pixnet.net/blog/post/36635972-iphone%E4%B8%AD%E5%88%A9%E7%94%A8mpmovieplayercontroller%E7%B7%9A%E4%B8%8A%E6%92%AD%E6%94%BE%E8%A6%96%E9%A0%BB(%E8%BD%89)
繼續閱讀

XReadr–A simple Google Reader App on Windows Phone 7

Finally, I decide to release the source code of my Windows Phone Google Reader App. Please feel free to https://xreadr.codeplex.com/ here. Here is my project summary: Project Description XReadr is a simple Windows Phone 7 app using Google Reader API. It already has login, browse and mark it as read function here. XReadr is simple Windows Phone 7 App which using Google Reader API. It also has follow function: Login page which using HttpWebRequest Browse Unread Labels Browse every news on Label I also put the first draft of source code, I hope it could help all of you which want to write more Windows News App here. More implementation detail about how Windows Phone to use Google Reader API, please refer my blog here: http://www.evanlin.com/blog/archives/001138.html http://www.evanlin.com/blog/archives/001139.html It write by Traditional Chinese, feel free to ask me via English.
繼續閱讀

[C#][WINDOWS PHONE] 關於頁面處理的相關小細節(改變初始頁面與頁面間傳遞參數)

這幾天開始把原來的RSS Reader APP程式多加頁面後,發現了一些小問題。網路上或許還算是好找。 但是我稍微整理一下,其實Pou’s blog兩篇文章有相當清楚的解釋 Windows Phone 7 - 動態轉換初始的Default Page Windows Phone 7 – Navigation Framework原理概論 在此只把常遇到的兩個問題整理一下: 如何改變初始頁面(How to change default page on Windows Phone) 修改文件”WMAppManifest.xml”以下程式碼: <Tasks> <DefaultTask Name="_default" NavigationPage="MainPage.xaml" /> </Tasks> 如何在頁面中傳遞參數(How to pass parameter over pages on Windows Phone) 在頁面間傳遞參數可以把它當成是網頁的GET模式(就是?Param_1=value_1&Param_2=value_2) 在原來的頁面可以用以下的指令傳遞 string mylogin = "/Page2.xaml"; mylogin += "?Param1=" + "VALUE1"; mylogin += "&Param2=" + "VALUE2"; if (!String.IsNullOrWhiteSpace(mylogin)) { this.NavigationService.Navigate(new Uri(mylogin, UriKind.Relative)); } 再接收的Page2就必須要有以下的方式去接受參數 protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { //Get parameter string myParam1 = NavigationContext.QueryString["Param1"]; string myParam2 = NavigationContext.QueryString["Param2"]; } 這樣就可以了~~~ 參考網頁: http://www.eugenedotnet.com/2011/03/passing-values-to-windows-phone-7-pages-uri-paremeters-or-querystring/ http://stackoverflow.com/questions/3892271/how-do-i-change-the-startup-page-on-a-wp7-silverlight-app http://www.dotblogs.com.tw/pou/archive/2011/06/05/27148.aspx http://www.dotblogs.com.tw/pou/archive/2011/04/30/23929.aspx http://www.dotblogs.com.tw/pou/archive/2011/01/23/20967.aspx
繼續閱讀

[C#][Windows Phone][JSON]如何用C#完成一個簡單的Google Reader APP(下)

3. 瀏覽全部尚未閱讀的列表 接上篇文章,接下來會開始講解如何去獲得使用者所有標籤(Label)的文章。 一開始首先一樣是先提供這裡會用到的相關Google Reader API的講解 > > [https://www.google.com/reader/api/0/unread-count?allcomments=true&output=json&ck=12121&client=scroll](https://www.google.com/reader/api/0/unread-count?allcomments=true&output=json&ck=12121&client=scroll) > > 你就可以在瀏覽器上面獲得你要的資訊。你如果有登入你可能會獲得像是以下的一些資料。 接下來是取得資料的相關原始碼: public void GetGoogleReaderUnReadCount() { string auth_params = string.Format("https://www.google.com/reader/api/0/unread-count?allcomments=true&output=json&ck=" + DateTime.Now.Ticks.ToString() + "&client=scroll"); HttpWebRequest httpRequest = (HttpWebRequest)WebRequest.Create(auth_params); httpRequest.Method = "GET"; httpRequest.Headers["Authorization"] = "GoogleLogin auth=" + UserAuth; httpRequest.Headers["Cookie"] = "SID=" + UserSid; httpRequest.BeginGetResponse(new AsyncCallback(ResponseCallbackInner), httpRequest); } 抓回資料後,就開始要去parse這些資料,這邊會用到大量的JSON相關技巧,我也盡量試著解釋清楚一點給大家知道。首先,會拿到以下的資料,以下是以我的資訊當作範例~跟你拿到的可能會有點差異。 { "max":1000, "unreadcounts":[ { "id":"user/-/label/教學網站", "count":9, "newestItemTimestampUsec":"1335595557150290" }, { "id":"user/-/label/Funny", "count":83, "newestItemTimestampUsec":"1335621983685977" }, { "id":"user/-/label/專業評論", "count":38, "newestItemTimestampUsec":"1335617137314302" } } 這些資料就是JSON的資料,關於JSON是甚麼與JSON.NET該怎麼使用的部分,網路上有許多相關的程式碼,我這裡就不詳述了。 根據上面資料排序的結果,我們需要去抓unreadcounts下面的子結點,而他的資料格式如下: public class ServerUnreadResult //JSON { public string id { get; set; } public string count { get; set; } public string newestItemTimestampUsec { get; set; } } 所以在我們程式碼中,就是可以依照以下的安排: private void ParseUnreadList(string responseString) { //JSON Parse JObject googleSearch = JObject.Parse(responseString); // get JSON result objects into a list IList<JToken> results = googleSearch["unreadcounts"].Children().ToList(); // serialize JSON results into .NET objects IList<ServerUnreadResult> searchResults = new List<ServerUnreadResult>(); foreach (JToken result in results) { ServerUnreadResult searchResult = JsonConvert.DeserializeObject<ServerUnreadResult>(result.ToString()); //Parse the label name // ex: user/06771113693638414260/label/Win8 string...
繼續閱讀