Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

-_KIKO_-

Botão enter ou códigos no campo...

Recommended Posts

putz.....ta um isso..o cara tem um campo pra digitarse ele apertar enter tem que dar um espaço de uma linha se o cara digitar :bola: , :triangulo: ou :quadrado: , tem que ser trocado por script de HTML para mostrar imagens....sabem como mapear um campo de texto para que se ele digitar algum enter ou esses tipo de palavras ele converta? tipo...se ele digita um palavrao, eu coloco no sistema que se for palavrão (put* por exemplo) ele converte para **** ....mas isso tem que ser no ASP,,,,teno que fazer com um monte de coisas de variar assim...

Compartilhar este post


Link para o post
Compartilhar em outros sites

:huh:/> acho que naum fui claro

 

 

tipo...é assim...

você digita num campo de texto por exemplo [PINICO] , dai eu quero saber como eu faço para que o ASP na hora que for gravar no DB converte toda a palavra que tiver no texto escritp [PINICO] para http://www.pinico.com.br .........será que dá pra fazer isso? ^o)

Compartilhar este post


Link para o post
Compartilhar em outros sites

ve se isso te ajuda:

Function Palavrao(valor)

dim arrPalavra(2)

 

arrPalavra(0) = "CACHORRO"

arrPalavra(1) = "CAVALO"

arrPalavra(2) = "GALINHA"

 

For i = 0 to Ubound(arrPalavra)

if (valor = arrPalavra(i)) Then

  filtra = Replace(arrPalavra(i),valor,"*******")

  Else

  filtra = valor

End if

Next

 

Palavrao = filtra

End function

 

Response.Write Palavrao("CAVALO")

Compartilhar este post


Link para o post
Compartilhar em outros sites

ve se isso te ajuda:

Function Palavrao(valor)

dim arrPalavra(2)

 

arrPalavra(0) = "CACHORRO"

arrPalavra(1) = "CAVALO"

arrPalavra(2) = "GALINHA"

 

For i = 0 to Ubound(arrPalavra)

if (valor = arrPalavra(i)) Then

  filtra = Replace(arrPalavra(i),valor,"*******")

  Else

  filtra = valor

End if

Next

 

Palavrao = filtra

End function

 

Response.Write Palavrao("CAVALO")

ñ era bem isso...isso é mais para palavrão....mas tou falando assim...

se tiver um codigo também no meio, além de palavrão, tipo :BOLD: ...se tiver escrito :BOLD: no meio do texto, eu quero que ele converta para <B > por exemplo....

 

tem como me falar? parece ser tão simples

Compartilhar este post


Link para o post
Compartilhar em outros sites

cara da uma olhada no codigo do webwiz, é +- o q você qer

 

'******************************************'***   Format Forum Codes Function    *****'******************************************'Format Forum Codes Function to covert forum codes to HTMLPrivate Function FormatForumCodes(ByVal strMessage)	Dim strTempMessageLink  'Temporary word hold for e-mail and url words	Dim strMessageLink  'Holds the new mesage link that needs converting back into code	Dim lngLinkStartPos  'Holds the start position for a link	Dim lngLinkEndPos  'Holds the end position for a word	Dim intLoop 	 'Loop counter	'If emoticons are on then change the emotion symbols for the path to the relative smiley icon	If blnEmoticons = True Then  'Loop through the emoticons array  For intLoop = 1 to UBound(saryEmoticons) 	 strMessage = Replace(strMessage, saryEmoticons(intLoop,2), "<img border=""0"" src=""" & saryEmoticons(intLoop,3) & """>", 1, -1, 1)  Next	End If	'Change my own codes for bold and italic HTML tags back to the normal satandard HTML tags	strMessage = Replace(strMessage, "[B]", "<strong>", 1, -1, 1)	strMessage = Replace(strMessage, "[/B]", "</strong>", 1, -1, 1)	strMessage = Replace(strMessage, "[I]", "<em>", 1, -1, 1)	strMessage = Replace(strMessage, "[/I]", "</em>", 1, -1, 1)	strMessage = Replace(strMessage, "[U]", "<u>", 1, -1, 1)	strMessage = Replace(strMessage, "[/U]", "</u>", 1, -1, 1)	strMessage = Replace(strMessage, "[HR]", "<hr />", 1, -1, 1)	strMessage = Replace(strMessage, "[LIST=1]", "<ol>", 1, -1, 1)	strMessage = Replace(strMessage, "[/LIST=1]", "</ol>", 1, -1, 1)	strMessage = Replace(strMessage, "[LIST]", "<ul>", 1, -1, 1)	strMessage = Replace(strMessage, "[/LIST]", "</ul>", 1, -1, 1)	strMessage = Replace(strMessage, "[LI]", "<li>", 1, -1, 1)	strMessage = Replace(strMessage, "[/LI]", "</li>", 1, -1, 1)	strMessage = Replace(strMessage, "[CENTER]", "<center>", 1, -1, 1)	strMessage = Replace(strMessage, "[/CENTER]", "</center>", 1, -1, 1)	strMessage = Replace(strMessage, "[P ALIGN=CENTER]", "<p align=center>", 1, -1, 1)	strMessage = Replace(strMessage, "[P ALIGN=LEFT]", "<p align=left>", 1, -1, 1)	strMessage = Replace(strMessage, "[P ALIGN=RIGHT]", "<p align=right>", 1, -1, 1)	strMessage = Replace(strMessage, "[DIV ALIGN=CENTER]", "<div align=center>", 1, -1, 1)	strMessage = Replace(strMessage, "[DIV ALIGN=LEFT]", "<div align=left>", 1, -1, 1)	strMessage = Replace(strMessage, "[DIV ALIGN=RIGHT]", "<div align=right>", 1, -1, 1)	strMessage = Replace(strMessage, "[DIV]", "<div>", 1, -1, 1)	strMessage = Replace(strMessage, "[/DIV]", "</div>", 1, -1, 1)	strMessage = Replace(strMessage, "[P]", "<p>", 1, -1, 1)	strMessage = Replace(strMessage, "[/P]", "</p>", 1, -1, 1)	strMessage = Replace(strMessage, "[BLOCKQUOTE]", "<blockquote>", 1, -1, 1)	strMessage = Replace(strMessage, "[/BLOCKQUOTE]", "</blockquote>", 1, -1, 1)	strMessage = Replace(strMessage, "[SIZE=1]", "<font size=""1"">", 1, -1, 1)	strMessage = Replace(strMessage, "[SIZE=2]", "<font size=""2"">", 1, -1, 1)	strMessage = Replace(strMessage, "[SIZE=3]", "<font size=""3"">", 1, -1, 1)	strMessage = Replace(strMessage, "[SIZE=4]", "<font size=""4"">", 1, -1, 1)	strMessage = Replace(strMessage, "[SIZE=5]", "<font size=""5"">", 1, -1, 1)	strMessage = Replace(strMessage, "[SIZE=6]", "<font size=""6"">", 1, -1, 1)	strMessage = Replace(strMessage, "[FONT=Arial]", "<font face=""Arial, Helvetica, sans-serif"">", 1, -1, 1)	strMessage = Replace(strMessage, "[FONT=Courier]", "<font face=""Courier New, Courier, mono"">", 1, -1, 1)	strMessage = Replace(strMessage, "[FONT=Times]", "<font face=""Times New Roman, Times, serif"">", 1, -1, 1)	strMessage = Replace(strMessage, "[FONT=Verdana]", "<font face=""Verdana, Arial, Helvetica, sans-serif"">", 1, -1, 1)	strMessage = Replace(strMessage, "[BLACK]", "<font color=""black"">", 1, -1, 1)	strMessage = Replace(strMessage, "[WHITE]", "<font color=""white"">", 1, -1, 1)	strMessage = Replace(strMessage, "[BLUE]", "<font color=""blue"">", 1, -1, 1)	strMessage = Replace(strMessage, "[RED]", "<font color=""red"">", 1, -1, 1)	strMessage = Replace(strMessage, "[GREEN]", "<font color=""green"">", 1, -1, 1)	strMessage = Replace(strMessage, "[YELLOW]", "<font color=""yellow"">", 1, -1, 1)	strMessage = Replace(strMessage, "[ORANGE]", "<font color=""orange"">", 1, -1, 1)	strMessage = Replace(strMessage, "[BROWN]", "<font color=""brown"">", 1, -1, 1)	strMessage = Replace(strMessage, "[MAGENTA]", "<font color=""magenta"">", 1, -1, 1)	strMessage = Replace(strMessage, "[CYAN]", "<font color=""cyan"">", 1, -1, 1)	strMessage = Replace(strMessage, "[LIME GREEN]", "<font color=""limegreen"">", 1, -1, 1)	strMessage = Replace(strMessage, "[/FONT]", "</font>", 1, -1, 1)	'Loop through the message till all or any images are turned into HTML images	Do While InStr(1, strMessage, "[IMG=", 1) > 0  AND InStr(1, strMessage, "]", 1) > 0  'Find the start position in the message of the [IMG= code  lngLinkStartPos = InStr(1, strMessage, "[IMG]", 1)  'Find the position in the message for the ]] closing code  lngLinkEndPos = InStr(lngLinkStartPos, strMessage, "[/IMG]", 1) + 6  'Read in the code to be converted into a hyperlink from the message  strMessageLink = Trim(Mid(strMessage, lngLinkStartPos, (lngLinkEndPos - lngLinkStartPos)))  'Place the message link into the tempoary message variable  strTempMessageLink = strMessageLink  'Format the IMG tages into an HTML image tag  strTempMessageLink = Replace(strTempMessageLink, "[IMG=", "<img src=""", 1, -1, 1)  strTempMessageLink = Replace(strTempMessageLink, "]", """>", 1, -1, 1)  'Place the new fromatted hyperlink into the message string body  strMessage = Replace(strMessage, strMessageLink, strTempMessageLink, 1, -1, 1)	Loop	'Loop through the message till all or any hyperlinks are turned into HTML hyperlinks	Do While InStr(1, strMessage, "[URL=", 1) > 0 AND InStr(1, strMessage, "[/URL]", 1) > 0  'Find the start position in the message of the [URL= code  lngLinkStartPos = InStr(1, strMessage, "[URL=", 1)  'Find the position in the message for the [/URL] closing code  lngLinkEndPos = InStr(lngLinkStartPos, strMessage, "[/URL]", 1) + 6  'Make sure the end position is not in error  If lngLinkEndPos - lngLinkStartPos =< 5 Then lngLinkEndPos = lngLinkStartPos + 5  'Read in the code to be converted into a hyperlink from the message  strMessageLink = Trim(Mid(strMessage, lngLinkStartPos, (lngLinkEndPos - lngLinkStartPos)))  'Place the message link into the tempoary message variable  strTempMessageLink = strMessageLink  'Format the link into an HTML hyperlink  strTempMessageLink = Replace(strTempMessageLink, "[URL=", "<a href=""", 1, -1, 1)  strTempMessageLink = Replace(strTempMessageLink, "[/URL]", "</a>", 1, -1, 1)  strTempMessageLink = Replace(strTempMessageLink, "]", """>", 1, -1, 1)  'Place the new fromatted hyperlink into the message string body  strMessage = Replace(strMessage, strMessageLink, strTempMessageLink, 1, -1, 1)	Loop	'Loop through the message till all or any email links are turned into HTML mailto links	Do While InStr(1, strMessage, "[EMAIL=", 1) > 0 AND InStr(1, strMessage, "[/EMAIL]", 1) > 0  'Find the start position in the message of the [EMAIL= code  lngLinkStartPos = InStr(1, strMessage, "[EMAIL=", 1)  'Find the position in the message for the [/EMAIL] closing code  lngLinkEndPos = InStr(lngLinkStartPos, strMessage, "[/EMAIL]", 1) + 8  'Make sure the end position is not in error  If lngLinkEndPos - lngLinkStartPos =< 7 Then lngLinkEndPos = lngLinkStartPos + 7  'Read in the code to be converted into a email link from the message  strMessageLink = Trim(Mid(strMessage, lngLinkStartPos, (lngLinkEndPos - lngLinkStartPos)))  'Place the message link into the tempoary message variable  strTempMessageLink = strMessageLink  'Format the link into an HTML mailto link  strTempMessageLink = Replace(strTempMessageLink, "[EMAIL=", "<a href=""mailto:", 1, -1, 1)  strTempMessageLink = Replace(strTempMessageLink, "[/EMAIL]", "</a>", 1, -1, 1)  strTempMessageLink = Replace(strTempMessageLink, "]", """>", 1, -1, 1)  'Place the new fromatted HTML mailto into the message string body  strMessage = Replace(strMessage, strMessageLink, strTempMessageLink, 1, -1, 1)	Loop	'Loop through the message till all or any files are turned into HTML hyperlinks	Do While InStr(1, strMessage, "[FILE=", 1) > 0 AND InStr(1, strMessage, "[/FILE]", 1) > 0  'Find the start position in the message of the [FILE= code  lngLinkStartPos = InStr(1, strMessage, "[FILE=", 1)  'Find the position in the message for the [/FILE] closing code  lngLinkEndPos = InStr(lngLinkStartPos, strMessage, "[/FILE]", 1) + 7  'Make sure the end position is not in error  If lngLinkEndPos - lngLinkStartPos =< 6 Then lngLinkEndPos = lngLinkStartPos + 6  'Read in the code to be converted into a hyperlink from the message  strMessageLink = Trim(Mid(strMessage, lngLinkStartPos, (lngLinkEndPos - lngLinkStartPos)))  'Place the message link into the tempoary message variable  strTempMessageLink = strMessageLink  'Format the link into an HTML hyperlink  strTempMessageLink = Replace(strTempMessageLink, "[FILE=", "<a target=""_blank"" href=""", 1, -1, 1)  strTempMessageLink = Replace(strTempMessageLink, "[/FILE]", "</a>", 1, -1, 1)  strTempMessageLink = Replace(strTempMessageLink, "]", """>", 1, -1, 1)  'Place the new fromatted hyperlink into the message string body  strMessage = Replace(strMessage, strMessageLink, strTempMessageLink, 1, -1, 1)	Loop	'Return the function	FormatForumCodes = strMessageEnd Function

Compartilhar este post


Link para o post
Compartilhar em outros sites

então o negócio é só colocar isso?

 

strMessage = Replace(strMessage, "[SIZE=5]", "<font size=""5"">", 1, -1, 1)

mas me explica ae...q q eh strMessage e oque é esses numeros ai no final ,1,-1,1...

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.