Aug 14

The other day i was chatting with my team mate Shk.Aziz Poonawalla and he inspired me to do a plugin for coppermine which should convert the uploaded documents (txt, pdf, doc, ppt etc..) to Scribd iPaper format and then display them using the Scribd document viewer.

So i went ahead and created such a plugin for coppermine. The plugin requires PHP 5 and CURL on the server and you should register an account on Scribd Platform to get an API key and secret phrase. After installing the plugin whenever a document is uploaded to cpg - it is copied (uploaded) to scribd server as well (behind the scenes). Scribd converts the document to iPaper format on its server and assigns a document id to it. Now when the document is viewed in cpg, we display the Scribd document viewer and supply it the document id. This displays the document in a nice flash viewer.

For further instructions and to download the plugin please see the forum thread.

Aug 12

The other day i had some free time and thought why not try my hand at converting a wordpress theme to coppermine one. I chose Fieldofsand which is a free wordpress them designed by Smarter Templates and started the conversion. Fortunately i did quite well and published the theme for coppermine community.

You may find quite a few HTML/CSS issues with the theme as i am primarily not a designer but developer. If you are a coppermine user then you might want to check the demo of the theme here. You can download the theme from sourceforge download page.

Jul 31

I am excited to announce the launch of Starting 11 | Free Fantasy Football, my latest work at SANIsoft. The project was done for a client based in UK who happens to be a football fanatic. Starting 11 is a fantasy game based on English Premier League where users can create their fantasy (virtual) team consisting of real life players playing in the EPL. The players (and fantasy teams) are awarded points based on real life performances in the matches. Users can create their own leagues and compete with their friends.

It took us around 4 months of hard work to create the application. The project is entirely built on LAMP (Linux, Apache, MySQL, PHP) technologies. We have also used jQuery at few places.We have used a popular php framework in the backend. We have tried to optimized the application as much as possible and hope that it will handle high loads at peak time (which will be the weekly deadline to select one’s team).

S11 got around 1300 members on the first day of the launch and more will be registering in the coming days as the word spreads. Many of the Yahoo Fantasy Football’s top players (user’s) have already registered on s11. If you are a football fanatic then don’t wait…get going and register on starting11.

Apr 24

Coppermine Photo Gallery is again taking part as a mentoring organization in GSoC and i will be mentoring for coppermine organization for the second year straight in a row. It took us around a month to decide on project ideas and students.

Finally on April 21st 2008 the final student allocation list was published by google. I will be mentoring the project called AJAX functionality for core of Coppermine which will be done by Nuwan Sameera Hettiarachchi from Sri Lanka. After the completion of this project coppermine will be an Ajax rich application. Ofcourse every ajax functionality will gracefully degrade if javascript is not supported by the client browser. We intend to put following main features :

  • Filmstrip carousel
  • Ajax slideshow with transition effects
  • New upload form to reduce the number of steps required to upload files
  • Ajax sorting of pictures/albums/categories
  • And many more cool small features…

The coding period will start on May 26th and will last till August 18th 2008. I am really looking forward for a great summer of code ahead and hope that coppermine interface gets better with student contributions.

Sep 28

On many banking sites you will find that when back or refresh button is pressed the session expires and it shows you a custom page. Well below is a simple PHP code which will do the same. The code is very basic and illustrates just the logic.

Include the below given code in all your scripts.

PHP:
  1. // First make sure that the page is not cached
  2. header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
  3. header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
  4.  
  5. // Start the session
  6.  
  7. // If there is a key in session and there is no key in GET then exit with error.
  8. if (isset($_SESSION['key']) && !isset($_GET['key'])) {
  9.   echo "SESSION expired";
  10.   exit;
  11. }
  12.  
  13. // If there is a key in GET then validate the key against the key stored in session
  14. if (isset($_GET['key']) && isset($_SESSION['key'])) {
  15.   // Compare the key passed with the one stored in session
  16.   if ($_GET['key'] != $_SESSION['key']) {
  17.     echo "SESSION expired";exit;
  18.   }
  19. }
  20.  
  21. // Generate a key for next page and store it in session.
  22. $next_key = md5(time());
  23. $_SESSION['key'] = $next_key;
  24.  
  25. // Now $next_key is the key which should be passed in all links
  26. // Something like <a href="second_page.php?key=$next_key">Secon page</a>
  27. // If no key is passed or invalid key is passed then session expire error will be shown

$next_key should be passed in the URL to all scripts.

Apr 21
Coppermine
icon1 Abbas | icon2 Open Source, PHP | icon4 04 21st, 2006| icon3No Comments »

In the year 2004, I came across Coppermine Photo Gallery (CPG) which is an open source project on sourceforge. Being developing PHP based applications i thought why not take a look at the source code of CPG. This was the first time ever when i came across an open source application (ofcourse apart from php). I found it very interesting and i started feeling strong penchant for coppermine. In the next few days i studied the CPG code and started contributing on the coppermine support forums.

Soon i found myself in the Development Team of coppermine. At that time cpg1.4 was in beta stage. Much of the work was already completed and i only got chance to fix few bugs. In year end of 2005 cpg1.4 was release as stable.

Classic coppermine had a self templating system and didn't used a database abstraction layer. Much of the code is procedural programming based. We (Dr.Tarique Sani, Aditya Mooley and me) thought why not develop a next generation cpg where we will use oops based programming and smarty as templating system. So we started working on cpgNG (Coppermine Next Generation). cpgNG is written totally from scratch. cpgNG is now in alpha stage. To download and get more info on cpgNG go here. To download cpg go here.