Goodies Depot

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

Archive for April, 2009

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

Posted by gpy6529 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

Uncategorized

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

Posted by gpy6529 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.

Uncategorized

Dynamic Drag’n Drop With jQuery And PHP

Posted by gpy6529 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.

Uncategorized

Create Slick Navigations Easily: jQuery Menu

Posted by gpy6529 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.

Uncategorized

OmniGrid – The MooTools Datagrid Component

Posted by gpy6529 On April - 6 - 2009

ajaxOmniGrid is a free grid, one of the great components from  MooTools that has advanced features.

MooTools Datagrid

Besides client-side sorting, with a serverside script (PHP), it connects to the data & can easily sort/paginate an unlimited number of records.

Columns can be resized, multiple records can be selected, the look can be customized & more.

Free PHP Uptime Monitor Script: phpWatch

Posted by gpy6529 On April - 6 - 2009

ajax1Free PHP Uptime Monitor Script

PhpWatch is a free PHP uptime monitoring script that can watch unlimited number of websites and send notifications via e-mail or SMS (for US phones).

PhpWatch complete with an Ajaxed interface, new monitors & notifications can be easily configured. And, once the cron job / scheduled task -that pings the servers in desired time intervals- is set, the script is awesome and ready to go.

phpWatch also offering an API which lets other applications to query the monitored services, get the statistics and use the notification system for sending SMS and e-mail alerts.

Thursday, November 21, 2024