Autor Zpráva
Anonymní
Profil *
Čau!
Nemohli byste mi někdo prosím napsat kód pro stahování?
Zkoušel jsem ten kód napsat podle tohoto návodu ale nevim jaksi mi to nešlo asi jsem napsal něco blbě.

A ještě jedna otázka:
Nevíte jak na www stránky dát smajlíky? Myslím jako jestli nevíte jak udělat to aby se místo tohoto: :) nakreslil smajlík který se usmíva atp.

Diky!
kuko
Profil *
skus tie smajliky hodit na stranku ako img
Alphard
Profil
stahování: http://www.linuxsoft.cz/article.php?id_article=310
:) za obrázek nahradíš třeba PHP funkcí pro nahrazování řetězců: http://cz.php.net/manual/cs/function.str-replace.php
peta
Profil *
function filterLine(source,zImg,xSett)
{
var f = parent.document;
if (Boolean(f))
{
var reg,a,b,c,d,i,j,x,sml, o,oX,xSml;
d = ">"; //divider
// http://en.wikipedia.org/wiki/Domain_name
// http://www.ietf.org/rfc/rfc3986.txt
var xSource = new Array();
var xData = new Array();
var ip0 = "(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])"; //255-250 249-200 199-100 99-10 9-0
var ip = "(?:(?:"+ ip0 +"\\.){3}"+ ip0 +")";
var mailsep = "[\\!#\\$%&\\'\\*\\+-\\/\\=\\?\\^_\\`\\{\\|\\}~]";
var linksep = "[_\\.-]";
var xHost = "[A-Za-z0-9](?:(?:"+ linksep +"?[a-zA-Z0-9]+)*)";
var xProtocol = "(?:(?:file|ftp|ftps|gopher|http|https|news|nntp|sftp|telnet)\\:\\/\\/ |"+ ip +")";
var xDomain = "(?:(?:"+ xHost + "\\.[a-zA-Z]{2,9})|"+ ip +")";
var xPort = "(?:\\:[0-9]{2,4})?";
var xFilter = new Array ();
/*smile*/
xFilter[0]="\\*([1-2]?[0-9])\\*";
xSml = (xSett.charAt(3))*1;
/*link*/
if ((xSett.charAt(4))*1==0)
{xFilter[2]="(("+ xProtocol + xDomain +")"+ xPort +"(?:\\/[-_~#%&;\\=\\?\\.a-zA-Z0-9\\/]*)?)";}
// http://msdn.microsoft.com:80/scripting/default.htm
/*mail*/
if ((xSett.charAt(5))*1==0)
{xFilter[3]="[A-Za-z0-9](?:(?:"+ mailsep +"?[a-zA-Z0-9]+)*)@"+ xDomain + xPort;}
// RFC2821/RFC2822 e-mailAddress[64]@domainName[255]
// me@24.111.232.1 joe_smith@here.com you.me.hello@somewhere.else.cc u-s_e.r1@s-ub2.domain-name.museum:8080 PN=Joe/OU=X400/@gateway.com

// find smiley/link
//source = source.replace(/@/g,"@"); //innerHTML bug Opera @"
source = source.replace(/"/g,"\""); //innerHTML bug Opera @"
//source = source.replace(/&/g,"\&");
j = 0;
for (i in xFilter)
{
//alert(xFilter[i])
reg = new RegExp(xFilter[i],"");
//alert(reg.source)
a = 1;
while (a>0)
{
if (x = source.match(reg))
{
b = 0;
if (Boolean(x) && Boolean(x[0]))
{
i = i*1; //bug for(i in array)
xSource[j] = i;
switch (i)
{
case 0: xData[j] = x[1]*1; b = 1; xSource[j] = xSml; break;
case 2: xData[j] = new Array( x[1],x[2] ); b = 1; break;
case 3: xData[j] = x[0]; b = 1; break;
}
}
if (b) {b = d; j++;}
else {b = "";}
source = source.replace(reg,d);
//alert(x[1])
a = 2;
}
a--;
}
}

// add object smiley/link
if (xData.length>0)
{
o = creEL(f,'SPAN');
source = source.split(d);
for (i in source)
{
creaddTN(f,o,source[i]);
x = xData[i];
switch (xSource[i])
{
case 0: //smile img
if (Boolean(zImg[x]))
{
creaddTN(f,o," ");
o1=creEL(f,'SPAN');
o1.className = "smile";
o1.setAttribute('title',"*"+x+"* "+zImg[x].title);
oX = creImg(f,zImg[x].src,"*"+x+"*",15,15);
setxEvent(oX,"onclick","smlPut(\'"+x+"\')");
appEL(o1,oX);
appEL(o,o1);
creaddTN(f,o," ");
}
break;
case 1: //smile text
if (Boolean(zImg[x]))
{
a = zImg[x].title;
b = (a!=="") ? a : "*"+x+"*";
creaddTN(f,o," "+b+" ");
}
break;
case 2:
creaddTN(f,o," ");
o1=creEL(f,'A');
o1.className = "www";
o1.setAttribute('href',x[0]);
o1.setAttribute('title',"URL = "+x[0]);
o1.setAttribute('target',"_blank");
creaddTN(f,o1,x[1]);
appEL(o,o1);
creaddTN(f,o," ");
break;
case 3:
creaddTN(f,o," ");
o1=creEL(f,'A');
o1.className = "mail";
o1.setAttribute('href',"mailto:"+x);
o1.setAttribute('title',"MAIL = "+x);
o1.setAttribute('target',"_blank");
creaddTN(f,o1,x);
appEL(o,o1);
creaddTN(f,o," ");
break;
}
}
}
else {
o = creTN(f,source);
}
return o;
}
}


A to stahovani nerozumi, ani jaky navod, ci co.
Toto téma je uzamčeno. Odpověď nelze zaslat.