Archive for March, 2009

KomunitasWeb March 2009 Summary

KomunitasWeb summary for march 2009.

PHP

Continue reading »

HTML Wireframe with Polypage

polypage

What is PolyPage?

Polypage is jQuery plugin to help you build wireframe. It was designed to ease the process of showing multiple states in html mock-ups. You can do this by adding class names to your html mock-ups.

See the demo.

Where can I get PolyPage?

You can get the latest version from the github repository.

How to use PolyPage

After download the PolyPage files, you need to include jQuery, jQuery cookie plugin, jQuery PolyPage plugin, and don’t forget to include PolyPage stylesheet file.

Continue reading »

42 Pagination Design Inspiration

pagination

Pagination is navigation for browsing through part of large dataset. It has simple function, add user experience for your user to browse your site. But hey, it doesn’t need to be ugly. Here pagination gallery to inspire you build your next pagination.

Continue reading »

CakePHP ACL Tutorial – What and How

CakePHP ACL

In this tutorials, I’ll show you everything you need to know to get started with CakePHP ACL. First you need to know what is ACL, and how ACL is implemented in CakePHP. Are you ready?

What

ACL or Access Control List is security concept about permission. It’s contain a list of permission to access some of resources. It specify who and what is allowed to access something.

In CakePHP ACL is used to specify users access to a controller, or specific action of a controller. Before we get to the how to section, there are a few terms we have to understand first.

  • Access Request Object (ARO) is defined who want to access or request object. In simple term, it will be a user or group. This list of user or group is stored in table called ‘aros’.
  • Access Control Object (ACO) is defined object that is being protected from a user or a group. In other word ACO related with which controller or action of controller you want to protect. ACO is stored in table called ‘acos’.

‘acos’ and ‘aros’ table is created automatically when you initialize the DB Acl tables (we’ll get into this later in how to part). Along with those table, there is table called ‘aros_acos’ which specify relationship between ARO and ACO. In english it will be mean which user has permission to a controller or action of controller.
Continue reading »

CodeIgniter Tutorials to Help You Get Started

Do you like CodeIgniter? Here a CodeIgniter round up collection to help you get started with this framework.

Introduction and Basic CodeIgniter Tutorial

  1. Introduction to Code Igniter: Part 1 – CodeIgniter introduction, get started with Model, View, and Controller in CodeIgniter
  2. Introduction to Code Igniter: Part 2 – Form and validation.
  3. Introduction to Code Igniter: Part 3 – Working with database.
  4. Everything You Need to Get Started With CodeIgniter – Introduction to CodeIgniter, installation and sample
    application.
  5. Building a Complete CodeIgniter Application: Part 1 - Installation and configuration.
  6. Building a Complete CodeIgniter Application: Part 2 – Feed parsing using SimplePie, unit testing and database.
  7. Building a Complete CodeIgniter Application: Part 3 -Handle security issue.

Basic

  1. Templating With CodeIgniter – Basic templating with CodeIgniter.
  2. Code Igniter Template Tutorial -Another template tutorial for CodeIgniter.
  3. Forms in CodeIgniter Views – Form tutorial in CodeIgniter.
  4. Pagination with Code Igniter – Build pagination system in CodeIgniter
  5. CodeIgniter: Interacting With a Database – Get close with database.

Need more advanced tutorials? Fine, we have here.
Continue reading »

Email Validation Challenge

My post about validating an email using regular expression seem cause so many reaction. Rather than arguing, let’s figure out what the best solution to validate an email address. And everyone could learn in the process.

So, here the question. How you validate an email format?

So for I pick this one, but it is in PHP. Not a universal solution.

if (filter_var('test+email@fexample.com', FILTER_VALIDATE_EMAIL)) {
    echo "Your email is ok.";
} else {
    echo "Wrong email address format.";
}

Give your solution in the comment, and I’ll post the 10 best solutions. Do you have a better solution? Please don’t keep it in your treasure box.

101 PHP Tutorials for PHP Programmer Wannabe

When I type this, google for ‘php tutorial’ result 8,950,000 pages. Yes, there are tons of great tutorial about PHP. But when you’re a beginner, it will make you confuse what tutorials you should read. Either it’s too complicated or just waste your time.

So, here the shortcut. Take it and be a better PHP programmer by tomorrow. Hmm, maybe not that fast. But here they are.

WebMonkey

  1. PHP Tutorial for Beginners

PHP 101: PHP For the Absolute Beginner

  1. PHP 101 (part 1) Down the Rabbit Hole – An introduction to PHP’s variables and operators.
  2. PHP 101 (part 2) Calling All Operators – The rest of the PHP operators (there are many), and simple form processing.
  3. PHP 101 (part 3) Looping the Loop – Basic control structures explained.
  4. PHP 101 (part 4) The Food Factor – Arrays, PHP array functions, and what it all means.
  5. PHP 101 (part 5) Rank and File – Everything you’re ever likely to need to know about dealing with external files from a PHP script.
  6. PHP 101 (part 6) Functionally Yours – All about functions, arguments, passing by reference, globals and scope.
  7. PHP 101 (part 7) The Bear Necessities – A gentle introduction to object oriented programming in PHP 4 and PHP 5.
  8. PHP 101 (part 8) Databases and Other Animals – All about connecting to a MySQL database from PHP, using the mysql or mysqli extensions.
  9. PHP 101 (part 9) SQLite My Fire! – Introducing another database: SQLite.
  10. PHP 101 (part 10) A Session In The Cookie Jar – Sessions and cookies – how to keep track of visitors to your site.
  11. PHP 101 (part 11) Sinfully Simple – An introduction to PHP’s easiest method for dealing with XML.
  12. PHP 101 (part 12) Bugging Out – Basic error handling.
  13. PHP 101 (part 13) The Trashman Cometh – A primer in basic security.
  14. PHP 101 (part 14) Going to the Polls – Putting the pieces together – a first Web application.
  15. PHP 101 (part 15) No News is Good News – Creating a simple RSS news aggregator.

Continue reading »

CodeIgniter Tutorial – To do list application part 3

ci_logo_flame

Let’s take a look at our to do list application.

By now, you have familiarize your self with CodeIgniter framework. It is take a while to know everything, but if you keep learning then someday you will get there.

If you have completed last tutorial, then you have a to do list application based on CodeIgniter framework. It’s not complete, but at least working.

But if there is something you don’t understand, you could stop by, give a comment or ask me. Or maybe you want to correct me. That’s fine. We all learning here.

Let’s go build another features.
Continue reading »

10 Practical PHP Regular Expression Recipes

Latest update Email validation seems quite tricky. Do you have a better solution? Let’s have email validation challenge. And give the user the best way to validate an email format.

Mastering regex or regular expression is one advantages for you as programmer, but not everyone has time to learn something.

Not knowing how regex works doesn’t mean you couldn’t use the power of regex in your project.

Bookmark this list, so you can always going back here whenever you need this regex recipes.

Update :
Never though, my post will reach so many people, and cause so many reaction. But thank you to everyone, as I myself learn from my mistake.
Some credit goes to Joey Sochacki as I did use and modify some of his regular expression.

Continue reading »

.htaccess What, Why, When and How

What

.htaccess is a file with a power to override certain configurations in the Apache httpd.conf file. If you’re using shared hosting, then you don’t have access to Apache main configuration. So most of shared hosting will provide you with .htaccess file.

Definition from Wikipedia :

.htaccess (hypertext access) is the default name of directory-level configuration files that allow for decentralized management of configuration when placed inside the web tree.

Why

You have your site up and running, but then again you ask yourself, why you need to configure and tweak your .htaccess.

If you think your site can run without dealing with .htaccess, then you absolutely right. But to optimize your website in term of bandwidth or rewrite your url to look nice in front of search engine, you have to know .htaccess.

Continue reading »

20 Great PHP Libraries You Need to Know

You’re in the middle of a project, and need to get everything done as soon as possible. To keep the deadline and still have a life, you would better to collect this awesome library on your fingertip. By knowing this library capability, then you’ll know when to use any of them.

Charting Library

You can create simple graph or chart using GD library on PHP, but to help you create more complex chart, then you’ll need this awesome library.

  1. pChart – a PHP class to build charts.
  2. Libchart – Simple PHP chart drawing library.
  3. JpGraph – Object-oriented graph creating library for PHP.
  4. Open Flash Chart – Flash based charting library.

Continue reading »

CodeIgniter Tutorial – To do list application#2

ci_logo_flame

Let’s continue our journey with CodeIgniter, last time we built a simple to do list application. It is so simple and only have 1 feature, list your to do list.

But wait, right now we’ll add more power to this application. We will go step by step in this tutorial.

The to do list application are meaningless if we could not add new one. So let’s go upgrade it.

So, ready to open your favourite editor? Here we go.

Continue reading »

jQuery modal box round up

jquery-logo1

jQuery has many great plugin, and some of them are modal box. So, I collected amazing list of modal box for jQuery, and here they are.

ColorBox

ColorBox is a light-weight, customizable lightbox plugin for jQuery 1.3. And it was design to follow web best standard and W3C standards.

Features

  • Supports photos, photo groups, ajax, inline, and iframed content.
  • Appearance is completely controlled through CSS so users can restyle the box.
  • Behaviour settings can be over-written without altering the ColorBox javascript file.
  • Completely unobtrusive, requires no changes to existing HTML
  • Degrades gracefully, all content displayed can be accessed without JavaScript.
  • Preloads background images to avoid flash of unstyled content on first use.
  • Can preload upcoming images in a photo group.
  • Lightweight: only 12kbs of JavaScript – only 2kbs gzipped & minified!
  • Written in jQuery plugin format and can be chained with other jQuery commands.
  • Generates W3C valid XHTML and CSS
  • Released under the MIT License.

Homepage

http://colorpowered.com/colorbox/

Screenshots

colorbox-1
Continue reading »

Codeigniter tutorial – To do list application

ci_logo_flame

What is CodeIgniter?

CodeIgniter is a powerful PHP framework with a very small footprint, built for PHP coders who need a simple and elegant toolkit to create full-featured web applications. If you’re a developer who lives in the real world of shared hosting accounts and clients with deadlines, and if you’re tired of ponderously large and thoroughly undocumented frameworks

CodeIgniter has an excellent documentation. It’s really help you in getting started. If you new to CodeIgniter, you can start by reading the user guide or read this excellent article Everything You Need to Get Started With CodeIgniter.

If you’re ready with your CodeIgniter, now we will create complete application using codeigniter. Building to do list in CodeIgniter. Let’s get started.
Continue reading »

29 tutorials to help you build your mobile site

Why do we have to care with mobile site?

Simple, because there are billion people who have access to mobile phone. So? What’re you waiting for? Go ahead and check if your website is mobile ready. You can go to ready.mobi

If you don’t want to build everything from zero and just need an instant mobile version of your site, you can check out this tutorial How to Create a Mobile Site with MoFuse.

For blogger with wordpress, you can install mobile plugin for your wordpress. Check this out WordPress Mobile Plugin.

And if you prefer to build mobile site from scratch, maybe this will help you to get started.
Continue reading »

9 great UX presentations to help you build better website

User experience is one of the most important element in developing a product, and so with developing web application. If you want to design for your user, take some extra time to design great UX.

Because if you have great UX, then you’ll have happy customer. Now, Here a list of some great presentation about User Experience presentation. Learn it and give it a shot on your next project. You’ll see the different.

Continue reading »

Using Django template in PHP

How Django template work

In Django template you can’t mix programming logic into template, and this is by the design, because basically template is meant to express presentation. But of course, Django template provide something called tags which function similarly to some programming constructs. Now let’s go through some real example how Django template work.

In Django template we use {{ variable }} to express variable.

1
2
3
4
5
6
<html>
    <head><title>{{ page.title }}</title></head>
    <body>
        {{ page.body }}
    </body>
</html>

To loop over array or list we use for tag

1
2
3
4
5
6
7
8
9
<html>
    <head><title>{{ page.title }}</title></head>
    <body>
    {% for news in news_list %}
    <h2>{{ news.title }}</h2>
    <p>{{ news.content }}</p>
    {% endfor %} 
    </body>
</html>

And to simulate selection, Django template provide if tag

1
2
3
4
5
6
7
8
<html>
    <head><title>{{ page.title }}</title></head>
    <body>
    {% if message %}
    {{ message }}
    {% endif %}
    </body>
</html>

Continue reading »

Web Developer Resources #1 – CSS Layout

Free CSS Layout

With this css layout, you can quickly create your website or you can create HTML prototype of your website faster.

Layout Gala (40 layouts)

Layout Gala css layout range from 2 fixed column to liquid layouts.

layout-gala

Continue reading »

Sphinx search introduction

507110_binocular

After reading my introduction to full text search or you have read article somewhere else and decided to go with full text search in your next project, but you still confuse what full text search engine to use. One implementation of full text search engine is Sphinx. And I’ll give you a short course on how you installing Sphinx for your full text search engine.

Sphinx is a full-text search engine, distributed under GPL version 2. It is not only fast in searching but it is also fast in indexing your data. Currently, Sphinx API has binding in PHP, Python, Perl, Ruby and Java.

Sphinx features

  • high indexing speed (upto 10 MB/sec on modern CPUs);
  • high search speed (avg query is under 0.1 sec on 2-4 GB text collections);
  • high scalability (upto 100 GB of text, upto 100 M documents on a single CPU);
  • provides good relevance ranking through combination of phrase proximity ranking and statistical (BM25) ranking;
  • provides distributed searching capabilities;
  • provides document exceprts generation;
  • provides searching from within MySQL through pluggable storage engine;
  • supports boolean, phrase, and word proximity queries;
  • supports multiple full-text fields per document (upto 32 by default);
  • supports multiple additional attributes per document (ie. groups, timestamps, etc);
  • supports stopwords;
  • supports both single-byte encodings and UTF-8;
  • supports English stemming, Russian stemming, and Soundex for morphology;
  • supports MySQL natively (MyISAM and InnoDB tables are both supported);
  • supports PostgreSQL natively.

There you go, so fire up your terminal or console, and let’s get thing done. Continue reading »

Full text search introduction

What is full text search?

Full text search is searching method that will use the entire words and find all match search against our database.

And according to Wikipedia

In text retrieval, full text search refers to a technique for searching a computer-stored document or database. In a full text search, the search engine examines all of the words in every stored document as it tries to match search words supplied by the user

In our traditional search method mostly we only search our criteria for against 1 column in our table.

Let’s say we have 1 million data about books, and we have title, author, and summary.

And now, we’re trying to create simple search against them. If I want to search book with title ‘PHP and MySQL Web Development’

forms01

We fill the form and click search button, and ta da, we got the result. But wait … Continue reading »