Fórumozást segítő progik forumozóktól forumozóknak. Avagy a \"Mi kellene az SG-nek?\" kérdésre kliens oldali megoldások.
  • Benc16
    #153
    // ==UserScript==
    // @name SG + szmajli script
    // @namespace http://bracsek.kilu.de/userscripts/SG
    // @description Plusz szmajlik beszurasa az sg -re
    // @include http://sg.hu/*
    // @include http://www.sg.hu/*
    // ==/UserScript==
    // Notes:
    // *** You must define the URL of the custom logo below, or the script will display the default logo! ***


    /*
    getElementsByAttribute function is:
    Copyright Br4cs3k Csaba, http://bracsek.kilu.de
    Free to use if this text is included
    Slightly modified to work in this user script
    */

    window.getElementsByAttribute = function(oElm, strTagName, strAttributeName, strAttributeValue){
    var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
    var arrReturnElements = new Array();
    var oAttributeValue = (typeof strAttributeValue != "undefined")? new RegExp("(^|\\s)" + strAttributeValue + "(\\s|$)") : null;
    var oCurrent;
    var oAttribute;
    for(var i=0; i<arrElements.length; i++){
    oCurrent = arrElements[i];
    oAttribute = oCurrent.getAttribute && oCurrent.getAttribute(strAttributeName);
    if(typeof oAttribute == "string" && oAttribute.length > 0){
    if(typeof strAttributeValue == "undefined" || (oAttributeValue && oAttributeValue.test(oAttribute))){
    arrReturnElements.push(oCurrent);
    }
    }
    }
    return arrReturnElements;

    }

    var logo = document.createElement("div");
    logo.innerHTML ='<HEAD>'+
    '<TITLE>Beszýrhatý szmýjlik listýja</TITLE>'+
    '<script type=text/javascript>'+'self.moveTo(100,100);'+'self.resizeTo(900,700);'+'window.scroolbars="1";'+'self.menubar.visible="true";'+
    ' function put(mit) '+
    '{'+
    ' emoticon(mit);'+
    ' }'+
    'function emoticon(text)'+
    ' {'+
    ' text = \'[#\' + text + \']\';'+
    'PostWrite(text);'+
    ' }'+
    'function emoticon1(text) '+
    '{'+
    'text = \'[IMG]http://bracsek.kilu.de/userscripts/SG/szmajlik/\' + text + \'[/IMG]\';'+
    'PostWrite(text);'+
    '}'+
    'function PostWrite(text)'+
    '{'+
    ' if (opener.document.newmessage.message.createTextRange && opener.document.newmessage.message.caretPos) '+
    '{'+
    'var caretPos = opener.document.newmessage.message.caretPos;'+
    'caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == \' \' ? text + \' \' : text;'+
    '}'+
    'else opener.document.newmessage.message.value += text;'+
    '}'+
    '</SCRIPT>'+
    '<BODY marginwidth=0 marginheight=0 leftmargin=0 scrolling="yes" topmargin=0 ONLOAD="JavaScript: this.focus()">'+
    '<CENTER>'+

    '<INPUT TYPE=IMAGE SRC="IDE JÖN A LINK!!!" ONCLICK="JavaScript:emoticon1(\'IDE NEM TUDOM MILYEN KÉP JÖN!!!\')" >'+

    if (window.location=="http://www.sg.hu/forumfaces.php"){
    document.body.insertBefore(logo, document.body.firstChild);}
    else {
    var logos = getElementsByAttribute(document.body, "A", "HREF", "*");
    var x=20;
    while (x in logos&& x<= 50){ x++;
    if(logos[x].href=="http://www.sg.hu/forumhelp.html?keepThis=true&TB_iframe=true&height=400&width=600") {
    logos[x-1].href ='javascript:NewWindow("http://www.sg.hu/forumfaces.php","forumfaces",800,600,scroolbars=1);';

    }
    } ;
    };

    Ez ugy hogy nem csoportokban... de csoportosan leírnál egy pl. -val majd és kihúznád vastagon amit ismételni kell... és így: "javasrcipt img" asse toom mit írok de hogy ennél kell beírni a kép url -jét...