Thursday, 20 December 2012

Difference between compiler and interpreter


A Compiler and Interpreter both carry out the same purpose – convert a high level language (like C, Java) instructions into the binary form which is understandable by computer hardware. They are the software used to execute the high level programs and codes to perform various tasks. Specific compilers/interpreters are designed for different high level languages. However both compiler and interpreter have the same objective but they differ in the way they accomplish their task i.e. convert high level language into machine language. Through this article we will talk about the basic working of both and distinguish the basic difference between compiler and interpreter.
 
Compiler
compiler is a piece of code that translates the high level language into machine language. When a user writes a code in a high level language such as Java and wants it to execute, a specific compiler which is designed for Java is used before it will be executed. The compiler scans the entire program first and then translates it into machine code which will be executed by the computer processor and the corresponding tasks will be performed.  
Compiler working
Shown in the figure is basic outline of the compilation process, here program written in higher level language is known as source program and the converted one is called object program.
 
Interpreter
Interpreters are not much different than compilers. They also convert the high level language into machine readable binary equivalents. Each time when an interpreter gets a high level language code to be executed, it converts the code into an intermediate code before converting it into the machine code. Each part of the code is interpreted and then execute separately in a sequence and an error is found in a part of the code it will stop the interpretation of the code without translating the next set of the codes.  
Interpreter working
Outlining the basic working of the interpreter the above figure shows that first a source code is converted to an intermediate form and then that is executed by the interpreter.
 
The main differences between compiler and interpreter are listed below:
·         The interpreter takes one statement then translates it and executes it and then takes another statement. While the compiler translates the entire program in one go and then executes it.
·         Compiler generates the error report after the translation of the entire page while an interpreter will stop the translation after it gets the first error.
·         Compiler takes a larger amount of time in analyzing and processing the high level language code comparatively interpreter takes lesser time in the same process.
·         Besides the processing and analyzing time the overall execution time of a code is faster for compiler relative to the interpreter.

In the field of computers, the instructions given by the user are normally of high level language, whereas the computer will understand the instructions only in the binary format, the language of a computer is known as machine language. The sole purpose of the compiler and interpreter is to convert the user given high level language into machine level language so as to make the computer understand and executed the users driven instruction set. “If both the interpreter and compiler are used for sole purpose then what is the significance of each, for this reason the current report if aimed at exploring the difference between a compiler and interpreter”. A compiler will translate the high level language input given by the user into the machine language, i.e. in the binary codes, whereas an interpreter also converts the high-level language into machine level language but the interpreter will initially generate an intermediate code and then convert the high level language to machine level language.

The following context doles out brief description on the differences among the compiler and interpreter

Difference between compiler and interpreter:
Even though the compiler and interpreter are used for converting the high level language to machine language, there exist few variations between the compiler in the style and functionalities in converting the languages.

Compiler is a unique program that runs the instructions that are written in a certain programming language and convert them into the machine code that a computer can understand. The interpreter just does the same work as of the compiler, but the major variation is that, it converts the high level language into an intermediate code which is executed by the processor.  Normally a developer compose the instructions set by using any kind of programming language such as C, Java, Pascal, Python etc. The instruction written by the programmer is referred as the source code. The programmer must initiate the compiler or interpreter that is pertained to the language used for writing source code. Interpreter investigates and runs each line of source code in sequence, without considering the whole program at once. Nevertheless, programs shaped by compilers run greatly faster than the same instructions executed by an interpreter.

Basic differences between Compiler and Interpreter:
  • Compiler translates the high level instruction into machine language, but the interpreter translates the high level instruction into an intermediate code.
  • The compiler executes the entire program at a time, but the interpreter executes each and every line individually.
  • Compiler reports the list of errors that are caused during the process of execution, but the interpreter quits translating soon after finding an error, the progression of the other lines of the program will be done after refining the error.
  • Autonomous executable file is generated by the compiler while interpreter is compulsory for an interpreter program.

Differences on the basis of Various characteristics:
  • In a compiler the analyzing and processing time of the program is more, while an interpreter spends less time for the program analyzing and processing.
  • The resulting code of the compiler is in the form of machine code or binary format, in case of interpreter the resulting code is in the form of the intermediate code.
  • In case of compiler, the resulting code is executed by the computer hardware, in an interpreter; another program interprets the resulting code.
  • The execution of the program is fast in the compiler; in an interpreter the program execution speed is comparatively slow.

Differences on the basis of programming:
  • The compiler will verify syntax of program, whereas the interpreter verifies the keywords of a program.
  • The compiler will verify the entire program at a time, but the interpreter verifies the program concurrently in the editor.
  • The execution of the program in the interpreter is done line by line but the compiler executes the program on the whole.

Thursday, 6 December 2012

Drupal Subject

http://www.anilsagar.com/content/drupal-7-tutorial-part-14-drupal-7-file-system-structure-explained

http://websule.com/tutorials/drupal-basics/drupal-technology-stack

Friday, 30 November 2012

online jobs

<a href="http://www.onlinejobsfree.com/?id=1161537"><img src="http://www.onlinejobsfree.com/mem/images/300-

Monday, 19 November 2012

Differences between PHP4 and PHP5

Differences between PHP4 and PHP5:


Here's a quick overview of what has changed between PH4 and PHP5. PHP5 for the most part is backwards compatible with PHP4, but there are a couple key changes that might break your PHP4 script in a PHP5 environment. If you aren't already, I stronly suggest you start developing for PHP5. Many hosts these days offer a PHP5 environment, or a dual PHP4/PHP5 setup so you should be fine on that end. Using all of these new features is worth even a moderate amount of trouble you might go through finding a new host!

Note: Some of the features listed below are only in PHP5.2 and above.

Object ModelThe new OOP features in PHP5 is probably the one thing that everyone knows for sure about. Out of all the new features, these are the ones that are talked about most!

Passed by ReferenceThis is an important change. In PHP4, everything was passed by value, including objects. This has changed in PHP5 -- all objects are now passed by reference.

PHP Code:
$joe = new Person();$joe->sex 'male';
$betty $joe;$betty->sex 'female';

echo 
$joe->sex// Will be 'female'  
The above code fragment was common in PHP4. If you needed to duplicate an object, you simply copied it by assigning it to another variable. But in PHP5 you must use the new clone keyword.

Note that this also means you can stop using the reference operator (&). It was common practice to pass your objects around using the & operator to get around the annoying pass-by-value functionality in PHP4.

Class Constants and Static Methods/Properties
You can now create class constants that act much the same was as define()'ed constants, but are contained within a class definition and accessed with the :: operator.

Static methods and properties are also available. When you declare a class member as static, then it makes that member accessible (through the :: operator) without an instance. (Note this means within methods, the $this variable is not available)

Visibility
Class methods and properties now have visibility. PHP has 3 levels of visibility:
  1. Public is the most visible, making methods accessible to everyone and properties readable and writable by everyone.
  2. Protected makes members accessible to the class itself and any subclasses as well as any parent classes.
  3. Private makes members only available to the class itself.
Unified Constructors and DestructorsPHP5 introduces a new unified constructor/destructor names. In PHP4, a constructor was simply a method that had the same name as the class itself. This caused some headaches since if you changed the name of the class, you would have to go through and change every occurrence of that name.

In PHP5, all constructors are named __construct(). That is, the word construct prefixed by two underscores. Other then this name change, a constructor works the same way.

Also, the newly added __destruct() (destruct prefixed by two underscores) allows you to write code that will be executed when the object is destroyed.

Abstract ClassesPHP5 lets you declare a class as abstract. An abstract class cannot itself be instantiated, it is purely used to define a model where other classes extend. You must declare a class abstract if it contains any abstract methods. Any methods marked as abstract must be defined within any classes that extend the class. Note that you can also include full method definitions within an abstract class along with any abstract methods.

InterfacesPHP5 introduces interfaces to help you design common APIs. An interface defines the methods a class must implement. Note that all the methods defined in an interface must be public. An interface is not designed as a blueprint for classes, but just a way to standardize a common API.

The one big advantage to using interfaces is that a class can implement any number of them. You can still only extend on parent class, but you can implement an unlimited number of interfaces.

Magic Methods
There are a number of "magic methods" that add an assortment to functionality to your classes. Note that PHP reserves the naming of methods prefixed with a double-underscore. Never name any of your methods with this naming scheme!

Some magic methods to take note of are __call, __get, __set and __toString. These are the ones I find most useful.

Finality
You can now use the final keyword to indicate that a method cannot be overridden by a child. You can also declare an entire class as final which prevents it from having any children at all.

The __autoload FunctionUsing a specially named function, __autoload (there's that double-underscore again!), you can automatically load object files when PHP encounters a class that hasn't been defined yet. Instead of large chunks of include's at the top of your scripts, you can define a simple autoload function to include them automatically.

PHP Code:
function __autoload($class_name) {
     require_once 
"./includes/classes/$class_name.inc.php";
}  
Note you can change the autoload function or even add multiple autoload functions usingspl_autoload_register and related functions.

Standard PHP LibraryPHP now includes a bunch of functionality to solve common problems in the so-named SPL. There's a lot of cool stuff in there, check it out!

For example, we can finally create classes that can be accessed like arrays by implementing the ArrayAccess interface. If we implement the Iterator interface, we can even let our classes work in situations like the foreach construct.


Miscellaneous Features

Type Hinting
PHP5 introduces limited type hinting. This means you can enforce what kind of variables are passed to functions or class methods. The drawback is that (at this time), it will only work for classes or arrays -- so no other scalar types like integers or strings.

To add a type hint to a parameter, you specify the name of the class before the $. Beware that when you specify a class name, the type will be satisfied with all of its subclasses as well.

PHP Code:
function echo_user(User $user) {
    echo 
$user->getUsername();
}  
If the passed parameter is not User (or a subclass of User), then PHP will throw a fatal error.

ExceptionsPHP finally introduces exceptions! An exception is basically an error. By using an exception however, you gain more control the simple trigger_error notices we were stuck with before.

An exception is just an object. When an error occurs, you throw an exception. When an exception is thrown, the rest of the PHP code following will not be executed. When you are about to perform something "risky", surround your code with a try block. If an exception is thrown, then your following catch block is there to intercept the error and handle it accordingly. If there is no catch block, a fatal error occurs.

PHP Code:
try {
    
$cache->write();
} catch (
AccessDeniedException $e) {
    die(
'Could not write the cache, access denied.');
} catch (
Exception $e) {
   die(
'An unknown error occurred: ' $e->getMessage());
}  
E_STRICT Error Level
There is a new error level defined as E_STRICT (value 2048). It is not included in E_ALL, if you wish to use this new level you must specify it explicitly. E_STRICT will notify you when you use depreciated code. I suggest you enable this level so you can always stay on top of things.

Foreach Construct and By-Reference Value
The foreach construct now lets you define the 'value' as a reference instead of a copy. Though I would suggest against using this feature, as it can cause some problems if you aren't careful:

PHP Code:
foreach($array as $k => &$v) {
    
// Nice and easy, no working with $array[$k] anymore
    
$v htmlentities($v);
}
// But be careful, this will have an unexpected result because
// $v will still be a reference to the last element of the $array array
foreach($another_array as $k => $v) {

}  


New Functions

PHP5 introduces a slew of new functions. You can get a list of them from the PHP Manual.

New Extensions
PHP5 also introduces new default extensions.
  • SimpleXML for easy processing of XML data
  • DOM and XSL extensions are available for a much improved XML-consuming experience. A breath of fresh air after using DOMXML for PHP4!
  • PDO for working with databases. An excellent OO interface for interacting with your database.
  • Hash gives you access to a ton of hash functions if you need more then the usual md5 or sha1.
Compatibility IssuesThe PHP manual has a list of changes that will affect backwards compatibility. You should definately read through that page, but here is are three issues I have found particularly tiresome:
  • array_merge() will now give you warnings if any of the parameters are not arrays. In PHP4, you could get away with merging non-arrays with arrays (and the items would just be added if they were say, a string). Of course it was bad practice to do this to being with, but it can cause headaches if you don't know about it.
  • As discussed above, objects are now passed by references. If you want to copy a object, make sure to use the clone keyword.
  • get_*() now return names as they were defined. If a class was called MyTestClass, then get_class() will return that -- case sensitive! In PHP4, they were always returned in lowercase.
__________________

PHP OOPs concepts


In the earlier tutorials we have witnessed keywords like public, private and protected. These are nothing but access specifiers. So, lets understand what access specifiers are.
Definition of Access Specifiers
Access specifiers specify the level of access that the outside world (i.e. other class objects, external functions and global level code) have on the class methods and class data members. Access specifiers can either be publicprivate or protected.
Why do we need Access specifiers
Access specifiers are used as a key component of Encapsulation and Data Hiding. By using either of the access specifiers mentioned above i.e. public, private or protected you can hide or show the internals of your class to the outside world.
Explanation of each access specifier
1. Private
2. Protected
3. Public

1. Private
A private access specifier is used to hide the data member or member function to the outside world. This means that only the class that defines such data member and member functions have access them. Look at the example below:
class Customer {
 private $name;
 
 public function setName($name) {
  $this->name = $name;
 }
 
 public function getName() {
  return $this->name;
 }
}
 
$c = new Customer();
$c->setName("Sunil Bhatia");
echo $c->name; //error, $name cannot be accessed from outside the class
               //$name can only be accessed from within the class
 
echo $c->getName(); //this works, as the methods of the class have access
                    //to the private data members or methods
In the above example, echo $c->name will give you an error as $name in class Customer has been declared private and hence only be accessed by its member functions internally. Therefore, the following line echo $c->getName() will display the name.
2. Public
A public access specifier provides the least protection to the internal data members and member functions. A public access specifier allows the outside world to access/modify the data members directly unlike the private access specifier. Look at the example below:
class Customer {
 public $name;
 
 public function setName($name) {
  $this->name = $name;
 }
 
 public function getName() {
  return $this->name;
 }
}
 
$c = new Customer();
$c->setName("Sunil Bhatia");
echo $c->name;  // this will work as it is public.
$c->name = "New Name" ; // this does not give an error.
In the above example, echo $c->name will work as it has been declared as public and hence can be accessed by class member functions and the rest of the script.
3. Protected
A protected access specifier is mainly used with inheritance. A data member or member function declared as protected will be accessed by its class and its base class but not from the outside world (i.e. rest of the script). We can also say that a protected data member is public for the class that declares it and it’s child class; but is private for the rest of the program (outside world). Look at the example below:
 
class Customer {
 protected $name;
 
 public function setName($name) {
  $this->name = $name;
 }
 
 public function getName() {
  return $this->name;
 }
}
 
class DiscountCustomer extends Customer {
 
 private $discount;
 
 public function setData($name, $discount) {
  $this->name = $name; //this is storing $name to the Customer
         //class $name variable. This works
         // as it is a protected variable
 
  $this->discount = $discount;
 }
}
 
$dc = new DiscountCustomer();
$dc->setData("Sunil Bhatia",10);
echo $dc->name; // this does not work as $name is protected and hence
  // only available in Customer and DiscountCustomer class
In the above example, echo $dc->name will not work work $name has been defined as a protected variable and hence it is only available in Customer and DiscountCustomer class.
You will learn more about inheritance later in this tutorial series. You should revisit this tutorial and read more on the protected section again when you understand inheritance better.
Important Note of Access Specifier in PHP5
In PHP5, access specifiers are public by default. This means that if you don’t specify an access specifier for a data member or method then the default ‘public’ is applicable.
Feel free to write comments if you need more examples or if you need to ask a question on PHP5 Class. You can also subscribe to my notification service to be informed as an when a new tutorial article goes online. Subscribe Below
Related Posts on PHP5 Tutorial – Object Oriented Programming (OOPS)
  1. PHP5 Tutorial – Learn to create a PHP5 Class
  2. PHP5 Tutorial – Learn to Create a PHP5 Class Object
  3. PHP5 Tutorial – Defining Attributes of a PHP5 Class
  4. PHP5 Tutorial – Defining Methods of a PHP5 Class
  5. PHP5 Tutorial – Creating a PHP5 Constructor __construct()
  6. PHP5 Tutorial OOPS – Creating a PHP5 Destructor __destruct()
  7. PHP5 Tutorial OOPS – PHP5 Class Access Specifiers – public, private and protected
  8. PHP5 Tutorial – Magic Methods – __toString() method
  9. PHP5 Tutorial – Magic Methods – __get() and __set()
  10. PHP5 Tutorial – Magic Methods – __isset() and __unset()
  11. PHP5 Tutorial – Magic Methods – __call() method
  12. PHP5 Tutorial – Magic Methods – __autoload() method
  13. PHP5 Tutorial – Magic Methods – __sleep() and __wakeup()
  14. PHP5 Tutorial – Magic Methods – __clone() method

Thursday, 8 November 2012

Differences between wp_query and get_posts


  • query_posts() is overly simplistic and problematic way to modify main query of a page by replacing it with new instance of the query. It is inefficient (re-runs SQL queries) and will outright fail in some circumstances (especially often when dealing with posts pagination). Any modern WP code should use more reliable methods, like making use ofpre_get_postshook, for this purpose. TL;DR don't use query_posts() ever;
  • get_posts() is very similar in usage and accepts same arguments (with some nuances, like different defaults), but returns array of posts, doesn't modify global variables and is safe to use anywhere;
  • WP_Query class powers both behind the scenes, but you can also create and work with own object of it. Bit more complex, less restrictions, also safe to use anywhere.
The basic difference is that query_posts() is really only for modifying the current Loop. Once you're done it's necessary to reset the loop and send it on its merry way. This method is also a little easier to understand, simply because your "query" is basically a URL string that you pass to the function, like so:
query_posts('meta_key=color&meta_value=blue'); 
On the other hand, wp_query is more of a general purpose tool, and is more like directly writing MySQL queries than query_posts() is. You can also use it anywhere (not just in the Loop) and it doesn't interfere with any currently running post queries.
I tend to use wp_query more often, as it happens. Really, it's going to come down to your specific case.

Thursday, 25 October 2012

word press doc



Table of Contents


Introduction of Word Press ..................................................................................................4

Installation of Word Press …................................................................................................5

Folder Structure of Word Press …......................................................................................14

Theme ….................................................................................................................................15

Default Types in Word Press …...........................................................................................16

            Post ….........................................................................................................................16

Page.............................................................................................................................16

Attachment ….............................................................................................................16

Revision.......................................................................................................................16

Nav Menus...................................................................................................................16

Administration  Dashboard ….............................................................................................17
Post...............................................................................................................................17

Description of Post Fields......................................................................................18

Process for creating Posts......................................................................................22
Media …......................................................................................................................24
Links ….......................................................................................................................24
Pages............................................................................................................................24
Appearance ….............................................................................................................24
Creating the Menus in Word Press …...................................................................26

Creating pages in Word Press …...........................................................................31

Creating a template in Word Press  …...................................................................33
Widget …...........…......................................................................................................38
Custom side bar creation …...................................................................................41
Custom widget creation …....................................................................................42

PlugIns …...............................................................................................................................47

PlugIn Installation …...................................................................................................48
Custom Plug In creation...............................................................................................50

Sample Custom PlugIn …...........................................................................................53
References …..........................................................................................................................56






























Introduction of Word Press :

Word Press  is a free  and open source blogging tool and content management system(CMS) based on PHP and MySQL. It has many features including a plug-in architecture and a template system.
If you plan to start your own blog website, the best choice for a blog application would be WordPress. Wordpress is an Open Source blog tool which offers a rich set of features as well as a large supporting community.WordPress has an intuitive administration interface which anyone can handle. In WordPress you will be able to compose a post and publish it on your website with just a few clicks! With WordPress you can easily customize the look of your website for there are lots of free WordPress themes available on the Net.

















Installation of Word Press :
We will download the latest version of Word Press from this below URL.
http://wordpress.org/ 
Place your Word Press folder in your project directory.If We run your project from browser , it will ask to configure.The installation process of Word Press is as below.



Please give your database details here.

































Please enter your Username and Password and Login to the admin side.








This is your back end of Word Press site. If we want to check the site front end, run your project from browser or else mouse over on wordpress on the top bar you will get visit site option click on it. You will get ,your site front end.








This is your site default theme . According to theme our site look will be changed. Before going to operate in Word Press, we should know what is theme and how we can activate the theme.
The folder structure of Word Press is as below:
Project(your wordpress project )
wp-admin
wp-content
wp-includes
(Files)
In  wp-content  folder we have Plugins and  themes folders. In themes  folder we  have twentyten and twentyeleven folders.These are the default themes available with Word Press.
















Theme:
A Word Press Theme is a collection of files that work together to produce a graphical interface with an underlying unifying design for a weblog. These files are called template files. A Theme modifies the way the site is displayed, without modifying the underlying software. Themes may include customized template files, image files (*.jpg,*.gif), style sheets (*.css), custom Pages, as well as any necessary code files (*.php). 

Get New Themes:
The Word Press Theme Directory's the official site for Word Press Themes which have been checked and inspected, and are free for downloading. The site features the ability to search by type and style, and offers a demonstration of the page view elements of the Theme.

Using Themes:
WordPress supplies a default theme (WordPress Twenty Eleven theme) in its distribution for your initial use. You can switch between Themes using the admin panel. Themes that you add to the theme directory will appear in the Administration Panels>Design>Themes as additional selections.You can select your own theme and activate it.We have different ways to post your content  in our website.
Defaultly  Twenty Eleven theme is activated.








Default Types in Word Press:

There are five major types that Word Press uses by default. 
Post :
A "post" in Word Press is the main type used by the blog. Posts are normally displayed in the blog in reverse sequential order by time (newest posts first). Posts are also used for creating the feeds. 

Page :
A "page" in Word Press is like a post, but it lives outside the normal time based structure of posts. They have their own URLs directly off the main site URL. They can also use special Page Templates to display them. Pages can also be organized in a hierarchical structure, with Pages being parents to other Pages. 

Attachment: 
An "attachment" is a special post that holds information about files uploaded through the Media upload system. They hold all the description and name and other information about uploaded files. For images, this is also linked to metadata information about the size of the images and thumbnails generated from the images, the location of the files, and even information obtained from EXIF data embedded in the images. 

Revisions:
A "revision" is used to hold draft posts as well as any past revisions of existing posts or pages. These are basically identical to the main post/page that they are for, but have that post/page as their parent. 

Nav Menus: 
The "nav_menu_item" type holds information about a single item in the Navigation Menu system. These are the first examples of entries in the posts table to be used for something other than an otherwise displayable content on the blog. 



Admin Dashboard:

1)Post :Posts are the entries that display in reverse chronological order on your home page. Creating the post in wordpress.







Descriptions of Post Fields:       
Title:

The title of your post. You can use any words or phrases. Avoid using the same title twice as that will cause problems. You can use commas, apostrophes, quotes, hypens/dashes, and other typical symbols in the post like "My Site - Here's Lookin' at You, Kid." Word Press will clean it up for the link to the post, called the post-slug. 
Post Editing Area:

The blank box where you enter your writing, links, links to images, and any information you want to display on your site. You can use either the Visual or the HTML view to compose your posts. For more on the HTML view, see the section below, Visual Versus HTML View. 

Preview button:

Allows you to view the post before officially publishing it. Publish box contains buttons that control the state of your post. The main states are Published, Pending Review, and Draft. 
A Published status means the post has been published on your blog for all to see. Pending Review means the draft is waiting for review by an editor prior to publication.
 Draft means the post has not been published and remains a draft for you. 
If you select a specific publish status and click the update post or Publish button, that status is applied to the post.
For example, to save a post in the Pending Review status, select Pending Review from the Publish Status drop-down box, and click Save As Pending. (You will see all posts organized by status by going to Posts > Edit). To schedule a post for publication on a future time or date, click "Edit" in the Publish area next to the words "Publish immediately". You can also change the publish date to a date in the past to back-date posts. Change the settings to the desired time and date. You must also hit the "Publish" button when you have completed the post to publish at the desired time and date. 


Visibility - This determines how your post appears to the world. Public posts will be visible by all website visitors once published. Password Protected posts are published to all, but visitors must know the password to view the post content. Private posts are visible only to you (and to other editors or admins within your site) 
Permalink:

After you save your post, the Permalink below the title shows the potential URL for the post, as long as you have permalinks enabled. (To enable permalinks, go to Settings > Permalinks.) The URL is generated from your title. In previous versions of WordPress, this was referred to as the "page-slug." The commas, quotes, apostrophes, and other non-HTML favorable characters are changed and a dash is put between each word. If your title is "My Site - Here's Lookin' at You, Kid", it will be cleaned up to be "my-site-heres-lookin-at-you-kid" as the title. You can manually change this, maybe shortening it to "my-site-lookin-at-you-kid". 
Save:

Allows you to save your post as a draft / pending review rather than immediately publishing it. To return to your drafts later, visit Posts - Edit in the menu bar, then select your post from the list. 
Publish:

Publishes your post on the site. You can edit the time when the post is published by clicking the Edit link above the Publish button and specifying the time you want the post to be published. By default, at the time the post is first auto-saved, that will be the date and time of the post within the database. 

Post Tags:

Refers to micro-categories for your blog, similar to including index entries for a page. Posts with similar tags are linked together when a user clicks one of the tags. Tags have to be enabled with the right code in your theme for them to appear in your post. Add new tags to the post by typing the tag into the box and clicking "Add". 



Categories:

The general topic the post can be classified in. Generally, bloggers have 7-10 categories for their content. Readers can browse specific categories to see all posts in the category. To add a new category, click the +Add New Category link in this section. You can manage your categories by going to Posts > Categories. 
Excerpt:

A summary or brief teaser of your posts featured on the front page of your site as well as on the category, archives, and search non-single post pages. Note that the Excerpt does not usually appear by default. It only appears in your post if you have changed the index.php template file to display the Excerpt instead of the full Content of a post. If so, Word Press will automatically use the first 55 words of your post as the Excerpt or up until the use of the More Quick tag mark. If you use an Explicit Excerpt, this will be used no matter what. For more information, see Excerpt. 

Send Trackbacks:

A way to notify legacy blog systems that you've linked to them. If you link other WordPress blogs, they'll be notified automatically using pingbacks. No other action is necessary. For those blogs that don't recognize pingbacks, you can send a trackback to the blog by entering the website address(es) in this box, separating each one by a space. See Trackbacks and Pingbacks for more information. 
Custom Fields:

Custom_Fields offer a way to add information to your site. In conjunction with extra code in your template files or plugins, Custom Fields can modify the way a post is displayed. These are primarily used by plugins, but you can manually edit that information in this section. 
Discussion:

Options to enable interactivity and notification of your posts. This section hosts two check boxes: Allow Comments on this post and Allow trackbacks and pingbacks on this post. If Allowing Comments is unchecked, no one can post comments to this particular post. If Allowing Pings is unchecked, no one can post pingbacks or trackbacks to this particular post. 


Password Protect This Post:

To password protect a post, click Edit next to Visibility in the Publish area to the top right, then click Password Protected, click Ok, and enter a password. Then click OK. Note - Editor and Admin users can see password protected or private posts in the edit view without knowing the password. 
Post Author:

A list of all blog authors you can select from to attribute as the post author. This section only shows if you have multiple users with authoring rights in your blog. To view your list of users, see Users tab on the far right. 
         WordPress Admin Writing Post Advanced Panel - Bottom of Page
   Note: You can set basic options for writing, such as the size of the post box, how    smiley tags are converted, and other details by going to Settings > Writing. See    Writing Options SubPanel. 












Process for creating Posts:



If we click on publish , our post will be published in our site. If we see in our site, it will  visible like below image. The theme Is twenty eleven theme.




















2) Media  in Administrative  panel:
Media is the images, video, recordings, and files, you upload and use in your blog. Media is typically uploaded and inserted into the content when writing a Post or writing a Page. 


3) Links  in Administrative  panel:
WordPress allows you to store a set of external links, also known as your blogroll. These links can be put into categories, imported, exported, added, deleted, and edited. The link categories can also be added, deleted, and edited. 


4) Pages:
In WordPress, you can write either posts or pages. When you're writing a regular blog entry, you write a post. Posts automatically appear in reverse chronological order on your blog's home page. Pages, on the other hand, are for content such as "About Me," "Contact Me," etc. Pages live outside of the normal blog chronology, and are often used to present information about yourself or your site that is somehow timeless -- information that is always applicable. You can use Pages to organize and manage any amount of content.Other examples of common pages include Copyright, Legal Information, Reprint Permissions, Company Information, and Accessibility Statement. In general, Pages are very similar to Posts in that they both have Titles and Content and can use your site's Presentation Templates to maintain a consistent look throughout your site. Pages, though, have several key distinctions that make them quite different from Posts.









Difference between page and post:
Posts: Pages:
We  can  categorize the posts. We cant categorize the pages.
We are unable to  use templates to display posts.      We can use templates to display posts.
Posts are mainly for blogs.      Pages are mainly for static type data.

5)Appearance:    
In appearance tab we have options like ,
Themes,
widgets,
Menus,
Theme Options,
Background,
Header,
Editor.






















Creating the  Menus in Word Press:
Go to Appearance tab from administrative panel  then  click on menus option.
Give your name of the menu in “menu name” text box.















I have given ' menu1' as menu name.
You can call the menu in your template files  with menu name (menu1) .
Now we are going to start creating a menu.
I will create 'About Us','Services','Solutions' as  menu items.
Go to “Custom links”  box and give your label name as 'About Us', and give the URL.
And click on Add to Menu. It will add to “menu1”.
In the same way you create 'Services' and 'solutions' menu items.
After creating menu items please click on Save Menu buttons. It will save Menu and Menu Items. It will be as like below figure.

We can call  this menu in our required template files by  using the method  wp_nav_menu().
To call this “menu1” we need to  give arguments to that method as like below.
wp_nav_menu(array('menu' => 'menu1'));




You can find our custom menu(menu1)  in the image above.To give sub menu  you just add menu links and drag to right side of to which menu you want to add this as sub menu. Then click on save menu.For example If you want to create 2 sub menus  for “About Us” link I.e  “Company Overview” and ”Vision and Mission”.
The procedure as shown below.















You can observe sub menus  under the “About Us” menu tab. If we want to add any link to that “About Us” we need to create a page.











Creating pages in Word Press:
To create a new Page, log in to your WordPress installation with sufficient admin privileges to create new articles. Select the Administration > Pages > Add New option to begin writing a new Page. 



I just created “about us”  page and publish it. We will get the permalink below that title of page. If you observe page attributes box  at right side of your administrative panel,
you can find  template select box.You can use any template to display the page content of “about-us”.We can organize our page content using templates.If we want to show our page content as per client requirement,by using template file only we can arrange content  in a specific way. For that purpose we need to place our html code in our template files.

If you check permalink of “aboutus” then we will get the page as shown in the below image.
Permalink of “aboutus” page is :  http://localhost/wordpress/about-us/ 


If we select different template from template drop down, then this “aboutus” page look will  change according to that template html code.I will explain how to use templates to display page type post contents.Before that I will explain what is template.


Template:
Templates are the files which control how  your WordPress site will be displayed on the Web. These files draw information from your WordPress MySQLdatabase and generate the HTML code which is sent to the web browser. Through its powerful Theme system, WordPress allows you to define as few or as many Templates as you like all under one Theme. Each of these Template files can be configured for use under specific situations .





Creating a template in Word Press :
 Create a file with php extension and give the required name for that file.
I want to create a “aboutus” name template. So that I create a php file in our theme directory and given name as aboutus.php.If you create any template you should mention comments for that template.
<?php
/*
 Template Name:AboutUs
 */
?>

If you don't mention the comments, then you dont get your template name  in page attributes of template select box.You can observe “AboutUs” template name in template drop downs in  page attributes section .Please select “AboutUs”  template from that template drop down.





















This means we are using ' About us'  template to display that post .Click on update for the post .Now we copy the permalink of “About-us” post and paste in the URL then we will find updated post like  as shown in the below image.


In the “aboutus” template we don't have any html code , so that we are getting plain content with any design.If you want to add any design for this content, then  we need to add html code in our   “about-us” template. In the above image we are getting page title as “About us” 
and content based on this following code.






<?php
/*
 Template Name:AboutUs
 */
?>
<?php 
if(have_posts()){
while(have_posts()) {
the_post();
the_title();
the_content();
}
}
?>

Upto now we don't have any header and footer to our template , so we are including header and footer in our template file .
The following two methods to display the header and footer in our template.
get_header();
get_footer();

If we add these two  methods to our template, then these methods automatically  includes header.php and footer.php template files  into our aboutus.php template file.

Now our template file looks like below:
<?php
/*
 Template Name:AboutUs
 */
get_header();
?>
<?php 
if(have_posts()){
while(have_posts()) {
the_post();
the_title();
the_content();
}
}
?>
<?php  get_footer();?>


Now our  “About-us”page looks like below,



In Word Press for every template you need to add header and footer .We can change beauty of our website by changing the theme. If we want to call this “about us” page as a menu , then we need to give this permalink as URL to that menu item.












Widget:

WordPress Widgets are WordPress Plugins that add visitor visual and interactivity options and features, such as sidebar widgets for post categories, tag clouds, navigation, search, etc. They were originally designed to provide a simple and easy-to-use way of giving design and structure control of the WordPress Theme to the user in the sidebar, which is now available on properly "widgetized" WordPress Themes to include the header, footer, and elsewhere in the WordPress design and structure. 
Widgets require no code experience or expertise. They can be added, removed, and rearranged on the WordPress Administration Appearance > Widgets panel. The order and placement is set by the WordPress Theme in the functions.php file. 
Some WordPress Widgets offer customization and options such as forms to fill out, includes or excludes of data and information, optional images, and other customization features. 













To active your WordPress Theme Widget options: 

1.1Go to Appearance > Widgets.

1.2Choose a Widget and drag it to the sidebar where you wish it to appear. There might be more than one sidebar option, so begin with the first one. Once in place, WordPress automatically updates the Theme.
1.3Preview the site. You should find that the "default" sidebar elements are now gone and only the new addition is visible. 
1.4Return to the Widgets Panel to continue adding Widgets.
1.5To arrange the Widgets within the sidebar or Widget area, click and drag it into place. 
1.6To customize the Widget features, click the down arrow in the upper right corner to expand the Widget's interface.
1.7To remove the Widget, click Remove or Delete. 

If you change WordPress Themes, the Widgets will return to the left side of the page in the Widget Archives or Available Widgets list. You may need to add them again and rearrangement depending upon the Theme's ability to preserve other Theme's Widgets. 










Custom Side Bar creation :
Custom Sidebars allows you to create all the widgetized areas we need .
Sometimes it is necessary to show different elements on the sidebars for some posts or pages. 
If we want to create a custom side bar ,then we need to add little bit of code in our functions.php file.
Example : 
function section_one() { 
register_sidebar(array(
'name' => __( 'SectionOne', 'tempaltename' ),
'id' => 'SectionOne',
'description' => __( 'SectionOne', 'tempaltename' ),
'before_widget' => '<div>',
'after_widget' =>'</div>',
'before_title' => '<h2>',
'after_title' => '</h2>',
));
}

add_action( 'widgets_init', 'section_one');

In the above array we have 'name' => __( 'SectionOne', 'tempaltename' ).
Here name have two parameters.

1.”SectionOne”  is our custom sidebar name(position name).
2.”tempaltename”  is our template name.

before_widget,after_widget,before_title,after_title are the parameters for CSS. We will give css as  input, for these fields.

Finally we need to register this sidebar. For that purpose we are using :
add_action( 'widgets_init', 'section_one');

Now we have done our custom side bar creation. Now we need to call this side bar in to our web pages. If suppose we need this custom side bar in our index.php ,then just we will call like bellow:

<?php dynamic_sidebar('SectionOne');?>

Custom Widget Creation :

Wordpress Widget is also a plugin. So if we want to create a  Custom widget,then we need to create folder in Wordpress plugin folder.

Suppose if we want to create  a widget with the name of “example-widget”,then we need to create  a folder in plugin loctaion.

Like :  wp-content\plugins\example-widget

In this folder we have  file with the name of  “ example-widget.php”

The top of your Plugin's main PHP file must contain a standard Plugin information header. This header lets WordPress recognize that your Plugin exists, add it to the Plugin management screen so it can be activated, load it, and run its functions; without the header, your Plugin will never be activated and will never run. Here is the header format: 

<?php
/**
 * Plugin Name: Example Widget
 * Plugin URI: http://example.com/
 * Description: A widget that serves as an example for developing more advanced widgets.
 * Version: 0.1
 * Author: 
 * Author URI: 
 */
?>

Based  on this comment only wordpress will recognize this is a plugin.

Every widget have 4  mandatory  functions.

  1) Constructor ()
  2) Form()    : It is used to outputs the options form on admin
 3) Update() :  It is used to processes widget options to be saved
 4) Widget() :  It is used to outputs the content of the widget








“example-widget.php” file  :
<?php
/**
 * Plugin Name: Example Widget
 * Plugin URI: http://example.com/widget
 * Description: A widget that serves as an example for developing more advanced   widgets.
 * Version: 0.1
 * Author: 
 * Author URI: 
 */

/**
 * Add function to widgets_init that'll load our widget.
 * @since 0.1
 */
add_action( 'widgets_init', 'example_load_widgets' );

/**
 * Register our widget.
 * 'Example_Widget' is the widget class used below.
 *
 * @since 0.1
 */
function example_load_widgets() {
register_widget( 'Example_Widget' );
}

/**
 * Example Widget class.
 * This class handles everything that needs to be handled with the widget:
 * the settings, form, display, and update.
 *
 * @since 0.1
 */
class Example_Widget extends WP_Widget {

/**
* Widget setup.
*/
function Example_Widget() {
/* Widget settings. */
$widget_ops = array( 'classname' => 'example', 'description' => __('An example widget that displays a person\'s name and sex.', 'example') );

/* Widget control settings. */
$control_ops = array( 'width' => 300, 'height' => 350, 'id_base' => 'example-widget' );

/* Create the widget. */
$this->WP_Widget( 'example-widget', __('Example Widget', 'example'), $widget_ops, $control_ops );
}

/**
* How to display the widget on the screen.
*/
function widget( $args, $instance ) {
extract( $args );

/* Our variables from the widget settings. */
$title = apply_filters('widget_title', $instance['title'] );
$name = $instance['name'];
$sex = $instance['sex'];
$show_sex = isset( $instance['show_sex'] ) ? $instance['show_sex'] : false;

/* Before widget (defined by themes). */
echo $before_widget;

/* Display the widget title if one was input (before and after defined by themes). */
if ( $title )
echo $before_title . $title . $after_title;

/* Display name from widget settings if one was input. */
if ( $name )
printf( '<p>' . __('Hello. My name is %1$s.', 'example') . '</p>', $name );

/* If show sex was selected, display the user's sex. */
if ( $show_sex )
printf( '<p>' . __('I am a %1$s.', 'example.') . '</p>', $sex );

/* After widget (defined by themes). */
echo $after_widget;
}


/**
* Update the widget settings.
*/
function update( $new_instance, $old_instance ) {
$instance = $old_instance;

/* Strip tags for title and name to remove HTML (important for text inputs). */
$instance['title'] = strip_tags( $new_instance['title'] );
$instance['name'] = strip_tags( $new_instance['name'] );

/* No need to strip tags for sex and show_sex. */
$instance['sex'] = $new_instance['sex'];
$instance['show_sex'] = $new_instance['show_sex'];

return $instance;
}

/**
* Displays the widget settings controls on the widget panel.
* Make use of the get_field_id() and get_field_name() function
* when creating your form elements. This handles the confusing stuff.
*/
function form( $instance ) {

/* Set up some default widget settings. */
$defaults = array( 'title' => __('Example', 'example'), 'name' => __('John Doe', 'example'), 'sex' => 'male', 'show_sex' => true );
$instance = wp_parse_args( (array) $instance, $defaults ); ?>

<!-- Widget Title: Text Input -->
<p>
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e('Title:', 'hybrid'); ?></label>
<input id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>" style="width:100%;" />
</p>

<!-- Your Name: Text Input -->
<p>
<label for="<?php echo $this->get_field_id( 'name' ); ?>"><?php _e('Your Name:', 'example'); ?></label>
<input id="<?php echo $this->get_field_id( 'name' ); ?>" name="<?php echo $this->get_field_name( 'name' ); ?>" value="<?php echo $instance['name']; ?>" style="width:100%;" />
</p>

<!-- Sex: Select Box -->
<p>
<label for="<?php echo $this->get_field_id( 'sex' ); ?>"><?php _e('Sex:', 'example'); ?></label> 
<select id="<?php echo $this->get_field_id( 'sex' ); ?>" name="<?php echo $this->get_field_name( 'sex' ); ?>" class="widefat" style="width:100%;">
<option <?php if ( 'male' == $instance['format'] ) echo 'selected="selected"'; ?>>male</option>
<option <?php if ( 'female' == $instance['format'] ) echo 'selected="selected"'; ?>>female</option>
</select>
</p>

<!-- Show Sex? Checkbox -->
<p>
<input class="checkbox" type="checkbox" <?php checked( $instance['show_sex'], true ); ?> id="<?php echo $this->get_field_id( 'show_sex' ); ?>" name="<?php echo $this->get_field_name( 'show_sex' ); ?>" /> 
<label for="<?php echo $this->get_field_id( 'show_sex' ); ?>"><?php _e('Display sex publicly?', 'example'); ?></label>
</p>

<?php
}
}

?>


After that we will find this widget as a plugin in our Plugins section. So we will activate this plugin,then this widget will display in our widget's section.



Plugins: 

Plugins are tools which provide additional functionality to your application. To install a plugin you generally just need to put the plugin file into your 'wp-content/plugins' directory. Once a plugin is installed, you may activate it or deactivate it from the Plugins menu in your WP administration.

Plugin Installation process:






PlugIn Installation:
Generally the Plugin installation is a straight-forward process. In most cases it is enough to upload the plugin under the 'wp-content/plugins' directory for the WordPress installation and activate it from the administrator backend. 



The removal is also straight-forward in most cases. Simply remove the directory for the plugin you would like to uninstall and it will be automatically deactivated. 

Other wise First we need to “Deactivate” particular Plugin ,then we will get “delete” option for that plugin. By using that “Delete” link, we will uninstall that plugin.








Still always bear in mind that not all plugins are easy to install, so always refer to their documentation and installation instructions first. 






Custom Plugin Creation :

A WordPress Plugin is a program, or a set of one or more functions, written in the PHP scripting language, that adds a specific set of features or services to the WordPress weblog, which can be seamlessly integrated with the weblog using access points and methods provided by the WordPress Plugin Application Program Interface (API).


Plugin Name :
The first task in creating a WordPress Plugin is to think about what the Plugin will do, and make a (hopefully unique) name for your Plugin. Check out Plugins and the other repositories it refers to, to verify that your name is unique; you might also do a Google search on your proposed name. Most Plugin developers choose to use names that somewhat describe what the Plugin does; for instance, a weather-related Plugin would probably have the word "weather" in the name. The name can be multiple words. 


Plugin Files :
The next step is to create a PHP file with a name derived from your chosen Plugin name. For instance, if your Plugin will be called "Fabulous Functionality", you might call your PHP file fabfunc.php. Again, try to choose a unique name. People who install your Plugin will be putting this PHP file into the WordPress Plugin directory in their installation, wp-content/plugins/, so no two Plugins they are using can have the same PHP file name. 

Another option is to split your Plugin into multiple files. Your WordPress Plugin must have at least one PHP file; it could also contain JavaScript files, CSS files, image files, language files, etc. If there are multiple files, pick a unique name for a file directory and for the main PHP file, such as fabfunc and fabfunc.php in this example, put all your Plugin's files into that directory, and tell your Plugin users to install the whole directory under wp-content/plugins/. However, an installation can be configured for wp-content/plugins to be moved, so you must use plugin_dir_path() and plugins_url() for absolute paths and URLs. 











File Headers :
The top of your Plugin's main PHP file must contain a standard Plugin information header. This header lets WordPress recognize that your Plugin exists, add it to the Plugin management screen so it can be activated, load it, and run its functions; without the header, your Plugin will never be activated and will never run. Here is the header format: 

<?php
/*
Plugin Name: Name Of The Plugin
Plugin URI: http://URI_Of_Page_Describing_Plugin_and_Updates
Description: A brief description of the Plugin.
Version: The Plugin's Version Number, e.g.: 1.0
Author: Name Of The Plugin Author
Author URI: http://URI_Of_The_Plugin_Author
License: A "Slug" license name e.g. GPL2
*/
?>
The minimum information WordPress needs to recognize your Plugin is the Plugin Name line. The rest of the information will be used to create the table of Plugins on the Plugin management screen. The order of the lines is not important. 
Wordpress Plugin Hooks :
Many WordPress Plugins accomplish their goals by connecting to one or more WordPress Plugin "hooks". The way Plugin hooks work is that at various times while WordPress is running, WordPress checks to see if any Plugins have registered functions to run at that time, and if so, the functions are run. These functions modify the default behavior of WordPress. 
For instance, before WordPress adds the title of a post to browser output, it first checks to see if any Plugin has registered a function for the "filter" hook called "the_title". If so, the title text is passed in turn through each registered function, and the final result is what is printed. So, if your Plugin needs to add some information to the printed title, it can register a "the_title" filter function. 
Another example is the "action" hook called "wp_footer". Just before the end of the HTML page WordPress is generating, it checks to see whether any Plugins have registered functions for the "wp_footer" action hook, and runs them in turn. 
You can learn more about wordpress hooks from Plugin API

Saving plug in Data to the Data Base :
Most WordPress Plugins will need to get some input from the site owner or blog users and save it between sessions, for use in its filter functions, action functions, and template functions. This information has to be saved in the WordPress database, in order to be persistent between sessions. There are three methods for saving Plugin data in the database: 
Use the WordPress "option" mechanism (described below). This method is appropriate for storing relatively small amounts of relatively static, named pieces of data -- the type of data you'd expect the site owner to enter when first setting up the Plugin, and rarely change thereafter. 
Post Meta (a.k.a. Custom Fields). Appropriate for data associated with individual posts, pages, or attachments. See post_meta Function Examples, add_post_meta(), and related functions. 

Create a new, custom database table. This method is appropriate for data not associated with individual posts, pages, attachments, or comments -- the type of data that will grow as time goes on, and that doesn't have individual names. See Creating Tables with Plugins for information on how to do this.
For more information about custom plugin creation, please find the bellow link :http://codex.wordpress.org/Writing_a_Plugin











Sample custom Plugin :
First create a folder “myplugin”  in \wp-content\plugins\ .
In this folder we are creating “myplugin.php” file,with bellow code.
<?php
/*
Plugin Name: myplugin
Description: This plugin will replace “example” word  with  , in all posts
Version: 1.0
Author: Team
*/
function my_function($text)
{
$text = str_replace('example','',$text);
return $text;
}
add_filter('the_content','my_function');
?>

Now we need to go to  administrator panel and enable this plugin.This  add_filter() method have a hook  “the_content ”.If suppose in any posts we will display the content by using  “the_content”  method ,in that case  automatically the above “my_function” will execute.
      After that this plugin will replace the “example” word with “” in all posts.
     Before execution of this plug-in we have posts as shown in below image.After execution of          this plug-in we will get the posts as shown in below image.
















Before executing of Plugin:
















After execution of plugIn:








Reference websites:

http://wordpress.org/ 

http://codex.wordpress.org/ 


For Plug-ins:

http://wordpress.org/extend/plugins/