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)
 Alternate Preview
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 17 March 2001 :  19:14:06  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
Because of some flaws in the current preview function (me & huwr have encountered problems, I dont know if anyone else has), I have written up a 'built-in' preview function into post_info.asp

http://stormwhispers.com/snitz_testing - Demo

post.asp - Remove The following around line 821

<input name="Submit" type="submit" value="<% =btn %>">
<%
if strRqMethod = "Reply" or _
strRqMethod = "Edit" or _
strRqMethod = "ReplyQuote" or _
strRqMethod = "Topic" or _
strRqMethod = "TopicQuote" then
%>


 <input name="Preview" type="button" value=" Preview " onclick="OpenPreview()">
<%
end if
%>


post.asp Add the following around line 772

<font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">
<input name="Sig" type="checkbox" value="yes" checked>Check here to include your profile signature.<br>
<input type="checkbox" name="newPreview" value="yes" checked>Check here to Preview your message before it gets posted.<br></font>


post_info.asp Add the following around line 50

err_Msg = ""
ok = ""

'Added Preview
if ((request.form("Method_Type") = "Topic" or request.form("Method_Type") = "Reply" or request.form("Method_Type") = "ReplyQuote") and (request.form("newPreview") = "yes")) then
strFormMType = request.form("Method_Type")
strFormType = request.form("Type")
strFormTopicId = request.form("TOPIC_ID")
strFormReplyId = request.form("REPLY_ID")
strFormForumId = request.form("FORUM_ID")
strFormCatId = request.form("CAT_ID")
strFormAuthor = request.form("Author")
strFormModId = request.form("Mod_ID")
strFormCatTitle= request.form("Cat_Title")
strFormForumTitle = request.form("FORUM_Title")
strFormTopicTitle = request.form("Topic_Title")
strFormM = request.form("M")
strFormRefer = request.form("Refer")
strFormCookies = request.form("cookies")
strFormUsername = request.form("UserName") ' UserName
strFormPassword = request.form("Password") ' Password
strFormSubject = replace(request.form("Subject"), Chr(34), "&quot;") ' Subject
strFormMessage = ChkString(request.form("Message"), "message")
strTempFormMessage = Replace(request.form("Message"), Chr(34), """) 'Message for sending
strTempFormMessage = Replace(strTempFormMessage, "'", "''") 'Message for Sending
strFormSig = request.form("Sig") ' Show Sig?
strFormLock = request.form("lock")
if strFormLock = "" then
strFormLock = 0
end if
if strFormSig = "yes" then
strTempSignature = getSig(strFormUsername)
end if
response.write "<table border=0 bgcolor=""" & strTableBorderColor & """ cellspacing=1 width=95% cellpadding=3 align=""center"">" & vbcrlf _
& "<tr><td align=""center"" bgcolor=""" & strHeadCellColor & """><font color=""" & strHeadFontColor _
& """ face=""" & strDefaultFontFace & """>" & vbcrlf _
& "Below is a Preview of your message</font>" & vbcrlf & "</td>" & vbcrlf & "</tr>" & vbcrlf

response.write "<tr><td align=""left"" bgcolor=""" & strForumCellColor & """><font face=""" & strDefaultFontFace & """ size=" & strDefaultFontSize & ">" _
& formatStr(strFormMessage) & "<p>" & formatStr(strTempSignature) & "</font>" & vbcrlf & "</td>" & vbcrlf & "</tr>" & vbcrlf & "</table>"

response.write "<p>"

response.write "<form action=""post_info.asp"" method=""post"">" & vbcrlf

response.write "<input type=""hidden"" name=""Method_Type"" value=""" & strFormMType & """>" & vbcrlf
response.write "<input type=""hidden"" name=""Type"" value=""" & strFormType & """>" & vbcrlf
response.write "<input type=""hidden"" name=""TOPIC_ID"" value=""" & strFormTopicId & """>" & vbcrlf
response.write "<input type=""hidden"" name=""REPLY_ID"" value=""" & strFormReplyId & """>" & vbcrlf
response.write "<input type=""hidden"" name=""FORUM_ID"" value=""" & strFormForumId & """>" & vbcrlf
response.write "<input type=""hidden"" name=""CAT_ID"" value=""" & strFormCatId & """>" & vbcrlf
response.write "<input type=""hidden"" name=""Author"" value=""" & strFormAuthor & """>" & vbcrlf
response.write "<input type=""hidden"" name=""Mod_Id"" value=""" & strFormModId & """>" & vbcrlf
response.write "<input type=""hidden"" name=""Cat_Title"" value=""" & strFormCatTitle & """>" & vbcrlf
response.write "<input type=""hidden"" name=""FORUM_Title"" value=""" & strFormForumTitle & """>" & vbcrlf
response.write "<input type=""hidden"" name=""Topic_Title"" value=""" & strFormTopicTitle & """>" & vbcrlf
response.write "<input type=""hidden"" name=""M"" value=""" & strFormM & """>" & vbcrlf
response.write "<input type=""hidden"" name=""Refer"" value=""" & strFormRefer & """>" & vbcrlf
response.write "<input type=""hidden"" name=""cookies"" value=""" & strFormCookies & """>" & vbcrlf
response.write "<input type=""hidden"" name=""UserName"" value=""" & strFormUsername & """>" & vbcrlf
response.write "<input type=""hidden"" name=""Password"" value=""" & strFormPassword & """>" & vbcrlf
response.write "<input type=""hidden"" name=""Subject"" value=""" & strFormSubject & """>" & vbcrlf
response.write "<input type=""hidden"" name=""Message"" value=""" & strTempFormMessage & """>" & vbcrlf
response.write "<input type=""hidden"" name=""Sig"" value=""" & strFormSig & """>" & vbcrlf
response.write "<input type=""hidden"" name=""lock"" value=""" & strFormLock & """>" & vbcrlf

response.write "<input type=""button"" value="" Back "" onClick=""history.go(-1)"">"
response.write "<input type=""submit"" value="" Submit "">" & vbcrlf & "</form>"

%>
<!--#include file="inc_footer.asp" -->
<%
else
'End Added

if Request.Form("Method_Type") = "Edit" then


post_info.asp Add the following at the END of the file

<% end if %>


----------------
Da_Stimulator
Need a Mod?
My Snitz Test Center


Edited by - da_stimulator on 17 March 2001 22:09:40

Edited by - da_stimulator on 18 March 2001 17:13:47

Edited by - da_stimulator on 18 March 2001 17:14:39

gor
Retired Admin

Netherlands
5511 Posts

Posted - 17 March 2001 :  21:37:44  Show Profile  Visit gor's Homepage
Though I am a absolute fan of popups and the way the preview looks at the moment (that is probably why I coded it that way ), there is one basic design problem with the way it works now: it uses cookies.
That is nice for small topics, but because the (total) sice of cookies is restricted, I've notices that when I previewed large posts, it started clearing other (relatively recent) cookies like my hotmail password.

There are two other ways of doing the preview: using session variables to store the message-body or the way Stimmy used here. You can't do this using a popup, since you need to post the form in the page you are working in. The concept used here is so simple it is great.
I looked at the demo, the only things that would need to be changed is the alignment of the buttons that say "return" / "post" on the preview page. And there is no reason to use strTemp. Using a direct Response.Write is faster.

Thanks Stimmy !

Pierre
Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 17 March 2001 :  21:48:22  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
sure

want me to convert it all to reponse.write and re-post the code?
Are ya considering using this in 3.2? cuz im sure I could prolly make it look better.

----------------
Da_Stimulator
Need a Mod?
My Snitz Test Center
Go to Top of Page

gor
Retired Admin

Netherlands
5511 Posts

Posted - 17 March 2001 :  22:02:04  Show Profile  Visit gor's Homepage
I like it...also..since you might consider the current preview not bugfree...that would be a (another) reason to include it...lets see what others think of it...reposting with the Response.Write would be good either way though.

Pierre
Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 17 March 2001 :  22:10:35  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
response.write done :)

----------------
Da_Stimulator
Need a Mod?
My Snitz Test Center
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 17 March 2001 :  22:12:06  Show Profile  Visit HuwR's Homepage
Good idea. while were on this subject, why do we have to format the code tags like this


A piece of stuff in the code tag


why can't we make it arial
    A piece of stuff in the code tag

looks neater than courier

Go to Top of Page

frankie
Junior Member

Vatican City
304 Posts

Posted - 18 March 2001 :  01:54:36  Show Profile  Visit frankie's Homepage  Send frankie an AOL message  Send frankie an ICQ Message  Send frankie a Yahoo! Message
I lik it but, there's always a but :

I keep getting an error to this line:
strFormSubject = replace(request.form("Subject"), Chr(34), """) ' Subject


I fixed that by doing something wierd:
strFormSubject = replace(request.form("Subject"), Chr(34), Chr(34)Chr(34)Chr(34)) ' Subject


Also, my forum won't show the new topic in it after I press submit??!!

otherwise I love it. Peace


Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 18 March 2001 :  17:12:41  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
strFormSubject = replace(request.form("Subject"), Chr(34), """) ' Subject

Should be

strFormSubject = replace(request.form("Subject"), Chr(34), "&quot;") ' Subject


----------------
Da_Stimulator
Need a Mod?
My Snitz Test Center


Edited by - da_stimulator on 18 March 2001 17:15:32
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.34 seconds. Powered By: Snitz Forums 2000 Version 3.4.07