Thursday, August 25, 2011

How can We Create the custom page

Hello Friends,
Today I will give you some tips abot how to create custom page inside wordpress.
Follow these steps -
1. Opne any word editor.
2. Put this line on top of the page.

3. Put Some Html and and javascripts
{html}
{head}
{Title}{/title}
{/head}
{body}
{p}This is custome page{/p}
{/body}
{/html}
4. Save this file inside \wp-content\themes\{CURRENT THEME}
5. Now create page you see your page in Tempelate Drop down as your {template name}
Just Do it and Full Fill Your requirement.

Tuesday, August 23, 2011

Creation Of Drupal Module

Hello Friend,

I am back with new topic. This time I bring HOW TO CREATE DRUPAL custom module.

For creation of Drupal Module mailny we need two files first is .info and second is .module file.

Create a exapmle.info in your example folder. You may do so by using a notepad or any text editors. Copy the codes below

About example.info file

    ;$Id$

name = Test
description = Hello Kunal.
datestamp = "1202913006"

Description –

name (required)

The human readable name can now be set independently from the internal "machine" readable name. This imposes fewer restrictions on the allowed characters.

description (recommended)

A short description. This description is displayed on the module instll

core (required)

From 6.x onward, all .info files for modules and themes must indicate what major version of Drupal core they are compatible with.

Creation of .module

 
function example_help($section) {
  switch ($section) {
    case 'admin/modules#description':
      return t('This module implements an example form.');
  }
}
 
function example_menu($may_cache) {
  $items = array();
  if ($may_cache) {
    $items[] = array(
      'path' => 'example',
      'title' => t('Example'),
      'callback' => 'example_page',
      'access' => TRUE,
      'type' => MENU_CALLBACK
    );
  }
  return $items;
}
 
function example_page() {
  return drupal_get_form('example_page_form');
}
 
function example_page_form() {
  $form['fullname'] = array(
    '#type' => 'textfield',
    '#title' => t('Enter your full name'),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save'),
  );
  return $form;
}
 
function example_page_form_submit($form_id, $form_values) {
  $message = 'You have submitted the ' . $form_id . ' form which contains the following data:
' . print_r($form_values,true) . '
';
  drupal_set_message(t($message));
}
 
?>
 
After That Put your module inside examplesite/sites/all/modules/{your example  module}.
And Install Your module and make changes as yor wish. 
In my next post I will give you how to make install and unistall module and database access.

Friday, August 19, 2011

Through FCKeditor Image/any document goes to your desired folder

Hello Friends After a long time i put any changes on my blog. This time i have some some
tricks for fckeditors.
That is change in
FCKeditors/editors/filemanager/connectors/config.php

Step 1 -

$Config['Enabled'] = false ;
Change This line to
$Config['Enabled'] = true ;

Step 2 -

$Config['UserFilesPath'] = '/images/' ;
In my case my image folder is in my root. If you dont have this folder then it is created.

Step 3 -

$Config['UserFilesAbsolutePath'] = $_SERVER['DOCUMENT_ROOT'] . $Config['UserFilesPath'] ;

put this line for absolutepath.

Step 4 -

$Config['FileTypesPath']['Image'] = $Config['UserFilesPath'] . 'news/' ;
// Changes to desired folder name in my case news is
$Config['FileTypesAbsolutePath']['Image']= ($Config['UserFilesAbsolutePath'] == '') ? '' : $Config['UserFilesAbsolutePath'].'news/' ;

Change news to as subfolder name.
Thats It.......

Use FCK editor.And upload your images as your desired place.
When you want your uploaded images along with you text it have no problem. Use and Enjoy.