This will be something that will knock your socks off!
Aptana has what is called Intellisense, this is nothing new. Many modern IDE’s have Intellisense for standard HTML, XML, CSS, JavaScript, and other languages like PHP, and Ruby.
This will be a place where you can store your various frameworks. I store the frameworks in there own folders separate from the production scripts for Three reasons. One, I can keep versions of my library’s. And Two so they are independent of the production application. And Three I can update all the Frameworks with SVN.
I am…
This is basically the exact same code I used in my Addressbook to export all of the contact information. Its good to note that a CSV is not a full backup, while you can restore the information in a Database you will not restore the structure.
A CSV file is commonly used to export information for manipulation, or importing into other applications.
You could export all of your contacts fro example and import them into Google contacts.
A file format is a particular way to encode information for storage in a computer file. Particularly, files encoded using…
This is a quick and dirty little snippet. I had a case where I had to fill in a Subject Line and a message with only one multi line text box. It wasn’t practice to have a hard coded subject line as it would be the same for every message or in my base bug.
Have a look at the code, I will explain what is going on below.
<?
// Get the message String
$rawString = $_POST['comments'];
// Split the string into pieces for processing
$pieces = explode("\n", $rawString);
// First element is the subject line
$subject = $pieces[0];
// Take…
cURL or Client URL Library is a very powerful tool, and its something that i recently had to use while working with two APIs one for Unfuddle and one for HelpSpot.
PHP supports libcurl, a library created by Daniel Stenberg, that allows you to connect and communicate to many different types of servers with many different types of protocols. libcurl currently supports the http, https, ftp, gopher, telnet, dict, file, and ldap protocols. libcurl also supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading (this can also be done with PHP’s ftp extension), HTTP form based upload, proxies, cookies, and user+password authentication.
These…
When you first start to learn about Graphic design from a technical point you learn about Format. In graphic design there are many different file formats created by even more graphic editors. They all have there Pros and there Cons.
When you are working for the web you really only have three options: GIF, JPEG and PNG. They all server there purpose and are great at there jobs. The trick is to learn how each format can best to its job and when.
JPEG stands for the Joint Photographic Experts Group or simply JPG. The group was organized in 1986, issuing a standard…
I had a heck of a time finding a Regular Expression to parse URLs in a body of text. The beauty with this expression is its flexibility, it will handle a http or https url with or without www. and it’s fine with tinyurls.
// $subject contains a body of text with non html URLs
$text = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]", "<a href=\"\\0\">\\0</a>", $subject);
This is posted more as a snippet because is spent so long trying to find one that would work.
$subject will be the body of text containing flat text urls. $text will now contain our information.
// Output New formatted content with links. echo $text;…
This is a handy little Snippet that goes well with PHP Microtime. Not only are we concerned with our scripts execution time but we also want to make sure we are not using an exorbitant amount of memory in the process.
At the top of your script lets place the code that will start PHP’s Micro time.
$time_start = microtime(true);
At the bottom of your page, just before the “” tag we will put the Code that will calculate the execution time as well as how much memory was used to execute the script.
// RENDER TIME $time_end = microtime(true); $time = $time_end…
Not to long ago i made a tutorial on how to Creating Black and White Images in Photoshop CS3. This tutorial though centered around JPG was will an nondestructive method and has worked well for me in the past. But there are many methods in creating black and white images. Some involve a bit more understanding of colour and manipulating the colour channels in Photoshop. The method i have been using lately is done with RAW photos in Adobe Camera Raw 4.4.1.
Step 1:
First thing is first, we will need a RAW photo to work with,…
I tried a few examples from the internet and neither seamed to work properly so i adapted the two that i found.
First things first:
Open your comments.php file and look for a line like this.
<li class="<?php echo $oddcomment; ?>" id="comment-< ?php comment_ID() ?>"> </li>
Second:
Simply past the following code replacing the PHP “< ?php echo $oddcomment; ?>“. Replace my@mail.com with your email that your wordpress admin account uses.
< ?php /* Only use the authorcomment class from style.css if the email is set to the…
I was using this technique on my site for a while and realized that i actually liked the evening image you currently see in the header of my site.
The basic principle behind this tutorial is to allow a CSS file to be dynamic in the sense that it can use logic to define certain images or even colour schemes if you wish. The User will never see any JavaScrip so if they have Javascript dissabled your design will still come through.
For my example i used a div with the class of headerImage, simple enough. I then created a new PHP…