Archive for the ‘PHP’ Category

Get Latest Tweet Using ExtJS DataView and PHP

July 27th, 2010   by  aditia rahman

Recently I love twitter, even though I didn’t tweet too often, cause I found many great link from the people that I follow. In this post, I want to create a little twitter client to getting the latest tweets by specific username using ExtJS DataView, cause the app are just getting the tweets the it doesn’t have to authenticate the users, let get straight to the code:

Posted in Extjs PHPNo Comments
Tags:

Extjs: Simple Image Gallery Using DataView and PHP

July 21st, 2010   by  aditia rahman

Last week I tried some of the extjs dataview example, it really great, just my thought, why not creating simple image gallery with dataview? All that we need is provided in the example (the panel, fileinputfield, the xtemplate) and this is the page wire frame that I created using Pencil Firefox Plugins.

Ext JS Dataview Gallery Wire Frame

Posted in Extjs PHP1 Comment

Create Spy With ExtCore

July 6th, 2010   by  aditia rahman

This post is a sort post describing how to create simple spy, if you don’t know what the spy yet, check the digg spy, that is very cool infographic to displaying updated content from it users, but when this post is created digg using flash technology to pooling data from the server, but this post using extcore to pooling data from the server, and the code is not really have big different from my previus post, I just create single file and include one js file (it’s the extcore.js file of course), that file i called “index.php”, now here we go.

Posted in Extjs PHPNo Comments
Tags:

Cropping Image to Square Dimension Using PHP

July 1st, 2010   by  aditia rahman

When I wrote my previous post about creating image gallery with codeigniter, I browse some popular image sharing service, and I spent most of my time in flickr, till now I think flickr is still the best photo sharing on the net, when we search on flickr, there are many result that displayed only the thumbnail photo, for example you can see on the screen that I captured

Search Home Design On Flickr.com

Posted in PHPNo Comments

Basic Image Gallery With CodeIgniter

June 27th, 2010   by  aditia rahman

CodeIgniter is quite mature framework to creating web application, the built in libraries and helper very helpful to creating most feature in web application, this post I want to create very basic image gallery using CodeIgniter, the the built in libraries that I used are File Uploading, Image Manipulation and Pagination, whereas the used helper is URL Helper, and here’s we go

First open the config.php in folder system/application/config/ and set the CodeIgniter base_url

$config['base_url'] = "http://localhost/ci_gallery/";

Next load the URL Helper in autoload.php in the same folder as above file

$autoload['helper'] = array('url');

Now create the image controller in file image.php inside folder system/application/controller and add this attribute inside the image class

private $data = array(
    'dir' => array(
        'original' => 'assets/uploads/original/',
        'thumb' => 'assets/uploads/thumbs/'
    ),
    'total' => 0,
    'images' => array(),
    'error' => ''
);

Posted in Codeigniter PHP1 Comment
Tags:

Load Content Scroll Using EXT Core and PHP

June 22nd, 2010   by  aditia rahman

Extcore is one the Extjs product, but the company name now called sencha, read this why extjs changes their name. If you using full stack Extjs source the Extcore must be included in the source, in this post I want to show how to load content while window scroll from the server using Extcore, this feature maybe useful when users want to see more data than visible on the screen maybe like facebook wall, actually this post is similar to another post i found, but using jquery (they are in 9lessons.info and webresourcesdepot.com), in this example i’m just using one file and the data is hardcoded from array

So lets start, here’s the php code

<?php

$data = array(
    0 => array('post' => 'Post Number 0')
);

for ($i=1; $i<=50; $i++) {
    $tmp_data = array(
        $i => array('post' => 'Post Number ' . $i)
    );
    $data = array_merge($data, $tmp_data);
}

// get next 10 row data,
if (isset($_GET['act'])) {
    $start = ($_GET['page'] * 10) + 1;
    $finish = $start + 10;
    if ($finish <= count($data)) {
        echo '<div class="data newhead">Loaded Data &darr;</div>';
        for ($i=$start; $i<$finish; $i++) {
            echo '<div class="data">'.$data[$i]['post'].'</div>';
        }
    } else {
        echo 'stop';
    }
    exit;
}

?>

Posted in Extjs PHPNo Comments
Tags:

Creating Register and Login Form Using EXTJS and CodeIgniter

June 2nd, 2010   by  aditia rahman

Like another tutorial this post will create the basic form login and register using Extjs and Codeigniter, and I want to mix my previous post about Codeigniter Session Library, Extjs Unique Field Validation and using Statusbar in Extjs Window.

1. Setting up the database

Using phpmyadmin in XAMPP I create the database named “ci_extjs_login”, and create simple “users” table, here below is the sql code that I generated from phpmyadmin, for more advance database modelling you can use mysql workbench.

CREATE TABLE  `ci_extjs_login`.`users` (
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`username` VARCHAR( 100 ) NOT NULL ,
`password` VARCHAR( 100 ) NOT NULL ,
`email` VARCHAR( 100 ) NOT NULL
) ENGINE = MYISAM ;

Resource Links For PHP Performance Tips

May 25th, 2010   by  aditia rahman

This time I want to share my resources about PHP performance link, because when developing web application I always worry about how fast my application can serve the user request, I really need advice about performance in PHP and I found it some, you can see more than 15 resources about PHP performance, but you may found something similar tips from one post to another post. Well at least I’m try to follow the advice, and hope this list useful for you.

1. PHP performance tips from Google

Posted in PHPNo Comments

EXTJS: Getting each row value from the grid

May 14th, 2010   by  aditia rahman

When I write this post, a friend of mine asking me how to get the value from all the row in EXTJS grid, she use EditorGridPanel to make the grid editable by it’s user, and submit all edited value in each row to the server  i’m using php to take all the server side process). Actually the idea is very simple, the grid need to have sm config options it is a shorthand for selModel and this config that make the grid can be selected per row, and you can added the checkboxselection model to choose the row that you desired, so trid to make it simple tutorial, and at the of the post you can download the source from this post.

1. Setting the main page
Include the EXTJS file (javascript and css) in html header file, then create single div with an id to where the grid to put on, and i’m using inline css style to centering the div the on the page

<!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>
<link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css"/>
<script type="text/javascript" src="extjs/adapter/ext/ext-base.js"; ?>"></script>
<script type="text/javascript" src="extjs/ext-all.js"; ?>"></script>
</head>

/* This should be fill with the EXTJS script code
 * It explain on the next step
 */

// on the body section
<body>
<div id="grid-example1" style="height: 200px;width:600px;margin:0 auto;padding:20px;"></div>
</body>
</html>

Posted in Extjs PHP5 Comments

Unique Field Form Validation Using PHP and EXTJS

May 7th, 2010   by  aditia rahman

In this post I try to share my code about form validation in EXTJS, so why another EXTJS form validation tutorial? well, the EXTJS default form validation is quite great, but most sample that I’ve found it just using client side validation and the only server side validation is when the user press submit button. So in this post the I modified a bit code about custom form validation in EXTJS, and here I’m not using database. The expected result should be like this

Posted in Extjs Javascript PHP4 Comments