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: Pic Upload for: 2000 Version 3.3.03
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

KC
Junior Member

USA
152 Posts

Posted - 04 February 2004 :  13:52:44  Show Profile  Visit KC's Homepage
This MOD provides an easy way to allow your Forum posters to upload and include a picture in their post.

If you use both parts, it secures them from direct link display anywhere else on the Internet as well.

It works like this:



This MOD is based on using ASPSmartUpload as your servers file upload engine.
If you use a different engine, you will need to modify this code.

If you don't have a file upload engine, I highly recommend you get ASPSmartUpload put on your Windows Server.
It's free, and I have been using it to host a massive file sharing domain for years.

It is actually a pretty concept.

I just used the Snitz Java Window code to open a Pop-Up WIndow.
Just add the BOLD code to your inc_post.buttons.asp page.

----------

<a href="Javascript:list();"><img src="icon_editor_list.gif" width="23" height="22" alt="Insert List" border="0"></a>
<% if lcase(strIcons) = "1" then %>

<a href="JavaScript:openWindow2('pop_icon_legend.asp')"><img src="icon_editor_smilie.gif" width="22" height="22" alt="Insert Smilie" border="0"></a>

<a href="JavaScript:openWindow2('pop_pic_upload.asp')"><img src="icon_upload.bmp" width="60" height="22" alt="Upload Picture" border="0"></a>


<% end if %>
</td>
</tr><tr>
-----------

And you have a Pic Upload button in every New Post, Reply or Edit screen because it's an <include> file.



-----------

pop_pic_upload.asp is a simple Form Page with Browse allowing up to 4 files to be uploaded at one time.



--------------

Clicking the UPLOAD button calls pop_pic_upload2.asp, which display the easy to copy and paste BBS Forum Code line to display the pic in a post.



--------------

Things to note:
Create a sub-directory of your Snitz Forum named Fpics/
This is where the picture files will be stored on your server.

The file names are modified on upload to make management easier in the following ways using the top file uploaded in the example above.

The 1st file I uploaded was named test8.jpg on my hard drive.

The Fpics/ portion is the sub-directory name off of the root Snitz Directory.
You do NOT need this copy/paste line to have the http://bla bla/path to your Snitz Root.
Snitz is smart enough to know it is a sub-directory path and fill in the blanks.

The 2_ is my Member ID via the inc_top.asp memberID variable.

The .FP at the end stands for Forum Post, and is added for the purpose of blocking direct links that I will discuss in later post here.
This does not affect the display of uploaded .gif or .jpg images in a Forum Post.

With this file format, you can see what member uploaded a pic, and if multiple members upload a pic called say “MyPic.jpg” from their hard drive, they all remain unique.

To install this on your 3.3.03 version of Snitz:

Create an Fpics/ directory on your server.
Download
pop_pic_upload and pop_pic_upload2
They are saved as .txt files.
Rename them to .asp files.

Save this icon as icon_upload.bmp

Copy all three to your root Snitz directory.

If you haven’t modified your inc_post_buttons.asp file, you can grab and use This One.
It is stock besides the change highlighted above.
Rename it from .txt to .asp and drop it in the root as well.

That’s it.
Use it, abuse it, make mounds and mounds of cole slaw with it if you choose.
I need no credit.
I am just doing my part to share my customizations ;-}




Owner of vales.com and Elite Computers.

Edited by - KC on 04 February 2004 14:13:48

DavidRhodes
Senior Member

United Kingdom
1222 Posts

Posted - 04 February 2004 :  16:35:18  Show Profile
very nice idea, have you put measures in to stop the user uploading malicious files?

The UK MkIVs Forum
Go to Top of Page

KC
Junior Member

USA
152 Posts

Posted - 05 February 2004 :  16:31:43  Show Profile  Visit KC's Homepage
quote:
Originally posted by DavidRhodes

very nice idea, have you put measures in to stop the user uploading malicious files?


ASPsmart Upload has some great file checking ability.
You can limit by Size, Extention, etc.
I do that for regular .zip file uploads.
I have not added it to pop_pic_upload2.asp yet.

Since it's an IMG command and ends in .FP no matter what, anything nasty would be a "red X" pic.
Even if they left the IMG tages out, it would just be a link to an .FP file and harmless without renaming it.

I do want to make a Web GUI to let people (and Mods) manage the uploads.
It should be easy with FSO commands as every pic starts with a MemberID and then a _.

But here is the Security Tool I mentioned...

If you want to block off site file calls get http://www.isapirewrite.com/

This is a great little NT Mod, but it does require the provider to activate it.
Just download the FREE Lite Version.

It basicly just adds some new web related system functions, and a plain text httpd.ini file for entering commands.

Since I simply want to block access to .zip and now .FP files, the whole httpd.ini would only need to consist of:

------
[ISAPI_Rewrite]
RewriteCond Referer: (?!http://(www\.)?mysite\.com).+
RewriteRule .*\.(.zip|.FP) /404.asp [I,L]
-------

Mine is more complex, and you can redirect to any page you choose.
It does a ton of other stuff as well, but finding out what that would be is half the fun, right ;-}

Owner of vales.com and Elite Computers.
Go to Top of Page

DavidRhodes
Senior Member

United Kingdom
1222 Posts

Posted - 05 February 2004 :  16:53:16  Show Profile
You might want to lookk into version 3.4. You say this is for 3.3.03 but can't see why it can't be used on 3.4.xx which the majority use.

The UK MkIVs Forum
Go to Top of Page

Etymon
Advanced Member

United States
2385 Posts

Posted - 06 February 2004 :  02:02:12  Show Profile  Visit Etymon's Homepage

Hi KC,

Thank you for the MOD. I still run a 3.3.05 forum on one of my sites. This might come in handy.

Cheers,

Etymon
Go to Top of Page

Jag24
Junior Member

182 Posts

Posted - 06 February 2004 :  09:52:28  Show Profile  Visit Jag24's Homepage  Send Jag24 an ICQ Message
Hey KC very nice work sir, I would be interested in implementing your Isapi Rewrite, I have tried it once before a few months ago when you first mentioned it but I never had any luck.
Maybe you could give a dummy some pointers? I am using Crash version 3.4 very heavily modified.
I run IIS 5 & windows 2000 advanced server & access db to host everything
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.25 seconds. Powered By: Snitz Forums 2000 Version 3.4.07