Author |
Topic |
|
darkmercenary44
Starting Member
USA
11 Posts |
Posted - 03 November 2002 : 01:31:07
|
I was wondering if it was possible , without HTML on, to somehow modify snitz to put a table with a white background and black border in the post when someone used the keyword code, like Yabb Forums do, and then put the text after the code keyword in that table. I loved this feature but don't want to enable HTML to be ablt to do it. Does anyone know what file needs to be edited to do this and umm... well what I should put in it to achieve this. |
Edited by - ruirib on 08 November 2002 08:16:42 |
|
Hamlin
Advanced Member
United Kingdom
2386 Posts |
Posted - 03 November 2002 : 04:18:21
|
You will need to change the ReplaceCodeTags function in the inc_func_common.asp file.
This code here
CodeTags(1,1,2) = "<pre id=""code""><font face=""courier"" size=""" & strDefaultFontSize & """ id=""code"">"
CodeTags(1,2,2) = "</font id=""code""></pre id=""code"">"
Can have the border wrapped around it, I did it a while ago like this.
CodeTags(1,1,2) = "<table border=""0"" width=""80%"" cellspacing=""0"" cellpadding=""0"">" & _
"<tr><td><span class=""textFrontRed"">Code Snippet</span><BR><hr noshade size=""1""></td></tr>" & _
"<tr>" & _
"<td>" & _
"<table border=""0"" width=""100%"" cellspacing=""0"" cellpadding=""1"">" & _
"<tr>" & _
"<td bgcolor=""#000000"">" & _
"<table border=""0"" cellspacing=""0"" cellpadding=""2"" width=""100%""><tr><td bgcolor=""lightsteelblue"">" & _
"<pre id=""code""><span class=""textFront"">"
CodeTags(1,2,2) = "</span></pre id=""code"">" & _
"</td></tr></table></td></tr></table><hr noshade size=""1""></td></tr></table>"
Its errm messy but it seemed to work |
|
|
darkmercenary44
Starting Member
USA
11 Posts |
Posted - 04 November 2002 : 01:25:53
|
schweeeeeeet thanks, I'm going to try it right now
|
|
|
darkmercenary44
Starting Member
USA
11 Posts |
Posted - 04 November 2002 : 01:37:07
|
you da man, I <3 you. It worked like a charm, took me a minute to figure out how to get the <font> tag to work, but other than that it was perfect. Thank you so much Hamlin. |
|
|
Gremlin
General Help Moderator
New Zealand
7528 Posts |
Posted - 04 November 2002 : 02:24:45
|
What about if you edit the post after making it with those changes ? does it screw everything up again, becuase it'll be trying to post HTML rather than Forum Code wont it ? |
Kiwihosting.Net - The Forum Hosting Specialists
|
|
|
darkmercenary44
Starting Member
USA
11 Posts |
Posted - 08 November 2002 : 07:53:48
|
Nope, tested it out in my forums, doesn't screw anything up at all! |
|
|
Ez4arab
Junior Member
479 Posts |
Posted - 08 November 2002 : 08:55:00
|
the ezay way to do this to put css around code here
i do this for my forum
inc_header.asp add this at
Response.Write ".code {" & vbNewLine & _
"font-family: Courier, 'Courier New', sans-serif; font-size: 13px; color: #006600;" & vbNewLine & _
"background-color: #FAFAFA; border: #264621; border-style: solid;" & vbNewLine & _
"border-left-width: 1px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px" & vbNewLine & _
"}" & vbNewLine
inc_func_common.asp
fString = doCode(fString, "[code]", "[/code]", "<pre id=""code"" class=""code""><font face=""courier"" size=""" & strDefaultFontSize & """ id=""code"">", "</font id=""code""></pre id=""code"">")
CodeTags(1,1,2) = "<pre id=""code"" class=""code""><font face=""courier"" size=""" & strDefaultFontSize & """ id=""code"">" |
Ez4arab web site Ez4arab | |
Edited by - Ez4arab on 08 November 2002 08:58:49 |
|
|
mortioli
Average Member
United Kingdom
898 Posts |
Posted - 09 November 2002 : 05:12:40
|
Is there a demo anywhere, as I'm confused as what it does |
|
|
Gremlin
General Help Moderator
New Zealand
7528 Posts |
Posted - 09 November 2002 : 05:27:00
|
Take a look at any phpbb2 forum and you'll see quotes are in boxes rather than just Horizontal bars top and bottom, thats what this does basically but for the CODE tag instead. |
Kiwihosting.Net - The Forum Hosting Specialists
|
Edited by - Gremlin on 09 November 2002 05:29:57 |
|
|
mortioli
Average Member
United Kingdom
898 Posts |
Posted - 09 November 2002 : 08:45:20
|
Ah I see! Pretty smart set up |
|
|
Arne2
New Member
Denmark
51 Posts |
Posted - 09 November 2002 : 11:12:42
|
quote: Originally posted by Hamlin
You will need to change the ReplaceCodeTags function in the inc_func_common.asp file.
..snip..
It works fine as long as I remember to change my inc_func_posting.asp to be able to edit the posts as well. I also removed the PRE tag to avoid the left-right scrollbar which is quite annoying.
It is in use here: http://asp.flaaten.dk/proxo/topic.asp?TOPIC_ID=238
|
|
|
|
Topic |
|