Forums

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

You are not logged in.

Announcement

FluxBB 1.5.6 and 1.4.12 released

These releases fix a security issue - please update your forums! Download links: v1.5.6 | v1.4.12

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

chris98
Member
From: England, United Kingdom
Registered: 2013-05-31
Posts: 225
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: 104

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,603
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: 225
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: 104

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: 225
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: 104

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: 225
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

Board footer

Powered by FluxBB 1.5.6