Friday, October 15, 2010

Introducing Wordpress Theme

In the post Wordpress Admin Panel I have introduced about wordpress admin panel. In this post I will discuss about wordpress theme. Wordpress theme is a collection of files that work together to produce the graphical interface with an underlying design for the website.

Wordpress theme uses combination of three things.
A)Template Files.
B)Template Tags.
C)CSS Style Sheets.

A)Template Files: Template files are the files (building blocks) which come together to create the site. The header, sidebar, content, footer are all individual template files.

The following are the template files typically included within a Theme.

i) 404 Template = 404.php
ii) Archive Template = archive.php
iii) Archive Index Page = archives.php
iv) Comments Template = comments.php
v) Footer Template = footer.php
vi) Header Template = header.php
vii) Links = links.php
viii) Main Template = index.php
ix) Page Template = page.php
x) Popup Comments Template = comments-popup.php
xi) Post Template = single.php
x) Search Form = searchform.php
xi) Search Template = search.php
xii) Sidebar Template = sidebar.php

B) Template Tags: Template Tags are small piece of code which provide instructions and requests for information stored within the WordPress database. It instructs WordPress to "do" or "get" something. For example after login to wordpress Dashboard if you open template file header.php ( from Appearance>Editor) you will notice template tags like below.

Each of these template tags instructs wordpress to "do" or "get" something. Let's introduced with bloginfo temaplte tag with some parameters that it take.

1)Site Name : The bloginfo template tag with name parameter is used to display the site name that is set by admin via Settings> General subpanel.

2)Site Description : The bloginfo template tag with description parameter displays some descriptive sentence that says the blog/site about. Generally it is called tagline. This is set by admin via Settings> General subpanel.

3)Site url : The bloginfo template tag with url parameter is used to display the URL or website address for your WordPress site. This is set by admin via Settings> General subpanel.

4) Admin Email : bloginfo template tag with admin_email parameter is used to display email of the administrator.

5) Wordpress Version : The bloginfo template tag with version parameter display the version of WordPress you are using.

C)CSS Style Sheets: CSS Style Sheets make the things all together. With your css you can move the building block structures around, make your header very long, float the sidebar left or right. The css stylesheet instruction are found under style.css file.

Introducing Wordpress Admin Panel

After you install wordpress you will have an admin panel from where you have can manage wordpress. For example if your domain name is example.com and you install wordpress in the root directory then your wordpress admin panel url will be http://example.com/wp-admin/. After you login as admin you will have Dashboard.

In this post I will discuss several wordpress sections that will make you
flexible to work with wordpress.

In my wordpress 2.8 version following is the image from wordpress dashboard i.e
after logging to wordpress admin panel.

wordpress dashboard

We see, within wordpress-2.8 dashboard we have several sections of,

1) Posts
2) Media
3) Links
4) Pages
5) Comments
6) Appearance
7) Plugins
8) Users
9) Tools
10)Settings.

If we expand each of the sections it will look like following image.

wordpress admin panel


The rest part of screenshot,


Now let's briefly familiarize with the each section.

1) Posts: From Posts
section you can add your new blog posts, edit posts, add post tags, add
categories etc. In order to manage main contents of your website you have to
deal with Posts section.

2) Media: Media indicates
the images, video, recordings files etc. From Media section inside wordpress,
you can these upload these documents inside your blog. Media is typically
uploaded and inserted into the content when writing a Post or Page. The Media
Library SubPanel allows you edit, delete or view Media previously uploaded to
your blog.

3) Links: From the Links
section of your wordpress you can add interesting links to your site so that
people can navigate those links from your blog. The Links Edit SubPanel
allows you to select the Links to edit or delete. The Links Add
New
SubPanel handles the creation of new links. The Links Link
Categories
SubPanel allows
you to add, edit, and delete Link Categories, as well as organize your Link
Categories hierarchically.

4) Pages: The Pages
section in wordpress is for adding static content to wordpress site. This is
like "About Us", "Contact Us", "Company Info"
information that merely changes. The Pages Edit SubPanel
provides the necessary tools to edit, delete, and view existing Pages. The
"Add New" Page SubPanel allows you to create new Pages.

5) Comments: In a blog
comments allow users to respond to a post. Through wordpress Comments section
you edit, delete and mark comments as spam. Comments that are awaiting
moderation can be marked as approved or previously approved comments can be
unapproved.

6) Appearance: From
Appearance section in wordpress you can control how the contents of your site
will be displayed. You can change the style of your site by installing, editing,
activating themes. A Theme is the overall design of a site and encompasses
color, graphics, and text.

From Themes subpanel you can check your current theme and available theme installed in our wordpress.

From Add New Themes subpanel you can check for themes by keyword, author, or tag. Through Feature Filter you can filter and check variable themes. You can Install and Preview themes through this subpanel and then activate themes for your wordpress.

Widgets are gadgets which allow you to add various pieces of information to your Theme's sidebar content.
Just like as I add various piece of information like Recent Post, Recent Comments, Add Categories, Archives, Blogroll, to my sidebar. Through Widgets just drag widgets from widgets left pane to a sidebar on the right to activate them. If you want to deactivate them just Drag widgets back to left side from the right side.

From the Editor subpanel of the Appearance section you can edit the various files that comprise your
Themes. In the Appearance section Editor SubPanel allows you to designate which theme you want to edit then displays the files in that theme. Each file (Template and CSS) in the theme can be editted in the large text box.

7) Plugins: Plugins allow
users add new features to the WordPress site that don't come with the default installation.

The Plugins Installed SubPanel allows you to manage plugins that is to view the plugins you've downloaded and
choose which plugins you activated on your site.

The Plugins Add New SubPanel allows you to add new plugins.

The Plugins Editor SubPanel, you can modify the source code of all your plugins.

8)Users: Whenever you
install wordpress you have by default admin user.

Via "Users and Authors" you can change a assign a user to the Roles:
Administrator, Editor, Author, Contributor, or Subscriber.

Via Users Add New SubPanel you can manually create user and then assign them to various roles.

From Users Your profile SubPanel name, contact info and other information can be changed.

9)Tools: Tools sections
in wordpress provide you the ability to speed up WordPress for your local machine, import content from other sources, backup your content, or to upgrade your WordPress software to a new release.

The Turbo ability, adds new features to your web browser and speeds up WordPress for the local computer user.

The Press This function allows quick posting and publishing through the use of a special web browser
favourite.

With Tools Import posts, comments, pages, categories, tags, and users, can be imported.

With WordPress Tools "Export" SubTool you can create an XML file to your computer. The format, which is called a WordPress eXtended RSS or WXR file, will contain your posts, comments, custom
fields, categories, and tags. This Export SubTool Take note that the Exporting is a useful method to backup your WordPress data.

The Tools Upgrade SubPanel give you a easy method to upgrade.

10) Settings: The Settings section determine how your site behaves, how you interact with your
site, and how the rest of the world interacts with your site.

The Settings General SubPanel allow you to change Title, tagline, blog address, admin email address, who can
register to site, date and time format etc.

With the Settings Writing SubPanel, you can control the interface with which you write new posts.

With the Settings Reading SubPanel, you can decide if you want posts, or a "static" Page, displayed as
your blog's front (main) page. You can also adjust how many posts are displayed on that main page.

With the Settings Discussion SubPanel allows you to control settings concerning incoming and outgoing comments, pingbacks and trackbacks.

With the Settings Media SubPanel you can determine where images, documents, and other media files will be linked to when inserted into the body of a post, specify dimension of the image.

With the Settings Privacy SubPanel you can determine whether your blog to be visible to everyone, including search engines (Google, Technorati etc).

With the Settings Permalinks SubPanel controls how that custom URL structure is defined.

With the Settings Miscellaneous SubPanel you can control the location of file uploads, uploads into month and year based folders, link tracking.


How to install wordpress

Step 01: Download the latest version of wordpress from http://wordpress.org/download/.
You will find both .zip and .tar.gz as downloadable format. Choose one of them
and then unzip wordpress.

Step 02: The next step is to create a database and a user for wordpress.

You can use cpanel mysql database to create a database and mysql user and then
add permission the user to use the database.

Also you can use phpmyadmin user interface to create your WordPress username and
database.

Mysql client can also be used if you are comfortable to use shell or command
line tool. Using mysql client,

i) Login to mysql client.

$ mysql -u root -p

ii)Create a database named wordpress.

mysql> CREATE DATABASE wordpress;

iii)Create a user name wp_userand assign privilege to use wordpress database.

mysql> GRANT ALL PRIVILEGES ON wordpress.* TO "wp_user"@"localhost"
IDENTIFIED BY "password";

iv) Flush the privileges

mysql> FLUSH PRIVILEGES;
mysql> EXIT

Step 03: Set up wp-config file.

You can either create and edit the wp-config.php file yourself, or you can skip
this step and let WordPress try to do this itself. If you let wordpress to
create you still need to provide database name, database user and password to
wordpress.

If you want to manually edit the wp-config file first rename the file
wp-config-sample.php to wp-config.php and then change the value of DB_NAME,
DB_USER, DB_PASSWORD and DB_HOST to adapt the changes.

Step 04: Upload these file to Server.

After extracting and doing changes upload/ftp the extracted changed Wordpress
file to the server in the location where you want to install wordpress. You can
install on root directory or in subdirectory.

If you have shell access in your unix server hosting then you can use "wget"
command to download the zip or .tar.gz file from wordpress website and then
using "unzip" or "tar" tool you can extract the files. Then
using "vi" editor you can edit wp-config file in server or let
wordpress to create one.

Step 05: Run the Install Script.

Open the WordPress installation script by accessing wp-admin/install.php in your
web browser.

If you copied WordPress files in the root directory, open http://example.com/wp-admin/install.php
in your browser.

If WordPress can't find the wp-config.php file, it will tell you and offer to
try to create and edit the file itself. (You can do also do this directly by
loading wp-admin/setup-config.php in your web browser.)

If you want to install WordPress in a subdirectory called wpblog, open link like
http://example.com/wpblog/wp-admin/install.php

GUI window will appear and fill the form as it asked. Like your blog title,
email.

That's all about wordpress installation. Open your site by visiting index.php


Friday, October 23, 2009

How to determine OS block size for windows or unix


In many times you probably have heard about set the oracle db block size as a multiple of the OS block size. But whenever you ask how I can determine or find OS block size for windows or Unix then many one get stopped. In fact this question is OS related. In this post I will show how I can get OS block.

1)UNIX or Linux System.
On my Solaris Machine,
SQL> !perl -e '$a=(stat ".")[11]; print $a'
8192
On my debian Linux,
$ perl -e '$a=(stat ".")[11]; print $a'
4096

On my Solaris Machine another way,
SQL> !df -g /oracle
/oracle (/dev/dsk/c1d0s3 ): 8192 block size 1024 frag size
Where /oracle is disk partition.

Another example,
SQL> !df -g | grep 'block size'
/ (/dev/dsk/c1d0s0 ): 8192 block size 1024 frag size
/devices (/devices ): 512 block size 512 frag size
/system/contract (ctfs ): 512 block size 512 frag size
/proc (proc ): 512 block size 512 frag size
/etc/mnttab (mnttab ): 512 block size 512 frag size
/etc/svc/volatile (swap ): 4096 block size 4096 frag size
/system/object (objfs ): 512 block size 512 frag size
/lib/libc.so.1 (/usr/lib/libc/libc_hwcap1.so.1): 8192 block size 1024 frag size
/dev/fd (fd ): 1024 block size 1024 frag size
/tmp (swap ): 4096 block size 4096 frag size
/var/run (swap ): 4096 block size 4096 frag size
/oradata1 (/dev/dsk/c1d0s4 ): 8192 block size 1024 frag size
/oracle (/dev/dsk/c1d0s3 ): 8192 block size 1024 frag size
/oradata2 (/dev/dsk/c1d0s5 ): 8192 block size 1024 frag size
/export/home (/dev/dsk/c1d0s7 ): 8192 block size 1024 frag size

2)Windows Machine.
If you use ntfs file system you can use
fsutil fsinfo ntfsinfo drivename: to get information of block size.

c:\>fsutil fsinfo ntfsinfo f:
NTFS Volume Serial Number : 0x1e345b64345b3e49
Version : 3.1
Number Sectors : 0x0000000004a852c0
Total Clusters : 0x0000000000950a58
Free Clusters : 0x00000000003ae433
Total Reserved : 0x0000000000000000
Bytes Per Sector : 512
Bytes Per Cluster : 4096 -- This is OS block size.
Bytes Per FileRecord Segment : 1024
Clusters Per FileRecord Segment : 0
Mft Valid Data Length : 0x000000000d72a000
Mft Start Lcn : 0x00000000000c0000
Mft2 Start Lcn : 0x00000000004a812c
Mft Zone Start : 0x0000000000800720
Mft Zone End : 0x000000000083b920

To get All possible size on windows machine use,
c:\ format /?
In the /A:size you will get the all possible size for both FAT and NTFS file system. Whenever you format a drive you can select default allocation unit as block size.

3)On HPUX issue like "vgdisplay -v /dev/vg01/lvol"