It’s a tiny plugin that logs the user login count. I made this about to months ago for a client. Now I am making it open source.
You can view how many registered user logged in in your site every day. There are no other options for this plugin. Just install and it’ll log the users when they login in your site.
User Login Statistics
You can use firebug to debug your Zend Framework application. May be you are using print_r(), var_dump() or Zend_Debug::dump($var), they prints the information in your application. But, with the help of FirePHP add-on for Firebug, we will be able to dump our variable on firebug console
First install the FirePHP add-on for your Firebug. Then you can use the following snippet anywhere to dump your variables to firebug console -
$writer = new Zend_Log_Writer_Firebug();
$logger = new Zend_Log( $writer );
$logger->log('My Sample Log', Zend_Log::DEBUG);
The second parameter of the Zend Logger is a constant. You can use 0-7 (zero to seven) as a parameter. Here is the details – Continue reading
About a month ago I wrote a script for my own need. It can download files from another server to your server. I just wrote it for my own purpose and it’s pretty simple and stupid enough. But hey, it works
if (filter_var($url = $_POST['url'], FILTER_VALIDATE_URL))
define('UPLOAD_DIR', dirname(__FILE__) . '/files/');
$length = 5120;
$handle = fopen($url, 'rb');
$filename = UPLOAD_DIR . substr(strrchr($url, '/'), 1);
$write = fopen($filename, 'w');
$buffer = fread($handle, $length);
echo "<h1>File download complete</h1>";
echo "<h2>Invalid url</h2>";
<form action="" method="POST">
<input type="text" size="50" name="url" id="url" />
<input type="submit" name="sub" value="download" />
This script has a form input field to make the operation simpler. The downloaded files will be saved on a directory named /files. I am just sharing it, may be it will help you in anyways
We have built our main Aloashbei class in the previous post. Now we will extend it to locate any GrameenPhone number. But currently, as a developer you can only track your number for testing purpose.
I saw everyone is participating in the GrameenPhone Aloashbei API contest and it’s began and I am late . So why not doing something that makes other’s life easy? So I decided to make a PHP class to do that job for you. You don’t need to know how to work with SOAP. Just instantiate a class, set the parameter and send, VOILA!!!
With the Aloashbei SMS API, you can send SMS, Check the SMS status and receive SMS. You can track location of any GP mobile number with the Location Locator API. It will provide you the longitude and latitude of the phone numbers current position. You can send MMS with the MMS API. You can charge any user who buys any content through the Charging API.
So we are going to build php class that will do these thing easily. Here I will built the SMS class. We can send SMS to any number and if it’s successful, it will return us a message ID. With this message ID, we can check the status of that sent message. To make a complete Aloashbei API class, we’ll first make a basic class and will extend it for other purposes. So here is the basic class that we will extend. It’ll hold the values for setting up the variables and will set user/password initially.
The file Structure:
Showing links in every post
Hey folks, in a short time i’ve made some punbb extension. Here is another, it’s for sharing post. It inserts share button in every post, here is the screenshot:
You will find the configuration at Administration → Settings → Features
Just wrote a punBB plugin for Projanmo Forum and now sharing with the community. The plugin describes it’s uses. You will find the configuration at Administration → Settings → Features Here is the screenshot:
* added plugin “active / inactive” feature, defult mode is set to “inactive”
* added plugin execution duration configuraton, it was executing in every page load on the previous version
Requesting bug report
Just wrote an another punBB plugin for Projanmo Forum.
In normal uses, everyone sign’s in with username and password. But for a special purpose, i needed to login with user ID and password. Because, when the username is in a complex script language like Bangla and you want to login from the mobile and you don’t have Bangla writing system in your mobile, this feature comes in action.
This extension is written for mobile users actually. When you will visit the forum from mobile, you will be redirected to the login screen containing user ID and password.
I always wanted to publish this as a PHP Class but never got that chance to do so. After a long time i worked with Bangla date today and finally created a PHP Class to use it anywhere by anyone. Sorry for the late.
$bn_date = new BanglaDate(time());
$date = $bn_date->get_date();
You will get an array of converted date in Bangla.
A few things needed to know. Bangla date counted or changes after the sun rise. That means, where English date changes at 12′O clock at the night, Bangla date changes at the morning after the sunrise.
This class constructor has 2 parameters. The first one in timestamp and the second one is the hour of changing the date. If you want to change the Bangla date like English at 12’0 clock at the night, you should use
$bn_date = new BanglaDate(time(), 0). But if you want to change the date at 6′O clock at the morning, use as
$bn_date = new BanglaDate(time(), 6). If you don’t pass the second parameter, the default value is 6. Use as you like.
After Creating the class object, you can set another date using
Bangla Date class on PHPClasses.org
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
Anyway, here is my latest blog post signature and here is my twitter 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
$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->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