New plugin: WordPress User Frontend

Today I am coming with a new wordpress plugin, named “WordPress User Frontend“. Some of us want something like that the subscriber/contributor will not be able to go in the wordpress backend and everything these user can control will be done from wordpress frontend.

Features:

So here is my plugin that solves your problem. This features of this plugin in it’s version 0.2 are follows:

  • User can create a new post and edit from frontend
  • They can view their page in the custom dashboard
  • Users can edit their profile
  • Administrator can restrict any user level to access the wordpress backend (/wp-admin)
  • New posts status, submitted by users are configurable via admin panel. i.e. Published, Draft, Pending
  • Admin can configure to receive notification mail when the users creates a new post.
  • Configurable options if the user can edit or delete their posts.
  • Users can upload attachments from the frontend
  • Admins can manage their users from frontend
  • Pay per post or subscription on posting is possible

Read the rest of this entry »

Simple server to server file downloader script

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 ;)

<?php
if (isset($_POST['sub']))
{
    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');

        while (!feof($handle))
        {
            $buffer = fread($handle, $length);
            fwrite($write, $buffer);
        }

        fclose($handle);
        fclose($write);
        echo "<h1>File download complete</h1>";
    }
    else
    {
        echo "<h2>Invalid url</h2>";
    }
}
?>
<form action="" method="POST">
    <p>
        <label for="url">Url:</label>
        <input type="text" size="50" name="url" id="url" />
    </p>
    <p>
        <input type="submit" name="sub" value="download" />
    </p>
</form>

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 :)

Locate phone location with GP Aloshbei location API and visualize with google maps API

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.

File Structure:

  • class.Aloashbei.php
  • class.AloashbeiLBS.php
  • location.php
  • includes/WebService_Aloashbei_LBS_WS.wsdl

Read the rest of this entry »

PHP class for sending, receiving and checking SMS status with GrameenPhone’s Aloashbei API

I saw everyone is participating in the GrameenPhone Aloashbei API contest and it’s began and I am late :P . 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:

  • class.Aloashbei.php
  • class.AloashbeiSMS.php
  • sms.php
  • includes/WebService_GP_ADP_BizTalk_SMS_Orchestrations.wsdl

Read the rest of this entry »

WordPress Plugin: GAF affiliate widget

Hello there, another wp plugin from me ;) . I was thinking to be a Freelancer.com affiliate (previous GetAFreelancer) and  looking for some wordpress widget as I want to show the links in my blog sidebar. I found a plugin built by Masnun bro, but it gets related projects from freelancer.com according to your post and shows below of your post . So i thought, why i don’t I built one before anyone creates before me? :P . So here is the plugin screenshot:

gaf_widget

Widget setting screenshot

So i don’t need to describe what to do after installing the plugin, right? It’ll show the selected links to your sidebar like this:

Displaying links from freelancer.com

So why don’t you add this plugin to your blog and make some money? :D

punBB extension: Post Share

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

Administration Area

Enjoy :)

punBB extension: We miss you!

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:

Version: 0.1

Download: We miss you

Version: 0.2
Changlog:
* 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 :)

punBB extension: Login with ID

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.

Download: Login with ID

Enjoy!!! :D

Bangla date as a PHP class

I have worked with Bangla date a long time ago. The first initiative was to make a extension for forum engine punBB. After that, i made a javascript widget to display Bangla date in any site. The third initiative was to make a facebook application that shows current Bangla date to your facebook profile.

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.

Usage:

<?php
include_once 'class.banglaDate.php';
$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.

Class Constructor:
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 set_time() like $bn_date->set_time(time(), 4);

Bangla Date class on PHPClasses.org

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: , , ,