Thursday, December 4, 2008

WEB DEVELOPMENT SOLUTION AT AFFORDABLE PRICES

We offer services towards web designs, web application development, Ecommerce Solutions, Offshore staffing, Offshore Outsourcing, ERP Softwares, Multimedia and Search Engine Optimization.

We works with understanding of client's challenges and requirements, expertise in technology and well managed development plan.

We are able to offer web development services rendered by best professionals in this field. We have highly-motivated and devoted team of exceedingly talented software engineers, consultants and managers, highly competent and knowledgeable in custom programming and customer relationship management. Our superior service is possible because of a combination of the best quality processes, technology systems, and customer friendly frontline staff. All of these mean that our customers start experiencing better service, from day one, in every aspect.

Services we offer


We works with all web technolgies & love to find and grab new growing techlogies & promote them.

Mastering the UNIX Command Line: A Beginner's Guide

When a web developer or designer uploads web site files to a web server, there’s a strong likelihood it’s running on an UNIX-style operating system. There’s an equally strong likelihood that, although developers and designers know all about how to upload their files through their favorite file transfer clients, the details of how it actually works are hidden from them.

While it’s possible to survive without this knowledge, many of you may have wondered what goes on up in that cloud where the UNIX gnomes carry out their work on your web creation. This desire to know how it all fits together probably occurred to you when things became unstuck, when you inadvertently placed your files in the wrong folder, resulting in dysfunctional CSS, or even a web site that didn’t function at all. And indeed, a bit of UNIX knowledge may have come in very handy at these times.

So, if you’d like to know what’s going on behind the scenes, and take a first step towards learning the nuts and bolts of a UNIX-style operating system, read on!

UNIX-style Operating Systems

So what does it mean for an operating system to be UNIX in style? How is it different from an operating system like Windows? Well, all UNIX-style operating systems are comprised of a group of similar tools that work together to produce a result, as opposed to a monolithic and stand-alone system such as Windows. UNIX’s groups of tools are also flexible enough to provide a number of ways to accomplish things. In fact, the common workaday toolbox is a useful metaphor here.

When you use a UNIX style operating system you have a useful box of tools at your disposal, and it’s well worth getting to know the basics of these tools. Furthermore, thanks to the similarities between all UNIX-style operating systems, once you know one tool you have a decent grounding for knowledge of them all.


While all UNIX-style systems have a standard set of tools, they can also contain specialized tools to meet certain objectives. The toolbox may come with every tool imaginable, or a limited set of tools to suit a very specific purpose.

The typical standard toolkit includes such things as the function to change directories, list files, move, copy, and delete files, control file permissions, see what programs are running, and so on. In their basic form, all these tools are very similar between different UNIX style operating systems. Think of the different types of toolboxes out there, from those treasured by tradespeople to those gathering dust in the sheds of home improvers. They’ll share common implements, such as screwdrivers, hammers, and wrenches. However, one may have an automated screwdriver, another may have different sizes of hammers, and still another may have strong grip wrenches.

The list of available UNIX-style systems is extensive, but here are links to the most common ones:

save

Wednesday, December 3, 2008

Before baking this code, you'll need to get your hands on a few ingredients:

* CakePHP, a PHP framework for rapid application development. The current version as of this writing is 1.1.13.
* phpFlickr, a PHP class that facilitates interaction with the Flickr API.
* Flickr Component, a CakePHP component developed by Miguel Ros (rossoft) that ties the phpFlickr class into the controller and view of our application.


Setting Up the Files

With CakePHP installed, you'll need to create a phpflickr folder at /app/vendors/phpflickr/ and drop phpFlickr into it. Next, place the Flickr Component into the /app/controllers/components/ folder. In the flickr.php component file, you'll need to specify your API key in the $_api_key variable, like this:

var $_api_key='PLACEKEYHERE';

If you don't already have an API key, you'll need to apply for one.

phpFlickr can cache the data it receives from the Flickr API to speed up subsequent calls. If you're using a file cache, you'll need to make sure the Flickr cache folder has been created and has write permissions. To set or change the cache folder, change the constant declared at the top of the Flickr component file as follows:

define('FLICKR_CACHE_DIR', CACHE . 'flickr/');

You now need to set up your controller to handle the gallery. I'm feeling pretty wild and crazy, so I'm going to call the controller GalleryController, and save it to /app/controllers/gallery_controller.php:

class GalleryController extends AppController{
var $name = 'Gallery';
var $components = array('Flickr');
var $uses = null;
}

The $name attribute is required if you're using PHP4, but can be omitted if you're using PHP5. The components array will automatically load our Flickr component. Finally, we set $uses to null to prevent the controller from auto-loading a model.
Routing

The next thing we need to do is modify our routes to handle the gallery calls. Add the following to your /app/config/routes.php file:

$Route->connect('/gallery/*',
array('controller' => 'gallery', 'action'=>'index'));

This routes all URLs that start with /gallery/ to run the index method of our gallery controller.
The Gallery Controller

Brace yourself! There really isn't much to this magic, but I'll explain what's happening line by line in a moment. Add the following block to the gallery_controller.php file:

function index($id = null)
{
$photosets = $this->flickr->photosets_getList('USER_ID');
$this->set('sets', $photosets);
$currset = $id == null ? $photosets['photoset'][0]['id'] : $id;
$this->set('currset', $this->flickr->photosets_getInfo($currset));
$this->set('thumbs', $this->flickr->photosets_getPhotos($currset));
}

The first thing we see here is that the index function is expecting an $id. This is a photoset ID that we can pass in to pull out a specific photoset.



The next line uses the Flickr API to retrieve all the photosets for a particular user. Authentication is not necessary for this task, unlike other aspects of the API. You'll need to know your user ID, also called an NSID. If you're not sure what it is, try using the API explorer with the flickr.people.findByEmail or .findByUsername calls:

$photosets = $this->flickr->photosets_getList('USER_ID');

Remember to replace USER_ID with your user ID, which you retrieved from the Flickr site.

Next up, we assign the photosets data to a sets variable for use in the view:

$this->set('sets', $photosets);

Next, we determine which is the current photoset ID. If the ID is null, we grab the ID of the first photoset in the list. Otherwise, we use the ID that was passed in:

$currset = $id == null ? $photosets['photoset'][0]['id'] : $id;

After that, we get the title and description of the current photoset, and assign it to a currset variable for use within the view:

$this->set('currset', $this->flickr->photosets_getInfo($currset));

Finally, we grab a list of all the photos and assign it to the thumbs variable for use within the view:

$this->set('thumbs', $this->flickr->photosets_getPhotos($currset));

Just like that, we're almost done. The last thing on our plate is to figure out how to lay this gallery out.

The View

You'll need to create a new folder in /app/views/ called gallery, if you haven't already. And in that folder, you'll need to create an index.thtml file.

I've decided to break my gallery into three main parts:

* the title and description of the current photoset (presented much like a blog post)
* the list of links to all the available photosets
* the thumbnails, one of which will be shown at a larger size

Title and Description

To show the title and description for the current photoset, we tap into the $currset variable we declared in our gallery controller:


Photosets

To display the list of links to photosets, we loop through each of the photosets in our $sets variable, using the title for the link text and creating a link to our gallery controller using the photoset ID as the parameter:



  • link($item['title'], '/gallery/' . $item['id']);?>




Clicking on any of the links will load that particular photoset.

If you'd like to change the order in which the photosets appear in the list, you'll need to go into Flickr and use the Organize feature.

Photos

I want to output a reasonably large image before getting into my thumbnails. Here's how I do it:

" alt="">

This code grabs the first thumbnail from the $thumbs array that we set in our controller and uses the phpFlickr library method buildPhotoURL to build the source URL for the image tag. In this case, I'm grabbing a medium-sized version of the photo, which is 500 pixels long on its longest side, but you can choose one of the following versions of the image:

* square, which has dimensions of 75x75px
* thumbnail, which is 100px on longest side
* small, which is 240px on longest side
* medium, which is 500px on its longest side
* large, which is 1024px on longest side
* original, which is the original image file

Last but not least, I loop through each of the photos in the $thumbs array to build the thumbnail display. I request the thumbnail-sized version from the buildPhotoURL method for the image source URLs and link each thumbnail to its medium version on the Flickr server:


A Sprig of JavaScript

To make this gallery a little more interesting, let's add just a touch of JavaScript: