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/O Code)
 Adding A Field To User Profile
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

richfed
Average Member

United States
999 Posts

Posted - 11 July 2002 :  12:45:55  Show Profile  Visit richfed's Homepage
Not sure if this is the correct forum for my query ...

I would like to be able to add a field to the user profile that will show up when that user posts ... let's say, right under, or above, the stars.

In a search, I found a reference to a "user fields mod" which very possibly did/does this very thing, but it wasn't among the downloads at the Snitz Exchange.

Can anyone help me accomplish this?

Rich

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 11 July 2002 :  14:57:31  Show Profile  Visit HuwR's Homepage
it is posted here in the 'Mod Completed Add ons' forum, but it only does half of what you want, it allows you to add extra field to the user profile, but that is the only place they are displayed.



Go to Top of Page

richfed
Average Member

United States
999 Posts

Posted - 11 July 2002 :  18:54:11  Show Profile  Visit richfed's Homepage
OK ... I downloaded that MOD, and will look it over this weekend. Thank you.

Now, how can I accomplish the second half ... make an additional designated field show up in posts, much like the user name, stars, avatars, and title do? Thinking post.asp is the file to edit, but what would I need in there?

Rich
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 12 July 2002 :  05:51:35  Show Profile
It's actually topic.asp you'd need to edit. If you post a link to a text version of your topic.asp along with the name of the new field you added to the members table, I'll give you a hand making the changes.

c ya in the funny books
MeTV - tvthemetunes.net - forums
house of design - graphic design consultants

"No one can earn a million dollars honestly."
Go to Top of Page

richfed
Average Member

United States
999 Posts

Posted - 12 July 2002 :  06:57:04  Show Profile  Visit richfed's Homepage
Mighty friendly of you! Thanks!

Here's the link: http://www.mohicanpress.com/topic.txt

Haven't decided for certain the name of the field ... For this purpose, let's just call it "New Field," then I can substitute it's real name when I know what it is.

I'd like it to show right under the stars, and not show at all if the field is left blank ... I guess that's obvious.

Appreciate the help ... hope I can return the favor some day!

Rich
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 12 July 2002 :  07:59:18  Show Profile
OK, assuming you haven't made any changes to topic.asp since posting the above, all the following line numbers should be correct. I'm gonna be calling the field you want to use NEW_FIELD, so just replace all occurences of that in the code below once you've decided on a name.

Find this on lines 120, 166 & 332:
	strMemberTablePrefix & "MEMBERS.M_AVATAR_URL, " & _

and add this immediately below it
	strMemberTablePrefix & "MEMBERS.NEW_FIELD, " & _



Find the following beginning on line 624 (after above is done):
        <br><% = getStar_Level(rsReplies("M_LEVEL"), rsReplies("M_POSTS")) %>
<% end if %>
<br>
<br><font color="<% =strForumFontColor %>" face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>"><small><% =rsReplies("M_COUNTRY") %></small></font>

and replace it with this
        <br><% = getStar_Level(rsReplies("M_LEVEL"), rsReplies("M_POSTS")) %>
<% end if %>
<% '################ Added by MeTV to show new field in Members Table ################
if rsReplies("NEW_FIELD") <> "" then %>
<br><font color="<% =strForumFontColor %>" face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>"><small><% =rsReplies("NEW_FIELD") %></small></font>
<% end if
'####################################################################################%>
<br>
<br><font color="<% =strForumFontColor %>" face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>"><small><% =rsReplies("M_COUNTRY") %></small></font>



Find the following beginning on line 777 (after the above is done):
        <br><% = getStar_Level(rsTopic("M_LEVEL"), rsTopic("M_POSTS")) %>
<% end if %>
<br><% if Trim(rsTopic("M_AVATAR_URL")) <> "" and lcase(rsTopic("M_AVATAR_URL")) <> "noavatar.gif" and (IsNull(rsTopic("M_AVATAR_URL")) = false) then %>

and replace it with this
        <br><% = getStar_Level(rsTopic("M_LEVEL"), rsTopic("M_POSTS")) %>
<% end if %>
<% '################ Added by MeTV to show new field in Members Table ################
if rsTopic("NEW_FIELD") <> "" then %>
<br><font color="<% =strForumFontColor %>" face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>"><small><% =rsTopic("NEW_FIELD") %></small></font>
<% end if
'####################################################################################%>
<br><% if Trim(rsTopic("M_AVATAR_URL")) <> "" and lcase(rsTopic("M_AVATAR_URL")) <> "noavatar.gif" and (IsNull(rsTopic("M_AVATAR_URL")) = false) then %>


That should be it, let me know if you've any probs. Incidentally, I noticed a couple of things in your code that you may wat to take a look at.

You have strSQL defined twice for rsTopic (beginning at lines 110 & 156), you can safely remove one of these.

Also, you seem to only have the Avatar Mod set up to show up in the first post in each topic, have a scan through the readme again, and add in the code you missed so it shows up in the replies too.

c ya in the funny books
MeTV - tvthemetunes.net - forums
house of design - graphic design consultants

"No one can earn a million dollars honestly."
Go to Top of Page

richfed
Average Member

United States
999 Posts

Posted - 12 July 2002 :  13:19:20  Show Profile  Visit richfed's Homepage
Thank you, very much MeTV ... Will work on that tomorrow. Should I encounter difficulties, I'll get back with you!

You are correct! Avatars on my forum show up only when someone begins a topic ... I just thought that was the way it was designed when I realized that was happening! Will have to go back in and sort through what I missed! Although, I kinda like it that way ...

You did quite a thorough job ... thank you!

Rich
Go to Top of Page

richfed
Average Member

United States
999 Posts

Posted - 13 July 2002 :  08:13:38  Show Profile  Visit richfed's Homepage
quote:

... let me know if you've any probs. Incidentally, I noticed a couple of things in your code that you may wat to take a look at.

You have strSQL defined twice for rsTopic (beginning at lines 110 & 156), you can safely remove one of these.



OK ... one of those is from the Poll Mod code. Do you mean I should - or could - delete just that one line - or the whole list that follows?

Anyway, I edited my topic.asp as you said, and ended up with the following error when clicking on a topic:

quote:
Microsoft VBScript compilation error '800a0400'

Expected statement

/messageboard/topic.asp, line 625

end if
^



I should say, that I have done this before adding the User's Field MOD. Perhaps, that is why? I've uploaded my back-up topic.asp file to my forum, however, I made a .txt version of the copy that produced the error for you to look at, if you can.

See: http://www.mohicanpress.com/topic.txt

Thanks ...

Rich
Go to Top of Page

cripto9t
Average Member

USA
881 Posts

Posted - 13 July 2002 :  09:54:06  Show Profile
Hi Rich, if you haven't got it working yet I believe it should look like this (add the part in red :)

<%	'################  Added by MeTV to show new field in Members Table  ################
if rsReplies("GATHERINGS_ATTENDED") <> "" then %>
<br><font color="<% =strForumFontColor %>" face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>"><small><% =rsReplies("GATHERINGS_ATTENDED") %></small></font>
<% end if %>
'####################################################################################%


Do the same for the other one below that to and you should be alright

--------Brian.
Go to Top of Page

richfed
Average Member

United States
999 Posts

Posted - 13 July 2002 :  15:45:21  Show Profile  Visit richfed's Homepage
Nah ... that didn't work ... at least not if I did it correctly ... Error read:

quote:
Microsoft VBScript compilation error '800a0400'

Expected statement

/messageboard/topic.asp, line 625

end if
^



Appreciate you trying!

EDITED: CORRECTION! It did work! I must not have saved the new file & re-uploaded the same one!!! So, now, I'll try to install the User's Field Mod & see what happens!

THANK YOU!

Edited by - richfed on 13 July 2002 15:52:41
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 15 July 2002 :  06:39:28  Show Profile
Oopsie! Sorry 'bout the error. It's always the simple things things that get overlooked, isn't it?!

quote:
OK ... one of those is from the Poll Mod code. Do you mean I should - or could - delete just that one line - or the whole list that follows?


You can delete the entire SQL statement (the whole list that follows). The modifications I gave you above applied to both of them so you can remove either of them. Backup your topic.asp first, just in case.

c ya in the funny books
MeTV - tvthemetunes.net - forums
house of design - graphic design consultants

"No one can earn a million dollars honestly."

Go to Top of Page

richfed
Average Member

United States
999 Posts

Posted - 15 July 2002 :  13:22:56  Show Profile  Visit richfed's Homepage
quote:


EDITED: CORRECTION! It did work! I must not have saved the new file & re-uploaded the same one!!! So, now, I'll try to install the User's Field Mod & see what happens!



I'm not sure what is going on now. I successfully installed the User Fields MOD - was not able to use the intended field name [too long] so changed it to USER_7.

Edited my topic.asp, and received this error now, when clicking on any topic]:

quote:
Microsoft JET Database Engine error '80040e10'

No value given for one or more required parameters.

/messageboard/topic.asp, line 203



I put up a new text file, if you can take a look ...

http://www.mohicanpress.com/topic.txt

I think I erred in the beginning when I uploaded the "corrected" file. At this point, I'm not sure what I uploaded ... it may have been the topic.asp sans edit.

Rich

Edited by - richfed on 15 July 2002 13:44:22
Go to Top of Page

richfed
Average Member

United States
999 Posts

Posted - 16 July 2002 :  19:04:17  Show Profile  Visit richfed's Homepage
I went back in to topic.asp and edited out the redundant strSQL statement, and fixed my avatar mod code. Consequently, the lines have changed. The error message now reads:

quote:
Microsoft JET Database Engine error '80040e10'

No value given for one or more required parameters.

/messageboard/topic.asp, line 157



Updated text file is up for anyone up to the the task to take a look at. It's at: http://www.mohicanpress.com/topic.txt

HELP!!!!!!!

Rich
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 17 July 2002 :  07:06:04  Show Profile
Had a quick look over it just there, the problem is in the SQL statement you're using, but I can't see what's wrong, been looking at far too much code today, my head hurts (and it's not even 12:00!!!). All I can suggest at the moment is that you replace the SQL statement you're using now with the one you removed, there was obviously some difference between them. If you can't find it, I have a copy, just lemme know.

c ya in the funny books
MeTV - tvthemetunes.net - forums
house of design - graphic design consultants

"No one can earn a million dollars honestly."
Go to Top of Page

richfed
Average Member

United States
999 Posts

Posted - 17 July 2002 :  13:27:19  Show Profile  Visit richfed's Homepage
No, I don't think that is the problem ... I'm using that statement now. The topic.asp currently on my forum is identical to the .txt version, minus the code we added in from this thread.

About ready to give up on this one ... it was not all for naught, though. I did, thanks to you, get my avatars working as they are supposed to!! Well, maybe I won't give up ... but take a break from it ...at least!

Rich
Go to Top of Page

richfed
Average Member

United States
999 Posts

Posted - 29 July 2002 :  20:27:05  Show Profile  Visit richfed's Homepage
quote:

Find this on lines 120, 166 & 332:
	strMemberTablePrefix & "MEMBERS.M_AVATAR_URL, " & _

and add this immediately below it
	strMemberTablePrefix & "MEMBERS.NEW_FIELD, " & _



Find the following beginning on line 624 (after above is done):
        <br><% = getStar_Level(rsReplies("M_LEVEL"), rsReplies("M_POSTS")) %>
<% end if %>
<br>
<br><font color="<% =strForumFontColor %>" face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>"><small><% =rsReplies("M_COUNTRY") %></small></font>

and replace it with this
        <br><% = getStar_Level(rsReplies("M_LEVEL"), rsReplies("M_POSTS")) %>
<% end if %>
<% '################ Added by MeTV to show new field in Members Table ################
if rsReplies("NEW_FIELD") <> "" then %>
<br><font color="<% =strForumFontColor %>" face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>"><small><% =rsReplies("NEW_FIELD") %></small></font>
<% end if
'####################################################################################%>
<br>
<br><font color="<% =strForumFontColor %>" face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>"><small><% =rsReplies("M_COUNTRY") %></small></font>



Find the following beginning on line 777 (after the above is done):
        <br><% = getStar_Level(rsTopic("M_LEVEL"), rsTopic("M_POSTS")) %>
<% end if %>
<br><% if Trim(rsTopic("M_AVATAR_URL")) <> "" and lcase(rsTopic("M_AVATAR_URL")) <> "noavatar.gif" and (IsNull(rsTopic("M_AVATAR_URL")) = false) then %>

and replace it with this
        <br><% = getStar_Level(rsTopic("M_LEVEL"), rsTopic("M_POSTS")) %>
<% end if %>
<% '################ Added by MeTV to show new field in Members Table ################
if rsTopic("NEW_FIELD") <> "" then %>
<br><font color="<% =strForumFontColor %>" face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>"><small><% =rsTopic("NEW_FIELD") %></small></font>
<% end if
'####################################################################################%>
<br><% if Trim(rsTopic("M_AVATAR_URL")) <> "" and lcase(rsTopic("M_AVATAR_URL")) <> "noavatar.gif" and (IsNull(rsTopic("M_AVATAR_URL")) = false) then %>




OK! This never worked because the Add User Field MOD did not write to the Members table. Cosequently, all the errors I was receiving.

Here's what it does do, the MOD that is, as I understand it. I create a new user field through the MOD. I called mine: USER_7

The MOD then creates a table called FORUM_USERFIELDS. In that table, it assigns a USER_FIELD_ID for each new field I create [I should add, that these fields show up in the User's Profile and are editable by the user]. These ID's are numeric. In this case, USER_7 was assigned #2. [confusing, isn't it?!?]

It also writes to the FORUM_MEMBERFIELDS table. The USER_FIELD_ID shows up under USR_VALUE (in this case, "2").

At least this is how it all looks to me, a very inexperienced tinkerer. I may have a somewhat garbled account here!

Assuming I'm near the mark, how do I edit the code above to get the USER_7 field to show up when the user posts?????

Do I use the FORUM_MEMBERFIELDS table or the FORUM_USERFIELDS table? And, then, which value do I use? USER_7 or USR_VALUE ... or, am I way off? Is this even doable?

HELP! [Please!]

Rich
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 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.28 seconds. Powered By: Snitz Forums 2000 Version 3.4.07