• 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

CodeIgniter: How to set your images path automatically for your site

February 13th, 2008 by Fahd

Well I was thinking that the old source code I got from the other guy Nouman who was working on this Home Work Center Project that was and is being coded in CodeIgniter was not very much upto date. I fixed the Javascript issues; in fact a lot of them including the JavaScript date picker calendar. It fits well, works on IE 6, IE7, Safari and Firefox; haven’t yet checked with others. But I am sure it will!. Anyhow the problem I was facing was that in different folders in Views for CodeIgniter , if we are using images, we have to use relative URLs in most of the pages, which gets quite troublesome sometimes. As long as it is the CodeIgniter I am working on, I don’t want to use my own includes having setting of the site because this is why we are using CodeIgniter .

Solution:

So cutting short the details, if you want to use the site’s URL and relative paths according to your site’s base url, here is the solution use site_url(). The link contains all the details you will need to use for your views and it also tells which helpers you need to load.

Posted in CodeIgniter, Open Source, PHP, Web Development, Web Development Software

Leave a comment

A very good article for Screen scraping any webpage into RSS

February 1st, 2008 by Fahd

I was looking for screen scraping a site for getting the download links off the site and I found this intersting tutorial. It makes you able to  get the content from a page and make it into RSS. Easily customizable thing. Just go for it. (Link on the full post.) (more…)

Posted in Open Source, PHP

Leave a comment

Script.aculo.us Its about the user interface, baby!

January 22nd, 2008 by Fahd

I am with my best days of learning web development now a days! Having coffee on my cabin’s table where me and my computer live together. Ah its quite bitter :( , I am still not good at making cape chino! But I am still happy as I have learned new things today. I have always been looking for some great JavaScript libraries that would do some really nice tricks like animation effects and user friendly techniques with easy to code syntax and minimal lines of code to call a specfic functionality. So I got it today.

And dear readers, I was really amazed at the high profile sites who are using it for example Gucci ,Digg , Apple fluxiom , Basecamp , Shopify , Blinksale , Backpack , Feedburner , Mailroom , Ruby on Rails and many others.

Isn’t that impressive? yeah I am sure it is!

Be sure to check out the demos, too: effects engine , autocompleter , drag’n'shop , puzzle game

 I will be using it with the codignitor , the new PHP framework that I am  goin g to use for my new project thats a CMS system for teachers to help manage their content for students. It focuses on Web 2.0 with Rich dynamic features!

 

Posted in AJAX, Open Source, PHP, Web Development, Web Development Software

Leave a comment

Starting a new project “WP Theme Agent”

January 17th, 2008 by Fahd

Check my latest quote “A wordpress theme a day doesn’t keeps a geek away! “, yeah off course to serve my fellow wordpress community and my loving wordpress blogging engine. All the wordpress geeks a very well aware of the fact that how cool wordpress theming can be, I would rather boast there is no better theming engine for blogs out there. Anyone with normal PHP understanding can easily customize a theme for their blog or even get a pre-done template and convert it into wordpress theme with few easy steps.

Posted in A theme a day, Blogging Engines, CSS, Open Source, PHP, Themes, Web Development, Web Development Software, Wordpress, WP Theme Agent

Leave a comment

A PHP function for date aritmetic simple and easy way to do date arithmetic

January 10th, 2008 by Fahd
function adddate($timesent,$daystoincrement=0,$monthstoincrement=0,$yearstoincrement=0){///echo "Original date is ".date("M-d-Y",$timesent);/*

$daystoincrement=32;

$yearstoincrement=-1;

$monthstoincrement=2;*/

$timesentnew=date("M-d-Y", mktime(0, 0, 0,date('m',$timesent)+$monthstoincrement,date('d',$timesent)+$daystoincrement,date('Y',$timesent)+$yearstoincrement));

//echo "Date after adding ".$daystoincrement." days, ".$yearstoincrement." years and ".$monthstoincrement."months equals " .$timesentnew."";

return $timesentnew;

}

echo adddate(time(),0,8,0);

Posted in Open Source, PHP, Web Development

Leave a comment

PHP & MYSQL: Recursive Function in PHP that returns an array of a category’s parent categories

January 3rd, 2008 by Fahd

The idea:

I was helping my team member with a recursive function while he wanted to implement some way of getting a parent category/categores of a category in an array. So we both coded that in 15 minutes. I thought it would be better to post this thing for your help on my blog.

Suppose you have a table named “product_cat” in a MySQL database named “trade”

The SQL for that table is

CREATE TABLE `product_cat` (`ID` smallint(6) NOT NULL auto_increment,`value` varchar(255) NOT NULL,`parentID` smallint(6) NOT NULL default '0',PRIMARY KEY  (`ID`)) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

and the following code does what I have explained above

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>Untitled Document</title>

</head><body>

<?php

$parents = array();

function getParendID($childID)

{

global $parents;

$hostname_conn = "localhost";

$database_conn = "trade";

$username_conn = "root";

$password_conn = "";

$conn = mysql_pconnect($hostname_conn, $username_conn, $password_conn) or trigger_error(mysql_error(),E_USER_ERROR);

$sql = "SELECT * FROM `product_cat` WHERE `ID`=$childID";

echo $sql;

$result_cat = mysql_query( $sql, $conn ) or die( "Line 12: $sql<br />" . mysql_error( ) );

$row_cat=mysql_fetch_array($result_cat);

if(mysql_num_rows($result_cat)==0)

{

print_r($parents);

}

else{

$cnt=count($parents);

$parents[$cnt+1]=$row_cat['parentID'];

getParendID($row_cat['parentID']);

}

}

?>

<?php

//$parents=getParendID(53);

?>

<pre>

<?php

print_r(getParendID(53));

?>

</pre>

</body>

</html>

If you want to get these both files, I have attached zip for the PHP code and MySQL query Recursive PHP Function to Get Parent categories

Posted in Open Source, PHP, Web Development

Leave a comment

  • «
  • 1
  • 2
  • 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/ flickr /
Copyright © 2006-2012 Fahd Murtaza

    • WordPress.org
    • Documentation
    • Support Forums
    • Feedback