• t
  • g
  • B
  • Z
  • @
  • e

portfolio & blog of senior web developer, Fahd Murtaza



  • About
  • Portfolio
  • WordPress
  • CV
  • Blog
  • Contact


  • About
  • Portfolio
  • WordPress
  • CV
  • Blog
  • Contact

Javascript – One of the best Scripts resource

September 17th, 2010 by Fahd

Looking for a cool Web 2.0 Javascript resource. Filled with great examples and downloadable example code, a great javascript resource thats clean as well as useful.

Without any long description here is the link. http://www.scriptdeck.co.uk/

Script Deck’s interface is blog like with top image scroller highlighting the hot tutorials and tips.

Posted in Web 2.0, Web Design, Web Development

Leave a comment

JavaScript – The easiest way to clean-up your JavaScript code

July 28th, 2010 by Fahd

You can use any desktop tool to clean-up and beautify that poorly formated JavaScript you got from a blog or web resource.

I my case I am working on a JavaScript based event calendar that displays a calendar and highlights the current date with the dates which have events associated with them.

I got this great event calendar thats totally based on JavaScript from this link and it was not formatted correctly.  As I had to make a few adjustments to the code as for my needs, I needed it to be correctly formatted so I could work on it. (more…)

Posted in JavaScript

Leave a comment

JavaScript – Adding an pure JavaScript event calendar to your site.

July 28th, 2010 by Fahd

You may find this tutorial very useful if you are looking for a way to do a simple event calendar on your site with no dependency on server side scripting.

Please check this simple and elegant way of adding an event calendar on your site.

Posted in JavaScript

Leave a comment

ExpressionEngine 2 beta, Wow factor

June 15th, 2010 by Fahd

OK here is the thing. Mohammed, my Boss asked me to work on an application 3 days ago. He wanted to use expression engine and got me a personal license for it. Its a good CMS and has a certain level of customization but something was  missing in the 1.6.9 version we got; yes the wow factor.

So he emailed me yesterday and wanted to hear my ideas about expression engine yesterday. I was not sure as I had already started working on expression engine 1.6.9 and had been working on a custom membership management solution and customize it to the level our client needs. We need membership management with custom fields which thankfully comes integrated with the licensed version of expression engine.

Member Management

Build a community with ExpressionEngine’s robust and flexible membership capability.

Multi-User System

ExpressionEngine is a true multi-user system. Each user can be granted a wide range of privileges, letting you define with precise control what each user is permitted to do.

Member Groups

You can define an unlimited number of Member Groups, each with over 40 individual user privileges. Each member of your community is assigned to a Member Group, determining what they are allowed to do.
Custom Member Fields

The member profile system permits you to add your own fields. Build your own data model and collect the information you need from your users.

Member Activation

Members can “self-activate” via email or you can validate accounts manually.

Profile Management

Each member has their own profile management page, in which they can set preferences and update their personal information.

Subscription Management

The member console allows your users to manage their comment and gallery subscriptions.

Member Localization

Each member can have their own localization settings, allowing them to view your site in their local time.
Member Communication

An Email Console permits members to email each other from your system. Each user can choose whether or not to receive email.

Email Console Logs

For security, all email sent by your members is logged.

Member Quick Links

Each member that has Control Panel access can view their own custom links in the Control Panel navigation.

Note Pad

Each member has their own notepad.

Member Management

Build a community with ExpressionEngine’s robust and flexible membership capability.

Multi-User System

ExpressionEngine is a true multi-user system. Each user can be granted a wide range of privileges, letting you define with precise control what each user is permitted to do.

Member Groups

You can define an unlimited number of Member Groups, each with over 40 individual user privileges. Each member of your community is assigned to a Member Group, determining what they are allowed to do.Custom Member FieldsThe member profile system permits you to add your own fields. Build your own data model and collect the information you need from your users.Member ActivationMembers can “self-activate” via email or you can validate accounts manually.Profile ManagementEach member has their own profile management page, in which they can set preferences and update their personal information.

Subscription Management

The member console allows your users to manage their comment and gallery subscriptions.Member LocalizationEach member can have their own localization settings, allowing them to view your site in their local time.

Member Communication

An Email Console permits members to email each other from your system. Each user can choose whether or not to receive email.Email Console LogsFor security, all email sent by your members is logged.

Member Quick Links

Each member that has Control Panel access can view their own custom links in the Control Panel navigation.

Note Pad

Each member has their own notepad.

Posted in Web Development, Web Development Software

Leave a comment

PHP: Text cropping with defining the number of characters, words or sentences

March 18th, 2009 by Fahd

I have recently been working on PHP RSS reader script that was supposed to do three different things with RSS description text. To make a teaser RSS text, I was asked to develop the functionality in a such a way that text can be cropped in these three ways.

  • with defining the number of words.
  • with defining the numbers of characters.
  • with defining the number of sentences.

Here is a set of functions that helps you crop a text in three different ways. The usage of the function is also mentioned at the end f the script. (more…)

Posted in PHP, PHP Tips, Web Development

5 Comments

How to make sure your PHP RSS feed reader doesn’t mess up

March 18th, 2009 by Fahd

I was recently working on a custom RSS feed reader where the prior most concern of the client was being able to crop the text with respect to the

  1. Number of words.
  2. Numbers of characters.
  3. Number of sentences. (more…)

Posted in PHP, PHP Tips, Web Development

Leave a comment

I am on home page of oDesk, feels great

March 17th, 2009 by Fahd

Hi guys

I am feeling good right now. Have been working on oDesk from Feb 17, 2009. And its good you get paid on hourly basis. I like oDesk the most among freelancing sites I have worked on. Anyhow, I took a few screen shots to show you that I was once featured on home page on oDesk.

(more…)

Posted in PHP, Portfolio, Web Development, Wordpress

1 Comment

We don’t mind if you code all night.

September 11th, 2008 by Fahd

They are starting Yahoo Hack Day again. They call it, “The hack is back!. Do you want to request an invite to Open Hack 2008, September 12-13? Sign up at www.hackday.org. Hope you can join us at Yahoo! HQ in Sunnyvale. We don’t mind if you code all night. ” (more…)

Posted in News, Web Development

Leave a comment

Convert date formats between PHP and MySQL (mm/dd/yyyy to yyyy-mm-dd)

September 8th, 2008 by Fahd

I have a view in HWC where I am using Javascript DHTML date picker script to pick the date and insert into test field. By the way HWC is the PHP-MVC (using codeigniter) application I am working on.

Date Picker in dhtml/Javascript

Date Picker in dhtml/Javascript

(more…)

Posted in CodeIgniter, PHP, Web Development

1 Comment

Codeigniter – Clean URLs – Apache mod rewrite : Removing /index.php/ from URL in CodeIgniter Application

August 22nd, 2008 by Fahd

Note: Based on its popularity, updated on 6th june 2011 to clean up code for easy copy paste.

OK readers, here is a simple method to achieve clean urls with your PHP application developed in CodeIgniter.

Please note that this method is applicable only to applications developed in CodeIgniter. Much of the content has been taken from CodeIgniter wiki but rewritten in my own way.

This article explains how to take away “index.php” from your CI application URLs. However, it does NOT remove the need for Index.php, which is the CI front controller i.e. even though Index.php will not appear in the URL, it still needs to be present at the top level of your site (above the /system/ directory). To quote the User Guide,

You can easily remove this file by using a .htaccess file with some simple rules.

You need to perform the following steps to get this working:

  1. Create a .htaccess file to configure the rewrite engine
  2. Set $config['index_page'] to an empty string
  3. Make sure your apache uses the mod_rewrite module
  4. Make sure apache is configured to accept needed .htaccess directives
  5. Restart apache and test

1. Create your .htaccess file

Create a new file named .htaccess and put it in your web directory

RewriteEngine On
RewriteBase /
#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/$1 [L]

#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

# If we don't have mod_rewrite installed, all 404's
# can be sent to index.php, and everything works as normal.
# Submitted by: ElliotHaughin

ErrorDocument 404 /index.php

Notes for Windows users:
To create this file you must open Command Prompt and type:

copy con .htaccess [Enter]
[Press CTRL + Z]

A blank .htaccess file will be created. Now you can edit it using Notepad or your favorite text editor and copy the script above.

Note: Most Windows editors will assume that you are attempting to save an .htaccess file as a file with an extension and no filename. The Crimson Editor can be used to create and save .htaccess files and other files that have no filename.

Note: If your site is placed in subfolder specify the path in the “RewriteBase /subfolder/” line.

2. Set $config['index_page'] to an empty string

Open your

system/application/config/config.php

and find the line that assigns $config['index_page'] a value, usually:

$config['index_page'] = "index.php";

and change it to:

$config['index_page'] = '';

Save the file.

3. Make sure your apache has mod_rewrite activated

This means that the apache must be configured to load the mod_rewrite module (or it might have it compiled-in). For module inclusion, usually you have to look for a line like this in httpd.conf or a file loaded by it (hint: use some quick file search utility to grep files with lines containing ‘rewrite’ string):

LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so

If you’re running Apache2 type

a2enmod

in the console and when prompted

rewrite

to enable mod_rewrite.

On a Windows machine this line might look this way:

LoadModule rewrite_module modules/mod_rewrite.so

If it is commented out (# in front), make sure to uncomment it and save the file. Checking if the corresponding module exists may be a good idea as well (but it usually does).

Make sure apache accepts needed .htaccess directives

This means that apache is explicitly configured to allow .htaccess files to override those directives that you use in your .htaccess file from step 1. above.

It seems to be sufficient if you add these two lines to your section where you configure the document root for your CI application:

#...
Options FollowSymLinks

AllowOverride FileInfo
#...

There might be other Options listed, just make sure you have FollowSymLinks as well.

Should you get a 500 Internal Server Error, try the following syntax:

Options Indexes Includes FollowSymLinks MultiViews
AllowOverride AuthConfig FileInfo
Order allow,deny
Allow from all

5. Restart apache and test your application

Works? Congratulations!

Doesn’t work? Ehrrr… well, do not give up; equip yourself with patience, double check all steps above and if it still does not work, post on the forum giving all details of your setup.

How does URL rewriting work?

<IfModule mod_rewrite.c>
...
</IfModule>

Do what is inside only if Apache has the mod_rewrite feature (by in place compilation, or loaded module).

RewriteEngine On

Activate the URL rewriting engine, if not already done (in main Apache configuration file.

RewriteBase /

Define the part of the URL that won’t change nor be used for rewriting. In fact, this part will be removed before processing, and prepended after processing. This’s a good way to use subfolder-independent rewrite rules. For example, if your CodeIgniter index.php is placed in a virtual host directory, like /tests/, set RewriteBase to /tests/.

RewriteCond %{REQUEST_FILENAME} !-f

Condition to meet for RewriteRule activation. Here, we test if the requested filename does not exist.

RewriteCond %{REQUEST_FILENAME} !-d

Same as above, but we test for directory existence.

RewriteRule ^(.*)$ index.php/$1 [L]

If RewriteCond conditions are met, this rule will be applied. It inserts index.php before the requested URI. The $1 represents the part of string enclosed by parentheses in left expression. The [L] means that this rule is the last one if rule is applied (thus stopping rewriting).

Configuring mod_rewrite in the httpd.conf file

The Apache mod_rewrite docs say

While URL manipulations in per-server context are really fast and efficient, per-directory rewrites are slow and inefficient. If you have access to your httpd.conf file, you’ll have better performance if you configure the rewrite rules in there.

You can add something like this to your httpd.conf:

RewriteEngine On
RewriteCond %{REQUEST_URI} !^(/index\.php|/img|/js|/css|/robots\.txt|/favicon\.ico)
RewriteRule ^(.*)$ /index.php/$1 [L]

Configuring mod_rewrite and virtual hosting with Apache 2.2

ServerName www.mydomain.com
DocumentRoot /path/to/ci/directory

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

Credits: http://codeigniter.com/wiki/mod_rewrite/

Posted in Articles, CodeIgniter, Frameworks, PHP, Web Development

19 Comments

  • 1
  • 2
  • 3
  • 4
  • »
  • Categories


Want to Hire Me?


Fahd Murtaza is the guy behind fahdmurtaza.com: your source for getting your web development projects done. Fahd sepcialises in Open Source Web Development and his favorite is WordPress. This site is a platform to his web development portfolio and blog all on a newly designed responsive website—try viewing it on your mobile.

If after viewing Fahd's portfolio, you think he might be just the guy to hire for your web / application development; check out the web development pricing page, then find out how to hire Fahd with a web development project idea and a brief of requirements.

 


Fahd Murtaza has put together a number of Web Development Articles that will help you see what he does, how he does it. You will also be able to see the level of work, and passion, that Fahad puts into each and every job. Understanding a little about the process can make the idea of investing good money much more palatable. People have always appreciated my Agile techniques. Its time you

Fahd Murtaza, Web Developer, Programmer, Wordpress Expert
U
This is portfolio & blog of senior web developer Fahd Murtaza, who has 9 years experience in: website development, WordPress, drupal, CMS and CRM application development with passion of making web better; one site at a time.


@
Mobile +968 93 678 199
email info@fahdmurtaza.com
Google Talk: fahdim@gmail.com
Skype fahd.murtaza
Location Muscat, Oman.


_
Developed using my beloved, love of my life, WordPress, built on the responsive, grid based, mobile optimised, Foundation Framework, and a modified Foundation theme. More Info →


Follow Fahd: Twitter / Google+ / Instagram / Facebook / Dribbble / Tumblr / Posterous /
Copyright © 2006-2012 Fahd Murtaza

    • WordPress.org
    • Documentation
    • Support Forums
    • Feedback