Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 MOD: Forum Code Addition
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Halus
Starting Member

20 Posts

Posted - 04 March 2001 :  04:38:25  Show Profile
Due to Davio's suggestion, I start a new thread here to continue discussion on Forum Code Editor
------------------------
The modified one has some advantages:
1. add code at exactly where the flag located, but not the very end of text

2. add code to the selected paragraph, both in the beginning and and the end of some selected paragraph

3. new function as [iframe][/iframe]

4. the size and color option is modified so that repeated selection of the same color is possible
------------------------
the modified code there

I think the center of the change in post.asp begin since line 429 of the zipped file.
and the most important function is
==============
function getActiveText(selectedtext) {
text = (document.all) ? document.selection.createRange().text : document.getSelection();
if (selectedtext.createTextRange) {
selectedtext.caretPos = document.selection.createRange().duplicate();
}
return true;
}
function AddText(NewCode) {
if (document.PostTopic.message.createTextRange && document.PostTopic.message.caretPos) {
var caretPos = document.PostTopic.message.caretPos;
caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? NewCode + ' ' : NewCode;
}
else {
document.PostTopic.message.value+=NewCode
}
setfocus();
}

==============

this modification is based on one far earlier version, and the code is moderately changed for localization, but I think maybe someone can put it into current version if he likes it
demo: http://musiz.adsldns.org/

StockholmStudent
Junior Member

Sweden
329 Posts

Posted - 04 March 2001 :  05:05:35  Show Profile  Visit StockholmStudent's Homepage  Send StockholmStudent an ICQ Message
Does it work in both Netscape and Internet Explorer?

AND WHY AINT THE E-MAIL NOTIFICATION WORKIN!??????

Go to Top of Page

Halus
Starting Member

20 Posts

Posted - 04 March 2001 :  05:23:05  Show Profile
Sorry,
the code is not written by me
and I post these codes because some members asked for it
I myself use IE only
and I don't know what it looks like on NE
the email function? I'm not sure, maybe I cut it someday just because I did not need it
Sorry

Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 04 March 2001 :  13:04:47  Show Profile
Darn! It doesn't work in Netscape.
Didn't realize it. Oh well.
I have it working here:
http://www.dsilvera.com/beta/31_sr4/link.asp?TOPIC_ID=13

if you are using IE.

Go to Top of Page

StockholmStudent
Junior Member

Sweden
329 Posts

Posted - 04 March 2001 :  13:34:19  Show Profile  Visit StockholmStudent's Homepage  Send StockholmStudent an ICQ Message
quote:

Darn! It doesn't work in Netscape.
Didn't realize it. Oh well.
I have it working here:
http://www.dsilvera.com/beta/31_sr4/link.asp?TOPIC_ID=13

if you are using IE.





well, I thought so... I dont even think it workes at all in Netscape when using this function. The more The Snitz Forum is developed, the more is a netscape and an explorer version needed, maybe in setup for the users, they can choose if using netscape or explorer. Cause I also know that Netscape has some difficulties with CSS...... which is a great coding.
I like the colors u use... may I take them for mine too? :)

cheers
/CHEETAH

Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 04 March 2001 :  13:44:56  Show Profile
quote:
I like the colors u use... may I take them for mine too?
Sure. I just used the Templates Mod for it.

Go to Top of Page

rick7165
Senior Member

USA
1094 Posts

Posted - 04 March 2001 :  14:25:44  Show Profile  Visit rick7165's Homepage
Can someone explain or show how to add this to SR4?
I'm kind of confussed what to do here...

Confussed is not hard for me to become! LOL


Rick


Test Site
www.eastpasco.com
Running on HuwR's SR4 release. Colors and Graphic scheme done by Richard Kinser.
Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 04 March 2001 :  14:41:20  Show Profile
LoL, sorry rick. I guess Halus's post wasn't all that clear on how to add the code.

I inserted the following code in inc_code.asp after the thelp(swtch) function:
function getActiveText(selectedtext) { 
text = (document.all) ? document.selection.createRange().text : document.getSelection();
if (selectedtext.createTextRange) {
selectedtext.caretPos = document.selection.createRange().duplicate();
}
return true;
}

function AddText(NewCode) {
if (document.PostTopic.Message.createTextRange && document.PostTopic.Message.caretPos) {
var caretPos = document.PostTopic.Message.caretPos;
caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? NewCode + ' ' : NewCode;
}
else {
document.PostTopic.Message.value+=NewCode
}
setfocus();
}

function setfocus() {
document.PostTopic.Message.focus();
}
The AddText() function in this code is replacing the one currently in the file.

And in post.asp look for the following code:
<td bgColor="<% =strPopUpTableColor %>"><textarea cols="<%=intCols %>" name="Message" rows="<%=intRows %>" wrap="VIRTUAL"><% =Trim(CleanCode(TxtMsg))%></textarea><br>
And replace it with this:
<td bgColor="<% =strPopUpTableColor %>"><textarea cols="<%=intCols %>" name="Message" rows="<%=intRows %>" wrap="VIRTUAL" onfocus="getActiveText(this)" onclick="getActiveText(this)" onchange="getActiveText(this)"><% =Trim(CleanCode(TxtMsg))%></textarea><br>
I didn't add everything that Halus posted, just the code I wanted.

Go to Top of Page

evehawk
New Member

Australia
65 Posts

Posted - 04 March 2001 :  21:04:22  Show Profile  Send evehawk an ICQ Message
Davio, i post something like this a while ago under
http://forum.snitz.com/forum/topic.asp?TOPIC_ID=3868&FORUM_ID=25&CAT_ID=17&Topic_Title=Formating+while+posting+topic&Forum_Title=MOD+Add%2DOn+Forum+%28W%2FCode%29

hope it help in someway :)

Go to Top of Page

Aznknight
Senior Member

USA
1373 Posts

Posted - 08 March 2001 :  03:40:37  Show Profile  Send Aznknight an AOL message  Send Aznknight an ICQ Message
Halus, Davio, and Evehawk

I tried adding this code to my site and it overwrites the part of the message I've selected when i try to add the formating. Wierd. I did exactly as Davio posted too.

I'm using ie 5.0 browser and I have checked out the demo's available for this and it works fine.

I think it's something wrong on my part but don't know what .



- Alan
www.iamviet.com
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 08 March 2001 :  04:45:56  Show Profile
for the code that Halus posted, I had to edit inc_code.asp more.

here is one example (just do this for all instances of like code)

change this:

} else if (basic) {
AddTxt="[b][/b]";
AddText(AddTxt);


to this:

} else if (basic) {
AddTxt="[b]"+text+"[/b]";
AddText(AddTxt);


make sure near the top of inc_code.asp you place this line:


set text = ""


this is in the file that Halus posted also
Go to Top of Page

rick7165
Senior Member

USA
1094 Posts

Posted - 08 March 2001 :  05:41:33  Show Profile  Visit rick7165's Homepage
After doing this mod.. what are the draw backs? Netcrap will not work?

Or can they still post just can't use this feature? Just trying to find
out before I apply this mod.


Thanks,
Rick


Test Site
www.eastpasco.com
Running on HuwR's SR4 release. Colors and Graphic scheme done by Richard Kinser.
Go to Top of Page

Aznknight
Senior Member

USA
1373 Posts

Posted - 08 March 2001 :  13:31:16  Show Profile  Send Aznknight an AOL message  Send Aznknight an ICQ Message
thanks richard, that was it.

rick, looking at the code, i think if they are using a netscape browser, it just add the formating code at the end like it's doing now.



Oh one thing, I've noticed...after selecting the text to add the formating and then adding the formating...the mouse cursor becomes the one with the hour glass and stays like that. Is this a bug?

- Alan
www.iamviet.com
Go to Top of Page

blackinwhite
Average Member

Turkey
657 Posts

Posted - 11 April 2001 :  12:36:52  Show Profile
sorry, I came to that post from another post abut the code addition, it was for it- nothing at all now I could make it work



Edited by - blackinwhite on 11 April 2001 15:52:15
Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 11 April 2001 :  15:38:42  Show Profile
What link?

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.2 seconds. Powered By: Snitz Forums 2000 Version 3.4.07