Simple image gallery with Flex and PHP

August 3rd, 2008 by hendra

Pictures demo screenshot

Here you go as a promise to a friend to have this uploaded this weekend. I’ve included the source code. Just do the right click and choose View Source on the demo or click here.

Here are some notes for navigating the demo:

  1. To create, rename or delete category use the button on the top of the screen.
  2. To view the content of the category, click the category name.
  3. To delete the picture(s), drag and drop them to the bar at the bottom of the screen.
  4. To assign the picture(s), drag and drop them to one of the listed category on the first container. By default dropping the picture(s) will move the picture(s) to different category. To copy them to different category, hold control (ctrl) key while dropping the picture(s).
  5. To upload your picture(s), click the “Upload Picture(s)” button. It will redirect you to the demo of my previous post. I have not put a link back to this demo from the uploader, so you can just press the browser’s back button :D
  6. To view a larger picture, double click the thumbnail

The code is still kind of messy and I don’t have time to refactore them (If any of you guys can do it, please do and let me know :) ). The main purpose of this app is just a playground for me for learning stuff. Within this app I am using:

  1. Flex
  2. PHP
  3. AMFPHP – to communicate between Flex and PHP
  4. flexlib – Google Code – for the flowbox as the categories container
  5. MySql – to store the images and categories data
  6. Misc stuff I took from here and there

Anyway, I’ve included everything (including the sql script to create the database). Feel free to use it and if you have any question feel free to shoot it. Have fun.

PS: I might miss some of the source files (unlikely). If I did, please let me know.

Upgraded to WordPress 2.6

July 17th, 2008 by hendra

Just finished upgrading to WordPress 2.6. Supposed to be a very smooth process but ran into problem with something like “Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 37890 bytes) in …“.

Tried for sometimes starting with adding php.ini, .htaccess to adding ini_set inside the script still didn’t work (my stupidipity :( ). Finally last attempt tried to get some help from hosting technical support and it didn’t take that long for the guy to fix it. The fix was by increasing the memory limit by editing php.ini:

[PHP]
memory_limit = 32M

So seem that creating php.ini with only this one line of memory_limit=”32M” like what I did before didn’t solve the issue, even when I called phpinfo() it showed me that the memory limit had increased to 32 MB :(

Multiple File Upload with Flex and PHP

July 17th, 2008 by hendra

Flex File Upload

I needed to create a FLEX file uploader with PHP on the server side. So I googled “flex upload”, found this site 9 Flex File Upload Examples Visited and found what I was exactly looking for on the first link (Flex File Upload Component).

So, I grabbed and did play a little bit by adding this stuff:

  • Filtering for the file type
  • Limiting the max file size
  • Modifying the progress bar in the bottom to show overall progress status instead of individual upload status
  • Add progress bar on individual file upload

Anyway, try the demo by clicking the screenshot above and if you like it feel free to use it (as usual, do right click then view source will get you to the source or just click here).
Just don’t forget to include the credit for the guys at weblog.cahlan.com as the most work were done by them :)

Update: Sun, 08.03.2008 – modified the upload.php to save the uploaded images in the database. I need it for collecting sample pictures of my other demo. If you want to delete your upload, go here and you will find it under “Not Categorized” category for the successful upload. Drag and drop your picture(s) to the bar at the buttom of the screen to delete your uploaded picture(s).

First Post

July 4th, 2008 by hendra

And here i am, finally decided to install a blogger software in my empty website. Searched for “PHP Blog” in google and ended up with WordPress. So, here it is, my “Hello World” post :)