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)
 I've modified HuwR's upload script
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Till
Starting Member

Australia
31 Posts

Posted - 22 January 2001 :  14:49:28  Show Profile
But I need some help with a certain part of it. This is my lack of asp skill showing through again

Basically I've changed it so that when a user uploads an image, (yes I''ve set it up only for images!) When finished, I've changed the scrip to insert the image code instead of the download code. What I would like to do is be able for this to work when posting a new topic. When I try it on a new topic, it gives me page not found but the file is uploaded! If I refresh the page it comes up saying finished... but does not present the user with the link to insert the image code in his/her new topic. So my question is, could someone help me out with this? Here is the link to my modified UploadEngine.txt file for anyone to look at or use if they like. You may notice that this file contains no font tags, I am trying to convert the whole forum over to style sheets and don't want any font tags. Sorry, you'll have to put them in again to use it...

Cheers Till

I use Internet Explorer
5.0 because the other one
Your Comment_____________

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 22 January 2001 :  19:14:51  Show Profile  Visit HuwR's Homepage
The reason your are probably having problems, is that it needs a topic ID, which you do not have until after you create the topic.

'Resistance is futile'
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 22 January 2001 :  19:35:12  Show Profile  Visit HuwR's Homepage
To make it work for a topic

in post.asp look for

'#################################################################################
'## File Attachment Stuff
'#################################################################################
if strRqMethod = "Reply" or _
strRqMethod = "Topic" or _
strRqMethod = "Edit" or _
strRqMethod = "ReplyQuote" or _
strRqMethod = "TopicQuote" then


and add the line in red , this will give you the button

Now to get it to update, in uplaodengine,

add the lines in red

TopicID = objUpload.Form.Item("TOPIC_ID")
ReplyID = objUpload.Form.Item("REPLY_ID")
if ReplyId = "" then
ReplyID = -1
end if
if TopicID = "" then
TopicID = -1
end if



Now in post_info.asp, look for this piece of code

'###################### Attach Files #######################
strSQL = "SELECT MAX(REPLY_ID) AS MAXID FROM " & strTablePrefix & "REPLY "
strSQL = strSQL + "WHERE TOPIC_ID = " & Request.Form("TOPIC_ID")
strSQL = strSQL + " AND R_AUTHOR = " & rs("MEMBER_ID")
set rs2 = my_Conn.Execute (strSql)
intReplyID = rs2("MAXID")
rs2.close
strSQL = "UPDATE " & strTablePrefix & "USERFILES "
strSQL = strSQL & "SET F_REPLY_ID = " & intReplyID
strSQL = strSQL & " WHERE MEMBER_ID = " & rs("MEMBER_ID")
strSQL = strSQL & " AND F_REPLY_ID = -1 AND F_TOPIC_ID =" & Request.Form("TOPIC_ID")
my_Conn.execute (strSQL)
'###################### Attach Files #######################


This is what does the update to userfiles, to set reply_id, Copy the code, and then look for

strSql = "INSERT INTO " & strTablePrefix & "TOPICS (FORUM_ID"


Scroll down to the end of the strSQL line untill you come to the

if Err.description <> "" then
err_Msg = "There was an error = " & Err.description
else
err_Msg = "Updated OK"
end if


Ok, Now the section of code that you copied, insert it between the else and the err_Msg = "Updated OK"

Now, change the code to look like this

'###################### Attach Files #######################
strSQL = "SELECT MAX(TOPIC_ID) AS MAXID FROM " & strTablePrefix & "TOPICS "
strSQL = strSQL + "WHERE TOPIC_ID = -1"
strSQL = strSQL + " AND T_AUTHOR = " & rs("MEMBER_ID")
set rs2 = my_Conn.Execute (strSql)
intTopicID = rs2("MAXID")
rs2.close
strSQL = "UPDATE " & strTablePrefix & "USERFILES "
strSQL = strSQL & "SET F_TOPIC_ID = " & intTopicID
strSQL = strSQL & " WHERE MEMBER_ID = " & rs("MEMBER_ID")
strSQL = strSQL & " AND F_REPLY_ID = -1 AND F_TOPIC_ID = -1"
my_Conn.execute (strSQL)
'###################### Attach Files #######################



I think that ought to do it


'Resistance is futile'

Edited by - huwr on 22 January 2001 19:36:06
Go to Top of Page

Till
Starting Member

Australia
31 Posts

Posted - 22 January 2001 :  22:48:16  Show Profile
quote:

Posted bu HuwR
To make it work for a topic

Now to get it to update, in uplaodengine,

add the lines in red

'#################################################################################
'## File Attachment Stuff
'#################################################################################

if strRqMethod = "Reply" or _
strRqMethod = "Topic" or _
strRqMethod = "Edit" or _
strRqMethod = "ReplyQuote" or _
strRqMethod = "TopicQuote" then

and add the line in red , this will give you the button

Now to get it to update, in uplaodengine,


TopicID = objUpload.Form.Item("TOPIC_ID")
ReplyID = objUpload.Form.Item("REPLY_ID")
if ReplyId = "" then
ReplyID = -1
end if
if TopicID = "" then
TopicID = -1
end if






Thanks HuwR, you're a gem! But I didn't need all the other stuff, I already got the button to show up in all post pages, just the Uploadengine wasn't updating after the upload. All that was needed was the updated code for the Uploadengine.asp and the small changes highlighted in this quote. Now it works in everything even private messages

Thanks again...

Cheers Till

I use Internet Explorer
5.0 because the other one
Your Comment_____________
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 23 January 2001 :  05:50:10  Show Profile  Visit HuwR's Homepage
I've been meaning to add it to the topics myself for a while, but 2000+ posts, not to mention the emails takes up a lot of your time.

'Resistance is futile'
Go to Top of Page

antor
Starting Member

Switzerland
9 Posts

Posted - 28 January 2001 :  21:22:14  Show Profile
quote:

Now, change the code to look like this

'###################### Attach Files #######################
strSQL = "SELECT MAX(TOPIC_ID) AS MAXID FROM " & strTablePrefix & "TOPICS "
strSQL = strSQL + "WHERE TOPIC_ID = -1"
strSQL = strSQL + " AND T_AUTHOR = " & rs("MEMBER_ID")
set rs2 = my_Conn.Execute (strSql)
intTopicID = rs2("MAXID")




I get errors with this code (intTopicID)
and I had to replace one line

strSQL = strSQL + "WHERE TOPIC_ID = -1"
with
strSQL = strSQL + "WHERE FORUM_ID = " & Request.Form("FORUM_ID")


Thanks!



Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 29 January 2001 :  04:20:36  Show Profile  Visit HuwR's Homepage
antor,


that should be OK, I hadn't tested it myself.

'Resistance is futile'
Go to Top of Page

rick7165
Senior Member

USA
1094 Posts

Posted - 29 January 2001 :  05:01:43  Show Profile  Visit rick7165's Homepage
Does this over ride the file uploads? It works for uploading Images now, but it thinks files are Images also and will not put a dowhload link.

To see what it's doing check out my demo site.

Thanks,
Rick

My Demo Site
www.eastpasco.com
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 29 January 2001 :  06:45:05  Show Profile  Visit HuwR's Homepage
quote:

Does this over ride the file uploads? It works for uploading Images now, but it thinks files are Images also and will not put a dowhload link.

To see what it's doing check out my demo site.

Thanks,
Rick

My Demo Site
www.eastpasco.com



Till's uploadengine is specifically for images. so yes, if you replaced it that is your problem.

'Resistance is futile'

Edited by - huwr on 29 January 2001 16:28:08
Go to Top of Page

Till
Starting Member

Australia
31 Posts

Posted - 29 January 2001 :  19:59:48  Show Profile
That is correct, if you read my original thread, you will see that it is only for images and not attachments. This was done to make it easy for people to upload an image and then insert it in their post, it will not insert a link to an attachment. I'm going to modify it so that you have the option to insert the attachment or the image, but have not done this yet. I will post it here when I have done so

Cheers Till

I use Internet Explorer
5.0 because the other one
Your Comment_____________
Go to Top of Page

fatwillie
New Member

Canada
79 Posts

Posted - 17 March 2001 :  16:38:50  Show Profile  Visit fatwillie's Homepage  Send fatwillie an ICQ Message
I am lost....

I want to make it so my member may place images in their posts without having there own server. But I want it to show up in the post itself, not as a file attachment.

I have read this thread a few times and do not know exactly what it does. If someone could help me out it would be much appreciated.

Thanks


Fatwillie's Forum
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