Drupal is totally based on module I am also studying module and trying to implement module .
Here I am describing the custom module how to show your data by module .
For this you first have to make the the file for module info . I am making it by my name vikas.info
And put your module information on it by the following format
;$Id$
name = "Vikas module"
description = "this is fist vikas fisrst module"
core = 6.x
php = 5.1
Remember always save your custom module in site/all/module/
After making vikas.info file save it on above location in folder vikas
Now you have to make file for the module data now name the new file
As vikas.module and put the following data in it
<?php
// $Id$
/**
* @file
* Module for fetching data from Goodreads.com.
* This module provides block content retrieved from a
* Goodreads.com bookshelf.
* @see http://www.goodreads.com
*/
/**
* Implementation of hook_block()
*/
function vikas_block($op='list', $delta=0, $edit=array()) {
switch ($op) {
case 'list':
$blocks[0]['info'] = t('Goodreads Bookshelf');
return $blocks;
case 'view':
$blocks['subject'] = t('vikas');
$blocks['content'] = t('hello world ');
return $blocks;
}
}
Now you static module I studied it from book and for good read so not changing the info
Now go to your drupal admin panel and activate the module and from the block select the option for the block where you want to display .this module is compatible with drupal 6.x version
Hello friend you can easily make a simple widget by the given format
You have only to give you condition query for the particular data to display from your data base or you can easily set it in your wp side bar by dra and drop .
Code given below is
<?php
/*
Plugin Name: Per Page Post
Plugin URI: http://dhanjalsolution.com/
Description: per page Post widget
Author: Vikas Gautam
Version: 2
Author URI: http://dhanjalsolution.com/
*/
function sampleeventcategory()
{
$page_name="index.php"; // If you use this code with a different page ( or file ) name then change this
$start=$_GET['start'];
if(strlen($start) > 0 and !is_numeric($start)){
echo "Data Error";
exit;
}
$eu = ($start - 0);
$limit = 2; // No of records to be shown per page.
$this1 = $eu + $limit;
$back = $eu - $limit;
$next = $eu + $limit;
$pname = $_REQUEST['event'];
/// here you have to give your query and show your date or call data from data base
How to add the loader on submit button when submit:
If you want that when you click on login button then it show the other image of other color and then
Loader on its side
By using java script property onclick or by css property you can easily do this. You first have to download the images and name the same name for images as given or can chage accordingly .