Grab your Google Buzz Status

Here’s how you can get your google buzz status with php. Just put your google username at the right place and do whatever you want.
We have used simpleXML to parse the google’s RSS feed for every user. :)

<?php
$user = "<username>";
$url = "http://buzz.googleapis.com/feeds/".$user."/public/posted";
$data = file_get_contents($url);
$xml = new SimpleXMLElement($data);

$status = $xml->entry[0]->summary;
$time = date('D j M Y g:i a', strtotime($xml->entry[0]->published));
echo "Status: $status <br />";
echo "Time: $time";
Tags: , , ,

We’ve won the “Best IT Innovation Award” from BASIS Softexpo

As a part of BASIS’s “IT Innovation Project”, 17 project was submitted for BASIS Softexpo 2010. Among of them, only 3 projects were selected. They were -

  • 1. Braille Board
  • 2. Bangla Text to Speech (TTS)
  • 3. Bangla OCR

Both, Braille Board and Bangla TTS was awarded for “Best IT Innovation Award”.

We are receiving award from Hon'ble State Minister, Ministry of Science and Information & Communication Technology

About Our Project:

Title: Design and Development of PC Controlled Dynamic Braille Board.

Project Description:
Braille is a primary medium of reading and writing for people who are blind or have low vision. Although blind or visually impaired individuals are able to access print materials by using audio books or listening to a personal reader and can write by dictating to someone, many find that they can access information more quickly and perform tasks that involve reading or writing more efficiently using Braille. Read the rest of this entry »

Tags: ,

Create your own twitter image signature

Many days ago i built two image signature as my forum signature. One of the signature shows the latest post from my blog and another shows my latest twitter update. I was inspired to do that signature by seeing Shiplu Vai’s signature. Originally he was using them and i copied the concept :D

Anyway, here is my latest blog post signature Blog Update Signature and here is my twitter signature Twitter image signature

I will show you the process to create your own twitter image signature like me.

1. At first we will get the latest twitter update by this

<?php
$username = "tareq_cse"; //Twitter Username
$url = "http://twitter.com/statuses/user_timeline/$username.json?count=1"; //json request url
$json = json_decode(file_get_contents($url));
$status = $json[0]->text; //get the status from array/object

2. Now we will get the time distance from now and the twitted time and will format it
Read the rest of this entry »

বাংলা তারিখ ভুলে যান? আর ভোলার চান্স নাই

বাংলা তারিখ নিয়ে প্রথমে কাজ করেছিলাম প্রজন্ম ফোরামের জন্যে। সেখানে হেডারে প্রতিদিনের বাংলা তারিখ দেখানো হয়। এরপর করলাম একটা জাভাস্ক্রিপ্ট উইজেট, যেটা দিয়ে আপনি আপনার যেকোন সাইটে বাংলা তারিখ যুক্ত করতে পারেন। অনেকদিন ধরেই চিন্তা করছিলাম ফেসবুকের জন্যে একটা অ্যাপ্লিকেশন বানালে মন্দ হয় না, কিন্তু সময় আর করে উঠতে পারিনি।

ফেসবুকে বাংলা তারিখ

ফেসবুকে বাংলা তারিখ

এই অ্যাপ্লিকেশন দিয়ে আপনি আপনার ফেসবুকের প্রোফাইলে আজকের বাংলা তারিখটি দেখাতে পারবেন। অ্যাপ্লিকেশনটি রয়েছে এখানে http://apps.facebook.com/bangladate/

Google Transliteration plugin for Wordpress & punBB

What is Google Transliterate?

Google offers an automatic transliteration option that converts Roman characters to the characters used in Arabic, Bengali, Gujarati, Hindi, Kannada, Malayalam, Marathi, Nepali, Punjabi, Tamil, Telugu and Urdu. This feature lets you type these languages phonetically in English letters, but they’ll appear in their correct alphabet. Keep in mind that transliteration is different from translation; the sound of the words is converted from one alphabet to the other, not the meaning.

What I did?
I did a integration of Google Transliterate with Wordpress & punBB. My plugin allows you to write phonetically with the help of Google Transliteration in the Wordpress post editor and also in punBB post box. This will not work in rich text editor mode in wordpress, you need to switch on HTML mode.

How does it work?
The bellow images tells you everything

  • You can select your desired language from the list
  • transliterate

  • After Selecting the language, active the google transliteration option by clicking the text.
  • transliterate1

  • Type the words phonetically. Once you type a space or a punctuation mark, the letters will be converted to corresponding language characters, like this:
  • transliterate2transliterate3

  • If you need to correct a transliterated word, click the word; you’ll see a menu of alternate spellings, in addition to an option to switch back to the Roman characters you typed. If you type the same word again, it will then be transliterated correctly based on your saved preference. transliterate4
Download Google Tranliteration for Wordpress (69)
Download Google Tranliteration for punBB (67)

Image upload & Validation: My first class to phpclasses.org

Recently i had to work with image uploading on my some projects. The issue was to upload the user avatar and rename the avatar’s with their userid. So that it will be easy to work with avatar system.

I first used this idea to one of my project and i did this with procedural method. But again on my current projects i need this facility again. So i thought to finish the job for the last time and decided to make a class to re-use the codes. So here i go…

Firstly, i use my class constructor to define the maximum file size, width, height and also the upload directory. So now create a instance of my class like this-

<?php
//$image = new ImageUloader($max_size, $max_width, $max_height, $upload_dir)
$image = new ImageUploader(26, 200, 150, 'images/avatar/');
?>

Now you need to set the image name to upload. Don’t be afraid, it’s the file input field name of your html form if you have a input file name like this -

<form enctype="multipart/form-data" action="" method="POST">
	<input name="input_field_name" type="file" />
    <input type="submit" name="submit" value="Change Avatar" />
</form>

Then you need to setup the image name like this

<?php
$image->setImage('input_field_name');
?>

Now it’s time for validation process :D
you can check the image size, width, height and also file type by the following method

<?php
$image->checkSize();
$image->checkHeight();
$image->checkWidth();
$image->checkExt();
?>

This method’s return true, if the condition are passed. We have permitted to use only jpg, jped, png and gif files. So lets use them

<?php
if(!$image->checkSize())
	$errors[] = "File size is Big";

if(!$image->checkHeight())
	$errors[] = "File height is Big";

if(!$image->checkWidth())
	$errors[] = "File width is Big";

if(!$image->checkExt())
	$errors[] = "File ext is not supported";
?>

So if the condition are passed, we will set the name of the file to be uploaded and now it’s the time to check if there any file with the same user id. If their is any file with same user id, we delete them for the sake of our need and upload them. By deleting the existing file with same user id clears the confusion of repeating same file name with same user id. Because, their is a possibility to found images with same file name but with different extensions.

<?php
if(!isset($errors)){
		$image->setImageName($userid);
		$image->deleteExisting();
		$image->upload();

		echo "<h2>Avatar Changed Successfully</h2>";
	}
	else{
		echo "<h2>You must correct the errors to proceed</h2><br>";
		print_r($errors);
	}
?>

So here is the complete code for validating and uploading

<?php
if(isset($_POST['submit'])){
	require 'class.imageupload.php';

	//$image = new ImageUloader($max_size, $max_width, $max_height, $upload_dir)
	$image = new ImageUploader(26, 200, 150, 'images/avatar/');
	$image->setImage('input_field_name');

	if(!$image->checkSize())
		$errors[] = "File size is Big";

	if(!$image->checkHeight())
		$errors[] = "File height is Big";

	if(!$image->checkWidth())
		$errors[] = "File width is Big";

	if(!$image->checkExt())
		$errors[] = "File ext is not supported";

	if(!isset($errors)){
		$image->setImageName($userid);
		$image->deleteExisting();
		$image->upload();

		echo "<h2>Avatar Changed Successfully</h2>";
	}
	else{
		echo "<h2>You must correct the errors to proceed</h2><br>";
		print_r($errors);
	}
}
?>

<form enctype="multipart/form-data" action="" method="POST">
	<input name="input_field_name" type="file" />
    <input type="submit" name="submit" value="Change Avatar" />
</form>

Download the class form here

যে কোন সাইটে দেখান বাংলা তারিখ

আপনারা জানেন, পানবিবির জন্যে আমি বাংলা তারিখের একটা এক্সটেনশন বানিয়েছি। তারপর চিন্তা করলাম যে কোন সাইটে লাগানোর ব্যবস্থা করলে মন্দ হয় না। তাই, সব ওয়েব সাইটে যাতে বাংলা তারিখ দেখানো যায় সেই জন্যে আজ একটা জাভাস্ক্রিপ্ট উইডগেট বানালাম। শুধু যেকোন পাতায় নিচের কোডটুকু পেস্ট করে দিন। ব্যস, আপনার সাইটে বাংলা তারিখ দেখুন।

<script type="text/javascript" src="http://tareq.wedevs.com/bangla_date_widget.php">
</script>

উদাহরণঃ

punBB 1.3.2 extension: Bangla Date (বঙ্গাব্দ)

বাংলা আমাদের মাতৃভাষা। এই ভাষার জন্যে আমরা যুদ্ধ করেছি। কিন্তু বাঙালী হলেও আমরা অধিকাংশ লোকই জানিনা আজকে বাংলা কত তারিখ। তাই আজকে জনপ্রিয় ফোরাম ইঞ্জিন পানবিবি’র জন্যে একটা এক্সটেনশন বানালাম। এই এক্সটেনশন আপাতত ব্যবহার করা হচ্ছে একটি অত্যন্ত জনপ্রিয় বাংলা ফোরাম প্রজন্মতে। ডিফল্টভাবে এটি ফোরামের Description এর সোজা ডানদিকে প্রদর্শিত হয়। নিচের স্ক্রিনশট দেখুন

bangla-date1

এটি প্রতিদিনের বাংলা তারিখ ফোরামের header এ দেখায়। সামনে পহেলা বৈশাখ আসছে, সে উপলক্ষ্যে এটি রিলিজ দেয়া হল। আসলে এই এক্সটেনশনের আইডিয়াটি ছিল রাজু ভাইয়ের। তিনি আমাকে বলাতে আমি এই এক্সটেনশনটি বানিয়েছি। ধন্যবাদ রাজু ভাইকে।

আপডেট(২৯ এপ্রিল): আজ এর নতুন ভার্সন ১.২ রিলিজ দিলাম। আগের ভার্সনে কিছু বাগ ছিল। যেমনঃ ঐটার সাল নিয়ে একটু ঝামেলা হচ্ছিল। ঠিক মত আপডেট হচ্ছিল না। তাই এর নতুন ভার্সনে এটা ঠিক করে দেয়া হয়েছে।

আরেকটা নতুন ফিচার যুক্ত করা হয়েছে। যেহেতু বাংলা তারিখ গণনা করা হয় সূর্যোদয় থেকে, তাই নতুন ভার্সনে সকাল ৬ টা থেকে তারিখ পরিবর্তিত হবে। অর্থাৎ রাত ১২ টার পরিবর্তে সকাল ৬ টা থেকে তারিখ পরিবর্তিত হবে।


Download Bangla Date (v 1.2) (142)

punBB 1.3 extension: Textarea resizer

Today i have developed a simple punbb forum extension for our developer forum. It includes a feature that adds a textarea resizer feature to the message writing area such as writing a quick post, writing a topic, PM or email. It uses jQuery.
resize

Download textarea resizer (278)

punBB 1.3.2 Final Bangla Language Pack

From one of my previous post, i told you that i’ve worked with punBB Bangla language pack for the version 1.3 RC. Now the full version of punBB 1.3.2 has released and my language pack is also ready for this. You can download the language pack from here. This Bangla language pack is only for the user interface only. I didn’t translate the admin section. So, enjoy it… :)

Download punBB 1.3.2 Bangla Language Pack (159)