Jump to content

Raffles System


Recommended Posts

Posted (edited)
13 hours ago, JTHastings said:

Ouch! and this is what's showing in the Activity Stream...15 people won the first prize and got notified....not good. Update: I "think" the actual notifications were correct. Everything worked good right up until the winners were auto selected.

 

2017-12-24_17-07-30.jpg

This is a dumb error actually. When I first developed it, it was allowed only 3 prizes (I changed that for the final version) but I forgot to make adjustments in the stream extension. The users you are seeing there are the REAL winners, in their right position: the first is really the first winner; the second is the second, etc. The lang bit is wrong:

		 	switch( $row['rw_prize_position'] )
		 	{
				case 1:
					$position = \IPS\Member::loggedIn()->language()->addToStack( 'leader_position_1' );
				break;
				case 2:
					$position = \IPS\Member::loggedIn()->language()->addToStack( 'leader_position_2' );
				break;
				case 3:
					$position = \IPS\Member::loggedIn()->language()->addToStack( 'leader_position_3' );
				break;
			}

As you can see, the extension search for position 1, 2 and 3 but if you have more than 3 winners, it will repeat any of them, in a loop. Will fix it now.

1 hour ago, Unlucky said:

Happy Christmas

Happy Christmas for you too.

Edited by Adriano Faria
Posted (edited)
42 minutes ago, Adriano Faria said:

Will fix it now.

tIPgxaG.png

After upgrade, it will fix the language bits for you and will show right.

18 hours ago, JTHastings said:

Looks like the Winners view (for a Giveaway) is not configured like the newer Participants list. I would like to see them be the same format.

4ihsIqT.png

Edited by Adriano Faria
Posted
Just now, Unlucky said:

Hi,

My raffle has just been drawn - how do I find who has won?

https://www.walkingfootball.com/raffles/category/1-free-raffles/

Enter in the giveaway. You'll see the winner in the top of page: https://www.walkingfootball.com/raffles/raffle/1-win-a-bala-sport-astro-ball-for-your-walking-football-team-in-our-free-to-enter-raffle/

Btw, you can re enable the setting for Raffles in the Activity Streams settings.

Posted
5 hours ago, Adriano Faria said:

Please, try to be more clear as possible when something like this haapens. All info I have now is: it’s a giveaway. I need to know how many prizes, etc.

Sorry Adriano, I'll try to be more complete in the future. It looks like you figured it out though which we all appreciate!

Merry Christmas to you and yours!

  • 2 weeks later...
Posted

Can anyone tell me what template to edit to change this title color?

2018-01-03_10-26-25.thumb.png.0b91774e46939629597900a516ae710b.png

Either the text color, or probably better would be to add:  ipsPageHeader

I just don't know where. Thanks!

  • 3 weeks later...
Posted (edited)

Hi :)

Small error with Giveaway appear in topic

p5D77Hj.png

Logs system :

#0 C:\wamp64\www\test\system\Theme\Theme.php(800): IPS\_Log::log('Template store ...', 'template_store_...')
#1 C:\wamp64\www\test\system\Theme\Theme.php(824) : eval()'d code(6006): IPS\_Theme->getTemplate('profile', 'core')
#2 C:\wamp64\www\test\system\Theme\SandboxedTemplate.php(56): IPS\Theme\class_raffles_front_view->winnerRow(Object(IPS\raffles\Raffle), Object(IPS\Member), Array, 1)
#3 C:\wamp64\www\test\system\Theme\Theme.php(824) : eval()'d code(1797): IPS\Theme\_SandboxedTemplate->__call('winnerRow', Array)
#4 C:\wamp64\www\test\system\Theme\SandboxedTemplate.php(56): IPS\Theme\class_raffles_front_view->raffleWinners(4, Array)
#5 C:\wamp64\www\test\system\Theme\Theme.php(824) : eval()'d code(720): IPS\Theme\_SandboxedTemplate->__call('raffleWinners', Array)
#6 C:\wamp64\www\test\system\Theme\SandboxedTemplate.php(56): IPS\Theme\class_raffles_front_submit->updateTopicWithWinners(4, 'giveaway', Array)
#7 C:\wamp64\www\test\applications\raffles\tasks\Winners.php(160): IPS\Theme\_SandboxedTemplate->__call('updateTopicWith...', Array)
#8 C:\wamp64\www\test\applications\raffles\tasks\Winners.php(104): IPS\raffles\tasks\_Winners->updateTopicWithResult(Object(IPS\raffles\Raffle), Array)
#9 C:\wamp64\www\test\system\Task\Task.php(248): IPS\raffles\tasks\_Winners->execute()
#10 C:\wamp64\www\test\applications\core\modules\admin\settings\advanced.php(605): IPS\_Task->run()
#11 C:\wamp64\www\test\system\Dispatcher\Controller.php(85): IPS\core\modules\admin\settings\_advanced->runTask()
#12 C:\wamp64\www\test\applications\core\modules\admin\settings\advanced.php(34): IPS\Dispatcher\_Controller->execute()
#13 C:\wamp64\www\test\system\Dispatcher\Dispatcher.php(146): IPS\core\modules\admin\settings\_advanced->execute()
#14 C:\wamp64\www\test\benjo\index.php(13): IPS\_Dispatcher->run()
#15 {main}

Any idea to fix this ? 

Thank you 

Edited by No'
Posted
2 hours ago, No' said:

Hi :)

Small error with Giveaway appear in topic

p5D77Hj.png

Logs system :


#0 C:\wamp64\www\test\system\Theme\Theme.php(800): IPS\_Log::log('Template store ...', 'template_store_...')
#1 C:\wamp64\www\test\system\Theme\Theme.php(824) : eval()'d code(6006): IPS\_Theme->getTemplate('profile', 'core')
#2 C:\wamp64\www\test\system\Theme\SandboxedTemplate.php(56): IPS\Theme\class_raffles_front_view->winnerRow(Object(IPS\raffles\Raffle), Object(IPS\Member), Array, 1)
#3 C:\wamp64\www\test\system\Theme\Theme.php(824) : eval()'d code(1797): IPS\Theme\_SandboxedTemplate->__call('winnerRow', Array)
#4 C:\wamp64\www\test\system\Theme\SandboxedTemplate.php(56): IPS\Theme\class_raffles_front_view->raffleWinners(4, Array)
#5 C:\wamp64\www\test\system\Theme\Theme.php(824) : eval()'d code(720): IPS\Theme\_SandboxedTemplate->__call('raffleWinners', Array)
#6 C:\wamp64\www\test\system\Theme\SandboxedTemplate.php(56): IPS\Theme\class_raffles_front_submit->updateTopicWithWinners(4, 'giveaway', Array)
#7 C:\wamp64\www\test\applications\raffles\tasks\Winners.php(160): IPS\Theme\_SandboxedTemplate->__call('updateTopicWith...', Array)
#8 C:\wamp64\www\test\applications\raffles\tasks\Winners.php(104): IPS\raffles\tasks\_Winners->updateTopicWithResult(Object(IPS\raffles\Raffle), Array)
#9 C:\wamp64\www\test\system\Task\Task.php(248): IPS\raffles\tasks\_Winners->execute()
#10 C:\wamp64\www\test\applications\core\modules\admin\settings\advanced.php(605): IPS\_Task->run()
#11 C:\wamp64\www\test\system\Dispatcher\Controller.php(85): IPS\core\modules\admin\settings\_advanced->runTask()
#12 C:\wamp64\www\test\applications\core\modules\admin\settings\advanced.php(34): IPS\Dispatcher\_Controller->execute()
#13 C:\wamp64\www\test\system\Dispatcher\Dispatcher.php(146): IPS\core\modules\admin\settings\_advanced->execute()
#14 C:\wamp64\www\test\benjo\index.php(13): IPS\_Dispatcher->run()
#15 {main}

Any idea to fix this ? 

Thank you 

Are you using latest version? This was fixed in 1.0.3 and was relatively to cron job. Do you use cron to run tasks in your board?

Posted
9 hours ago, Adriano Faria said:

Are you using latest version? This was fixed in 1.0.3 and was relatively to cron job. Do you use cron to run tasks in your board?

Yes i use the latest version
 

But, no i use the traffic by default. It's better to use Cron ?

Posted (edited)

The error Is about a missing template, which is weird. I will test within an hour and will reply back.

EDIT: Something probably changed in 4.2.7. A quick test shows this working fine in 4.2.6.

@No', after upgrade, run the support tool to see if it fixes de post; I don't think it will, because post is a "text". I can remove the COMPLETED status but this would run the script and choose a new winner, which wouldn't be right. So your best bet is to edit manuall the post and add the winners there.

Edited by Adriano Faria
Posted

@Adriano Faria I have two questions:

image.thumb.png.49eaca1834da71c402494e2d31073129.png

1st question: how can I edit giveaway settings in a giveaway that one of the members created but set these not totally poperly (there's no restriction on reputation and I want the restriction to be on for reputation = 0 so people with negative rep can't participate). I can edit it directly in the database but not on the webpage (and when I'm not at home I really don't want to log into my site databases). Besides that's a major pain in the neck - when I enter "0" in the table it interprets it as "no restriction" anyway.

image.thumb.png.2d83f3aaf2047e7988dd7a31dc9a7090.png

I can edit only restriction concerning number of participants and things visible above.

And 2nd question: any reply on question I asked in this post? 

 

Posted
20 minutes ago, Nebthtet said:

I can edit it directly in the database but not on the webpage (and when I'm not at home I really don't want to log into my site databases).

That’s how it works. If only appears when you create the raffle. I didn’t show it in the edit because this obviously can bring some issues, like a user participating when shouldn’t be. I wouldn’t like to know, for example, that I was required to have 1000 posts and 100 rep points to participate while others managed to participate with less than that just because the raffle submitter wanted to accommodate some buddies or something like that, then he change, people gets in and then he goes back to original values.

I would suggest you to copy everything and recreate it or even change it directly in your DB. I can also provide a file change tomorrow in the morning so you can make it work as you wish in your install. I’m not able to show you today, sorry. 

39 minutes ago, Nebthtet said:

And 2nd question: any reply on question I asked in this post?

Post is a post. It is a content and can’t be translated. It should be done using default language since it is an automatic action fired by a task and not by a user. Is it not being created in the default language? If not, please submit a bug to my tracker on my support board. 

Posted

This is a very valid point, maybe (if it isn't too much work in the future version it could be editable only when no one took part in the raffle / giveaway yet and/or before any prizes are added?

Also there's no rush, we're going to recreate that one - I just wanted to know if it can be done in any other way (also that rep thingy). If you could provide the file - that's marvelous and I'd be immensely grateful.

22 minutes ago, Adriano Faria said:

If not, please submit a bug to my tracker on my support board. 

I'll do a check on a test raffle and if this issue persists will use you support board.

Thank you very much for prompt reply!

Posted
4 minutes ago, Nebthtet said:

maybe (if it isn't too much work in the future version it could be editable only when no one took part in the raffle / giveaway yet

That can be done surely. It wouldn’t make any bad to anyone. I’ll add it in next version. ;)

  • 2 weeks later...
Posted

Hi,

When I create a new giveway and i fix the option "Number of participants" to 2 (for exemple) and when i try to participe with différents (test) accounts i can exceed this limit.

z32N4sv.png

Maybe i miss something ?

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...