The Party is About to Be ON

June 28th, 2008 by Sajith M.R

In every project works, there would be a lazy day. The day we spend with nothing. If you are plaining for a lazy day, a leisure time, I can offer a place to enjoy and stay. I will manage all your expenses !!! What you have to spend is your traveling charges to reach the REAL Nature Beauty area, The God’s Own Country, Kerala, in India. I welcome all of you into my place for a Blogcamp meet.

see

http://www.blogcampkerala.com/

Our first Blogcamp is going to happen on this AUGUST 16 th of 2@@8 inside a House Boat.

I would like to see all my readers on these chairs :)

(inside view of the house boat)

You programmed a lot, you designed a lot, you created a lot, you earned a lot. You have to take a little rest, a little sleep.

Is this bed is enough for you ???

(Bed room inside the house boat)

The boat is ready now, the nature is waiting your presence, the SEXY she , is lying , just above the lake.

So I cordially welcome all of your presence in this occasion, Kerala BlogCAMP . The Party is about to be ON.

You can call me regarding this in: +9I 9846&3IIO6
(not a toll free number and leave me free between 1 am to 8 am of GMT + 5.30 )

Wordpress Announcement - Plugin

June 24th, 2008 by Sajith M.R

Wordpress Announcement Plugin

Do you wanna inform any important news or message to your readers ? Here is a simple plugin, Wordpress Announcement Plugin.

Download the plugin from : http://downloads.wordpress.org/plugin/announcement.zip

Go to Admin > Plugin > and activate announcement plugin. After that, go to options and select Announcement. By default the plugin will be inactive. You have to set your announcement and activate the announcement by checking ‘Active’ checkbox.

Never Forgot to Run the Announcement. By Default the Announcement will be inactive

Enough !!! You visitors can now see your announcement. It will be displayed only one time for a particular user .

(If you want to see the announcement again, for testing purpose, Clear browser cookies, or atleast cookies from your blog. Otherwise you have to wait another 24 hours to play the announcement again)

The plugin is created with cute design and animation. It will never interrupt your blog reader.

Regards

Sajith

Requirements for a Video Website

June 23rd, 2008 by Sajith M.R

If you are planing to start a video website like youtube, here is some things to keep in mind.

FLV PLAYER
========

You know in now a days most of the video streaming websites use flash player for video streaming. The video file is in flv format. So you need a flash video player for this purpose.
You can download a free flash / flv player from : http://www.jeroenwijering.com/?item=JW_FLV_Player
or http://flowplayer.org/

FORMAT CONVERSION
===============

Now you need videos in flv file format. In normal cases, most of the videos uploaded by an user will be in avi, dat ,mpg,mp4 or 3gp. So you need a flv converter. You can use either ffmpeg library or mencoder for this purpose

Here is a sample video emmbedding method.



codebase=”http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,18,0″
width=”450″ height=”375″ id=”/YouTube_video/youtube” align=”middle”>




bgcolor=”#ffffff” width=”450″ height=”375″ type=”application/x-shockwave-flash”
pluginspage=”http://www.macromedia.com/go/getflashplayer” />;

Here src parameter points the swf file, the flash palyer and video parameter points the flv file. This is the format of player i used in http://www.amvizone.com

ffmpeg also can be used for making thumbnails and video watermarking

STORAGE and BANDWIDTH
=====================

Where would you save flv files. In yourown server ? If there is a minimum number of videos, your server might handle it. But consider the case having a large number of videos, your server bandwidth will get used soon. So we have to switch into a CDN (Content Data Network) like amazone S3. What you have to do is just register with any CDN website and use their webservices for uploading and manipulating your video files. These CDN have very reasonable cost for the bandwidth usage and storage space.

Comment here if any queries
Regards

Sajith M.R

Sexy Rating - Wordpress Plugin

June 19th, 2008 by Sajith M.R

If you wanna know , what is others review or opinion about your website, You can use this wordpress plugin. It will provide the blog readers and your regular visitor to rate your blog. You can put this plugin anywhere in your blog. The plugin name is sexyrate plugin.

Here is the screen shot:

Sexy Rate Plugin Screen Shot

There are 4 types for rating , Perfect, Good , Bad and Too-Bad. One user can rate one time only. The whole thing is made out of Ajax. For providing more attraction , the plugin is created with images of sexy ladies :) .

If you want to place this plugin, what to do is , download it from http://downloads.wordpress.org/plugin/sexyrate.zip

Go to your wordpress Admin > Plugin and activate this plugin. After that , go to Admin > Presentation > Theme Editor and edit any place you want (header, single.php , index.php, home.php or sidebar.php) as suit to your blog and add this line:

<?php wp_show_my_rate() ?>

*Remember, this plugin is referred to those who has white backgroud wordpress theme.

Comment me your opinion about this plugin

Later
Sajith

Crop Image Like Orkut

June 5th, 2008 by Sajith M.R
This entry is part 4 of 5 in the series Online Photoshop

Online Photoshop in PHP (Series Part 4) >>

Crop Image Like Orkut

Today we will discuss about cropping of images using php and gd library.

Look at the simple example here:

http://www.sajithmr.com/photoshop-tuts/crop/simplecrop.php


$x1 = $_GET['x1'];
$y1 = $_GET['y1'];

$x2 = $_GET['x2'];
$y2 = $_GET['y2'];	

$image_object =   imagecreatefromjpeg('hari.jpg');
$image_cropped =  Crop($image_object,$x1, $y1, $x2,$y2);
$temp_path = rand(1,99999)."hari.jpg";
imagejpeg( $image_cropped,$temp_path);

header('Location: simplecrop.php?img='.$temp_path );	  

?>

Here the Crop function is doing the real work. x1 and y1 are Top-Left Coordinates of new image and x2, y2 are the Bottom-Right .

Here is the function for Crop

function Crop($image, $xpos1,$ypos1,$xpos2,$ypos2)
	{
		require_once('class.cropcanvas.php');
		$cc =& new CropCanvas();
		$cc->loadImageFromObject($image);
		$cc->cropToDimensions($xpos1, $ypos1, $xpos2,$ypos2 );
		return $cc->getImageObject();

	}

?>

You can see the class.cropcanvas.php file from the attachment.

In the above example, we have to enter each coordinates manually. See the example below:

http://www.sajithmr.com/photoshop-tuts/crop/realcrop.php

Here you can select the area by click and drag (like orkut)

This is implemented with the help or jslib javascript. The given attachment in the end of this post contains the all.

http://www.sajithmr.com/photoshop-tuts/crop.zip

Keep reading for the further posts in this series. Next post is on Intellegent watermarking on images.

Subscribe to my Feeds: http://www.sajithmr.com/feed/

How Google Adsense Works

June 4th, 2008 by Sajith M.R

What you add for showing google ads on your website ? It is a javascript , right ?


Parameters are: Client Id
format, channel,url for the caller webpage, background color, link color, border color, text color, javasupport, flash support etc

The width and height of the iframe is calculated from google_ad_width = 468 and google_ad_height = 60 parameters.

This is not the end of the story. The actual story just begins now. The loading iframe contains all the advetisement according to your adsense configuration. If you check the links of add unit, you can see all the event with the link is tracked by google adsense code.

See a sample ad link:


<a id=”aw0″ class=”adt” target=”_top” onmouseover=”return ss(”,’aw0′)”
onmousedown=”st(’aw0′)” onfocus=”ss(”,’aw0′)” onclick=”ha(’aw0′)”
href=”http://pagead2.googlesyndication.com/pagead/iclk?sa=l&ai=
BW7_Ir6xGSKf3Npz6vQOespnnDdO6yVvXoIDxAs
CNtwGgnAEQARgBIL3C4wMoAjgAUKnM2_f6_____
wFg5aLmg7gOoAHNhrj5A7IBEHd3dy5zYWppdGhtci5jb226AQk0Njh4NjBfYXPIA
QHaAT9odHRwOi8vd3d3LnNhaml
0aG1yLmNvbS9kb3dubG9hZC15b3V0dWJlLXZpZGVvcy11
c2luZy1waHAtY29kZS_gAQKAAgGoAwHIAwfoAx_oA_g
D6AOmA-gDBegDDfUDCAAQAYgEAZAEAZgEAA&num=1&
adurl=http://www.codango.com/
&client=ca-pub-2389393537983674&nm=5″>
<span>Free PHP Code & Scripts</span>
</a>

Free PHP Code & Scripts
See onmouseover, onfocus, onmouseout etc functions are used. It means google studies user behaviour with google ads. The click on the link does not go directly into the corresponding website, instead it redirected inot googlesyndication.com and from then redirected into real website. You can guess the reason.

Depending on your browser configuration, google shows text ads, image ads and flash (shock wave) ads

This is a very small introduction of hows adsense works. There are a lot of steps behind the show_ad.js file. But this is will give you a rough idea.

I think

Regards

Sajith.M.R