Ads by Google

Donate

If you like articles and you want an increase of them, please make a little donation. If you make a donation you can submit us by mail an argument for next articles!

Importo: 

add RSS

Add to MyYahoo!
Subscribe in NewsGator Online
Add to Newsburst
Add to Google
Add to My AOL
Add to Pluck
Subscribe in FeedLounge
Add to Windows Live
Add to NetVibes
Subscribe in Rojo
Subscribe in Bloglines
Add to MyMSN
Add to Plusmo for your cellphone
Add to PageFlakes
Add to Technorati

Subscribe to Blog

Follow us on Twitter

follow us

Manfriday blog gadget

PHP


PHP web service for Flex
Lunedì 23 Marzo 2009 22:06
The aim of the sequence of these articles will be implement a flex application to build a portfolio for a Joomla site, like this one.
Joomla as you probably know is a CMS based on PHP and MySql, all info, articles, category, images location , etc... are stored in a mysql db and these info are retrieved through PHP.

When you download a Joomla component to manage your portfolio, is often required that all your items belong to a specific category and then we will follow this concept.

The first idea is to make a PHP page that will get all items of a category and will format info in a xml output because Flex can communicate with a php service only using xml. So Let's go to build the php service.
For this first step we will generate an xml with the title and an image that will be the first image contained in each item of the specified category, in my web-site the category will be the 'Realized Project' one with the fake ID = 99.


<?php 

//library.php only manage the connection to mysql
include ("library.php");
ConnectToDB('localhost','my_dbuser','my_password',"db_to_connect");
 
Photo upload with resizing
Venerdì 05 Dicembre 2008 17:30
 
Questo articolo può essere molto utile quando si vuole dare la possibilità all'utente di fare l'upload di foto.
Il web master però si trova spesso nella situazione di voler visualizzare le foto sempre con le stesse dimensioni.
Fare il resizing in fase di visualizzazione rende il sito pesante, così è molto utile salvare le foto direttamente nella dimensione voluta.
Se poi non si hanno problemi di spazio su disco si può salvare le foto sia in nel formato resized che in quello originale, come avviene in questo listato.
 
 
<?php
$img_thumb_width = 200;
$path_thumbs = "./resizedphoto/";
$path_big = "./bigphoto/";
        define("UPLOAD_DIR", "./upload_resize/images/thumbs/");
 
 


Ricerca personalizzata