Welcome, Guest. Please Login or Register.
May 13, 2024, 02:57:33 AM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  English User Help  |  English Help  |  Member Group probs - Sql « previous next »
Pages: [1] Reply Ignore Print
Author Topic: Member Group probs - Sql  (Read 1695 times)
stewade
Noobie
*
Posts: 12


I wish I was a Llama!

Member Group probs - Sql
« on: March 08, 2004, 12:06:17 AM »
Reply with quote

YaBB SE Version: 1.5.5

Problem Description:
I was trying to apply the mod for member group colours and could not work out why it wasn't working.

I checked the members table and the membergroups field is mostly empty - i.e. new users are not being assigned a group. Admin & GMod no problems...

I tried to set the default for this field (i.e. Newbie) and it would not allow me.  >:(

For a start shouldn't new users be given a value for group by default?

or

How can I set a default for the field when it won't let me?

I'm not sure where to work the fix.... Help...  ???
Logged
Peter Duggan
Llama Chameleon
Global Moderator
YaBB God
*****
Posts: 1793


You come and go...

WWW
Re:Member Group probs - Sql
« Reply #1 on: March 08, 2004, 12:10:37 AM »
Reply with quote

Newbie isn't a true member group in the sense that Admin and Global Mod are but, if you're working with a mod, you should really post your question in the topic for that mod in the Completed Mods board.
Logged

stewade
Noobie
*
Posts: 12


I wish I was a Llama!

Re:Member Group probs - Sql
« Reply #2 on: March 08, 2004, 12:18:37 AM »
Reply with quote

No - what I was pointing out is that new members aren't given any Membergroup by default (regardless of what they are) when becoming a member. This is a core YabbSE problem I have.

I probably just need to know where the default membergroup is assigned when a member signs up so it can't happen again...

And with 50+ members already, is there a quick way to apply the correct membergroup on the existing empty fields...

(Pssstttt - applying the mod was only where I noticed the problem. The fault isn't with the mod...  ;))
Logged
[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:Member Group probs - Sql
« Reply #3 on: March 08, 2004, 12:31:36 AM »
Reply with quote

This is normal.  You might like the way SMF handles membergroups better, however.

-[Unknown]
Logged
stewade
Noobie
*
Posts: 12


I wish I was a Llama!

Re:Member Group probs - Sql
« Reply #4 on: March 08, 2004, 12:57:25 AM »
Reply with quote

Normal  ???

So you guys are manually applying membergroups for new users? Yours is working AOK...

What about the SQL field membergroup - am I able to set a default value, it won't let me and I'm blowed if I know why. If I set to Not Null it has no effect when in fact it should popup an error for all the blank fields...

More confused then previously...

PS: I did a hack to force membergroups to a default color if the field is empty. It's a workround but it's horribly sloppy...  :P
Logged
[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:Member Group probs - Sql
« Reply #5 on: March 08, 2004, 01:50:14 AM »
Reply with quote

Check Register.php, search for INSERT INTO.

-[Unknown]
Logged
Shadow's Pawn
Support Team
YaBB God
*****
Posts: 597


ich soll nicht toten

ICQ - 8039201shadowpawn@hotmail.com WWW
Re:Member Group probs - Sql
« Reply #6 on: March 08, 2004, 03:29:09 AM »
Reply with quote

Members aren't given a group on signup.  The normal groups, i.e. newbie, etc etc are all post based.  They aren't true member groups.  Since they are post based, they will have the lowest group when they first start out.

You can edit Register.php as Unknown suggested to do, then you can make all users be put in a default membergroup...
Logged

apologize \A*pol"o*gize\, v. i. - To lay the foundation for a future offense.
stewade
Noobie
*
Posts: 12


I wish I was a Llama!

Re:Member Group probs - Sql
« Reply #7 on: March 08, 2004, 04:31:41 AM »
Reply with quote

OK, so far, so good. Just did the fix and now a default user is entered.

Still leaves the problem of when the group is updated based on post count.

Took a look at this in Post.php

UPDATE {$db_prefix}members
SET memberGroup = $newgroup
WHERE ID_MEMBER = $ID_MEMBER
$doLimitOne") or database_error(__FILE__, __LINE__);

I assume that this would be *the* only place to update the group based on count?

All I need then is the post count from the member table (+1 of course) and also check to make sure I ignore admin and Gmod...

Anything else can be updated regardless based on post count. Is this a fair assumption?

aka (in pseudo)

if not admin or gmod
 if posts >= newbie_count
     membergroup = group2_str
 elseif posts >= group2_count
     membergroup = group3_str
  .
  .  
  .

Last but not least (actual code)

UPDATE {$db_prefix}members
SET memberGroup = $membergroup
WHERE ID_MEMBER = $ID_MEMBER
$doLimitOne") or database_error(__FILE__, __LINE__);

Does this look right?
Logged
Shadow's Pawn
Support Team
YaBB God
*****
Posts: 597


ich soll nicht toten

ICQ - 8039201shadowpawn@hotmail.com WWW
Re:Member Group probs - Sql
« Reply #8 on: March 08, 2004, 04:37:23 AM »
Reply with quote

If you don't want it to determine their group based on post count, just remove those groups from Load.php.
Logged

apologize \A*pol"o*gize\, v. i. - To lay the foundation for a future offense.
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  English User Help  |  English Help  |  Member Group probs - Sql « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.115 seconds with 19 queries.