Forums

Unfortunately no one can be told what FluxBB is - you have to see it for yourself.

You are not logged in.

#1 2014-02-26 18:23:07

chris98
Member
From: England, United Kingdom
Registered: 2013-05-31
Posts: 618
Website

User Promotion Issue - 1.5.3

One of my users is not promoting from the default group. I have set the group to promote to in admin_users, and the number of posts is 3 - yet he has posted 5 and has not been promoted - however I have updated the post count through my own script from my downloads section, completely isolated from the forum.

Does the actual post evidence in the forum have to exist for them to get promoted, this is an issue I haven't noticed before?

Last edited by chris98 (2014-02-26 18:23:51)

Offline

#2 2014-02-26 20:55:26

Different55
Member
Registered: 2011-11-18
Posts: 158

Re: User Promotion Issue - 1.5.3

As far as I can tell, users are only promoted when they post to pass the minimum post for promotion limit. It doesn't look like changing the post count through profile.php will work. If they post at least once with an edited post count above the limit, it should promote them.

Last edited by Different55 (2014-02-26 20:56:45)

Offline

#3 2014-02-26 21:02:53

Franz
Lead developer
From: Germany
Registered: 2008-05-13
Posts: 5,857
Website

Re: User Promotion Issue - 1.5.3

Indeed. It's just like Different55 explained.

We'll make this process a bit simpler in the next version - you'll be able to directly promote the user to the next level from their profile.


fluxbb.de | develoPHP

"As code is more often read than written it's really important to write clean code."

Offline

#4 2014-02-27 16:48:41

chris98
Member
From: England, United Kingdom
Registered: 2013-05-31
Posts: 618
Website

Re: User Promotion Issue - 1.5.3

No, I haven't actually manually done it through profile.php, I've done it via my own script. It does update the post count, but doesn't promote the user - I meant does the post evidence have to exist in the FluxBB posts table?

Here's my code:

	$sql = "UPDATE `users` SET num_posts = num_posts + 1 WHERE id = :id";  
	$ps = $shn_fluxbb->prepare($sql);  
	$ps->execute(array( 
	':id'=>$pun_user['id']));

Sorry if I didn't make it clear enough.

Offline

#5 2014-02-27 16:58:05

Different55
Member
Registered: 2011-11-18
Posts: 158

Re: User Promotion Issue - 1.5.3

It shouldn't matter if you're setting it with profile.php or your own script. Users aren't promoted until they post. The forums don't need any evidence.

Offline

#6 2014-02-27 17:08:37

chris98
Member
From: England, United Kingdom
Registered: 2013-05-31
Posts: 618
Website

Re: User Promotion Issue - 1.5.3

Ah, right. So, in that case, would it be possible for me to copy/paste the code from the forums that promotes them?

Last edited by chris98 (2014-02-27 17:09:35)

Offline

#7 2014-02-27 19:08:50

Different55
Member
Registered: 2011-11-18
Posts: 158

Re: User Promotion Issue - 1.5.3

Yes. You can find it in post.php by searching for "promote"

Offline

#8 2014-02-27 19:13:02

chris98
Member
From: England, United Kingdom
Registered: 2013-05-31
Posts: 618
Website

Re: User Promotion Issue - 1.5.3

Great, got it thanks smile

// Promote this user to a new group if enabled
			if ($pun_user['g_promote_next_group'] != 0 && $pun_user['num_posts'] + 1 >= $pun_user['g_promote_min_posts'])
			{
				$new_group_id = $pun_user['g_promote_next_group'];
				$db->query('UPDATE '.$db->prefix.'users SET group_id='.$new_group_id.' WHERE id='.$pun_user['id']) or error('Unable to promote user to new group', __FILE__, __LINE__, $db->error());
			}

Offline

#9 2014-08-21 17:13:51

Lanark
Member
Registered: 2008-10-27
Posts: 71

Re: User Promotion Issue - 1.5.3

I just ran into a similar issue with promotion, I have a user group with very limited rights for people who need a timeout (suspected but not proven spammers etc) If I place a new account into this group all works as expected, but if the account already has enough posts to be promoted to a different group, then that takes precendece and placing them in the rstricted group doesnt have any effect.

Is there any workaround for this other than turning off promotion?

Last edited by Lanark (2014-08-21 17:14:36)

Offline

#10 2014-08-21 17:17:02

chris98
Member
From: England, United Kingdom
Registered: 2013-05-31
Posts: 618
Website

Re: User Promotion Issue - 1.5.3

You could alter the promotion code and change the if statement to the following:

 if ($pun_user['g_promote_next_group'] != '0' && $pun_user['num_posts'] + 1 >= $pun_user['g_promote_min_posts'] && $pun_user['g_id'] != 'GROUP_ID')

Obviosuly GROUP_ID would be the id of the group you wish to block.

Offline

#11 2014-08-21 17:19:57

Lanark
Member
Registered: 2008-10-27
Posts: 71

Re: User Promotion Issue - 1.5.3

^ which file is that in?

Offline

#12 2014-08-21 17:20:31

chris98
Member
From: England, United Kingdom
Registered: 2013-05-31
Posts: 618
Website

Re: User Promotion Issue - 1.5.3

I can't remember exactly of the top of my head, but I believe it's near the top of post.php.

Offline

#13 2014-08-21 20:59:04

Lanark
Member
Registered: 2008-10-27
Posts: 71

Re: User Promotion Issue - 1.5.3

Thanks I'll investigate

Offline

Board footer

Powered by FluxBB 1.5.7