Snitz™ Forums 2000
https://forum.snitz.com/forumTopic/Posts/59908?pagenum=1
05 November 2025, 03:51
Topic
Zuel
Zuel's Avatar Addon
19 October 2005, 16:23
heheheh I'm soo excited. After a few weeks of programming this thing I finally got my little add-on to work.
http://www.snitzbitz.com/mods/details.asp?Version=All&mid=52 This mod is not independent and it needs Avatar MOD VERSION 1.3 by Hamlin.
I'll post the code if I get some people who actually want to use it.
Doesn't modify any current Snitz files except the inc_header.asp to link to the page.
Screenshot #1 - http://www.twistingshadows.com/userimages/GeneralPreview.jpg
First screen people go to. Shows a default category and automatically generates the HTML to show the avatars.
Screenshot #2 - http://www.twistingshadows.com/userimages/UploadingPreview.jpg
Users can upload up to 4 images simentanously to a category.
Screenshot #3 - http://www.twistingshadows.com/userimages/DeletedPreview.jpg
Only Admins and moderators can see the Delete button to instantly delete any image or file that doesn't meet the requirments.
Screenshot #4 - http://www.twistingshadows.com/userimages/HoverPreview.jpg
Alt tag to tell people what stuff does.
Screenshot #5 - http://www.twistingshadows.com/userimages/CategoryPreview.jpg
Just more avatars under a different category.
Screenshot #6 - http://www.twistingshadows.com/userimages/ChoosingPreview.jpg
Users select the image they want and it adds the values to the DB so they can select their avatar within their profile. The form fields in the pop up are readonly so nothing can be messed around with.
This is just a preview of what I am working on. I won't release it yet because it is mainly spaghetti code. I want to put everything within Private Subs instead of inline code.
Trial:
http://www.twistingshadows.com/forum/avatars.asp
Account: tester Password: tester
Things are buggy and can be tweaked and they will. I was just excited I got everything to work. <
Replies ...
MarkJH
19 October 2005, 18:26
I've been looking for something like this for a while. Looking forward to seeing it's progress!<
Zuel
19 October 2005, 22:09
Yeah, this is my little pet project. I am happy with the progress I will continue to optimize it.<
weeweeslap
20 October 2005, 02:35
I tested an upload and uploaded a text file to see if you aded a check of sorts to make sure they upload only image files, like check the extensions of the file upload, if it meets that of selected extensions allowed, then upload, else, abort upload. It would be good to add such thing to prevent users from uploading virus to the server. also after upload at the bottom you see: Files uploaded: charles the first.txt (1268B) Enter a number = Checkbox values =
not sure what what the last two are for, can't type anything in so maybe not display the last two.<
Zuel
20 October 2005, 06:10
Originally posted by weeweeslap I tested an upload and uploaded a text file to see if you aded a check of sorts to make sure they upload only image files, like check the extensions of the file upload, if it meets that of selected extensions allowed, then upload, else, abort upload. It would be good to add such thing to prevent users from uploading virus to the server. also after upload at the bottom you see: Files uploaded: charles the first.txt (1268B) Enter a number = Checkbox values =
not sure what what the last two are for, can't type anything in so maybe not display the last two.
Yeah I have that coming soon. Until then I added a check for the users currently on the site. If file <> image then don't show it. If file <> image and a mod or admin passes by then it flags the file as not an image. I'll post a screenshot of what you uploaded.
http://www.twistingshadows.com/userimages/NotValidPreview.jpg
The reason I have this open is because what if I wanted to expand this to like attachments or screenshots or even a photo gallery. As of now I want to add some controls in there from the DB to give it a little more functionality. But I will put some security somehow <
vynsane
26 October 2005, 22:23
i would like to be a tester for you... the guys on my forum are dying for something like this. let me know if you want to pack up the files for me...
btw, in FF 1.0.7 when i click on an avatar or the upload link, the pop-up pops under. it pops up and then falls behind the main window immediately. just fyi...<
Zuel
27 October 2005, 11:06
Oh, okay.
Didn't have that happen since I have two monitors. Thanks for the tip.
Current Progress...
I am working on putting everything in Subroutines from the spaghetti code. I gotta learn how to create a Admin Config file and keep the variables stored in the DB.<
MarkJH
27 October 2005, 12:02
Is it possible to set a maximum file size and if the file uploaded is greater than this, the software automatically rejects it?<
Zuel
27 October 2005, 17:32
Yeah, I haven't set restrictions yet because the only people who can see this page will be trusted members.
Yes, I no the tester account can see it but I have it so only two usergroups can view the upload function. That will remove any guests / new members from uploading anything they shouldn't onto my site.
I plan to add a few checks before the upload begins: (1) File Extention (2) File Size (3) File Name Length
I am big on logic. I hate to see a program run through then tell you it is either too big or invalid. I feel that should be first. And it will to come. Sooner or later.
Update:
I just finished rewriting this into Functions and it looks alot cleaner. Now I need to convert the previous Javascript to work with the cleaner code. Vbscript doesn't like my ticks and inline javascript code. I still need to do alot before I'll release this code out.
1. Fix the Javascript Code.
2. Create an Admin page to handle all the unique fields that should be able to be changed.
3. Set up a DB Table or add-on to the existing avatar one.
4. Rewrite that code that will handle the new variables. / Add the new variables to the Config file and what not.
<
Zuel
27 October 2005, 19:26
Update: Big Update!!!!
I rewrote the whole code from Spagetthi to Functions. I used StringBuilders instead of contacinating strings to save memory and this page loads like 5 times faster. Used literals to handle the Javascript code.
Now this page pulls the table colors from the config file. New feature! This will automatically grab the look and feel of your forum.
Also this automcatially uses the file size settings from the avatar mod that this mod is dependant on.
I haven't uploaded the code to live yet. I will upload it to my test forums so you guys can preview it.
Preview: http://www.twistingshadows.com/development/forum/avatars.asp
Login: tester Pass: tester
vynsane, I also fixed the focus so it should pop correctly. Thanks for catching that.<
ruirib
27 October 2005, 19:35
It's not working. No avatars show and an error occurs when an upload is attempted.<
Zuel
27 October 2005, 19:38
I see the avatars....
You cannot upload. I didn't set any write permissions to the Developement Directory. I can, but probably will not.
I was just about to post that but you beat me to it.<
Zuel
27 October 2005, 19:39
You sure you don't see it? I'm looking at the source code from the page it showing correctly.<
ruirib
27 October 2005, 19:49
Yeah, I'm sure. Nothing shows, just a sort of table, light blue borders, no contents. According to the text it should be showing 33 Blizzard avatars.<
StephenD
27 October 2005, 19:50
I can't see the avatars either.<
Zuel
27 October 2005, 19:51
What the?
Broswer? Can you send me a screenshot?
I check it on IE and FF and I saw them. Let me clear my cache.
LOL! I know what the problem is.
See what happens is I have levels imbedded in this and since my account is Mod + Admin I see one thing and didn't get to test what regular memebers see.
I forgot the line to show members.<
Zuel
27 October 2005, 19:56
Fixed....heh.<
ruirib
27 October 2005, 19:59
Yeah, avatars are showing now.<
Zuel
27 October 2005, 19:59
<
ruirib
27 October 2005, 20:01
Are you going to post the code?<
vynsane
27 October 2005, 21:06
Originally posted by Zuel
vynsane, I also fixed the focus so it should pop correctly. Thanks for catching that.
it's still doing it sometimes. not all the time. i'm on FF, so it's probably the pop-up blocker trying to prevent the popup...
EDIT: just set FF to allow pops from twistingshadows.com and it's still popping under. i got nuthin'.<
Zuel
27 October 2005, 23:00
Zuel
28 October 2005, 00:04
Originally posted by Zuel
vynsane, I also fixed the focus so it should pop correctly. Thanks for catching that.
it's still doing it sometimes. not all the time. i'm on FF, so it's probably the pop-up blocker trying to prevent the popup...
EDIT: just set FF to allow pops from twistingshadows.com and it's still popping under. i got nuthin'.
There was a focus on the javascript piece but I removed because that is what gave the main page focus again. Here is the code for the pop up.
Using IE, the pop up window retains focus while the main page refreshes which is intended. I do not have FireFox at home so I can't test it here. I could download it but nah.
I'll try it from work but it did work when I tried it.
Can you give me a little more information on which ones you tried?
GIFS VS JPEGS On which Category
Anything else that may seem like the cause.<
vynsane
28 October 2005, 09:35
it seems to be working alright now... maybe i needed to have fresh versions of the pages - not cached...
it WAS popping under in all categories with either file format. but like i said, it now seems to be working correctly. (on development/forum)
HOWEVER
when i click on a 'tar in a category other than "blizzard" the refresh goes back to "blizzard" - meaning, when on "warcraft" or "misc" the refresh brings me back to "blizzard"<
Zuel
28 October 2005, 09:52
Yeah I'm trying to figure out how to remove the query the gets popped onto the URL when you click an avatar. Or even why that end piece gets put on there. I need to test that more.
I am requesting the query string based on the avatar category. When you click an avatar then it puts some wierd **** on there like ?X=5&Y=4 which isn't valid so my check sets the default to Blizzard so the page doesn't error out when someone tries to play with the URL query string.<
Zuel
28 October 2005, 16:44
Originally posted by vynsane
when i click on a 'tar in a category other than "blizzard" the refresh goes back to "blizzard" - meaning, when on "warcraft" or "misc" the refresh brings me back to "blizzard"
All fixed. I was using <input> tags to handle the onclick events. But I just removed those and replaced it with <a><img></a> tags. Same functionaility but without the page refreshing elsewhere.<
Zuel
29 October 2005, 09:53
Another Update:
Is it possible to set a maximum file size and if the file uploaded is greater than this, the software automatically rejects it?
Currently Implemented but it is hardcoded. I am working on putting this information in the Database. Any help with this would be greatly appreciated.
Oh man, I am getting dangerous. I just trimmed 6 pages into 2 using Query String Method Calls.
I am about 70% Done!<
Zuel
02 November 2005, 23:28
I finished the code.
Config and everything else is done. The only thing to do now is the installation guide and the readme.
I also need to create a DBS file.
Shouldn't be more then a another day or so.
But I need a quick answer. In the admin options, there is an area to create/delete a category in the database. When that happens, should it create/delete the associated folder in the avatars folder?
I would if I could but I can't get the FSO.folderexist command to work. If you feel it should be in there and can assist me in some folder checking code I would greatly appreciate it.<
vynsane
03 November 2005, 14:24
i take care of my folders independently of the admin home anyway, so it wouldn't bother me to not include it. also, i wouldn't want to delete the folder unless there was nothing in it anyway, and i would do that through FTP, so i guess that's my ten cents.
i'm really excited by this, BTW... thanks for your hard work.<
ruirib
03 November 2005, 18:57
Code:
set myFso = server.createObject("scripting.FileSystemObject") strFolderName = ("c:\temp\foldername\")
If not myFso.FolderExists(strFolderName) then myFso.createFolder(strFolderName) end if
<
Zuel
03 November 2005, 19:13
Ya ruirib, I got this to work with some personal testing with a different thread.
http://forum.snitz.com/forum/topic.asp?TOPIC_ID=60000<
MarkJH
03 November 2005, 19:16
i'm really excited by this, BTW... thanks for your hard work.
Yes, can't wait to see what you've accomplished with this. <
Zuel
03 November 2005, 19:21
Originally posted by vynsane i take care of my folders independently of the admin home anyway, so it wouldn't bother me to not include it. also, i wouldn't want to delete the folder unless there was nothing in it anyway, and i would do that through FTP, so i guess that's my ten cents.
i'm really excited by this, BTW... thanks for your hard work.
Based on that, I made variables in the config above it whether or not to create and delete the folders when creating/deleteing the category in the Database.<
Zuel
03 November 2005, 20:58
i'm really excited by this, BTW... thanks for your hard work.
Yes, can't wait to see what you've accomplished with this. I'm getting scared to release it. My biggest fear is having you guys install it and it crashes everything or it doesn't work period.
Remote debugging isn't my speciality.
Having said that, I have been coding in semi failsafes so users should never get an Internal Server Error. Every Database Request and every File System Object Request has been tested and coated with customized error messages.
Update: I am currently building my temporary forum on my local host. If I can install the avatars mod with no problems then my mod with no problems then I shall test on my server. If that passes then I will release for user tests.
Update # 2
Localhost temporary forum passed!<
Zuel
03 November 2005, 23:06
Server failed at two spots.
Assigning and Uploading. Cry.<
Zuel
03 November 2005, 23:27
I have no **** debugging, makes it just impossible for me to determine the exact error. But with Response.Writes and Ends I think the problem is displayed in red below. All is good until it hits the red line.
Code:
Public Sub checkForErrors() '=== Clear Error Message === Err_Msg = ""
'=== Get Form Fields Values === avatarURL = ChkString(Request.Form("AvatarURL"),"url") avatarName = ChkString(Request.Form("AvatarName"),"")
'=== No Avatar URL === if avatarURL = " " then Err_Msg = Err_Msg & "<li>You Must Enter a URL for your Avatar!</li>" end if
'=== No Avatar Name === if avatarName = " " then Err_Msg = Err_Msg & "<li>You Must Enter a Name for your Avatar!</li>" end if
'=== Execute SQL Query === my_Conn.Execute (strSql) '=== Insert Complete - Print Results to User === StringBuilder.AddString "<p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Avatar " & avatarName & " Added!</font></p>" & vbCRLF StringBuilder.AddString "<p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>To start using your new avatar,<br>go to your profile and choose the new avatar!</font></p>" & vbCRLF StringBuilder.AddString "<p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><A href='javascript: self.close ()'>Close this Window</A></p><BR>" & vbCRLF end if Exit Sub End Sub
<
ruirib
04 November 2005, 04:19
Before that line, add this:
Code:
Response.Write strSql Response.End
Tell us what is shown.<
Zuel
04 November 2005, 10:17
INSERT INTO FORUM_AVATAR (A_URL, A_NAME, A_MEMBER_ID) VALUES ('http://www.twistingshadows.com/forum/avatars/Blizzard/MaleGnome.gif', 'MaleGnome.gif', 1)<
ruirib
04 November 2005, 13:00
What error do you get when you remove the code I suggested?<
Zuel
04 November 2005, 14:26
On the server:
Internal Server Error
On my Localhost:
Nothing, works fine.
If I can't get it to work tonight then I'll zip it up and host it up here so you guys can give it a try.<
ruirib
04 November 2005, 14:33
The SQL shown is correct. I don't see how it would cause an error.<
Zuel
04 November 2005, 15:39
Do I need to open a connection?
<
ruirib
04 November 2005, 17:17
No, the code is correct.<
Zuel
07 November 2005, 10:06
After looking through everything and failing at everything trying to fix it, I am going to ZIP up everything and post on Snitz forums for more testing.
I need testers. This MOD will crash in two instances that I am aware of. I need someone who has debugging enabled on their server to relay the error messages back to me.
I tested: OS: Windows 2003 Server DB: Access 2003
I need these tested: OS: W/e Else DB: MySQL and SQLServer
It should fail on Assigning Avatars and Uploading. Funny thing is, Uploading fails but still uploads. Assigning is just broke period on the server.
Everything works perfect on my localhost. Get ready for a link on Wednesdayish.<
vynsane
07 November 2005, 14:01
wish i could help you there, but just following directions on mods makes my palms sweat. debugging ain't my strong suit...<
Zuel
08 November 2005, 14:04
Gah, I am ready to give up. I just logged on this morning and my whole snitz board was down. Internal server, 500 errors left and right.
I found the error log and checked through it. Over 5000 internal server errors from 6 am to 11 am.
I contacted my host which is my co worker and we saw the hosting company has been going under some maintence. After going through we found the problems. My board no longer errors out and if it does, I can isolate the problem.
Debugging was enabled and I found the bugs that I couldn't find before. I shall attempt finish this tonight.
I won't give up that easy.<
Zuel
08 November 2005, 14:35
Once permission errors are fixed, then I will setup another test forum along with the posted code. ETA is 2 days, November 10th, 2005.
Avatar Admin Page: http://www.twistingshadows.com/userimages/Avatar_Admin.jpg
Admins have full control over settings. They can specify file size, along with disable and enabling avatar uploading.
Category settings means when they create a new category, a new folder will automatically be created within the avatar folder. (Directory Write Permissions MUST BE ENABLED!) Similiar with the Delete Diretory. Deleting a directory will delete all avatars within the folder.
Avatar Main Page: http://www.twistingshadows.com/userimages/Avatars_Main.jpg
This page got a little tweaked. Now all images under the size limits (Admin Specifies in the Original Admin Panel) show up as their original size. Anything over just gets cut off, there plenty of free tools for users to crop themselves.
Also the button above the avatar is the delete function that only Admins and Moderators can see. Can control any inappropraite content or just an avatar in the wrong category.
Moving files feature coming after release.
No Folder: http://www.twistingshadows.com/userimages/No_Folder_Exists.jpg
If an Admin chooses to disable the Automatically create a new folder when a category is created, then a user tries to access the page it will throw an error to inform them to create the folder.
Once permissions are fixed then I need to update the Pop_Profile, admin_review_avatar.asp and Private Messages avatar piece and a clean up sweep through the code.<