1
MS-2001
User Rank
  • 2005/4/6 16:29

  • MS-2001

  • Quite a regular

  • Posts: 204

  • Since: 2004/7/27


Is it possible that there is no Function for updating the users' rank?
I searched all php files but i couldn't find any sql-query for such an action...

Some users already told me that their rank won't get higher and they're right. For example: One user should already be 2 ranks higher :-/

So is it a bug? Is there something missing?
I tried the Syncronize function in the admin-form for that user but it didn't work.

So what could i do?

2
rowdie
Re: User Rank
  • 2005/4/7 12:59

  • rowdie

  • Just can't stay away

  • Posts: 846

  • Since: 2004/7/21


You haven't got the 'special user ranks' setting turned on for the normal ranks, have you?

Maybe post the min posts and max posts settings you have for system admin->user ranks... because I can't make it not work, so maybe if I use your settings it might help.

3
MS-2001
Re: User Rank
  • 2005/4/7 13:12

  • MS-2001

  • Quite a regular

  • Posts: 204

  • Since: 2004/7/27


Anfänger          0      100          Aus
Möchtegern         101     250         Aus
Kampfwurst         251     400         Aus
Intelligenzbolzen     401     600         Aus
Jungfrau         601     800         Aus
Streber         801     1000         Aus
Lifestyler         1001     1400         Aus
Vielschreiber         1401     1800         Aus
Nightchecker         1801     2499         Aus
Gott                    2500     99999         Aus
Moderator         0     0         An
Administrator         0     0         An
Miss                0     0         An
Redaktion         0     0         An
Cheffotograf         0     0         An


Those are the ranks I'm using... The last column is about the special ranks. "Aus" -> Off, "An" -> On.

I even can't find any function increasing the rank of a user?!?!

4
rowdie
Re: User Rank
  • 2005/4/7 13:55

  • rowdie

  • Just can't stay away

  • Posts: 846

  • Since: 2004/7/21


The rank is increased for comments in include/comment_post.php around line 330:

// increment user post if needed
    
$uid $comment->getVar('com_uid');
    if (
$uid && false != $add_userpost) {
    
$member_handler =& xoops_gethandler('member');
    
$poster =& $member_handler->getUser($uid);
    if (
is_object($poster)) {
        
$member_handler->updateUserByField($poster'posts'$poster->getVar('posts') + 1);
    }
    }


Also in newbb/class/post.php around line 667.

I don't think it works for posting articles in News 1, the default News module that comes with the core.

When you view a user's profile is the post count high enough to go up a rank? Or is it just that they seem to have posted more than they've been credited with?

5
MS-2001
Re: User Rank
  • 2005/4/7 14:03

  • MS-2001

  • Quite a regular

  • Posts: 204

  • Since: 2004/7/27


well, this function the users posts but not the rank. i'm looking for a rank-increaser-function

and yes: when i view a user's profile the post count is high enough to go up a rank.

6
rowdie
Re: User Rank
  • 2005/4/7 14:39

  • rowdie

  • Just can't stay away

  • Posts: 846

  • Since: 2004/7/21


hehe you're right of course. I thought at first the actual post count wasn't increasing.

I'm doing too many things at once

7
Mithrandir
Re: User Rank

function xoops_getrank($rank_id =0$posts 0)
{
    
$db =& Database::getInstance();
    
$myts =& MyTextSanitizer::getInstance();
    
$rank_id intval($rank_id);
    if (
$rank_id != 0) {
        
$sql "SELECT rank_title AS title, rank_image AS image FROM ".$db->prefix('ranks')." WHERE rank_id = ".$rank_id;
    } else {
        
$sql "SELECT rank_title AS title, rank_image AS image FROM ".$db->prefix('ranks')." WHERE rank_min <= ".$posts." AND rank_max >= ".$posts." AND rank_special = 0";
    }
    
$rank $db->fetchArray($db->query($sql));
    
$rank['title'] = $myts->makeTboxData4Show($rank['title']);
    
$rank['id'] = $rank_id;
    return 
$rank;
}

non-special ranks are not assigned, but calculated.

8
MS-2001
Re: User Rank
  • 2005/4/7 15:51

  • MS-2001

  • Quite a regular

  • Posts: 204

  • Since: 2004/7/27


But thats still no answer to my question. I allready found that function.

in xoops_users there is a field "rank". that's the source for the rank-info of that user. but where is it set? when someone reaches the next rank, it has to be saved in that field or am i wrong?

but when does that take place? i cant find the function and my users complain about not reaching the next rank.

9
MS-2001
Re: User Rank
  • 2005/4/9 11:45

  • MS-2001

  • Quite a regular

  • Posts: 204

  • Since: 2004/7/27


my questions is yet not answered :-/

10
Mithrandir
Re: User Rank

If the rankid is 0 the rank is calculated at runtime based on the user's posts.

Login

Who's Online

321 user(s) are online (215 user(s) are browsing Support Forums)


Members: 0


Guests: 321


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits