MyBB Community Forums

Full Version: member of the week
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
LOL...yeah, i was just coming over to tell you where it was, so you wouldn't have to look! I manually fixed it on my end. Toungue
Hello again LeX,
I have 2 questions:

1. In this section of code, I guess you set plugin to filter member of the week by user (in this case "admin") with uid!='1', not by entire usergroups, right ?
{$interval} && dateline < {$time} AND uid!='1' GROUP BY uid ORDER BY posts DESC LIMIT 1
How can I set more than 1 filters for usergroups ?
I mean, in my case, I want to exclude usergroups with id=1,3,4,5,6,7.
I want to display in Member of the week one user (with most posts in last week, of course) but just from usergroups with id=2,9,10,12
It is possible, please !? And how can I do this !?

2. How I can change the day ? I don't want to be Monday(1).
I want to set the day to be Saturday.
What I must to change in code !?
	// GET DAY OF THE WEEK
	$dotw = date("w", time());
	// GET NEW MOTW ON MONDAY(1) ( TIME - 1WEEK )
	if($dotw == 5 && $motw['cur'] == 0)
	{
		$update_cache['display'] = get_motw();
		$update_cache['cur'] = 1;

If I change $update_cache['cur'] = 1; with $update_cache['cur'] = 6; it's ok !? This is number for day ?

I know you don't like posts like this and you don't have time to add changes more and more on every plugin, just for one or two users...
But I really hope to help me... I'm waiting for your support, when you have a litlle time, please...

Thank you.
Forumania Wrote:Hello again LeX,
I have 2 questions:

1. In this section of code, I guess you set plugin to filter member of the week by user (in this case "admin") with uid!='1', not by entire usergroups, right ?
{$interval} && dateline < {$time} AND uid!='1' GROUP BY uid ORDER BY posts DESC LIMIT 1
How can I set more than 1 filters for usergroups ?
I mean, in my case, I want to exclude usergroups with id=1,3,4,5,6,7.
I want to display in Member of the week one user (with most posts in last week, of course) but just from usergroups with id=2,9,10,12
It is possible, please !? And how can I do this !?

2. How I can change the day ? I don't want to be Monday(1).
I want to set the day to be Saturday.
What I must to change in code !?
	// GET DAY OF THE WEEK
	$dotw = date("w", time());
	// GET NEW MOTW ON MONDAY(1) ( TIME - 1WEEK )
	if($dotw == 5 && $motw['cur'] == 0)
	{
		$update_cache['display'] = get_motw();
		$update_cache['cur'] = 1;

If I change $update_cache['cur'] = 1; with $update_cache['cur'] = 6; it's ok !? This is number for day ?

I know you don't like posts like this and you don't have time to add changes more and more on every plugin, just for one or two users...
But I really hope to help me... I'm waiting for your support, when you have a litlle time, please...

Thank you.

No, you can't change that $update_cache['cur'] = 1; =P
That's a check if the 'motw' is already set on the recount-day. Else it runs a query everything when the correct info is already in the cache =P
If you want to change the day, change if( $dotw == 6 )...
Sunday = 0; Monday = 1 ... =P
And for excluding usergroups that requires a new query, since the usergroup aint stored in the posts table. Will take a look at that this evening.

Edit:

I've changed it, in the get_motw() function you will find $usergroups = array("2"); (It will only get a motw out of the Registered Usergroup), just add more gids to the array. So your array would look like array("2","9","10","12");

And for changing the day of the week, just change the var $day_of_the_week = 1;
Thanks again.
I do it.

Now it's great !
Smile
yeah this i want but....not at statistic board under user online but at the top under welcome block and marquee types.
And user get one medal or award pic at posbit or user profile.

Medal : Member of the week 4th november 2007, Member of the week 1st desember 2007.

ugh...my english is very bad..sorry
Just replace the display from the index_stats template into the header_welcomeblock_member template and put it in marquee tag ... i aint gonna build that in. And it doesn't store the members of the week, its cleared every week ...
If this is supposed to recycle every Monday, I was wondering if it's working. The same Member of the Week from the previous week is still the MOTW?? I even went back and counted her posts from the previous two weeks, and they aren't the same...and neither match the number posted for the MOTW's posts. I hope that makes sense? It says she had 45 posts the previous week, and it still says she has 45 posts. I counted her posts, and neither week did she have 45 posts. One week it was about 56 posts and then 44 posts. I'll give it another week to see if it still remains the same, but I thought I'd point that out. Big Grin
the recycle; it depends on what version you have ... if you don't have settings, it will be monday or you need to edit the file itself ... the one with the settings, you can choose yourself. As long as it works fine overhere, i've got nothing to worry about =P

And you did get the new version ? cause ... gonna quote myself
LeX- Wrote:Will add something to where clause + rewrite the code a lil' bit =P Just though of something that could cause wrong info =P
=P

Edit:
Another possibilty for showing the 'wrong' posts amount could be,
It takes the time of the first visit minus a week; so if a first user visits your forum on recountday at 8PM ; it counts from Now (8PM) to -1 Week (8PM). So every post before 8PM won't be counted =P Gonna change that though, so it will be counting the whole day.
And when 1.4 comes out, gonna put it in a task so it runs every week.
LeX- Wrote:Just replace the display from the index_stats template into the header_welcomeblock_member template and put it in marquee tag ... i aint gonna build that in. And it doesn't store the members of the week, its cleared every week ...

Iam waiting....... thanks
Well, I thought I had the newest one, but I downloaded it and uploaded to my forum. Now it just has "Array" after the most users online???

edit: OK, the reason why the new file wasn't working, is cause I hadn't set the GID's yet. It seems to be working now. So let's see if a new MOTW gets chosen after a week! Big Grin
Pages: 1 2