Author |
Topic |
bjlt
Senior Member
1144 Posts |
Posted - 11 May 2003 : 12:05:53
|
mortioli, you need to put writefootershort in your codes. |
|
|
Etymon
Advanced Member
United States
2385 Posts |
Posted - 12 May 2003 : 23:22:43
|
quote: Originally posted by bjlt
Etymon, have you come up with the codes you need? I don't have the gerder mod but here's the code for it.
function getGenderCount(piGender) '# e.g. 1: male, 2 female ...
Dim rs, strSql, lTemp
set rs = server.CreateObject("adodb.recordset")
strSql = "SELECT COUNT(MEMBER_ID) as GenderCount FROM " & strMemberTablePrefix & "MEMBERS WHERE M_SEX = " CLng(piGender)
rs.Open strSql, my_Conn
lTemp = rs("GenderCount")
rs.Close
set rs = nothing
getGenderCount = lTemp
end function
I don't know the field name for gender used in gender mod you have, change M_SEX to the one it uses if it's not the one.
Cheers,
Thanks for the code bjlt. I've been offline for a while and am just getting back in the swing of things.
Thanks again,
Etymon
|
|
|
bjlt
Senior Member
1144 Posts |
Posted - 12 May 2003 : 23:40:59
|
quote: Originally posted by Etymon
Thanks for the code bjlt. I've been offline for a while and am just getting back in the swing of things.
You're welcome. oh, I forgot a & in the code. M_SEX = " & CLng(piGender)
Also if the gender mod uses male/female etc for sex instead of 1/2, you need to change it to WHERE M_SEX = '" & chkString(piGender,"SQLString") & "'"
|
Edited by - bjlt on 12 May 2003 23:42:11 |
|
|
mortioli
Average Member
United Kingdom
898 Posts |
Posted - 25 May 2003 : 03:56:32
|
Hi! Sorry I haven't posted for a while!
I tried the above fixes etc, and I get this error
Microsoft VBScript runtime error '800a0009'
Subscript out of range: 'mM_SEX'
/where2.asp, line 187
Any ideas?
Cheers mate! |
|
|
mortioli
Average Member
United Kingdom
898 Posts |
Posted - 25 May 2003 : 03:57:45
|
Ooops, line 187 is:
M_SEX = aListBystate(mM_SEX,i) |
|
|
bjlt
Senior Member
1144 Posts |
Posted - 25 May 2003 : 06:21:50
|
look at these codes:
sSQL = "SELECT M.MEMBER_ID, M.M_NAME, M_FIRSTNAME, M_LASTNAME, M.M_LEVEL, M.M_TITLE, M.M_EMAIL, M.M_RECEIVE_EMAIL, M.M_HOMEPAGE, M.M_ICQ, M.M_MSN, M.M_AIM, M.M_YAHOO, M.M_CITY, M.M_SEX
=========
mMEMBER_ID = 0
mM_NAME = 1
M_FIRSTNAME = 2
M_LASTNAME = 3
mM_LEVEL = 4
mM_TITLE = 5
mM_EMAIL = 6
mM_RECEIVE_EMAIL = 7
mM_HOMEPAGE = 8
mM_ICQ = 9
mM_MSN = 10
mM_AIM = 11
mM_YAHOO = 12
mM_STATE = 13
mM_CITY = 14
mM_SEX = 15
if gbPM then '##
mM_PMRECEIVE = 16
end if
i = 0
j = 0
For i = 0 to iRecCount - 1
MEMBER_ID = aListBystate(mMEMBER_ID,i)
M_NAME = aListBystate(mM_NAME,i)
M_FIRSTNAME = aListBystate(mM_FIRSTNAME,i)
M_LASTNAME = aListBystate(mM_LASTNAME,i)
M_LEVEL = aListBystate(mM_LEVEL,i)
M_TITLE = aListBystate(mM_TITLE,i)
M_EMAIL = aListBystate(mM_EMAIL,i)
M_RECEIVE_EMAIL = aListBystate(mM_RECEIVE_EMAIL,i)
M_HOMEPAGE = aListBystate(mM_HOMEPAGE,i)
M_ICQ = aListBystate(mM_ICQ,i)
M_MSN = aListBystate(mM_MSN,i)
M_AIM = aListBystate(mM_AIM,i)
M_YAHOO = aListBystate(mM_YAHOO,i)
M_STATE = aListByState(mM_STATE,i)
M_CITY = aListBystate(mM_CITY,i)
M_SEX = aListBystate(mM_SEX,i)
if gbPM then '##
M_PMRECEIVE = aListBystate(mM_PMRECEIVE,i)
the number is its position in the recordset (in the select statement) starting from 0. if you change the fields to be retrieved, you need to change the number accordingly. also, the codes in green must match, it's a variable representing the number, I see that in your codes
M_FIRSTNAME = 2
M_FIRSTNAME = aListBystate(mM_FIRSTNAME,i)
they do not match.
now you understand how it works you can add/remove fields by yourself. |
Edited by - bjlt on 25 May 2003 06:26:10 |
|
|
mortioli
Average Member
United Kingdom
898 Posts |
Posted - 25 May 2003 : 11:22:23
|
Cheers
I changed those, but I'm still getting the error
Am I missing something |
|
|
bjlt
Senior Member
1144 Posts |
Posted - 25 May 2003 : 15:16:30
|
Dear mortioli, do you now understand how the codes work, and know how to add/remove a field to be retrieved?
the code in yellow was just to show you that the do not match, you need to find out what's wrong there and change them by yourself. If you have 10 fields in the select clause the you have variables (representing its position in the array actually) with value from 0 to 9.
If you get that error it means the number you assigned to that variable is beyond the number of selected fields minus one.
================== btw, if you have a recordset with just a few fields you don't need to use variables like this
mMEMBER_ID = 0
look at this code:
MEMBER_ID = aListBystate(mMEMBER_ID,i)
since mMEMBER_ID = 0 it's just
MEMBER_ID = aListBystate(0,i)
Now the question is, why it's 0? If you know why it's 0 you know what's wrong in your code.
Happy snitzing.
|
Edited by - bjlt on 25 May 2003 15:18:25 |
|
|
mortioli
Average Member
United Kingdom
898 Posts |
Posted - 26 May 2003 : 05:03:19
|
Doh'
I feel so stupid lol
I took out STATE from the SQL SELECT list, but not from the others! Ooops!
It's kind of working, but it's tripping over with the gender:
Microsoft VBScript runtime error '800a000d'
Type mismatch: '[string: "Female"]'
/where2.asp, line 357
...and the same with male
If I comment that out " & GetSexIcon(M_SEX) & " it works fine
Sorry if I'm annoying you with all these
I really appreciate the help though |
|
|
bjlt
Senior Member
1144 Posts |
Posted - 26 May 2003 : 05:49:11
|
mortioli, you're welcome. about sex, please refer to the comment in my codes. I use 1/2/3 for sex while current snitz uses 'male', 'female' etc. you need to changed it accordingly.
Function GetSexIcon(piSex) Select Case piSex Case 1 '# "male" GetSexIcon = sIconMale Case 2 '# "female" GetSexIcon = sIconFemale Case Else GetSexIcon = sIconUnknown End Select End Function
maybe we also need to fix the case by adding pisex = lcase(pisex) at the beginning of the function.
if you use string for sex, change it to
Case "male"
Case "female"
|
Edited by - bjlt on 26 May 2003 05:59:01 |
|
|
mortioli
Average Member
United Kingdom
898 Posts |
Posted - 26 May 2003 : 07:48:12
|
Awesome! It's working
Cheers mate!
One last thing though, sorry...
How do I get the icons to show up (because I'm using the code outside my forum folder) because at the moment they're showing as red xs'
Also, the sex icons aren't showing at all |
|
|
bjlt
Senior Member
1144 Posts |
Posted - 26 May 2003 : 09:02:13
|
sIconMale = getCurrentIcon(strIconMale,"Male","hspace=""4"" align=""absmiddle""") sIconFemale = getCurrentIcon(strIconFemale,"Female","hspace=""4"" align=""absmiddle""")
you need to have three or two icons first, male, female, unknown. there's a file named inc_iconfiles.asp in snitz. open it and look inside, if you have strIconMale, strIconFemale there. if not, make one.
it will work if you have set the correct imageurl in snitz.
if it dosen't, you can just change sIconMale = getCurrentIcon(strIconMale,"Male","hspace=""4"" align=""absmiddle""")
to
sIconMale = "<img src=""pathtoyourimage"" width=""width"" height=""height"" border=""0"" alt=""male or whatever you like"" title=""male or whatever"" hspace=""4 or whatever a number you like"" align=""absmiddle"" />" |
|
|
mortioli
Average Member
United Kingdom
898 Posts |
Posted - 28 May 2003 : 02:46:46
|
Cool
I dumped it in the forum folder, so the images work ok now
The icons to send an email etc...when you click on them, they don't do anything I tested it offline, and when you click on them then, it asks if you want to debug or not Any ideas mate?
Just a small thing...where it lists the persons name, it puts a comma after their first name...
E.g.
Oli, Mortimer
Any idea on how to get rid of this, because I tried, but failed
One last thing...sorry, I have some people who haven't put where they're from (so they'd be nothing in the STATE field), so I tried using this link...
<a href=JavaScript:where('forum/where2.asp?state=&method=0')>
...but it doesn't work because there isn't anything after state= Any ideas!?
Thanks a lot mate |
|
|
bjlt
Senior Member
1144 Posts |
Posted - 28 May 2003 : 04:01:18
|
GetName = GetName & ", " & psLast
I put it there as not every language uses firstname lastname.
about click on icon issue, open your topic.asp and find what's used there for the link of the icons and change accordingly if it's not the one in my code. if it still dosen't work it means you don't have the js file used, look into inc_header.asp or something to find the javascripts.
if no state is entered,
change this line if sCountry = "" then Response.Redirect "MemberCountByCountry.asp" : Response.End '# MemberCountByCountry.asp is a file I use to list num of users for every country. change it to the page you like.
to a page you want, you can make a page either list all or prompt them for the state.
|
|
|
mortioli
Average Member
United Kingdom
898 Posts |
Posted - 30 May 2003 : 02:47:45
|
Yeah I've changed that page.
I mean, what I'd like to do is this...
www.ckyalliance.co.uk/where.asp
When you click on a place, it now shows you what members are from there...but I have one at the bottom saying 'Unknown: ***' and I'd like to make that a link, to show which members haven't put a place.
But when I try this link <a href=JavaScript:where('forum/where2.asp?state=&method=0')> it doesn't work |
|
|
Topic |
|
|
|