Jump to content

Raffles System

Featured Replies

  • Author
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

  • Replies 717
  • Views 50.9k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

  • That's a bug in your app... The extensions class name is Image and you're using Images  in view.php \IPS\Output::i()->metaTags['og:image'] = \IPS\File::get( 'raffles_Images', $this->raf

  • Adriano Faria
    Adriano Faria

    I've made a change today.. probably will fix it because it handles currencies (default or member language/currency). Try it yourself. Open applications\raffles\modules\front\raffles\view.php and find:

  • Adriano Faria
    Adriano Faria

    No, that doesn't work like that and I can't reproduce. In images:       If you haven't filled the price in one specific currency, user won't be able t

Posted Images

  • Author
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

  • Author

What's New in Version 1.0.6:

  • Fix language bit for the winners position
  • Winners template reworked to meet participants template
  • Author
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.

thank you

 

  • Author
9 minutes ago, Unlucky said:

thank you

Have you updated your install? Your "winner" template is outdated.

just updated

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!

  • Author
3 minutes ago, JTHastings said:

Merry Christmas to you and yours!

For you too.

  • 2 weeks later...

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!

  • Author
47 minutes ago, Michael R said:

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

raffles -> front -> view -> view.

35 minutes ago, Adriano Faria said:

raffles -> front -> view -> view.

Got it. Thanks!

  • Author

What's New in Version 1.0.6.1:

  • Minor fixes in a template
  • Fix error when trying to buy tickets for a unlimited tickets Raffle
  • 3 weeks later...

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'

  • Author
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?

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 ?

  • Author

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

  • Author

What's New in Version 1.0.7:

  • Fix error in topic template on IPS 4.2.7

@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? 

 

  • Author
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. 

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!

  • Author
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. ;)

Wonderful news :) 

  • 2 weeks later...

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

  • No registered users viewing this page.