Code for tab in drupal.
This conditional statement controls the tabs.
if ($tabs = theme(‘menu_local_tasks’)) {
$output .= $tabs;
}
How to build joomla templates
Step 1:
Create a folder into the templates folder.This folder name must be the template name.
Step 2:
Create a folder named “style” for stylesheet,
Create a folder named “javascript” for javascript,
Create a folder named “images” for images,
Create a folder named “html” for components,
Create a file index.php into you template folder. After that copy and paste the following lines.
<?php
/**
* @copyright Copyright (C) 2005 – 2008 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
defined(‘_JEXEC’) or die(‘Restricted access’);
$url = clone(JURI::getInstance());
?>
Step 3: Copy and paste the follwing lines
<?php echo ‘<?xml version=”1.0″ encoding=”utf-8″?’.’>’; ?>
<!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” xml:lang=”<?php echo $this->language; ?>” lang=”<?php echo $this->language; ?>” dir=”<?php echo $this->direction; ?>” >
<head>
<jdoc:include />
<link href=”<?php echo $this->baseurl ?>/templates/<?php echo $this->template;?>/css/[your css].css” rel=”stylesheet” />
if any javascript file is needed, write the following lines
<script type=”text/javascript” src=”<?php echo $this->baseurl ?>/templates/<?php echo $this->template;?>/javascript/[your script].js”></script></head>
<body>
Step 4: For displaying primary links paste thi following codes into the appropriate <Div>
<jdoc:include type=”modules” style=”” />
Step 5:
For displaying your site content write the following code within appropriate <Div>
<jdoc:include type=”component” />
Step 6:
Colse all the opened html tag.
Pie chart using php
<?php
$myImage = ImageCreate(300,300);
$white = ImageColorAllocate ($myImage, 255, 255, 255);
$red = ImageColorAllocate ($myImage, 255, 0, 0);
$green = ImageColorAllocate ($myImage, 0, 255, 0);
$blue = ImageColorAllocate ($myImage, 0, 0, 255);
$lt_red = ImageColorAllocate($myImage, 255, 150, 150);
$lt_green = ImageColorAllocate($myImage, 150, 255, 150);
$lt_blue = ImageColorAllocate($myImage, 150, 150, 255);
for ($i = 120;$i > 100;$i–) {
ImageFilledArc ($myImage, 100, $i, 200, 150, 0, 90, $lt_red, IMG_ARC_PIE);
ImageFilledArc ($myImage, 100, $i, 200, 150, 90, 180, $lt_green, IMG_ARC_PIE);
ImageFilledArc ($myImage, 100, $i, 200, 150, 180, 360, $lt_blue, IMG_ARC_PIE);
}
ImageFilledArc($myImage, 100, 100, 200, 150, 0, 90, $red, IMG_ARC_PIE);
ImageFilledArc($myImage, 100, 100, 200, 150, 90, 180 , $green, IMG_ARC_PIE);
ImageFilledArc($myImage, 100, 100, 200, 150, 180, 360 , $blue, IMG_ARC_PIE);
header (“Content-type: image/png”);
ImagePNG($myImage);
ImageDestroy($myImage);
?>
Dynamic bar chart using php
<?php
header(“Content-type: image/jpeg”);
$data = array(‘3400′,’2570′,’245′,’473′,’1000′,’3456′,’780′);
$sum = array_sum($data);
$height = 255;
$width = 320;
$im = imagecreate($width,$height); // create width , height px of chart background
/* $background_color = imagecolorallocate($im, 0, 0, 0);
*/ $white = imagecolorallocate($im,255,255,255);
$black = imagecolorallocate($im,0,0,0);
$red = imagecolorallocate($im,255,0,0);
//create the X & Y axis lines.
imageline($im, 10, 5, 10, 230, $black);
imageline($im, 10, 230, 300, 230, $black);
$x = 15;
$y = 230;
$x_width = 20;
$y_ht = 0;
for ($i=0;$i<7;$i++){
$y_ht = ($data[$i]/$sum)* $height;
imagerectangle($im,$x,$y,$x+$x_width,($y-$y_ht),$red);
/* $colorHandle = imageColorAllocate($im, 225, 192, $i); // allocate color
imageFilledRectangle($im, $x,$y,$x+$x_width,($y-$y_ht), $colorHandle);// use it for drawing
*/
imagestring( $im,2,$x-1,$y+10,$data[$i],$black);
$x += ($x_width+20);
}
imagejpeg($im);
?>