Css quote (Italian version based on MarcelG mod)

Snitz™ Forums 2000
https://forum.snitz.com/forumTopic/Posts/59856?pagenum=1
05 November 2025, 16:53

Topic


squek
Css quote (Italian version based on MarcelG mod)
13 October 2005, 13:56


These is an Italian version of the alternative quoting method based on the original mod by MarcelG (http://forum.snitz.com/forum/topic.asp?ARCHIVE=true&TOPIC_ID=53896&SearchTerms=quotetd)

These are the steps to obtain this quoting method:


You have to modify <b>inc_fun_common.asp</b>, <b>inc_func_posting.asp</b>, <b>inc_header.asp</b>, <b>inc_header_short.asp</b> and <b>post.asp</b>.
<font color="red"><b>Warning</b></font id="red">: remove the <font color="red">*</font id="red"> which are in [*quote] and [*/quote], I have to use them here to show the code correctly.
<b>Let's start, in inc_func_common.asp search for this:</b>


fString = doCode(fString, "[*quote]", "[*/quote]", "<blockquote id=""quote""><font size=""" & strFooterFontSize & """ face=""" & strDefaultFontFace & """ id=""quote"">Citazione:<hr height=""1"" noshade id=""quote"">", "<hr height=""1"" noshade id=""quote""></blockquote id=""quote""></font id=""quote"">")
end if


<b>and replace with this:</b>

fString = doCode(fString, "[*quote]", "[*/quote]", "<div align=""center"" id=""quote2""><table class=""quote""><tr><td class=""quotetd""></td></tr><tr><td class=""quotetd2""><span class=""quotetext"">", "</span></td></tr></table></div align=""center"" id=""quote2"">")
end if


<b>
In in_func_posting.asp search for this:</b>


fString = replace(fString, "<BLOCKQUOTE id=quote><font size=" & strFooterFontSize & " face=""" & strDefaultFontFace & """ id=quote>Citazione:<hr height=1 noshade id=quote>","[*quote]", 1, -1, 1)


fString = replace(fString, "<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face=""" & strDefaultFontFace & """ size=" & strDefaultFontSize & " id=quote>","[*/quote]", 1, -1, 1)
'##
fString = replace(fString, "<blockquote id=""quote""><font size=""" & strFooterFontSize & """ face=""" & strDefaultFontFace & """ id=""quote"">Citazione:<hr height=""1"" noshade id=""quote"">","[*quote]", 1, -1, 1)


<b>and replace with this:</b>


fString = replace(fString, "<BLOCKQUOTE id=quote><font size=" & strFooterFontSize & " face=""" & strDefaultFontFace & """ id=quote>quote:<hr height=1 noshade id=quote>","[*quote]", 1, -1, 1)
fString = replace(fString, "<div align=""center"" id=""quote2""><table class=""quote""><tr><td class=""quotetd""></td></tr><tr><td class=""quotetd2""><span class=""quotetext"">","[*quote]", 1, -1, 1)
fString = replace(fString, "</span></td></tr></table></div align=""center"" id=""quote2"">","[*/quote]", 1, -1, 1)
fString = replace(fString, "<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face=""" & strDefaultFontFace & """ size=" & strDefaultFontSize & " id=quote>","[*/quote]", 1, -1, 1)
'##

fString = replace(fString, "<blockquote id=quote>quote:<hr size=1 noshade id=quote>","[*quote]", 1, -1, 1)
fString = replace(fString, "<hr size=1 noshade id=quote></blockquote id=quote>","[*/quote]", 1, -1, 1)


<b>
In inc_header.asp search for this:</b>


"a:active {color:" & strActiveLinkColor & ";text-decoration:" & strActiveTextDecoration & "}" & vbNewLine & _



<b>and copy this below it:</b>

"table.quote {width: 90%; border: 0px " & strTableBorderColor & " solid}" & vbNewLine & _
".quotetd {width: 100%; border: 0px #D1D7DC solid}" & vbNewLine & _
".quotetd2 {background-color: #FFFFFF ; width: 100%; border: 1px #D1D7DC solid; border-collapse: separate; padding: 0.3em}" & vbNewLine & _
".quotetext {font-family: "& strDefaultFontFace &"; font-size: 8pt; color: #000000}" & vbNewLine & _



<b>In inc_header_short.asp search for this:</b>


".spnMessageText a:link {color:" & strForumLinkColor & ";text-decoration:" & strForumLinkTextDecoration & "}" & vbNewLine & _


<b>and copy this below it:</b>


"table.quote {width: 90%; border: 0px " & strTableBorderColor & " solid}" & vbNewLine & _
".quotetd {width: 100%; border: 0px d1d7dc solid}" & vbNewLine & _
".quotetd2 {background-color: #ffffff ; width: 100%; border: 1px #d1d7dc solid; border-collapse: separate; padding: 0.3em}" & vbNewLine & _
".quotetext {font-family: "& strDefaultFontFace &"; font-size: 8pt; color: #000000}" & vbNewLine & _



<b>in post.asp search for this (it's the italian version):</b>

TxtMsg = "[*quote]Messaggio inserito da " & chkString(rs("M_NAME"),"display") & "" & vbNewline


<b>and replace with this ("ha scritto" means "wrote"):</b>


TxtMsg = "[*quote]" & chkString(rs("M_NAME"),"display") & " ha scritto:
" & vbNewline


<b>Then search for this:</b>

TxtMsg = "[*quote]Messaggio inserito da " & chkString(rs("M_NAME"),"display") & "" & vbNewline


<b>and replace with this:</b>

TxtMsg = "[*quote]Messaggio di " & chkString(rs("M_NAME"),"display") & "" & vbNewline


<b>That's all.</b>

<b>Thanks to MarcelG for the original mod and to Plasma (www.ciricadoforum.it) for the collaboration</b>.
Now I'm trying to obtain a quoting method much more similar to the phpBB one, with few "strange" code (I mean [*b][/b] etc...) on the reply window (that is a frequent problem for newbie users of forums, I always have to correct their quoted messages because they accidentally remove part of the quoting forum code!).
I'd like to have the code [*quote="John Doe"] to quote a previous post by John Doe (an example) into mine (i.e. when I click on in topic.asp.
This code should generate this style:


While, to quote in the standard method I'd like to use simply the quote button in post.asp: .
But really dunno how to obtain this...
So, I need some help! bigsmile

 

Replies ...


MarcelG
13 October 2005, 15:21


squek, excuse me for saying this, but this code is the EXACT code I used in my mod, of mid last year. shock The QuoteTD, QuoteTD2 and QuoteText are the same style classes used for 'my' quote code, and almost the entire how-to is the same as my post on this. Except, your how to refers to the 'Italian' version.
I'm not entirely sure what point you are trying to make with this 'new mod', especially since I updated my own mod 6 days ago, to use DIV's instead of these TD's (which, as I said, were used in my first version of this mod.)
I know that this piece of software is open source, but posting a mod made by someone else as your own - even one as simple as this one - is kind of....strange. dead
The last part of your post - the question - is also not entirely clear to me. What are you trying to do ?<
squek
13 October 2005, 16:15


The last part of your post - the question - is also not entirely clear to me. What are you trying to do ?
That's probably because my english is so poor... I'll try to explain it better.
Well, in phpBB bullettin when you quote someone else's post clicking on the replyquote button you have this forum code in the posting window:



I was wondering if it is possible to have the same forum code in snitz, because if I use the mod above (YOUR mod, at least...) I have this forum code in the posting window:

Code:
[*quote][*b]Guy wrote[*/b][*br]His message[*/quote] And here you write your message....

And very often the users of my forum (most of them are newbies...) delete part of the code accidentally when they answer, probably because there's all that b, /b, br which are not so simple to understand for someone who is not so familiar with bullettins.
Also, the string that says "Guy wrote" in phpBB is outside the quoted text, vertically aligned to it and in the same size, as the image I've added above (that's is particulary pratical when you have a multi quoted message, because it appears simpler who is quoting who).
That's all, I was only wondering if there's a way to obtain this.

P.S.: I've edited my post here and on OneWayMule with the correct credits for the mod. Sorry again.
<
MarcelG
14 October 2005, 07:37


Thank you for straightening this out.
I've looked into your request, but I think it's a big challenge to make that....at least, the way you want it to look like. I guess it would be doable if using a rather clever trick...a rather very clever trick.
Let me see what I can come up with.<
MarcelG
14 October 2005, 07:54


Done. bigsmile Okay, not with the [quote="bla"][/quote] tag, and not with this version of the CSS quote mod, but with the [quote='bla'][/quote] tag (single quotes instead of double quotes), and based on my CSS quote DIV's mod of a week ago. I've hightlighted the appropriate things to change, in case you want to adapt it to your current table-layout quotestyle.
Copy this function into inc_func_common.asp:
Code:
Function ReplaceQuotes(ByVal strToFormat)
Dim oTag, c1Tag, c2Tag
Dim roTag, rc1Tag, rc12Tag, rc2Tag
Dim oTagPos, c1TagPos, oTagPos2, c1TagPos2
Dim Counter
Dim strArray, strArray2
Dim strFirstPart, strSecondPart

oTag = "[quote='"
c1Tag = "']"
c2Tag = "[/quote]"

roTag = "<div class=""quoteboxhead"">" rc1Tag = " ha scritto</div><div class=""quotebox"">"
rc2Tag = "</div>"

oTagPos = InStr(1, strToFormat, oTag, 1) 'Position of opening tag
c1TagPos = InStr(1, strToFormat, c1Tag, 1) 'Position of closing tag

'if opening tag and closing tag is found... If (oTagpos > 0) And (c1TagPos > 0) Then
'Split string at the opening tag
strArray = Split(strToFormat, oTag, -1, 1)

'Loop through array
For Counter = 0 To UBound(strArray)
'if the closing tag is found in the string then... If (InStr(1, strArray(Counter), c1Tag, 1) > 0) Then
'split string at the closing tag... strArray2 = Split(strArray(Counter), c1Tag, -1, 1)
strArray2(0) = replace(strArray2(0), """", """) ' ## replace by entity equivalent
strArray2(0) = replace(strArray2(0), "(c)", "©", 1, -1, 1) ' ## replace by entity equivalent
strArray2(0) = replace(strArray2(0), "(r)", "®", 1, -1, 1) ' ## replace by entity equivalent
strArray2(0) = replace(strArray2(0), "(tm)", "™", 1, -1, 1) ' ## replace by entity equivalent
strArray2(0) = replace(strArray2(0), ">", ">", 1, -1, 1) ' ## replace by entity equivalent
strArray2(0) = replace(strArray2(0), "<", "<", 1, -1, 1) ' ## replace by entity equivalent
strArray2(0) = replace(strArray2(0), vbTab, " ", 1, -1, 1) ' ## filter out Tabs
strArray2(0) = replace(strArray2(0), "view-source", " ", 1, -1, 1) ' ## filter out view-source
strArray2(0) = replace(strArray2(0), "javascript", " ", 1, -1, 1) ' ## filter out javascript
strArray2(0) = replace(strArray2(0), "jscript", " ", 1, -1, 1) ' ## filter out jscript
strArray2(0) = replace(strArray2(0), "vbscript", " ", 1, -1, 1) ' ## filter out vbscript

'if the closing url tag is found in the string
If InStr(1, strArray2(1), c2Tag, 1) then

strFirstPart = Left(strArray2(1), InStr(1, strArray2(1), c2Tag, 1)-1)
strSecondPart = Right(strArray2(1), (Len(strArray2(1)) - Instr(1, strArray2(1), c2Tag,1) - len(c2Tag)+1))

ReplaceQuotes = ReplaceQuotes & roTag & strArray2(0) & rc1Tag & strFirstPart & rc2Tag & strSecondPart
Else
ReplaceQuotes = ReplaceQuotes & roTag & strArray2(0) & rc1Tag & strArray2(0) & rc2Tag & strArray2(1)
End If
Else
ReplaceQuotes = ReplaceQuotes & strArray(Counter)
End If
Next
Else
ReplaceQuotes = strToFormat
End If
End Function
(it might be that the code function here at Snitz has garbled the function. So, to be sure, check the function at the source (login demo/demo))

Find this line in inc_func_common.asp :
Code:
fString = extratags(fString)
Directly above it put the following line:
Code:
fString = ReplaceQuotes(fString)

That's it.<
squek
14 October 2005, 09:23


Wow, thanks! Uhm... I've copied the code exactly as you said, but if I copy
Code:
fString = ReplaceQuotes(fString) 

above this:
Code:
fString = extratags(fString)

I get this:
Code:
if strAllowForumCode = "1" then
fString = ReplaceQuotes(fString)
fString = extratags(fString)
end if
Is it right?
Now I have to modify the css I'm usig with your new one with the DIVs, right?<
squek
14 October 2005, 10:01


Uhm... I've modified the red code as this:
Code:
	roTag = "<td class=""quotetd"">"
rc1Tag = " ha scritto: </td><td class=""quotetd2"">"
rc2Tag = "</td>"

To use it with the td css... but I'm still getting the same forum code as before...<
SiSL
14 October 2005, 10:26


Below might work with quote tags :)

Code:

	oTag = "
" & chr(34)
c1Tag = chr(34) & "
"
c2Tag = "
"
<
Shaggy
14 October 2005, 10:34


You'll need to modify the function that inserts the [quote] tags in inc_code.js as well.
<
squek
14 October 2005, 10:40


So I have to replace this:
Code:
oTag = "
'"
c1Tag = "'
"
c2Tag = "
"
with this:
Code:
oTag = "
" & chr(34)
c1Tag = chr(34) & "
"
c2Tag = "
"

Still getting the same forum code...[*quote][*b]Daniele ha scritto:[*/b][*br]....[*/quote]<
squek
14 October 2005, 10:43


Originally posted by Shaggy
You'll need to modify the function that inserts the [quote] tags in inc_code.js as well.
How?<
SiSL
14 October 2005, 11:05


But that also makes problem at double quotes such as quote inside quotes.<
SiSL
14 October 2005, 11:11


Originally posted by Shaggy
You'll need to modify the function that inserts the [quote] tags in inc_code.js as well.
How?
Click Here<
squek
14 October 2005, 11:37


It keeps calling back the old style...<
SiSL
14 October 2005, 13:11


Ok, I did a little bit more tricky than Marcel

Code:
Function ReplaceQuotes(ByVal strToFormat)
Dim oTag, c1Tag, c2Tag
Dim roTag, rc1Tag, rc12Tag, rc2Tag
Dim oTagPos, c1TagPos, oTagPos2, c1TagPos2
Dim Counter
Dim strArray, strArray2
Dim strFirstPart, strSecondPart

oTag = "
" & chr(34)
c1Tag = chr(34) & "
"
'c2Tag = "[/quote]"
roTag = "<div class=""quoteboxhead""><b>"
rc1Tag = " quote:</b></div class=""quoteboxhead""><div class=""quotebox"">"
'rc2Tag = "</div id=""quotebox""">"

oTagPos = InStr(1, strToFormat, oTag, 1) 'Position of opening tag
c1TagPos = InStr(1, strToFormat, c1Tag, 1) 'Position of closing tag

'if opening tag and closing tag is found... If (oTagpos > 0) And (c1TagPos > 0) Then
'Split string at the opening tag
strArray = Split(strToFormat, oTag, -1, 1)

'Loop through array
For Counter = 0 To UBound(strArray)
'if the closing tag is found in the string then... If (InStr(1, strArray(Counter), c1Tag, 1) > 0) Then
'split string at the closing tag... strArray2 = Split(strArray(Counter), c1Tag, -1, 1)
strArray2(0) = replace(strArray2(0), """", """) ' ## replace by entity equivalent
strArray2(0) = replace(strArray2(0), "(c)", "©", 1, -1, 1) ' ## replace by entity equivalent
strArray2(0) = replace(strArray2(0), "(r)", "®", 1, -1, 1) ' ## replace by entity equivalent
strArray2(0) = replace(strArray2(0), "(tm)", "™", 1, -1, 1) ' ## replace by entity equivalent
strArray2(0) = replace(strArray2(0), ">", ">", 1, -1, 1) ' ## replace by entity equivalent
strArray2(0) = replace(strArray2(0), "<", "<", 1, -1, 1) ' ## replace by entity equivalent
strArray2(0) = replace(strArray2(0), vbTab, " ", 1, -1, 1) ' ## filter out Tabs
strArray2(0) = replace(strArray2(0), "view-source", " ", 1, -1, 1) ' ## filter out view-source
strArray2(0) = replace(strArray2(0), "javascript", " ", 1, -1, 1) ' ## filter out javascript
strArray2(0) = replace(strArray2(0), "jscript", " ", 1, -1, 1) ' ## filter out jscript
strArray2(0) = replace(strArray2(0), "vbscript", " ", 1, -1, 1) ' ## filter out vbscript

'if the closing url tag is found in the string
If InStr(1, strArray2(1), c2Tag, 1) then

strFirstPart = Left(strArray2(1), InStr(1, strArray2(1), c2Tag, 1)-1)
strSecondPart = Right(strArray2(1), (Len(strArray2(1)) - Instr(1, strArray2(1), c2Tag,1) - len(c2Tag)+1))

ReplaceQuotes = ReplaceQuotes & roTag & "Quoted from : " & strArray2(0) & rc1Tag & strFirstPart & rc2Tag & strSecondPart
Else
ReplaceQuotes = ReplaceQuotes & roTag & "Quoted from : " & strArray2(0) & rc1Tag & strArray2(0) & rc2Tag & strArray2(1)
End If
Else
ReplaceQuotes = ReplaceQuotes & strArray(Counter)
End If
Next
Else
ReplaceQuotes = strToFormat
End If
ReplaceQuotes = Replace(Replace(ReplaceQuotes,"
","</div>"),"[quote]","<div class=""quoteboxhead""><b>quote:</b></div><div class=""quotebox"">") End Function
<
squek
14 October 2005, 13:31


Just, let me understand... this code works with the inc_func_common, inc_func_posting, post and inc_header as the ones I've modified in the first post? Really, I can't make it works even if I modified that red code...<
SiSL
14 October 2005, 13:36


This was for inc_func_common.asp assuming you have did what Marcel said and this was kinda change of "function" marcelg wrote above.<
squek
14 October 2005, 14:12


I surrender... I'm not able to modify it.<
squek
19 October 2005, 03:02


Is there someone who can modify my files for me? I really can't find where I make something wrong... Here they are. http://www.hostfiles.org/files/20051019091123_squek.zip

Thanks in advance.<
SiSL
19 October 2005, 04:00


I did two changes to your inc_func_common.asp

here it is http://www.amedia.org/forum/inc_func_common_squek.zip


1st change added red line around line 457:

Code:
	if strAllowForumCode = "1" then
fString = ReplaceQuotes(fString) fString = extratags(fString)
end if

And second change added full function of ReplaceQuotes... So you can now user [quote="name"][/quote] as usage... Sorry no Italian here so you may change your words..
<
squek
19 October 2005, 04:35


It doesen't seems to work... I'm still having [*quote][b]Name wrote: instead of
"name"
if I reply to a message clicking on the "quote message" button in topic.asp... maybe there's something to remove in the other files, maybe the css or something else...<
SiSL
19 October 2005, 04:38


No, I didnt change anything on how to add Quote with your Javascript on Post.asp

I just changed how you can use it by manually writing.<
squek
19 October 2005, 04:48


Even if I manually write it I get this:
<
SiSL
19 October 2005, 05:01


Remove following line or comment (simply add a ' in front of it at line 1008

Code:
fString = doCode(fString, "[quote]", "[/quote]", "<div align=""center"" id=""quote2""><table class=""quote""><tr><td class=""quotetd""></td></tr><tr><td class=""quotetd2""><span class=""quotetext"">", "</span></td></tr></table></div align=""center"" id=""quote2"">")
<
SiSL
19 October 2005, 05:24


Oops and sorry, there is a function that I use for my own language there,

I uploaded file again for you...<
squek
19 October 2005, 05:54


Uhm... same as above... If I add ' in fronto of that part of cod I don't even get any quote style but only the simple text in the new message.
Maybe that's because in my css I use TD instead of DIV?<
SiSL
19 October 2005, 08:57


Weird really.<
© 2000-2021 Snitz™ Communications