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