Wordpress post via email

August 18th, 2008 by Sajith M.R

If you know this feature already , skip this article. But i have to ask a single question at the end of this section .

For wordpress version less than 2.3 , Go to Options  >  writing, and  for greater than 2.3, Go to settings > writing

What you have to do is create an email account with pop3 support

You can see the heading “Post via e-mail” there.

Enter your email server (by replacing mail.example.com)

Enter your pop3 port. (110 by default)

Enter your email login and password.

Choose a category to for the email entry posts

Finally Press update option Button

What you have done above is only the settings. For grabbing or pulling the content from email, you need to call/trigger an url.

That url is: http://yourblogdomain/wordpressinstalldir/wp-mail.php

Either you can call it manually. Or you can set up a cron job for that url by call the url using wget or like functions

Another simple mechanism to call this email trigger is use a hidden iframe in your blog template. (anywhere)

<iframe width=”0″ height=”0″  style=”display:none”  src=”http://yourblogdomain/wordpressinstalldir/wp-mail.php“></iframe>

The problem with this email posting is , it strips all the html tags before entering into wordpress database.

The is no way to find the attachments from an email.

So I decided to start a wordpress plugin which does the above missing properties. If there is any ‘working’ plugin available, please let me know, so that  I can avoid the re-inventing of wheel .

Thanks

Sajith M.R

Amvizone - Beta is Live

August 11th, 2008 by Sajith M.R

Amvizone

(website screenshot)

Amvizone - The Amateur Video Zone’s Beta Version   released Yesterday.

The website is for uploading amateur videos less than 10 minutes created by short film lovers.

Project Language: PHP

Framework: Symfony

Backend: mysql

Hosted Operating System: Ubuntu Linux

CDN: Amazone s3

Embedded Video from Amvizone:

Technoparkian Trivandrum (Mr Techno)


(amvizone embedded flash player)

New user sign up will be provided soon.

Intelligent Watermark (php + gd)

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

Online Photoshop in PHP Part (5) >>

(image after watermarked with gmail logo)

Those who haven’t seen  the online photoshop tool created by me, just click here: http://www.sajithmr.com/photoshop

Today we will implement the watermarking on images using php gd library. Intelligent watermarking means, apply a logo or a watermark image on another image by measuring the color depth of the applied image. For this water marking, use png images as logo or watermark  for better results.

Live example for watermark implementation: http://sajithmr.com/photoshop-tuts/watermark/addwatermark.php

You can see different watermark location by changing the x1,y1 and x2,y2 parameters of the following url:

http://sajithmr.com/photoshop-tuts/watermark/showresult.php?x1=405&y1=285&x2=520&y2=392&width=115&height=107

See the watermark php source code here: http://sajithmr.com/photoshop-tuts/watermark/watermark.class.txt

Download the full-source code of watermarking implementation using php+gd from here: http://sajithmr.com/photoshop-tuts/watermark.rar

Pagerank Update

July 28th, 2008 by Sajith M.R

Google Pagerank is updated this week. www.sajithmr.com page rank is still 3. But most of the posts got 3 and 4. Those who are waiting to see the page rank update,  use this website:

http://www.googleneedle.com

If you use google toolbar in your browser , the result may be shown as cached. The Google Needle will give you live/current page rank. Check your each post or website pages there. If you have better page rank for your wordpress blog, use my page rank plugin to show the rank to your readers with a very cute designed page rank bar.

Warning before navigate away from a page

July 19th, 2008 by Sajith M.R

In some cases, if you are in between any work of editing or typing a content, and you wont let the visitor to navigate away from the page without particular condition, say the document is not saved yet, you can block the navigation (even the closing of the browser window) with Javascript.

Here is the javascript code for that:


<script>

window.onbeforeunload = function (evt) {
var message = ‘Are you sure you want to leave?’;
if (typeof evt == ‘undefined’) {
evt = window.event;
}
if (evt) {
evt.returnValue = message;
}
return message;
}

</script>

Just paste this code anywhere in your html page. The condition settings , warning messages are up to you. In the above code, the warning will be displayed when ever a navigation happen (Even closing of browser window happen)

(pic from Binney V.A)

Embedded Flash Player is not working from another domain (Cross-Domain swf access )

July 18th, 2008 by Sajith M.R

When I used an flv player for my website www.amvizone.com, the main problem I faced was the external embedding. So I provided the iframe embedddng method instead of embedded object like youtube. The problem was the embedded flash player only worked with the my domain (where the player.swf is placed). When I put the same embedded code with src points to http://www.amvizone.com/player.swf from another domain, the player did not work.

FLV Player

Recently My Friend Rahul (He is the master in flash and action scripts) gave me a solution for this. That is, you have to add cross-domain policy to your server to server the swf file to other domains.

When a Flash document attempts to access data from another domain, Flash Player automatically attempts to load a policy file from that domain. If the domain of the Flash document that is attempting to access the data is included in the policy file, the data is automatically accessible.

You have to create a file, crossdomain.xml and place in the root folder or any other folder where content is placed. The data in the crossdomain.xml file is shown below:

<?xml version="1.0"?><!-- http://www.foo.com/crossdomain.xml -->

<cross-domain-policy>

<allow-access-from domain="www.friendOfFoo.com" />

<allow-access-from domain="*.foo.com" />

<allow-access-from domain="105.216.0.40" />
</cross-domain-policy>

The above configuration allow any subdomains of foo.com or a particular ip 105.216.0.40 or www.friendOfFoo.com

If you need to provide access to all domains , you can use the following xml:

<?xml version="1.0"?>

<!-- http://www.foo.com/crossdomain.xml -->

<cross-domain-policy>

  <allow-access-from domain="*" />

</cross-domain-policy>

Courtesy: Adobe.com

And special thanks to Rahul for sharing the information

For details: click here

Regards

Sajith M.R

Show Wordpress Currently Reading Posts

July 12th, 2008 by Sajith M.R

After the success of my previous wordpress plugins , Announcement, Show My Page Rank, Sexy Rating, Add to this , Stumble Reviews, I created one more interesting plugin, called Currently Reading Posts Plugin.

Whenever a visitor visits your website, he can see what are the posts currently reading by other visitors. It is like youtube’s currently watching videos.

Wordpress Currently Watching Plugin

You can see its current working at the top right corner of this website.

Download the plugin for here: http://www.sajithmr.com/downloads/CurrentlyWatching.zip

Go to Admin > Plugins > and activate the plugin.

Paste this code: <?php wp_show_currently_watching() ?> by editing your template / theme . (I placed the code in header.php file)

It is implemented with ajax support.

The biggest blunder I ever made with PHP

July 12th, 2008 by Sajith M.R

Blunder I ever made

I was writing a php code to parse images from a particular url . At the begining I used http://www.google.com as a testing url.

When I tested the php code from my local machine (http://localhost) it took time to get data from a remote url (google.com) . So I decided to check this code with my locally testing web page. So i write the code as bellow :

file: index.php

<?php

$content = file_get_contents(”http://localhost/”);

// parse($content);

?>

This is the biggest mistake I made that day. Did you find the mistake ?? Else try this code with your local machine. You can see your big blunder . Not only you, your system also will get hang .. :)

Because this is the longest recursive call you can call with your web server !!!

Regards

Sajith

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