Goodies Depot

Web Resources, HTML, SEO, AJAX, PHP, ERP, SAP, Microsoft Dynamics and latest IT Goodies.

Archive for the ‘Programming’ Category

jQTouch is a jQuery plugin for creating mobile applications with just HTML, CSS & JavaScript.

It comes with native animations, automatic navigation, and themes for mobile WebKit browsers like iPhone, G1, and Pre.

jQuery Webkit Pluginajax

It can be setup in a few minutes & totally customized with the selector options.

It has 2 ready-to-use themes:

  • default Apple theme
  • jQTouch theme

and new ones can be created with less effort.

The plugin offers page history management and CSS3 page transitions including 3d flip. Also, it easily allows applications to run in fullscreen mode with custom icons and startup screens.

Analyzing PHP Performance: PHP Quick Profiler

Posted by admin On September - 3 - 2009

w248h220_php-logoFirebug is the most popular tool for analyzing HTML, CSS & JavaScript based webpages. Now, there is PHP Quick Profiler (PQP), which can be called as Firebug for PHP.

It is specially focused on analyzing the performance of PHP codes. With a beautiful interface, PQP can:

  • log memory usage
  • display the number & sizes of included files
  • show page execution times
  • log database queries

PHP Quick Profiler

PHP Quick Profiler is not a plug & play solution as every project may have a totally different structure. But, by following the setup information & the example provided, it is easy to integrate.

To see how functional it is, you can check the demo.

Tutorial:Embed a Third-Party Video in your Drupal website

Posted by admin On April - 13 - 2009

opensource1Introduction

The book, Drupal Multimedia by Packt Publishing is a complete guide for creating media-rich Drupal sites by learning to embed and manipulate images, video, and audio. With this book, you will learn to integrate multimedia in your Drupal websites. You will also learn how to tackle media problems from all points of views: content editors, administrators, and developers.

What you’ll need

The reader needs basic knowledge of Drupal operation.

Steps

The book provides information for Drupal administrators and site developers on all aspects of multimedia in Drupal.

Adding and handling multimedia in Drupal, such as images or video, requires the use of many contributed modules, and deciding which ones to use and how to get the most from them is often not a straightforward task. Drupal Multimedia will guide you through the steps necessary to add image, video, and audio elements into your Drupal sites. For each topic, you start with simple techniques and move on to more advanced techniques. By the time you’ve completed this book, you should have a firm ground from which to tackle most multimedia needs, and enough of an understanding to creatively solve more complex problems.

The book will take you through the contributed modules for handling media, showing you what they do, when to use them, and how to get the most from them. When contributed modules aren’t enough, you will see examples of custom Drupal development to add that special touch to your media.
This book will provide information for administrators and professional site developers who are required to embed multimedia into a Drupal site. The reader needs basic knowledge of Drupal operation, but no experience of how Drupal handles multimedia items is expected.
For more information about the book, visit: [1]

Suggested readings

http://www.packtpub.com/files/drupal-multimedia-sample-chapter-5-third-party-video.pdf

Free To Use IP-To-Country/City-Database & API

Posted by admin On April - 13 - 2009

opensource1IP Location Tools is a free web service that helps you detect the country/city of an IP number.

It can be used in 2 ways:

  • with API (no installs required)
  • by downloading the geolocation database

IP Location Tools

Although downloading the SQL database & running it on our own database servers is much more flexible, keep in mind that there are 1.4 million records in it.

The geolocation database is updated regularly (once a month)

IP Location Tools offers another nice service: fraud detection. Again with an API request, with the zip code you submit, system compares the location of the IP and the area where zipcode belongs to. Can be very helpful, specially for e-commerce websites.

Dynamic Drag’n Drop With jQuery And PHP

Posted by admin On April - 9 - 2009

ajax1Jquery Drag’n drop generally looks hard-to-apply but it is definitely not by using JavaScript frameworks. Here is, how it is done by using jQuery & jQuery UI:

jQuery Drag'n Drop

The Database:

We create a simple database as below:

jQuery Drag'n Drop Database

The most important column in the database is recordListingID which shows us the order of the records.

This feature can be applied to any table by adding such a column to it.

The HTML:

We’ll be using an unordered list that is generated from a PHP query that lists the items according to the recordListingID value mentioned above.

Here it is:

</p>
<div id="contentLeft">
<ul>
    <li id="recordsArray_&lt;?php echo $row['recordID']; ?&gt;">&nbsp;</li>
</ul>
</div>
<p>

The JavaScript:

We will be using jQuery UI’s sortable plugin.

 <script type="text/javascript">
$(document).ready(function(){ 

	$(function() {
		$("#contentLeft ul").sortable({ opacity: 0.6, cursor: 'move', update: function() {
			var order = $(this).sortable("serialize") + '&action=updateRecordsListings';
			$.post("updateDB.php", order, function(theResponse){
				$("#contentRight").html(theResponse);
			});
		}
		});
	});

});
</script>

We made the unordered list inside #contentLeft a sortable item, used the serialize function of jQuery to create the array and posted it to updateDB.php.

The PHP:

After posting the array of “new order of the items” to updateDB.php, we must run a query to update our database that will reflect the last positions of every item:

<?php
require("db.php");

$action 				= $_POST['action'];
$updateRecordsArray 	= $_POST['recordsArray'];

if ($action == "updateRecordsListings"){

	$listingCounter = 1;
	foreach ($updateRecordsArray as $recordIDValue) {

		$query = "UPDATE records SET recordListingID = " . $listingCounter . " WHERE recordID = " . $recordIDValue;
		mysql_query($query) or die('Error, insert query failed');
		$listingCounter = $listingCounter + 1;
	}

	echo '<pre>';
	print_r($updateRecordsArray);
	echo '</pre>';
	echo 'If you refresh the page, you will see that records will stay just as you modified.';
}
?>

You can see that this is the easiest part. We handled the array as $updateRecordsArray and used it inside a for each statement.

With a new variable named $listingCounter, while the for each statement runs, we have updated the values of recordListingID column of every item in the database with $listingCounter values. And that’s it.

Create Slick Navigations Easily: jQuery Menu

Posted by admin On April - 9 - 2009

ajax1jQuery Menu is a solid menu system that helps creating dropdown, iPod drilldown and flyout styled navigations easily.
jQuery Menu System

The Jquery menu system uses a hierarchical unordered list for creating the menus & sub-menus.

It is ready with ThemeRoller which makes it very easy to customize the look and has ARIA (Accessible Rich Internet Applications Suite) support.

With various configuration options & ease of use, jQuery Menu is definitely a very helpful solution for creating menus.

Friday, September 18, 2009