Thursday, December 13, 2007

tab view

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="padding:10px; vertical-align:top; padding-right:0px;">
<div><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td ><a href="#" onclick="show('details','block');show('quote','none');">Details</a></td>
<td ><a href="#" onclick="show('details','none');show('quote','block');">Quoted Projects</a></td>
</tr>
</table><div ><div id="details">
KKKKKKKKKKKKKKKKKKKK

</div>

<div id="quote" style="display:none">
UUUUUUUUUUUUUUUUUUUUUUU
</div>
</div>


<script type="text/javascript" language="javascript">

function show(id, visibility)
{
document.getElementById(id).style.display=visibility;
}
</script>

Powered by ScribeFire.

Calculating age from DOB:php

$age = strtotime(date("Y-m-d")) - strtotime($dob);
$age = round( $age/30758400);


Powered by ScribeFire.

Tuesday, December 04, 2007

pl/ sql:dbms_output.put_line

set serveroutput on



DECLARE

buffer VARCHAR2(100);

status INTEGER;

BEGIN

dbms_output.put_line('This is');

dbms_output.put_line('a test.');

dbms_output.get_line(buffer, status);

dbms_output.put_line('Buffer: ' || buffer);

dbms_output.put_line('Status: ' || TO_CHAR(status));

END;

/


Powered by ScribeFire.

Wednesday, November 28, 2007

linking parent and child with same table

SELECT a.menu_name, b.menu_name
FROM menu AS a, menu b
WHERE a.parent_id = b.menu_id

Powered by ScribeFire.

Monday, November 26, 2007

how to catch 404 in .htaccess

ErrorDocument 404 /notfound.html

Powered by ScribeFire.

Thursday, November 22, 2007

radio button validation

function valButton(btn) {
var cnt = -1;
for (var i=btn.length-1; i > -1; i--) {
if (btn[i].checked) {cnt = i; i = -1;}
}
if (cnt > -1) return btn[cnt].value;
else return false;
}

Powered by ScribeFire.

Saturday, November 17, 2007

This_month_first

This month first

Mysql-format
date("Y-m")."-1";
php
"1-".date("m-Y");

This year first
Mysql-format
date("Y")."-01-1";
php
"1-01-".date("Y");


Powered by ScribeFire.

day of the year

z - day of the year; i.e. "0" to "365", so:

$day_number=date("z");

This returns January 1 as being 0. If you want the day numbers to be
the usual 1-365 then you should use:

$day_number=date("z")+1;

Powered by ScribeFire.

Wednesday, November 14, 2007

get current url from php

echo $HTTP_SERVER_VARS["HTTP_HOST"] . $HTTP_SERVER_VARS["REQUEST_URI"];

Powered by ScribeFire.

Saturday, November 10, 2007

HAVING

SELECT column,SUM(column) FROM table
GROUP BY column
HAVING SUM(column)

Powered by ScribeFire.

Friday, November 09, 2007

now_in_mysql()

function now_in_mysql()
{
$sql="select NOW()";
$res=dbquery($sql,"single");
return($res[0]);
}

Powered by ScribeFire.

get_unix_time_stamp($timestamp)

function get_unix_time_stamp($timestamp)
{
$res=dbquery("SELECT UNIX_TIMESTAMP('$timestamp')","single");
return($res[0]);


}

Powered by ScribeFire.

add_date_with_today($days)

function add_date_with_today($days)
{

$sql="select DATE_ADD(CURRENT_DATE(),INTERVAL ".addslashes($days)." day)";


$dat=dbquery($sql,"single");
return(toUkDate($dat[0]));

}

Powered by ScribeFire.

Tuesday, October 30, 2007

load large image (on clicking small image)

<script type="text/javascript" language="javascript">
function view_im(img){
newwin=window.open('','printwin','left=100,top=100,width=800,height=800')
newwin.document.write('<HTML>\n<HEAD>\n')
newwin.document.write('<TITLE>Print Page</TITLE>\n')
newwin.document.write('</HEAD>\n')
newwin.document.write('<BODY>\n')
newwin.document.write('<table align="center"> <tr><td align="center" valign="middle">')
newwin.document.write("<img src='")
newwin.document.write('<?=constant('HTML_HOST_LINK')?>'+img)
newwin.document.write("' alt=''/>")
newwin.document.write("</td></tr></table>")
newwin.document.write('</BODY>\n')
newwin.document.write('</HTML>\n')
newwin.document.close()


}
</script>



Powered by ScribeFire.

Thursday, October 25, 2007

inserting blob data to mysql(Images,mp3....)using php

fileHandle = fopen($fileUpload, "r");

$fileContent = fread($fileHandle, $fileUpload_size);

$fileContent = addslashes($fileContent);
$dbQuery = "INSERT INTO myBlobs VALUES (0, '$strDesc', '$fileContent', '$fileUpload_type')";



mysql_query($dbQuery);



Powered by ScribeFire.

hack the password encryption in phpbb3


<?
function phpbb_hash($password)
{
$itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';

$random_state = unique_id();
$random = '';
$count = 6;

if (($fh = @fopen('/dev/urandom', 'rb')))
{
$random = fread($fh, $count);
fclose($fh);
}

if (strlen($random) < $count)
{
$random = '';

for ($i = 0; $i < $count; $i += 16)
{
$random_state = md5(unique_id() . $random_state);
$random .= pack('H*', md5($random_state));
}
$random = substr($random, 0, $count);
}

$hash = _hash_crypt_private($password, _hash_gensalt_private($random, $itoa64), $itoa64);

if (strlen($hash) == 34)
{
return $hash;
}

return md5($password);
}

function unique_id($extra = 'c')
{
static $dss_seeded = false;
global $config;

$val = $config['rand_seed'] . microtime();
$val = md5($val);
$config['rand_seed'] = md5($config['rand_seed'] . $val . $extra);

if ($dss_seeded !== true && ($config['rand_seed_last_update'] < time() - rand(1,10)))
{
$config['rand_seed_last_update']=time();
$dss_seeded = true;
}

return substr($val, 4, 16);
}
function _hash_crypt_private($password, $setting, &$itoa64)
{
$output = '*';

// Check for correct hash
if (substr($setting, 0, 3) != '$H$')
{
return $output;
}

$count_log2 = strpos($itoa64, $setting[3]);

if ($count_log2 < 7 || $count_log2 > 30)
{
return $output;
}

$count = 1 << $count_log2;
$salt = substr($setting, 4, 8);

if (strlen($salt) != 8)
{
return $output;
}

/**
* We're kind of forced to use MD5 here since it's the only
* cryptographic primitive available in all versions of PHP
* currently in use. To implement our own low-level crypto
* in PHP would result in much worse performance and
* consequently in lower iteration counts and hashes that are
* quicker to crack (by non-PHP code).
*/


$hash = pack('H*', md5($salt . $password));
do
{
$hash = pack('H*', md5($hash . $password));
}
while (--$count);


$output = substr($setting, 0, 12);
$output .= _hash_encode64($hash, 16, $itoa64);

return $output;
}
function _hash_gensalt_private($input, &$itoa64, $iteration_count_log2 = 6)
{
if ($iteration_count_log2 < 4 || $iteration_count_log2 > 31)
{
$iteration_count_log2 = 8;
}

$output = '$H$';
$output .= $itoa64[min($iteration_count_log2 + ((PHP_VERSION >= 5) ? 5 : 3), 30)];
$output .= _hash_encode64($input, 6, $itoa64);

return $output;
}

/**
* Encode hash
*/
function _hash_encode64($input, $count, &$itoa64)
{
$output = '';
$i = 0;

do
{
$value = ord($input[$i++]);
$output .= $itoa64[$value & 0x3f];

if ($i < $count)
{
$value |= ord($input[$i]) << 8;
}

$output .= $itoa64[($value >> 6) & 0x3f];

if ($i++ >= $count)
{
break;
}

if ($i < $count)
{
$value |= ord($input[$i]) << 16;
}

$output .= $itoa64[($value >> 12) & 0x3f];

if ($i++ >= $count)
{
break;
}

$output .= $itoa64[($value >> 18) & 0x3f];
}
while ($i < $count);

return $output;
}

function phpbb_check_hash($password, $hash)
{
$itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
if (strlen($hash) == 34)
{
return (_hash_crypt_private($password, $hash, $itoa64) === $hash) ? true : false;
}

return (md5($password) === $hash) ? true : false;
}

$val=phpbb_hash('admin123');

if(phpbb_check_hash("admin123", $val))
{
echo "Value is true";
}
else
{
echo "val is false";
}
#."<br>".phpbb_hash('admin123');

?>



get actual date from unix time(Mysql)

FROM_UNIXTIME(unix_timestamp),
FROM_UNIXTIME(unix_timestamp,format)


Returns a representation of the
unix_timestamp argument as a value
in 'YYYY-MM-DD HH:MM:SS' or
YYYYMMDDHHMMSS format, depending on whether
the function is used in a string or numeric context. The value
is expressed in the current time zone.
unix_timestamp is an internal
timestamp value such as is produced by the
UNIX_TIMESTAMP() function.



If format is given, the result is
formatted according to the format
string, which is used the same way as listed in the entry for
the DATE_FORMAT() function.


mysql> SELECT FROM_UNIXTIME(875996580);
-> '1997-10-04 22:23:00'


Powered by ScribeFire.

Monday, October 15, 2007

Browser detection in javascript

var browserName=navigator.appName; 
if (browserName=="Netscape")
{
alert("Hi Netscape User!");
}
else
{
if (browserName=="Microsoft Internet Explorer")
{
alert("Hi, Explorer User!");
}
else
{
alert("What ARE you browsing with here?");
}
}

Wednesday, August 29, 2007

get_rand_nos($max,$count)




function get_rand_nos($max,$count)
{
for($i=0;$i<$max;$i++)
{
$range[]=$i;
}
for($i=0;$i<$count;$i++)
        {
        $rand_list[]=$i;
        }
foreach($range as $re)
  {
  if(mt_rand(0,1))
        {
        $rand_list[mt_rand(0,$count-1)]=$re;
        }
}
return $rand_list;
}




Thursday, August 16, 2007

Image resize in php

createthumb($name)
{

$system=explode(".",$name);
if(preg_match("/jpg|jpeg|JPG|JPEG/",$system[1]))
{
$src_img=imagecreatefromjpeg($name);
}

else if (preg_match("/gif|GIF/",$system[1]))
{
$src_img=imagecreatefromgif($name);
}
else if (preg_match("/png|PNG/",$system[1]))
{
$src_img=imagecreatefrompng($name);
}



$old_x=imageSX($src_img);
$old_y=imageSY($src_img);
$x=$old_x;
$y=$old_y;
if($old_x>500)
{
$new_x=500;
$old_y=500*($old_y/$old_x);
$old_x=$new_x;
}
if($old_y>500)
{
$new_y=500;
$old_x=500*$old_x/$old_y;
$old_y=$new_y;
}


$dst_img=ImageCreateTrueColor($old_x,$old_y);

imagecopyresampled($dst_img,$src_img,0,0,0,0,$old_x,$old_y,$x,$y);




if (preg_match("/gif|GIF/",$system[1]))
{

imagegif($dst_img,$rootPath.$filename);

}
else if (preg_match("/png|PNG/",$system[1]))
{
$src_img=imagecreatefrompng($rootPath.$name);
}

else
{

imagejpeg($dst_img,$name);

chmod($name,0777);

}

imagedestroy($dst_img);

imagedestroy($src_img);

}

Tuesday, July 31, 2007

Simple AJAX script


function ajaxFunction(x)
  {
  var xmlHttp;
  try
    {
      xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
 
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }
   
    }
   
    xmlHttp.onreadystatechange=function()
      {
     
       if(xmlHttp.readyState==4)
           alert(xmlHttp.responseText);
   
       
      }
   
    xmlHttp.send(null);
    var url="http://localhost/sajjad/ajax.php"+"?q="+document.compose.recv.value;
   xmlHttp.open("GET",url,true);
  }

Wednesday, July 25, 2007

download a file withoutshowing its url

php program

header('Content-type: application/'.$fileext);
header('Content-Disposition: attachment; filename="'.$file_name.'"');
readfile("softwares/".$file_name);

MysqlWord searching

SELECT * FROM articles WHERE MATCH (title,body)
-> AGAINST ('*apple*' IN BOOLEAN MODE);

so that we would get back results:

appleby
appleseed
bigapple
redapple

Friday, June 29, 2007

Define a new block in drupal

open          "site_base"/ template/"template_name"/template.php
function themeName_regions()
{
return array(
"left"=>t("left sidebar"),
"right"=>t("right sidebar"),
"newRegion"=>t("human readable name for the region");
)

}

you must edit theme file(Especially page.tpl.php) for outputing  "newRegion"

Thursday, June 28, 2007

how to acces latest 6 youtube video

<?php $youtube_user="gave here ur user name; ?>
<a href='http://flashandburn.net/youtubeBadge/<?php echo $youtube_user ?>/goto'><img border="0" src=' http://flashandburn.net/youtubeBadge/<?php echo $youtube_user ?>/logo:1-color:000000/recent.png'></a>

Wednesday, June 27, 2007

first 10 fotos tagged as per ur search # same component in yahoo cities

<?php
require_once("phpFlickr.php");
// Create new phpFlickr object
$f = new phpFlickr("2d9926bbd0237c88d2a2f77c1e348f83");

$tag = $f->photos_search(array("tags"=>"kannur", "tag_mode"=>"any","per_page"=>7));
$total_flickrpage=$tag["pages"];
$tag =$f->photos_search(array("tags"=>"kannur", "tag_mode"=>"any","per_page"=>7,"page"=>rand(1,$total_flickrpage)));

$i=0;
while($i<(6))
$i=0;
while($i<20)
{

$farm=$tag["photo"][$i]["farm"];
$serv=$tag["photo"][$i]["server"];
$xid=$tag["photo"][$i]["id"];
$secre=$tag["photo"][$i]["secret"];

$p_url="http://farm".$farm.".static.flickr.com/".$serv."/".$xid."_".$secre."_s.jpg";
print $tag["photo"][i]["farm"];
$i=$i+1;
#print "<hr>http://farm{farm-id}.static.flickr.com/{server-id}/{id}_{secret}.jpg ";

print "<img border='0' src=".$p_url."> </img>";}


?>

--
regards

sajjad.c

Portal Theme

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
     
    <link rel="stylesheet" type="text/css" href="<? print base_path().path_to_theme()?>/ext/resources/css/ext- all.css" />
    
    <!-- LIBS -->     <script type="text/javascript" src="<? print base_path().path_to_theme()?>/ext/yui-utilities.js"></script>     <script type="text/javascript" src="<? print base_path().path_to_theme()?>/ext/ext- yui-adapter.js"></script>     <!-- ENDLIBS -->
 
    <script type="text/javascript" src="<? print base_path().path_to_theme()?>/ext/ext-core.js"></script>
    <script type="text/javascript" src="<? print base_path().path_to_theme()?>/ext/package/util.js"></script>
    <script type="text/javascript" src="<? print base_path().path_to_theme()?>/ext/package/tabs/tabs.js"></script>
 
    <!-- Tabs Example Files -->
  
 <script  language="javascript" type="text/javascript">

 
<?php
 $voc=taxonomy_get_vocabularies();

  foreach($voc as $vocab)
     {
          if($vocab->vid!=4)
        {
        print("\n var Tab".$vocab->vid."Example = { \n init : function() \n  {");
         print("\n var tab".$vocab->vid."= new Ext.TabPanel('tab".$vocab->vid."'); \n");
       $arrx=taxonomy_get_tree($vocab->vid, $parent = 0, $depth = -1, $max_depth = NULL);
        $activate=True;
       
      foreach ($arrx as $arry)
         {
          print("tab".$vocab->vid.".addTab('".$arry->name."','".$arry->name."'); \n");
         if($activate)
             {
             print("tab".$vocab->vid.".activate('".$arry->name."'); \n");
            $activate=False;
            }
         }
     print("}} \n Ext.EventManager.onDocumentReady(Tab".$vocab->vid."Example.init, Tab".$vocab->vid."Example, true); \n");
   

     }
    }
?>
 



</script>
 
    <!-- Common Styles for the examples -->
<style>

<?php
$voc=taxonomy_get_vocabularies();

 foreach($voc as $vocab)
    print("\n #tab".$vocab->vid." {width:400px;} \n #tab".$vocab->vid." .x-tabs-item-body {display:none;padding:10px; font-size: 15px}");

?>


</style>
<! -----------------------coding related to  Go  Flexible----------------------->
<title> <?php print $head_title ?> </title>
<?php print $styles ?>
</head>
<body>
<div id="wrap">
    <div id="header-section">
            <h1> <?php print $site_name ?> </h1>
            <img id="header-background-right" src=" http://localhost/~space/img/theyyam.jpg" alt=""/>
           
    </div>
<div id="header">
        <ul>
                    <li><a href=<?php print "'".$base_path."'"?>>Home</a></li>

             <li><a href=<?php print "'".$base_path."/?q=en/taxonomy/term/2'"?>>Woman</a></li>
            <li><a href=<?php print "'".$base_path."/?q=en/taxonomy/term/3'"?>>Employment</a></li>
                 </ul>
        </div>

<?php if($sidebar_left):?>
        <div id="left-column">
             <div id="treeDiv1"></div>
            <?php print $sidebar_left ?>
           
        </div>
    <?php endif;?>
<div id="middle-column">

<p>
 
 
 

<?php




    $voc=taxonomy_get_vocabularies();
    foreach($voc as $vocab)
    {
      print("<div id='tab".$vocab->vid."'>");
      $arrx=taxonomy_get_tree($vocab->vid, $parent = 0, $depth = -1, $max_depth = NULL);
      foreach ($arrx as $arry)
        {
        print( "<div id='".$arry->name."' class='tab-content'><ul>");
        $res=taxonomy_select_nodes(array($arry->tid), $operator = 'and', $depth = "all", $pager = TRUE, $order = ' n.created DESC');
        while( $ans=$res->fetch_array())
            {
            print("<li><a href='".$base_path."?q=en/node/$ans[nid]'> $ans[title]</a></li>");            }               
               
        print("</ul></div>");
        }
    print"</div>\n";
 }
   
?>           

   
      </div>
<?php if($sidebar_right):?>
         <div id="right-column">
           
                             <?php print $sidebar_right ?>
           
        </div>
    <?php endif; ?>    
<div id="footer">
            <?php print $footer_message ?>
    </div>
         

 
    
</body>
</html>
 

disable Directory listing


<Directory "directorypath">
Options -Indexes
Options FollowSymLinks
AllowOverride None
</Directory>

Thursday, June 21, 2007

How to reset drupal admin password


update users set pass=md5('NEWPASS') where uid = 1;

NB:admins user id is 1

Wednesday, June 20, 2007

Add type in Windows php


Add the line at the end as
    LoadModule php5_module "c:/php-5.0.2-Win32/php5apache2.dll"

Search for AddType and insert the following lines
    #AddType application/x-tar .tgz
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php .phtml .php
    AddType application/x-httpd-source .phps

Configure the path to php.ini
PHPIniDir "C:/php-5.0.2-Win32"
Start Apache Server
--
regards

sajjad.c

Sunday, June 17, 2007

Best joomla templates

open_business
JA Sabina
open_salon
vista
Warmish

Friday, June 01, 2007

Malayalam transilitation plug in for TinyMCE

Malayalam transilitation plug in for TinyMCE
---------------------------------

This plugin adds a à´…  button to TinyMCE.

1 Installation Instructions
-------------------------

1.1 for TinyMCE
-----------

   1. Copy the malayalam  directory to the plugins directory of TinyMCE (/jscripts/tiny_mce/plugins).
   2. Add plugin to TinyMCE plugin option list example: plugins : "malayalam".
   3. Add the button name to button list, example: theme_advanced_buttons3_add : "malayalam".


   1.1.a.Initialization Example
   ----------------------
    tinyMCE.init({
        theme : "advanced",
        mode : "textareas",
        plugins : "malayalam",
        theme_advanced_buttons3_add : "malayalam"
         });

1.2 for Drupal
------------
    1. Copy the malayalam  directory to the plugins directory of TinyMCE in drupal 
        drupal_directory/modules/tinymce/tinymce/jscripts/tiny_mce//plugins/

    2. edit drupal_directory/modules/tinymce/plugin_reg.php
         add this code snippet before  return $plugins;

        $plugins['malayalam'] = array();
        $plugins['malayalam']['theme_advanced_buttons2'] = array('malayalam');
    3  goto Administrator->siteconfiguration->TinyMCE
            edit any profile in the list
        in  buttons and plugins ,enable  à´… malayalam button



2.How to use
------------
    2.1 Basic application usage
    ----------------------------
    After installation malayalam  plug in,TinyMCE has two modes of typing . English mode and Malayalam mode. if u will click The à´… button, TinyMCE mode  is toggled between malayalam and english.
        This application used basic transilitation methode
          for keycombination  and other deatils
        http://adeign.googlepages.com/ilamozhi.html
    2.2 WYSIWYG Editor usage
    ------------------------
        Formatting done only  after all the text typed in TinyMCE
3. Bug Report and code modification
-----------------------------------
    3.0  space website(www.space-kerala.org)
    3.1  blog article for this plug in(http://lifekamazza.blogspot.com)
    3.2  through email( csajjad AT gmail.com)
4.License
---------
    Gnu Public License

firefox and IE on keyup

http://tinymce.moxiecode.com/punbb/viewtopic.php?id=6788

Wednesday, May 30, 2007

related article module in drupal

<?print "<h1><b><a href='".$node_url."'>".$title."</a></b></h1>" ?>
<?print $content ?>
<?php
$rr=array_keys($taxonomy);
$arr=array();
foreach( $rr as $val)
    {array_push($arr,$val[14]);}
print "<h6>Related article<h6><br><ol>";

$res=taxonomy_select_nodes($arr, $operator = 'or', $depth = "all"
, $pager = TRUE, $order = 'n.sticky DESC, n.created DESC');

while( $ans=$res->fetch_array())
{
print("<li><a href='http://localhost/~space/drupal/?q=en/node/ ".$ans[nid]."'>".$ans[title]."</a></li>");
}
print "</ol>" ;

?>

Wednesday, May 23, 2007

Monday, May 21, 2007

malayalam plug in for tinyMCE


 
tinyMCE.importPluginLanguagePack('template');
 
tinyMCE.importPluginLanguagePack('template');
var vowels = "(a(a|e|i|u)?)|(A|U|E|O|I|H)|(i(i)?)|(e(e|i)?)|(u(u)?)|(o(o|a|u)?)|(r~|r_|r |r`)|(R~|R_|R |R`)|(m_|m )|(n_|n )|(N_|N )|(l_|l )|(L_|L )|(_|~)"
 
var consonants = "(b(h)?)|(B(h)?)|(c(h(h)?)?)|(C(h)?)|(d(h)?)|(D(h)?)|(f|F)|(g(h)?)|(G)|(h)|(j(h)?)|(J(h)?)|(k(h)?)|(K)|(l)|(L)|(m|M)|(N(t)?)|(n(g|j|k|n|t(h)?)?)|(ph?)|(P)|(q)|(Q)|(r)|(R)|(s(h)?)|(S)|(t(t|h(h)?)?)|(T(h)?)|(v|V)|(w|W)|(x|X)|(y|Y)|(z(h)?)|(Z)"
 
var letter_codes = {
  "~a": "&#3333;",
  "~aa": "&#3334;", "~A": "&#3334;",
  "~i": "&#3335;",
  "~ee": "&#3336;", "~ii": "&#3336;", "~I": "&#3336;",
  "~u": "&#3337;",
  "~oo": "&#3338;", "~uu": "&#3338;", "~U": "&#3338;",
  "~r~": "&#3339;", "~R~": "&#3339;",
  "~e": "&#3342;",
  "~ae": "&#3343;", "~E": "&#3343;",
  "~ai": "&#3344;", "~ei": "&#3344;",
  "~o": "&#3346;",
  "~oa": "&#3347;", "~O": "&#3347;",
  "~au": "&#3348;", "~ou": "&#3348;",
  "~m_": "&#3330;", "~m ": "&#3330;&#160;", //anuswara
  "~H": "&#3331;",  //visarga
  "~n_": "&#3368;&#3405;&#8205;", "~n ": "&#3368;&#3405;&#8205;&#160;", //chillu
  "~N_": "&#3363;&#3405;&#8205;", "~N ": "&#3363;&#3405;&#8205;&#160;",
  "~l_": "&#3378;&#3405;&#8205;", "~l ": "&#3378;&#3405;&#8205;&#160;", 
  "~L_": "&#3379;&#3405;&#8205;", "~L ": "&#3379;&#3405;&#8205;&#160;",
  "~r_": "&#3376;&#3405;&#8205;", "~r ": "&#3376;&#3405;&#8205;&#160;", 
  "~R_": "&#3376;&#3405;&#8205;", "~R ": "&#3376;&#3405;&#8205;&#160;",
  "~_": "&#3405;&#8204;", //chandrakkala(Virama)
  "~~": "&#3405;&#8204;", //chandrakkala(Virama)
  "~r`": "&#3376;&#3405;&#8204;", //ra with anusvara
  "~R`": "&#3377;&#3405;&#8204;", //rra with anusvara
  
  "m_": "&#3330;",  "m ": "&#3330;&#160;&#8203;", //anuswara
  "H": "&#3331;",   //visarga
  "a": "",
  "*": "&#3405;",
  "aa": "&#3390;", "A": "&#3390;",
  "i": "&#3391;",
  "ee": "&#3392;", "ii": "&#3392;", "I": "&#3392;",
  "u": "&#3393;",
  "oo": "&#3394;", "uu": "&#3394;", "U": "&#3394;",
  "r~": "&#3395;", "R~": "&#3395;",
  "e": "&#3398;",
  "ae": "&#3399;", "E": "&#3399;",
  "ai": "&#3400;", "ei": "&#3400;",
  "o": "&#3402;",
  "oa": "&#3403;", "O": "&#3403;",
  "au": "&#3404;", "ou": "&#3404;",
  "n_": "&#3368;&#3405;&#8205;", "n ": "&#3368;&#3405;&#8205;&#160;", //chillu
  "N_": "&#3363;&#3405;&#8205;", "N ": "&#3363;&#3405;&#8205;&#160;", //chillu
   "l_": "&#3378;&#3405;&#8205;", "l ": "&#3378;&#3405;&#8205;&#160;", 
   "L_": "&#3379;&#3405;&#8205;", "L ": "&#3379;&#3405;&#8205;&#160;",
  "r_": "&#3376;&#3405;&#8205;", "r ": "&#3376;&#3405;&#8205;&#160;",
  "R_": "&#3376;&#3405;&#8205;", "R ": "&#3376;&#3405;&#8205;&#160;",
  "_": "&#3405;&#8204;", //chandrakkala(Virama)
  "~": "&#3405;&#8204;", //chandrakkala(Virama)
  "r``": "&#3376;&#3405;&#8204;", //ra with anusvara
  "R`": "&#3377;&#3405;&#8204;", //rra with anusvara
 
  "k": "&#3349;", "c": "&#3349;",
  "kh": "&#3350;", "q": "&#3350;", "Q": "&#3350;",
  "g": "&#3351;",
  "gh": "&#3352;",
  "ng": "&#3353;",
  "ch": "&#3354;", "C": "&#3354;",
  "chh": "&#3355;", "Ch": "&#3355;",
  "j": "&#3356;",
  "jh": "&#3357;",  "Jh": "&#3357;",
  "nj": "&#3358;",
  "T": "&#3359;",
  "Th": "&#3360;",
  "D": "&#3361;",
  "Dh": "&#3362;",
  "N": "&#3363;",
  "th": "&#3364;",
  "thh": "&#3365;",
  "d": "&#3366;",
  "dh": "&#3367;",
  "n": "&#3368;",
  "p": "&#3370;",
  "f": "&#3371;",  "ph": "&#3371;", "F": "&#3371;",
  "b": "&#3372;",
  "bh": "&#3373;",
  "m": "&#3374;",
  "y": "&#3375;",
  "r": "&#3376;",
  "l": "&#3378;",
  "v": "&#3381;",   "w": "&#3381;",
  "S": "&#3382;",   "z": "&#3382;",
  "sh": "&#3383;",
  "s": "&#3384;",
  "h": "&#3385;",
  "L": "&#3379;",
  "zh": "&#3380;",
  "R": "&#3377;",
  "mp": "&#3374;&#3405;&#3370;",
  "t": "&#3377;&#3405;&#3377;",
  "tt": "&#3359;&#3405;&#3359;",
  "nt": "&#3368;&#3405;&#3377;",
  "nth": "&#3368;&#3405;&#3364;",
  "nk": "&#3353;&#3405;&#3349;",
  "nn": "&#3368;&#3405;&#3368;",
  "Nt": "&#3363;&#3405;&#3359;",
  "B": "&#3372;&#3405;&#3372;",
  "G": "&#3351;&#3405;&#3351;",
  "J": "&#3356;&#3405;&#3356;",
  "K": "&#3349;&#3405;&#3349;",
  "M": "&#3374;&#3405;&#3374;",
  "P": "&#3370;&#3405;&#3370;",
  "V": "&#3381;&#3405;&#3381;", "W": "&#3381;&#3405;&#3381;",
  "x": "&#3349;&#3405;&#3383;", "X": "&#3349;&#3405;&#3383;",
  "Y": "&#3375;&#3405;&#3375;",
  "Z": "&#3382;&#3405;&#3382;"
  }

function split_word(word)
{
  var syllables = new Array(0);
  var vowel_start_p = true;
  while (word.length) {
    re = new RegExp(vowels);
    var index = word.search(vowels);
    if (index == 0) {  //the vowel's at the start of word
      var matched = re.exec(word)[0]; //what is it?
      if (vowel_start_p) {
    syllables.push(("~"+matched)); //one more to the syllables
      } else {
    syllables.push(matched);
      }
      vowel_start_p = true;
      word = word.substring(matched.length);
    } else {
      re = new RegExp(consonants);
      var index = word.search(consonants);
      if (index == 0) {
    var matched = re.exec(word)[0];
    syllables.push(matched);
    vowel_start_p = false;
    word = word.substring(matched.length);
 
    //look ahead for virama setting
    var next = word.search(vowels);
    if (next != 0 || word.length == 0)
      syllables.push('*');
      } else {
    syllables.push(word.charAt(0));
    word = word.substring(1);
      }
    }
  }
  return syllables;
}
 
function match_code(syllable_mcc)
{
  var matched = letter_codes[syllable_mcc];
 
  if (matched != null) return matched;
  return syllable_mcc;
}
 
function one_word(word_ow)
{
  if (!word_ow) return "";
  var syllables_ow = split_word(word_ow);
  var letters_ow = new Array(0);
 
  for (var i_ow = 0; i_ow < syllables_ow.length; i_ow++) {
    letters_ow.push(match_code(syllables_ow[i_ow]));
  }
  return letters_ow.join("");
}
 
function many_words(sentence)
{
  var regex = "((" + vowels + ")|(" + consonants + "))+";
  var words = new Array(0);
  while (sentence.length >= 1) {
    re = new RegExp("^``" + regex);
    var match = re.exec(sentence);
    if (match != null) {
      match = match[0];
      words.push("`");
      words.push(one_word(match.substring(2)));
      sentence = sentence.substring(match.length);
    } else {
      re = new RegExp("^`" + regex);
      match = re.exec(sentence);
      if (match != null) {
    match = match[0];
    words.push(match.substring(1));
    sentence = sentence.substring(match.length);
      } else {
    re = new RegExp("^" + regex);
    match = re.exec(sentence);
    if (match != null) {
      match = match[0];
      words.push(one_word(match));
      sentence = sentence.substring(match.length);
    } else {
      words.push(sentence.charAt(0));
      sentence = sentence.substring(1);
    }
      }
    }
  }
  return words.join("");
}


function pass_ml(oldstring1)
{

 var newstring
 var iter=0
oldstring=">"+oldstring1+"<"
newstring=oldstring.match(/>[a-z]*</g)
oldstring
 for(iter=0;iter< newstring.length;iter++)
 {
     
    oldstring=oldstring.replace(newstring[iter],">"+conv_ml(newstring[iter].substring(1,newstring[iter].length-1))+"<")

 }
oldstring1=oldstring.substring (1,oldstring.length-1)

return(oldstring1)

}
function conv_ml(index_pmw)
{

 
  var text_pmw = many_words(index_pmw);
 
  var ans = "";
  while (text_pmw.length) {
    var unicode_chars = /&#[0-9]+;/;
    re = unicode_chars;
    var matche = re.exec(text_pmw);
    if (matche != null) {
      matche = matche[0];
      search = text_pmw.search(unicode_chars);
      ans += text_pmw.substring(0, search);
      ans += String.fromCharCode(matche.match(/[0-9]+/));
      text_pmw = text_pmw.substring(search + matche.length);
    } else {
      ans += text_pmw.substring(0);
      text_pmw = "";
    }
  }

 
return ans;
  
}

var jey_jey=0;
var jey_btn=0;
var txteng="";
var txt2ml=""
var TinyMCE_TemplatePlugin = {
    getInfo : function() {
        return {
            longname : 'Template plugin',
            author : 'Moxiecode Systems AB',
            authorurl : 'http://www.moxiecode.com',
            infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/template',
            version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
        };
    },
 
    initInstance : function(inst) {
        var  content, x = 0, key, value, rvals, ds = inst.getData('template');
 
 
        // classes that specify where selected content should go
        content = tinyMCE.getParam("template_selected_content_classes", '').split(/\s+/);
 
         
 
        for (x = 0; x < content.length; x++)
            TinyMCE_TemplatePlugin.functions[content[x]] = TinyMCE_TemplatePlugin.functions['selectedContent'];
 
        // special template functions for replacing template content
        rvals = tinyMCE.getParam("template_replace_values", false);
        for (key in rvals) {
            value = rvals[key];
 
            if (typeof value == "function")
                TinyMCE_TemplatePlugin.functions[key] = value;
            else
                TinyMCE_TemplatePlugin.functions[key] = TinyMCE_TemplatePlugin.functions['generateReplacer'](value);
        }
 
        // Setup replace_items
        rvals = tinyMCE.getParam("template_replace_values", false);
        ds.replace_items = {};
 
        for (key in rvals)
            ds.replace_items[key] = rvals[key];
 
        inst.addShortcut('ctrl', 't', 'lang_template_desc', 'mceTemplate');
 
        // Setup data storage
        ds.currentAction = "insert";
        ds.currentTmplNode = null;
    },
 
    getControlHTML : function(cn) {
        switch (cn) {
            case "template":
                return tinyMCE.getButtonHTML(cn, 'lang_template_desc', '{$pluginurl}/images/template.gif', 'mceTemplate', true);
        }
 
        return "";
    },
 
    execCommand : function(editor_id, element, command, user_interface, value) {
        var nodeArray, current, newTmpl, x, inst = tinyMCE.getInstanceById(editor_id), ds = inst.getData('template'), telm;
 
        switch (command) {
            case "mceTemplate":
                if (user_interface)
                    {
                    jey_jey=(jey_jey+.5)%2;
                    if(jey_jey==0)
                        {
                        jey_btn=0;
                        alert("English Mode");
                        txteng="";
                       
                        }
                    else if(jey_jey==1)
                            {
                        jey_btn=1;
                        alert("Malayalam Mode");
                        txteng=tinyMCE.getContent();
                        txt2ml="";
                        }
                       
                        }
                     
 
                 
        }
 
        return false;
    },
 
    handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
        var inst = tinyMCE.getInstanceById(editor_id), ds = inst.getData('template');
 
        if (tinyMCE.hasCSSClass(node, TinyMCE_TemplatePlugin.TMPL_ELEMENT) || tinyMCE.hasCSSClass(node.parentNode, TinyMCE_TemplatePlugin.TMPL_ELEMENT)) {
            tinyMCE.switchClass(editor_id + '_template', 'mceButtonSelected');
            ds.currentAction = "update";
            ds.currentTmplNode = node;
 
            return true;
        }
 
        ds.currentAction = "insert";
        ds.currentTmplNode = null;
        tinyMCE.switchClass(editor_id + '_template', 'mceButtonNormal');
 
        return false;
    },
handleEvent : function(e) {
        var inst = tinyMCE.selectedInstance;
        var w = inst.getWin(), le = inst._lastStyleElm, e;
 
        if (tinyMCE.isGecko) {
            if(e.type=='keyup'&&jey_btn==1)
                {
        txt=tinyMCE.getContent();
        last_char=(txt).charAt(txt.length-1)
        txt2ml=txt2ml+last_char ;
        tinyMCE.setContent("");
        tinyMCE.selectedInstance.execCommand('mceInsertContent',true,txteng+pass_ml(txt2ml)); }
            }
        return true;
    },
 
    cleanup : function(type, content, inst) {
        var nodes = [];
 
        switch (type) {
             
            case "insert_to_editor":
                break;
 
         
        }
 
        return content;
    },
 
    // Private plugin internal methods
 
     
    _convertToNode : function(html) {
        var elm = document.createElement('div');
 
        elm.innerHTML = html;
 
        return elm;
    },
 
    /**
     * pass an array of template html elements and they will have the template class name added and any template functions applied
     *
     * @param {array} template HTML elements
     * @return array of template HTML elements
     * @type array
     */
    _prepareTemplateContent : function(elms) {
        var x, n, nodes = [];
 
        if (!elms)
            return {};
 
        if (!elms.length)
            elms = [elms];
 
        for (x = 0; x<elms.length; x++)
            tinyMCE.getNodeTree(elms[x], nodes, 1);
 
        for (n = 0; n<nodes.length; n++) {
            tinyMCE.addCSSClass(nodes[n], TinyMCE_TemplatePlugin.TMPL_ELEMENT);
            TinyMCE_TemplatePlugin._applyFunctions(nodes[n], TinyMCE_TemplatePlugin.TMPL_TEMPLATE_EVENT);
        }
 
        return elms;
    },
 
    _replaceValues : function(s) {
        var t = this, ds = tinyMCE.selectedInstance.getData('template');
 
        return s.replace(/\{\$([^\}]+)\}/g, function(a, b) {
            var it = ds.replace_items[b];
 
            if (it) {
                // Only supports text for now
                if (typeof(it) != 'function')
                    return it;
            }
 
            return b;
        });
    },
 
    /**
     * Applies any special functions to the template elements
     *
     * @param {array} template HTML elements
     * @return array of template HTML elements
     * @type array
     */
    _applyFunctions : function(elms, editor_event) {
        var x, elm, names, c, f;
 
        if (!elms)
            return {};
 
        if (!elms.length)
            elms = [elms];
 
        for(x = 0; x < elms.length; x++) {
            elm = elms[x];
 
            if (elm.className){
                names = elm.className.split(/\s+/);
 
                for (c = 0; c < names.length; c++){
                    if (names[c] == TinyMCE_TemplatePlugin.TMPL_ELEMENT)
                        continue;
 
                    f = (TinyMCE_TemplatePlugin.functions[names[c]] ? TinyMCE_TemplatePlugin.functions[names[c]] : TinyMCE_TemplatePlugin.functions['blank']);
                    f(elm, editor_event);
                }
            }
        }
 
        return elms;
    },
 
    /**
     * Given one node reference this function will collect all the nodes of the template to which it belongs.
     * It does this by finding the parent template wrapper DIV and returning all child nodes.
     *
     * @param {HTMLElement} a HTMLElement which is part of a template
     * @return array of template HTML elements
     * @type array
     */
    _collectTemplateElements : function(node) {
        var nodeArray = [], p;
 
        p = tinyMCE.getParentElement(node, 'DIV', function(n) {
            return tinyMCE.hasCSSClass(n, TinyMCE_TemplatePlugin.TMPL);
        });
 
        if (p)
            tinyMCE.getNodeTree(p, nodeArray);
 
        return nodeArray;
    },
 
    /**
     * Simply calls TinyMCE_TemplatePlugin._deleteTemplateContent and then TinyMCE_TemplatePlugin._insertTemplate
     *
     * @param {HTMLElement} currently selected template node in editor
     * @param {string} id of editor instance
     * @param {HTMLElement} template contents as a HTMLElement (the parent DIV wrapper)
     * @param {string} title of template (unused as yet)
     * @param {string} source URI of the template file (unused as yet)
     * @return array of template HTML elements
     * @type array
     */
    _replaceTemplateContent : function(currentNode, editor_id, newTemplate, title, tsrc) {
        TinyMCE_TemplatePlugin._deleteTemplateContent(currentNode);
        TinyMCE_TemplatePlugin._insertTemplate(editor_id, newTemplate, title, tsrc, false);
    },
 
    /**
     * Deletes a template from the editor content
     * Finds the parent DIV wrapper and deletes it and all children
     * @param {HTMLElement} currently selected template node in editor
     */
    _deleteTemplateContent : function(node) {
        var p = tinyMCE.getParentElement(node, 'DIV', function(n) {
            return tinyMCE.hasCSSClass(n, TinyMCE_TemplatePlugin.TMPL);
        });
 
        if (p)
            p.parentNode.removeChild(p, true);
    },
 
    /**
     *  Inserts a template into the specified editor
     *
     * @param {string} id of editor instance
     * @param {HTMLElement} template contents as a HTMLElement (the parent DIV wrapper)
     * @param {string} title of template (unused as yet)
     * @param {string} source URI of the template file (unused as yet)
     */
    _insertTemplate : function(editor_id, elm, title, tsrc, incComments) {
        var html;
 
        TinyMCE_TemplatePlugin._prepareTemplateContent(elm);
 
        html = '<div class="' + TinyMCE_TemplatePlugin.TMPL + '">';
        html += elm.innerHTML;
        html += '<!-- ' + TinyMCE_TemplatePlugin.TMPL_ENDS + ' --></div>';
 
        tinyMCE.execInstanceCommand(editor_id, 'mceInsertContent', false, html);
    },
     

     
    /**
     * template functions - functions for modifying template content
     */
    functions : { 
        blank : function(elm, editor_event) {},
         
         
         
 
        /**
         * This will insert the currently selected editor content into the template element.
         * It only does this if the template inserted is a new one and if the element does not have the special class.
         * The special class name prevents this from happening more than once.
         */
        selectedContent : function(elm, editor_event) {
            var ds = tinyMCE.selectedInstance.getData('template');
     
            if (editor_event != TinyMCE_TemplatePlugin.TMPL_TEMPLATE_EVENT)
                return;
 
            if (ds.currentAction == "insert-new" && !tinyMCE.hasCSSClass(elm, TinyMCE_TemplatePlugin.TMPL_SEL_HTML_DONE)) {
                elm.innerHTML = tinyMCE.selectedInstance.selection.getSelectedHTML();
                tinyMCE.addCSSClass(elm, TinyMCE_TemplatePlugin.TMPL_SEL_HTML_DONE);
            }
        },
 
        /**
         * When the plugin is initialised this generates the functions that insert configured strings into template elements.
         */
        generateReplacer : function(s) {
            return function(elm, editor_event) {elm.innerHTML = "" + s;};
        }
    },
 
    /**
     * formats a date according to the format string - straight from the 'insert date/time' plugin
     *
     * @param {Date} date object
     * @param {string} format string
     * @return formatted date
     * @type string
     */
    _getDateTime : function(d,fmt) {
            if (!fmt)
                return "";
 
            function addZeros(value, len) {
                var i;
 
                value = "" + value;
 
                if (value.length < len) {
                    for (i=0; i<(len-value.length); i++)
                        value = "0" + value;
                }
 
                return value;
            }
 
            fmt = fmt.replace("%D", "%m/%d/%y");
            fmt = fmt.replace("%r", "%I:%M:%S %p");
            fmt = fmt.replace("%Y", "" + d.getFullYear());
            fmt = fmt.replace("%y", "" + d.getYear());
            fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2));
            fmt = fmt.replace("%d", addZeros(d.getDate(), 2));
            fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2));
            fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2));
            fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2));
            fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1));
            fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM"));
            fmt = fmt.replace("%B", "" + tinyMCE.getLang("lang_template_months_long")[d.getMonth()]);
            fmt = fmt.replace("%b", "" + tinyMCE.getLang("lang_template_months_short")[d.getMonth()]);
            fmt = fmt.replace("%A", "" + tinyMCE.getLang("lang_template_day_long")[d.getDay()]);
            fmt = fmt.replace("%a", "" + tinyMCE.getLang("lang_template_day_short")[d.getDay()]);
            fmt = fmt.replace("%%", "%");
 
            return fmt;
    },
 
    TMPL_ELEMENT : 'mceTmplElm',
    TMPL : 'mceTmpl',
    TMPL_BEGINS : 'mceTmplBegins',
    TMPL_SEL_HTML_DONE : 'mceSelHTMLDone',
    TMPL_ENDS : 'mceTmplEnds',
    TMPL_DATE_SRC_ATTR : 'mcetmpldtesrc',
    TMPL_TEMPLATE_EVENT : 'prepare_template'
};
 
tinyMCE.addPlugin("template", TinyMCE_TemplatePlugin);
 

insert new plug in to tinyMCE in drupal

unzip the plug in into plugins directory

and edit

public_html/drupal/modules/tinymce/plugin_reg.php



--
regards

sajjad.c

Thursday, May 17, 2007

function include(filename)
{
var head = document.getElementsByTagName('head')[0];

script = document.createElement('script');
script.src = filename;
script.type = 'text/javascript';

head.appendChild(script)
}


Thursday, May 10, 2007

php code for drupal block wise news


<?php
$res=taxonomy_select_nodes($tids = array(1,3), $operator = 'and', $depth = "all"
, $pager = TRUE, $order = 'n.sticky DESC, n.created DESC');

while( $ans=$res->fetch_array())
{
print("<a href='http://azhikkodu.com/?q=en/node/$ans[nid]'> $ans[title]</a><BR>");
}
?>



--
regards

sajjad.c

Friday, May 04, 2007

Taxonomy details

http://drupal.org/handbook/modules/taxonomy


Drupal taxonomy

on the menus page (administer >> site building >> menus) you can create a menu item for your term. Select add item, and when you fill in the path field you add your category like this:

taxonomy/term/1

If your category "sonatas" is term 1, this would call for all the nodes of that category.

If your category "Bach" is term 2, you could call for only those sonatas written by Bach:

taxonomy/term/1,2

Or if Brahms is term 3 and you want to call for everything that has to do with either Bach or Brahms, you'd do it this way:

taxonomy/term/2+3

Tuesday, May 01, 2007

components of webportal


web portals are mainly 4 types

  1. personal webportal
  2. organaisations` webportal
  3. LSG`s webportal
  4. corparates webportal

Common features for all   web portals
-------
blog
    A blog is basically a journal that is available on the web. The activity of updating a blog is "blogging" and someone who keeps a blog is a "blogger." Blogs are typically updated daily using software that allows people with little or no technical background to update and maintain the blog.

Events/calender
    An event-calendar for  website. we have  got different views ( month, week, day) certain categories to sort  events and the possibility to submit events from the frontend. These can be autopublished or not depending on the settings of its parent category. In submitting events you are supported by several repetition- options and the possibility to generate exception dates.

comments
    it provide comments for various articles and post in the websites
guest book
    A Guestbook is a form that enables visitors to add comments on a web page
news(and related item)

RSS/Atom
    it is a data format used for serving users frequently updated content. Content distributors syndicate a web feed, thereby allowing users to subscribe to it. Making a collection of web feeds accessible in one spot is known as aggregation
Articles
    Static elements of the portal. its usually contain bylaw,rules and regulations,essays...
search
    search  and find the contents in the site

sitemap(sitemap generator)
    site map is a representation of the architecture of a web site.  It can be either a document in any form used as a planning tool for web design, or a web page that lists the pages on a web site, typically organized in hierarchical fashion. This helps visitors and search engine bots find pages on the site.

WYSIWYG editors(JCE)
    WYSIWYG  is an acronym for What You See Is What You Get, used in computing to describe a system in which content during editing appears very similar to the final product. It is commonly used for word processors, but has other applications, such as Web (HTML) authoring. These types of editors use to  add contents in the website

contact
    its contact  address of siteowner/organaisation
search engine friendly url`s
    This package helps listing the article in google and other search engines.
google analytics components
    is a free service offered by Google that generates detailed statistics about the visitors to a website


organaisation  specific components
------
Forum
    is a facility on the World Wide Web for holding discussions and posting user generated content based on topics, or the web application software used to provide this facility

chat
    it is a kind of communication over the internet.text/audio/video based synchronised communication.user authentication is needed for this communication
shoutbox
    is a chat-like feature of some websites that allows people to quickly leave messages on the website, generally without any form of user registration
news letter
    email based weekly/monthly news letter
private message system
    message between  diffrent users of the website
poll
    Opinion poll, a type of survey
FAQ
    Freequently asked questions related to  site/organaisation /company/products
Downloads
    gave a good interface to  downloads of the site
image gallery
    systematically  arrange  and show pictures and photos
Donations/Paypal
    this tool help for non-profit organaisations, accept donations through online
Adsense
    Its a revenue generation program  from  google.it wil gave some advt on  our site,for this advts they(google) provide cash based on how much popular our sites

podcasting/stream-media/youtube plugin
    its online broadcasting of audio /video files

Project and Task Mgmnt
    online project managment tools, its very  helpful for collabarative developments of project planning/event managmentss

Multilingual content
    Present the article/contents in more than one format

Portfolio
    showcase of their work.
social bookmarking
    Social Bookmarking is a way for internet users to store, classify, share and search Internet bookmarks(adding webpage address`)

social networking
    social network is a social structure made of nodes (which are generally individuals or organizations) that are tied by one or more specific types of relations, such as financial exchange, friends, kinship, dislike, trade, web links, sexual relations, or airline routes.

Directory/Address book component
    online address books

Career board
    listing career in the organaisations.it helps to get suitable employers for organaisations

Groupware/email-group
    its a mailing list component
Bannerad/ADmanager
    Advertisment managment program(allow starting date, ending date,no of time the baner is shown...)

Community builder plugin
    An environment for producing and maintaining online communities
e-cards
    greeting cards,send between the members of a site, or to the friends
CRM(Relationship manager)
    his component (primarly targeted to the non-profit and public sectors) will allow you to very effectively manage your organization's contacts, and begin to build a better connection between your CMS and your constituent


User home page module
    for a acadamic /organaisational portal, user`s need their own homepages, this modules allow to create home pages for all users

Who is online module
    list of users whom  they are in online

 components for personel  webpages
---------
image gallery
    
Adsense

 

Components specific to Companies/corparates
------------
Forum(if product delivering  company)
news letter
FAQ
Shopping cart
    is software used in e-commerce to assist people making purchases (products of this company) online

Project and Task Mgmnt
Help desk
    A help desk is an information and assistance resource that troubleshoots problems with products.

Portfolio(showcase of their work)

Career board

CRM(Relationship manager)

Local Self Govt.s
-------
Forum
chat
news letter
poll
map
    show the map of this location(with help of google map)include road map,satelite view
rating review

weather
    Report on  weather
FAQ
downloads(varius forms and articles)
podcasting/stream-media/youtube plugin
Help desk
Portfolio(showcase of their work)
social bookmarking/social networking
Directory/Address book component
Education
Jobportal
    its a bridge between jobseekers and companies
Bannerad/ADmanager

Community builder plugin

Sunday, April 29, 2007

BSNL broadband connection with Linux


you can also install it on yum enabled distributions like Fedora Core simply by:
yum install rp-pppoe
It asks questions like your login name and password tarag(provided by BSNL), your ethernet interface (choose the default provided; works for most cases) etc. After the setup you should preferably reboot (or restart the network) and you will find your DSL connection up and running.

You can also manually bring up DSL connection by:
ifup ppp0

You can bring it down by:
ifdown ppp0

Note: Unless you have multiple DSL connections, ppp0 is a safe bet.

Thursday, April 26, 2007

adding new fonts in tinyMCE


in tinyMCE init
theme_advanced_fonts : "Arial=arial,Courier New=courier new;Unikurd Web=unikurd web",

Tuesday, April 24, 2007

how to integrate tinyMCE in drupal

a screencast to how integration done

Monday, April 23, 2007

tinyMCE cursor problem in setcontent



tinyMCE.selectedInstance.execCommand('mceInsertContent', false, "text");

Saturday, April 21, 2007

pluginTinyMCE development guide

First of all i would really like to make a dedicated button for a certain css class.
Second i need to insert 2 div's one with non editable content and one with editable content. In another topic i read that you could use the handleNodeChange() function to achieve that some content cannot be changed by the user (see: link). It should do something like the code style is doing in the editor on this site

I really don't get the comments in the _template plugin. Maybe we could use this topic to clarify that, because there are a lot of topic with people asking for support with creating plugins and almost non contain hints that people who are making a plugin for the first time could use.

(1) wrote:

/* Import plugin specific language pack */
tinyMCE.importPluginLanguagePack('template', 'en,tr,he,nb,ru,ru_KOI8-R,ru_UTF-8,nn,fi,cy,es,is,pl'); // <- Add a comma separated list of all supported languages

I think there is no need to change any of this?

(2) wrote:

/****
* Steps for creating a plugin from this template:
*
* 1. Change all "template" to the name of your plugin.
* 2. Remove all the callbacks in this file that you don't need.
* 3. Remove the popup.htm file if you don't need any popups.
* 4. Add your custom logic to the callbacks you needed.
* 5. Write documentation in a readme.txt file on how to use the plugin.
* 6. Upload it under the "Plugins" section at sourceforge.
*
****/

This is pretty straight forward, but the example online doesn't replace ALL the instances of "template", so I think it should be good do clarify which one should be changed.

(3) wrote:

// Singleton class
var TinyMCE_TemplatePlugin = {
    /**
     * Returns information about the plugin as a name/value array.
     * The current keys are longname, author, authorurl, infourl and version.
     *
     * @returns Name/value array containing information about the plugin.
     * @type Array
     */
    getInfo : function() {
        return {
            longname : 'Template plugin',
            author : 'Your name',
            authorurl : ' http://www.yoursite.com',
            infourl : 'http://www.yoursite.com/docs/template.html',
            version : " 1.0"
        };
    },

this isnt very important and i think everyone will understand this

(4) wrote:

/**
     * Gets executed when a TinyMCE editor instance is initialized.
     *
     * @param {TinyMCE_Control} Initialized TinyMCE editor control instance.
     */
    initInstance : function(inst) {
        // You can take out plugin specific parameters
        alert("Initialization parameter:" + tinyMCE.getParam("template_someparam", false));

        // Register custom keyboard shortcut
        inst.addShortcut('ctrl', 't', 'lang_ template_desc', 'mceTemplate');
    },

The alert is only for debug use and can be removed later. The other line is to register a keyboard shortcut for this plugin

(5) wrote:

/**
     * Returns the HTML code for a specific control or empty string if this plugin doesn't have that control.
     * A control can be a button, select list or any other HTML item to present in the TinyMCE user interface.
     * The variable {$editor_id} will be replaced with the current editor instance id and {$pluginurl} will be replaced
     * with the URL of the plugin. Language variables such as {$lang_somekey} will also be replaced with contents from
     * the language packs.
     *
     * @param {string} cn Editor control/button name to get HTML for.
     * @return HTML code for a specific control or empty string.
     * @type string
     */
    getControlHTML : function(cn) {
        switch (cn) {
            case "template":
                return tinyMCE.getButtonHTML(cn, 'lang_template _desc', '{$pluginurl}/images/template.gif', 'mceTemplate', true);
        }

        return "";
    },

where is the variable {$editor_id}?!? I don't really get what this doest. Does this function add a button to the GUI and I don't get the what is returns.

(6) wrote:

/**
     * Executes a specific command, this function handles plugin commands.
     *
     * @param {string} editor_id TinyMCE editor instance id that issued the command.
     * @param {HTMLElement} element Body or root element for the editor instance.
     * @param {string} command Command name to be executed.
     * @param {string} user_interface True/false if a user interface should be presented.
     * @param {mixed} value Custom value argument, can be anything.
     * @return true/false if the command was executed by this plugin or not.
     * @type
     */
    execCommand : function(editor_id, element, command, user_interface, value) {
        // Handle commands
        switch (command) {
            // Remember to have the "mce" prefix for commands so they don't intersect with built in ones in the browser.
            case "mce Template":
                // Show UI/Popup
                if (user_interface) {
                    // Open a popup window and send in some custom data in a window argument
                    var template = new Array();

                    template['file'] = '../../plugins/ template/popup.htm'; // Relative to theme
                    template['width'] = 300;
                    template ['height'] = 200;

                    tinyMCE.openWindow(template, {editor_id : editor_id, some_custom_arg : "somecustomdata"});

                    // Let TinyMCE know that something was modified
                    tinyMCE.triggerNodeChange(false);
                } else {
                    // Do a command this gets called from the template popup
                    alert("execCommand: mce Template gets called from popup.");
                }

                return true;
        }

        // Pass to next handler in chain
        return false;
    },

I understand that this opens a popup  window and that the 'changes' get saved using the  triggerNodeChange() function.

(7) wrote:

/**
     * Gets called ones the cursor/selection in a TinyMCE instance changes. This is useful to enable/disable
     * button controls depending on where the user are and what they have selected. This method gets executed
     * alot and should be as performance tuned as possible.
     *
     * @param {string} editor_id TinyMCE editor instance id that was changed.
     * @param {HTMLNode} node Current node location, where the cursor is in the DOM tree.
     * @param {int} undo_index The current undo index, if this is -1 custom undo/redo is disabled.
     * @param {int} undo_levels The current undo levels, if this is -1 custom undo/redo is disabled.
     * @param {boolean} visual_aid Is visual aids enabled/disabled ex: dotted lines on tables.
     * @param {boolean} any_selection Is there any selection at all or is there only a cursor.
     */
    handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
        // Select template button if parent node is a strong or b
        if (node.parentNode.nodeName == "STRONG" || node.parentNode.nodeName == "B") {
            tinyMCE.switchClass (editor_id + '_template', 'mceButtonSelected');
            return true;
        }

        // Deselect template button
        tinyMCE.switchClass(editor_id + '_template', 'mceButtonNormal');
    },

I really don't get the point of this function either.

(8) wrote:

/**
     * Gets called when a TinyMCE editor instance gets filled with content on startup.
     *
     * @param {string} editor_id TinyMCE editor instance id that was filled with content.
     * @param {HTMLElement} body HTML body element of editor instance.
     * @param {HTMLDocument} doc HTML document instance.
     */
    setupContent : function(editor_id, body, doc) {
    },

a function to execute on page load to set some initial things.

(9) wrote:

/**
     * Gets called when the contents of a TinyMCE area is modified, in other words when a undo level is
     * added.
     *
     * @param {TinyMCE_Control} inst TinyMCE editor area control instance that got modified.
     */
    onChange : function(inst) {
    },

???

(10) wrote:

/**
     * Gets called when TinyMCE handles events such as keydown, mousedown etc. TinyMCE
     * doesn't listen on all types of events so custom event handling may be required for
     * some purposes.
     *
     * @param {Event} e HTML editor event reference.
     * @return true - pass to next handler in chain, false - stop chain execution
     * @type boolean
     */
    handleEvent : function(e) {
        // Display event type in statusbar
        top.status = "template plugin event: " + e.type;

        return true; // Pass to next handler
    },

an event handler. You can add some other event listeners

(11) wrote:

/**
     * Gets called when HTML contents is inserted or retrived from a TinyMCE editor instance.
     * The type parameter contains what type of event that was performed and what format the content is in.
     * Possible valuses for type is get_from_editor, insert_to_editor, get_from_editor_dom, insert_to_editor_dom.
     *
     * @param {string} type Cleanup event type.
     * @param {mixed} content Editor contents that gets inserted/extracted can be a string or DOM element.
     * @param {TinyMCE_Control} inst TinyMCE editor instance control that performes the cleanup.
     * @return New content or the input content depending on action.
     * @type string
     */
    cleanup : function(type, content, inst) {
        switch (type) {
            case "get_from_editor":
                alert("[FROM] Value HTML string: " + content);

                // Do custom cleanup code here

                break;

            case "insert_to_editor":
                alert("[TO] Value HTML string: " + content);

                // Do custom cleanup code here

                break;

            case "get_from_editor_dom":
                alert("[FROM] Value DOM Element " + content.innerHTML );

                // Do custom cleanup code here

                break;

            case "insert_to_editor_dom":
                alert("[TO] Value DOM Element: " + content.innerHTML );

                // Do custom cleanup code here

                break;
        }

        return content;
    },

can someone explain the use of this?!?

(12) wrote:

// Private plugin internal methods

    /**
     * This is just a internal plugin method, prefix all internal methods with a _ character.
     * The prefix is needed so they doesn't collide with future TinyMCE callback functions.
     *
     * @param {string} a Some arg1.
     * @param {string} b Some arg2.
     * @return Some return.
     * @type string
     */
    _someInternalFunction : function(a, b) {
        return 1;
    }

a place to add internel functions

(13) wrote:

};

// Adds the plugin class to the list of available TinyMCE plugins
tinyMCE.addPlugin ("template", TinyMCE_TemplatePlugin);

This should always be in the file. It registers the plugin with the rest of TinyMCE