Author |
Topic |
|
nankingrevenge
Starting Member
36 Posts |
Posted - 23 November 2002 : 10:52:18
|
I'm new to ASP but am learning, so I'm not a complete newbie but close to it.
I have an idea that I'd like to try coding.
I believe the actual coding would be related to a smiley mod. The idea is this.
The user would enter the following post:
Check out the following position and give me some advice.
[D] rbbqknnr/pppppppp/8/8/8/8/PPPPPPPP/RBBQKNNR w KQkq -
The [D] would be a new Forum Code. The rest of the line is actually a description for a chess position. What I want my mod to do is to be able to render a graphical chessboard depicting the diagram. So the actual post would look like this:
Check out the following position and give me some advice.
[D] rbbqknnr/pppppppp/8/8/8/8/PPPPPPPP/RBBQKNNR w KQkq -
The actual image would be created on the fly by my ASP script, which I think only needs to be a single function. The returned HTML code would utilize tables, colored cells and chess piece graphics to render the board. I think I'm adept enough in ASP to be able to code that part. My question is how to incorporate that script into Snitz Forums. Which files should I be looking at to make my changes?
Actually, I think all I would need is something that would detect the forum code [D], then take the rest of the line and pass it as an argument to a RenderChessBoard function that would return the appropriate HTML code. What do you think?
Thanks in advance for any guidance. |
|
laser
Advanced Member
Australia
3859 Posts |
Posted - 23 November 2002 : 16:25:00
|
Sounds like an awesome MOD,
quote:
Actually, I think all I would need is something that would detect the forum code [D], then take the rest of the line and pass it as an argument to a RenderChessBoard function that would return the appropriate HTML code. What do you think?
Sounds good to me, but I'm just attempting my first MOD as well. The translation of the tags is done in inc_func_common.asp, just search for [b]
Let us know your progress, it will be interesting to see this one working (although I don't understand the notation you're using) |
|
|
nankingrevenge
Starting Member
36 Posts |
Posted - 23 November 2002 : 17:45:50
|
After searching the forum for "chess", I came across the topic http://forum.snitz.com/forum/topic.asp?ARCHIVE=true&TOPIC_ID=34248 which relates to Othello.
After reading it, I'm starting to think that perhaps my implementation won't be as easy as I first thought. In my forum, I have forum code ON and html OFF. However, when I implement my proposed mod, it will scan for a new forum code [D] and insert a diagram generated by the mod which is an HTML table. Judging from the Othello thread, it sounds like I'm asking for trouble if I mix forum code and HTML.
Am I being paranoid, or can I can go forward with the mod as described above? |
|
|
laser
Advanced Member
Australia
3859 Posts |
Posted - 23 November 2002 : 18:39:31
|
I don't think so, wouldn't it work the same way as the [b] tag ? as in, the tag is still [b] but gets translated to <b> just prior to rendering.
I might be pushing you down the right track, but I think it's doable. |
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 23 November 2002 : 21:19:33
|
why not use the id attribute for each block and accordingly move the pics |
|
|
DoraMoon
Average Member
Taiwan
661 Posts |
Posted - 23 November 2002 : 23:25:54
|
hi~ nankingrevenge, message received, and just reply here...
i also posted a similar mod request about special chess content sometime ago.. http://forum.snitz.com/forum/topic.asp?TOPIC_ID=34247 (and no one care me......)
i'm not sure what script/EPD diagram?? you used for generating the Chess board. in my situation, it's a Java Applet code to get the dynamic Othell chess book. (just take from a famous Othell program - WZebra http://www.nada.kth.se/~gunnar/othello.html)
at beginning, i use the most stupid method , i turn on HTML and teach my chess friends how to copy/paste the Java Applet code in their posts. but later, i know turn on HTML really not a good choice, so i try to find another solution to do this job. (see above link topic for deatail...)
now i've this done totally with "Forum Code" on 3.3 (my chess forum is closed... and it seem no hope to get back in a short time. but i think it's the same doing in 3.4). in generally, the usage of "Forum Code" just transform some [xx] to "HTML code" <xx....> in post message.
so if your original chess code program use HTML to generate Chess board image, i think it's no problem to change it to Forum Code !! the basic rule between them just the replace("[xx]","<xx...>") string replace function, that's all.. (but of course, if the Html code is complex... i really need a lots transform work...)
my custom Chess forum code just a little modified form the [ list ][ * ][ /* ][ /list ].(change <li...> to <applet....>...) if your chess code also suitable by this method, just let me know again, i'll post my chess forum code to be a reference for you. |
|
|
DoraMoon
Average Member
Taiwan
661 Posts |
Posted - 23 November 2002 : 23:55:00
|
hi~ nankingrevenge, here is a my test demo site on 3.4 (sorry the super slow speed and pop-up ad), and the chess forum code still work ! http://c.1asphost.com/doramoon/forum/forum.asp?FORUM_ID=1
(and please ignore the ????????, the free server got some problem to show Chinese words..)
just go into above forum and view anyone topic. (the topics NEW!! ??????? is using the forum code to generate the Chess board..) now i have three different dynamic chess code/java applet available, and one new alternative [ img ] tag to show special static chess image. you can try "quote topic" to reply a post, and see what it look like of the original source forum code.
anythink i can help you, just let me know... |
|
|
|
Topic |
|
|
|