Mauro Pirrone | Blog

Design & Logic Arts

Integrating Flickr with your PHP website

Posted in Web Design, Web Development by Mauro on the May 31st, 2008

Flickr is an image and video hosting website. Luckily enough, they provide a web service to access your photos and use them in any way you want. To get you into perspective, here’s the Flickr photoset which I am using, and here are the customised photo gallaries which I created using PHP:

Although I’m showing you how to integrate Flickr with Lightbox and PostCardViewer, this technique works with any photo gallery including the commercial one SlideShowPro.

Step 1

Downlaod the phpFlicker library from http://phpflickr.com/

Download Lightbox or PostCardViewer (or any other photo gallery).

Step 2

To access Flickr using a web service, you need an API key. You may get one from http://www.flickr.com/services/api/keys

Step 3

Get the photoset ID. In this case I am using photoset id ‘72157605353756648′. Note that the photoset id is part of the URL. For example, http://www.flickr.com/photos/26262208@N07/sets/72157605353756648/

Step 3

Step up your php script.

require_once("phpFlickr/phpFlickr.php");
$f = new phpFlickr("your api key");
$photoset_id = '72157605353756648';
$photos = $f->photosets_getPhotos($photoset_id);

Step 4

Loop through each photo in the photoset and you’re done! The following example uses the Lightbox photo gallery.

<ul>
<?php foreach ($photos['photo'] as $photo): ?>
<li><a rel="lightbox[roadtrip]" href="<?= $f->buildPhotoURL($photo, ‘medium’) ?>" title="<?= $photo['title'] ?>"><img src="<?= $f->buildPhotoURL($photo, ’square’) ?>" alt="<?= $photo['title'] ?>" title="<?= $photo['title'] ?>" /></a></li>
<?php endforeach; ?>
</ul>

Notes

  • You may easily change the file size by specifying either square, thumbnail, small, medium, large or original. For example: $f->buildPhotoURL($photo, ‘large’)
  • You may programmatically get the photoset ids by using the API call photoset.getList (or photoset_getList method)
  • You may also use API calls to get comments, upload photos, and so on
  • For the complete API documentation visit here

Source Code Download

Display your images with Lightbox

Posted in Web Design by Mauro on the May 29th, 2008

A photo speaks a thousand words. With Lightbox you can simply make your images stand out! It is basically a JavaScript library used to display large images without having to leave the current web page (this functionality is known as modal). The modal is automatically resized according to the size of the image by using a gliding animation.

One of the main advantages of Lightbox is that if a particular browser simply does not support Lightbox, the image will simply load as a separate file.

Its simplicity makes it even more elegant and encouraging to use it. For step-by-step tutorial how to use it click here.

Note that there many alternatives:

Top Firefox Extensions

Posted in Open Source by Mauro on the May 27th, 2008

Here are some Firefox extensions which I find very useful. If you would like to suggest other Firefox extensions which are not listed over here, feel free to do so by sending a comment.

General

PicLens
PicLens transforms your browser into a visually stunning experience for enjoying online photos and videos. It is also integrated with Facebook. Must try this out…it’s amazing!

ColorfulTabs
Colors every tab in a different color and makes them easy to distinguish while beautifying enjouting the overall appearance of the interface.

Download Statusbar
View and manage downloads from a tidy statusbar - without the download window getting in the way of your web browsing.

DownlaodHelper
The easy way to download Web videos from hundreds of YouTube-like sites. This works also for audio and picture galleries.

PDF Download
PDF Download relieves the pain experienced when encountering PDF files on the Web. Whenever you click on a PDF file, PDF Download lets you know before trying to open it, and then offers you choices such as downloading, opening, or converting it straight to HTML.

Extended Statusbar
A Statusbar with Speed, Percentage, Time and loaded size (like in Opera)

Gmail Notifier
A notifier for Gmail accounts.

ChatZilla
A clean, easy to use and highly extensible Internet Relay Chat (IRC) client.

Web Development

Web Developer
A do everything addon for web developers. Must install!

IE Tab
An extension which uses IE’s rendering engine to view web pages inside Firefox. Very useful when you want to switch between Firefox and IE.

Page validator
Validates a page using the W3C Markup Validation Service.

Firebug
Firebug integrates with Firefox to put a wealth of development tools at your fingertips while you browse. You can edit, debug, and monitor CSS, HTML, and JavaScript live in any web page.

FireFTP
FireFTP is a free, secure, cross-platform FTP client for Mozilla Firefox which provides easy and intuitive access to FTP servers.

Selenium IDE
Selenium IDE is an integrated development environment for Selenium tests. It is implemented as a Firefox extension, and allows you to record, edit, and debug tests. Selenium IDE includes the entire Selenium Core, allowing you to easily and quickly record and play back tests in the actual environment that they will run.

Social Networking

Digg Firefox Extension
The Digg Firefox extension allows you to interact with Digg (http://www.digg.com) and see information about the web page you are currently viewing while you use Firefox.

MVC using a PHP Development Framework

Posted in Open Source, Web Development by Mauro on the May 25th, 2008

MVC which stands for Model View Controller is an architectural design pattern used for building modularised web applications. The main idea behind this model is to separate the business logic from the user interface. As a result, the application would be easier to manage and maintain since any changes in the business logic will not affect the user interface.

MVC consists of:

  • Model which consists of the application’s data and the business rules (methods) used to modify the data.
  • View is the application’s presentation layer which consists of text, buttons, and other objects.
  • Controller which uses a model to invoke methods for data processing and views to output the results.

As with regards to the PHP programming language, there are many open-source frameworks which you can use including the following:

Zend Framework
Zend Framework is well designed and specifically targeted for PHP5. The nice thing about ZF is that all modules are self-contained. Practically should can take any module from this framework and plug it into your application. Video Tutorial

CodeIgniter
CodeIgniter works with PHP 4 and 5. CI is very easy to use and it is very well documented. Video Tutorials

CakePHP
CakePHP works with PHP 4 and 5. It is feature-rich and has built-in support for ORM (Object Relational Model) and Ajax. Video Tutorials

Symfony
Symfony is much like Ruby on Rails since you have to use a command line. Video Tutorials

All the above frameworks support MVC but there are some differences when it comes to the framework’s functionality. I would suggest trying them out!

Tips to promote your site

Posted in Internet Marketing by Mauro on the May 23rd, 2008

Here are some tips to help you promote your site for free:

  • Create your own blog and submit it to websites such as Technorati.
  • Comment on blogs without spamming and marketing.
  • Increase your online presence by getting involved in communities such as MySpace or Facebook
  • Create your own profile. You may try LinkedIn for business profiles or even Last.fm for music.
  • Local Listing…worth having another link! Here in Malta you should try About Malta or Search Malta
  • Share your work with websites such as Digg.

Adobe kuler

Posted in Web Design by Mauro on the May 22nd, 2008

Still wondering how to come up with a Picasso colour scheme? Adobe’s kuler may solve your problem. It’s all about sharing harmonious colour schemes for the web!

Adobe Kuler

http://kuler.adobe.com/

I’d like to thank Matthew who shared with me this website :) If you know about any other useful websites, feel free to share them with me by leaving a comment.

pirronedesign.com

Posted in Latest News, Web Design by Mauro on the May 19th, 2008

In summer besides redesigning my own website, I’m planning to launch a new website (www.pirronedesign.com). The idea behind this website is simply to promote professional web design!

And here’s the logo…

I would greatly appreciate if you send me your comments about my new logo!

Dreamweaver Specific Features

Posted in Web Design by Mauro on the May 15th, 2008

I’ve decided to cover Dreamweaver specific features (i.e not general web design concepts) including the most basic ones and some of the advanced features which help you increase your productivity.

(more…)

Rsb.com.mt coming soon!

Posted in Latest News, Web Design by Mauro on the May 12th, 2008

A new real estate website is coming in July. For the moment you may check a temporary webpage which has been created until the website is online.

RSB - Rent, Sell & Buy

[ www.rsb.com.mt ]

Artificial Neural Networks

Posted in Artificial Intelligence by Mauro on the May 7th, 2008

There are certain situation in life where you want to program something but you either do not have an algorithm or its known algorithm is exponential. To solve this problem, we have to use AI (Artificial Intelligence) techniques. One of the most popular techniques is the Artificial Neural Network. These are practically learning machines which are able to teach themselves and use that knowledge for operational mode. Note that AI techniques always give an approximate output which is fairly acceptable. Typical applications include robotics, motor control, image recognition, and many others.

Just to give an idea about this stuff, here’s a website which allows you to chat with a machine which was done by using a sophisticated Artificial Neural Network.

http://www.titane.ca/igod/main.html

Next Page »