PDA

View Full Version : Little help please, w/ custom user group and author info


JJR512
03-22-2001, 02:49 AM
What I want is for some of my members, those who are on my SETI@home team, to have a link to my SETI@home page somewhere in their post. I think it would be cool/neat to have it in the author info area (the left column), right above their registration date.

I tried this with a custom user profile field, and I edited the appropriate template so it shows up in the right spot. But they can edit the contents of the field. This I do not want, because I only want one thing displayed, and only for the certain members. Non-team-members were putting silly stuff in the field, etc.

So now I'm thinking I can make a custom user group (i.e., like Registered or Moderator), called SETI Group Members. I can manually add people to this group. I'm thinking there must be some kind of way the board, when displaying posts, can check to see if the member is a member of that group, and if so, to put this link above the registration date.

I've already made the group; now I just need to know how to make the checking part, and include the link in that spot. Any help, please? :)

03-22-2001, 03:09 AM
if ($post[usergroup] == XX) {
$setilink = "your/url/here";
} else {
$setilink ="";
}


That should give you an idea of what to put in showthread.php

03-22-2001, 04:02 AM
I just thought of something. I'm on the SETI team, as are moderators and regular members. Obviously, we all can't be part of the same user group. If I add multiple user groups, like SETI_Admin, SETI_Mod, SETI_SuperMod, and SETI_Member, how would the above little code be made to check all those groups?

And assuming I correctly set permissions for each group, would putting a Moderator in another group have any effect on his/her abilities?

03-22-2001, 04:06 AM
Or is there maybe a better way to do this? I could make a new field in the user table, and if I manually set the value to 1 for someone, the link would show up. This is probably the best way.

But I don't know how to write the part...the same part, that checks the value to see if it's 1 or not.

03-22-2001, 03:31 PM
if ($post[seti] == 1) {
$setilink = "<a href=http://your.com/url/here/>SETI member</a>";
} else {
$setilink = "";
}
You must add a field named "seti" to the User table, and set each seti member to "1" by hand. Add $setilink where you want it to appear under each user's info or in the icon line.

03-22-2001, 06:39 PM
OK, thanks! Two questions:

1. Does it matter where in showthread.php I put this code?

2. What is the syntax of a query I could issue to the db through phpMyAdmin to change the value for a member?

03-22-2001, 06:42 PM
1. Find
if ($post[aim]!="") {
eval("\$post[aimicon] = \"".gettemplate("aim")."\";");
} else {
$post[aim]="";
}
and put it right after that.
2. UPDATE user SET seti='1' WHERE userid='XX' and substitute the user's ID for XX.

HTH.