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

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: Database: MS SQL Server
 How to change Sex from nvarchar(50)
 New Topic
 Printer Friendly
Author  Topic Next Topic  

samcko
Starting Member

Australia
8 Posts

Posted - 09 August 2015 :  15:21:57  Show Profile  Reply with Quote
Mods if in wrong place please (re)move to correct area.

I am new to forums (obviously), and have been trying to locate in the code where to change the Sex/Gender information, but as yet I haven't found this, I need it to be Male = 1 or Female = 0 (I know off but still) as I require it due to the main site, I'm trying to tie the main site and Snitz together but as this is one of the issues I'm facing I cannot fully tie it in together.

Q1. Where do I change the sex/gender from full text (fe/male) to 0/1?

Q2. I know not related but would help if anyone can assist - The main site uses <%session="mainsiteuser"%>, Q how can I set Snitz to use the same session tags as the main site?

These are the main two that I really do need answered, as without them I am unable to full tie the two systems together. Aside from this I think I'll be able to tie the databases (SQL Server 2005) via foreign keys (just need to iron out the 'other keys' issue I'm having with it) but i think I can handle this section :), as the primary site database and Snitz uses different 'keys' and collations (though the collation doesn't seem to affect Snitz too much :D - Thankfully) and I honestly am still trying to wrap my head around the database aspect of the main site even after four years of dealing with it :(.

I'll leave it here for the time being. Hopefully someone better than myself can help with the section(s) of code I need to solve this issue, I've been pulling my hair out with the code, database, site, etc. for the past three weeks trying to solve it, but alas help is what I need :-|, yes doing something on this sort of scale is a nightmare - believe me I know, though I'll leave it here as I feel like I'm writing a bit of a novel now, and getting extremely tired :(.

TIA for the assistance!! I need it ;).

Almost bald as is, but after pulling so much hair out, pretty much 'scalped' now.

Cheers and thank you again.

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 09 August 2015 :  16:34:37  Show Profile  Visit HuwR's Homepage
for the gender stuff you need to look in inc_profile around line 500ish
Not certain about the session, will have to take a look

MVC .net dev/test site | MVC .net running on Raspberry Pi
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 09 August 2015 :  17:31:47  Show Profile
quote:
Originally posted by Samcko

Where do I change the sex/gender from full text (fe/male) to 0/1?

quote:
Originally posted by HuwR

for the gender stuff you need to look in inc_profile around line 500ish




Good memory, HuwR. Samcko, if you need the field definition for "M_SEX" to be numeric, you should change all of these. Otherwise, if it's alright to remain as text, just the section in "inc_profile.asp" needs changing.


In "inc_profile.asp", change lines (appx 488-502) to say:

		if strMode <> "Register" then
			if rs("M_SEX") = "1" then Response.Write(" selected")
		end if
		Response.Write	">Male </option>" & vbNewLine & _
				"                           <option value=""Female"""
		if strMode <> "Register" then
			if rs("M_SEX") = "0" then Response.Write(" selected")
		end if

In "pop_profile.asp", change lines (appx 1376-1378) to say:

			if strSex = "1" then
				strSql = strsql & ",	M_SEX = " & ChkString(Request.Form("Sex"),"SQLString")
			end if

In "register.asp" 

Change line (appx 180) to say:

			strSql = strSql & ", " & chkString(rsKey("M_SEX"),"SQLString")


Change line (appx 710) to say:

				strSql = strsql & ", " & ChkString(Request.Form("Sex"),"SQLString")
Go to Top of Page

samcko
Starting Member

Australia
8 Posts

Posted - 10 August 2015 :  02:15:19  Show Profile
Greatly appreciate the response, unfortunately I am having some server issues at current, once I have sorted these issues out with it, I'll implement these changes and test, at current I have two users (both of myself - one 'admin' and one 'normal' user), but as first post states, I'll be setting the database up so that if a user registers on the main site, that registration carries over to Snitz as well. As for the session information, again as I'm facing server issues this can wait for the next day or two ;), as I'm working tonight I most likely won't have too much time to fix the server issue that I've got. But still though, HuwR & Carefree your help has been extremely helpful in regards to the Sex/Gender from Text to Dig (int/char(1)), this will allow me to at least start getting the forum and site integrated.

Once these changes are done, I'll start 'killing' the database :D, in other words trying to figure out how to foreign key the sections that are needed to each other, this will be quite fun I think :|.

Thank you again for your help so far, hopefully the session section can come to pass (this is the other that is needed to fully tie the sites together :)).

Cheers.
Go to Top of Page

samcko
Starting Member

Australia
8 Posts

Posted - 15 August 2015 :  13:27:12  Show Profile
Huwr & CareFree,

Thank you for your help regarding to the sex from text to int. This has helped greatly! I have implemented the changes and works great.

Next is to work on the <session> tags, and to figure out exactly why my db isn't allowing foreign keys :(. - keep getting error: "the columns in table do not match an existing primary key or unique constraint" or very similar, which is giving me some headache, as when I think I've solved it (yes did a google search found several results, so far none have helped - I even removed the any and all references to PK, FK, IX, etc. to no avail), I know that the tables need to match in respect to collation, string type and string size (I.E. cannot be nvarchar(50)?PK? to int?FK? or vice versa) I am partly aware of this.

Therefore these two sections are what is preventing me from fully integrating the forum now :(, does anyone have any suggestions relating to this? I've just about tried everything except for destroying the db and restarting it from scratch (believe me, this is the "LAST RESORT", as there is too many tables (36 tables, with over 10 columns per table) to recreate not to mention the stored procedures - anyone say nightmare?) which honestly I don't want to do if I don't need to.

Any help on these Questions will be greatly appreciated.

Q1. Is there a way to configure foreign keys with constraints/unique properties intact, as even removing them didn't seem to help, if anyone would like, I can attempt to upload the MDF file associated with the db (without user details for privacy/security reasons), I use SQL 2005 Ent. ed. for the databases (32 bit - unfortunately), Windows Server 2003 Ent. Ed. with most recent updates (updated when updates come out and restarted regularly for said updates to install).

Q2. Session data - How can I set Snitz Forums to use the site <session> (<%if session("userid")="" then%> - excert from one of the pages on the main site) tags?

Any help would be appreciated, and would be helpful as well - other users may need this sort of information (perhaps).

Carefree,

I wish to advise that there was a slight error in the coding provided as when I tried to change details on the forum it wouldn't work correctly :(.

It was one line only that prevented it from working correctly though ;).

The line in pop_profile.asp needed to remain the same or it'd throw an error, unsure if it is my end that was causing it or if there was a piece of software/hardware on my end that was causing it, but if I left that line intact, no problems were encountered.

Also, not relevant but still would help. How does one bypass the spam check/blocker when sending out emails? I.E. the change of email confirmation and the registration email? As I attempted to sign 'another user' up and it failed to send the email to their address - suspected spam message :(, is there a way to prevent this from happening?

I used: Bigpond (Australian ISP) (suspected spam), my own domain (using spam assasin - localhost and mailguard - primary filter - rejected) and hotmail (again supected but moved to junk mail - thankfully), is there a way to prevent this from happening? I don't want to resort to 'admin approval only' or 'no "approval"' as I would like the system to send 'confirmation' emails to the user to attempt to prevent spam or slow it down.

Any help on the above mentioned would be greatly appreciated. Again this is turning into a little of a novel so I'm stopping here and calling it a night, getting fairly tired and also a little annoyed at my computers not working quite right :(.

Cheers.
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 15 August 2015 :  15:12:12  Show Profile
Which spam check is installed? There have been quite a number of them over the years.

As for session variables, they're enabled via IIS on the server. I'm assuming the forum is a sub-folder or virtual folder from the parent path. If either is the case, visiting the parent (root) site first, then clicking a link to enter the forum should retain the session variables.
Go to Top of Page

samcko
Starting Member

Australia
8 Posts

Posted - 16 August 2015 :  04:14:21  Show Profile
Carefree,

I have spamassassin in conjunction with hMailServer (this isn't where the problem lies) nor is it with the Mailgaurd system. I'm not entirely sure where the issue does lie, but I think it could be on Bgiponds end.

As for the session details, the forum is a sub-folder of the main site - ./asp/sf2/ - main = ./asp/, forum = ./asp/sf2/, even though this is said, the session isn't being passed through, when I return to the main site (not logged out), it seems to have me logged out of the main site anyway. Is there a way to tie these together with the same session 'key'?

I noticed that there was some form of 'cookie' information in the one of the main sites .asp pages, if you'd like me to copy and paste, I can re-locate the section and c|c / c|v it here, not entirely sure what this cookie section is even for either to make matters worst. But if it's apart of the actual site for the reason for a 'forum' I'd be happy to attempt a play on it ;).

Cheers.
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 16 August 2015 :  04:35:33  Show Profile
Sounds like something isn't enabled in IIS. If you assign a session variable upon logging in to the main site, then click through to your forum, that variable should still be valid. If it isn't, then look for any of these in your code:

Session.Timeout (you can override the default time in IIS)
EnableSessionState = False (disables session)
Session.Abandon (that will wipe your variables) - if you logout of the forum, that's part of the process. This sounds like your issue. When you return to the main site, are you logging out of the forum?

Go to Top of Page

samcko
Starting Member

Australia
8 Posts

Posted - 16 August 2015 :  10:03:50  Show Profile
Carefree,

I'm not logging out of the forum, all I'm doing is clicking the home button on the forums ./asp/ but still not entirely sure what is causing the issue. I don't recall seeing anything to the |session| variables you pointed out in any of the main site code, but I can double check all pages if needed to verify.

As for IIS, sessions are enabled (to my knowledge) on the root folder which I think should've carried over to the subs as well I think (clarification needed to verify my assumptions).

All-in-all I don't believe it's a case of session variables going astray, it could very well be something within the IIS configuration that I haven't seen/checked. Although I am confident that I had setup IIS the way it should've been setup unless there is an error with the settings, but pretty sure it's all good.

I'll go over the website pages and check if there are any session variables in them but I have a feeling that there is no 'EnableSessionState = ?' or 'Session.Timeout' variables but I am pretty sure the Session.Abandon variable is found in the user logout page. In this page, there are 4 lines - 1st: <%<br>2nd: session.abandon<br>3rd: response.redirect "index.asp"<br>4th: %>

I'll need to further check other pages for the <session> variable.

Cheers.
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 16 August 2015 :  15:09:28  Show Profile
Yeah, typically the only place you should abandon your session variables is when logging out and deleting cookies. If you don't find any session dumping/limiting code elsewhere, then I'd say it must be in improperly configured IIS.

I just tested it on a localhost system, the forum recognized the parent path session variables just fine.
Go to Top of Page

samcko
Starting Member

Australia
8 Posts

Posted - 17 August 2015 :  15:12:31  Show Profile
Hmmm..... I wonder where I've screwed up ;) with the configuration, this is what I'm thinking at current. As for the session variables, do they need to use the same 'variables' as the Forum? I.E. M_user, M_pass, etc. as the main site uses id_login, id_pass for the user and pass sections. I'm not entirely sure. But please also note, the forum is in a sub from a sub I.E. www.example.com/asp/sf2, the root doesn't contain any index files as I didn't deem them needed at current (due to testing and verification work on the main and forum - have tried many forum 'packages' and Snitz Forums seems to be the better one out of the ones I've tried to this point) so basically no index.xxx file is found under the root directory except for "directory browsing" which is 'disabled and cannot be used - 403: Forbidden error is applied' aside from this I can't think of anything else that could be causing the issue.

I'd be happy for you to remote in (via teamviewer) to check these settings as I'm not entirely sure what I'm looking for :( or where I may've gone wrong in the configuration. Please also note this is a windows 03 server not a 08 or 08 R2 server. Again not entirely sure where the configuration is incorrect, I thought it was configured correctly but after this, it seems not.

Another thought just came to mind, will Snitz Forums bring over the login details from the main if that user isn't in the Snitz db? If yes, fantastic, if not, I've got a slight problem :|.

Cheers.

P.s. is it possible to upload a copy of your entire test site you used as I'd like to see what the difference(s) maybe between it and my site. Or if you'd prefer, again I'm happy for you to remote into my server and verify the settings. To be honest, I don't know too much about IIS nor do I know too much about the server OS (server 2k, 2k3, 2k8, etc.), all I know is: if it works, its working, if it's not working, there's something a miss and try to fix. If unable to fix, restart from scratch and try again. ;-) typical IT guy for you ;-), yes I am an IT person but more or less have mainly dealt with Win xp, 2k, vista, 7, 8 and sooner or later Win 10, due to lack of "training" thanks to workplace involvment I wasn't really able to learn too much about the Server OS, so I needed to play around with this sort of thing in my own home :*(, which in turn has allowed me to learn a bit more than if I was in the workplace ;), afterall a small mistake could've meant 'life or death' to the entire workplace environment :D.
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 17 August 2015 :  15:27:35  Show Profile
ok - can remote and check for you. My test forum is massive, it's the modular package I've been working on and only superficially resembles a stock Snitz. But easy enough. I'm quite familiar with all MS products from Interface Manager through Windows 10; including all of the standard servers and a few of the specialized servers (e.g., Data Center, small business) of different years.

Email me the connection information and we'll get this fixed for you.

Go to Top of Page

samcko
Starting Member

Australia
8 Posts

Posted - 17 August 2015 :  17:45:19  Show Profile
Carefree,

No problems, just hope the forums allow it, though I'll have to wait until at least Wednesday Morning as I'd like to watch (if that's ok) so I can see exactly where I made the mistake instead of being told ;), hope that's ok with you. I'll send through the connection details in the morning, as I need to catch some z's now as I work again tonight, being a taxi driver I won't be able to watch everything, as if the phone rings, I gotta go :(, so be better set for morning this way I can see my mistake :D, and how I killed the poor thing ;), and also ensure it doesn't happen again in the future ;).

Cheers.

P.S. I really do appreciate all your help! Windows 10, I gotta ask, is it what it's supposed to be cracked up to be? I'm trying to image a laptop of mine so that I can upgrade for the 'hands-on' fun :D, lol, should be interesting if/when I get it imaged. Thank you again for all your help! 'Speak' with you in the morning.
Go to Top of Page

samcko
Starting Member

Australia
8 Posts

Posted - 18 August 2015 :  19:34:36  Show Profile
Carefree,

it seems that I don't have enough posts as yet to send an email :(, so I'm not going to be able to send it, if I remember correctly the minimum posts required is 10 (whether or not Snitz has upped this limit or kept it to it's default I'm unsure).

I could create a 'temp' email address for the express purpose of this meeting, then post that 'dead-end' address here. Or I could upload the entire site to a file sharing site (Mediafire, Cubby, similar) in a zip, 7z, etc. format due to it's entirety size (approx. 400 - 450 MB this is everything in /asp/*) there is more than likely quite a bit that isn't required within the folder but as I've been 'playing around' with different 'software', it has grown and I haven't bothered to clean it up, as I'll more or less re-visit the folders and see if I can work out what's causing what error or solve something that shouldn't be happening or otherwise.

Perhaps thinking about it now, I should've 'spread' these sorts of replies/comments out over multiple posts to put the count up, but this would be classed as 'hacking the count' I guess, I know I'd be mad if someone did something like that to my forum ;|.

Cheers.
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 18 August 2015 :  21:26:44  Show Profile
I Emailed you, now you can just reply.
Go to Top of Page
   Topic Next Topic  
 New Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.18 seconds. Powered By: Snitz Forums 2000 Version 3.4.07