Jump to content

Raffles System


Recommended Posts

Posted

@Adriano Faria

Hey quick question.  Is there ANY WAY I can change the currency type when showing ticket prices.  I know I could add a fake currency to commerce but I don't want to do that.  For example I have raffle items that cost 200 POINTS, but users are scarred a bit when they see $200.00 >> USD <<  So I want to be able to edit USD for the raffles system to read PTS.  I couldn't find anything in translations.  I'm open to try anything, I just need an idea of where to look and what I could do.

 

 

Posted
Just now, pilotguy said:

Ok - Could you possibly add an option that would allow someone creating a raffle to display the price in POINTS from Points Economy?? 

No! Again:

 

2 minutes ago, Adriano Faria said:

Anything related to CURRENCIES, PAYMENTS, etc., are handled by Commerce, not by my app.

 

Posted
Just now, pilotguy said:

Sorry I was just asking...

You have the right to ask. I just replied. My app do not handle currencies or payment, etc. This is handled by Commerce. I can't "create" a currency in my app!

Posted

I don;t want a currency created.  I guess what I'm asking is how to format the output when someone goes to "buy" a ticket..  That is all.  Not create a currency.  I just want $200.00 to turn into "200 points" in the buy ticket window.  

Sorry for the misunderstanding.  Anyway I understand.  Not possible.  

Posted

The price comes formatted from Commerce, as I said:

	/**
	 * Get Price
	 *
	 * @param	float	$cost				The cost
	 * @param	string	$nexusPackageIds	Comma-delimited list of associated package IDs
	 * @return	\IPS\nexus\Money|NULL
	 */
	public static function _price( $cost )
	{
		if ( $cost )
		{
			$currency = ( isset( $_SESSION['currency'] ) and in_array( $_SESSION['currency'], \IPS\nexus\Money::currencies() ) ) ? $_SESSION['currency'] : \IPS\nexus\Customer::loggedIn()->defaultCurrency();
			
			/* If $cost is an empty JSON array, the conditional will evaluate false thus resulting in [] being passed to \IPS\nexus\Money (which will fail). */
			$costs = json_decode( $cost, TRUE );
			if ( is_array( $costs ) )
			{
				if ( isset( $costs[ $currency ]['amount'] ) and $costs[ $currency ]['amount'] )
				{
					return new \IPS\nexus\Money( $costs[ $currency ]['amount'], $currency );
				}
			}
			else
			{
				return new \IPS\nexus\Money( $cost, $currency );
			}
		}
		
		return NULL;
	}

File: applications\raffles\sources\Raffle\Raffle.php:

So 200, will return 200 USD, because it's bought in USD! $currency is who's in charge here.

If you want to change it, feel free but you're on your own; I don't support code changes.

Posted

I want to sell raffle tickets with the prize being a file in downloads gets featured for a week.

Is this something I can do using this?

Posted

I don't think I explained it correctly.
 

"Winner of this raffle will get to have 1 file of their choice featured in the downloads marketplace" (this part I would do manually for the winner)

What would be needed to support this are

  • Can I use Raffle settings to make it visible only to specified group? (because I only want download contributor group having access or visibility to raffle)
  • Can credit be used to purchase a raffle ticket?
Posted
1 minute ago, superj707 said:

Can I use Raffle settings to make it visible only to specified group? (because I only want download contributor group having access or visibility to raffle)

You can either:

  • Allow specific groups to view and use the Raffle app
  • Restricat a raffle/giveway per group. When you create a raffle/giveaway, you can choose which user groups can buy tickets.
2 minutes ago, superj707 said:

Can credit be used to purchase a raffle ticket?

It will use any payment gateway set up in the Commerce. It must be a setting from the payment gateway.

You can also choose to use a specific payment gateway for Raffles app.

Posted (edited)

Can I limit raffle ticket purchase to exclusively site credit? (even if I have other gateways available for my site)

trying to avoid the strict rules from paypal

Edited by superj707
  • 3 weeks later...
  • 3 weeks later...
Posted
21 minutes ago, Northeast Mountain Sports said:

Question: is there support to limiting participation in raffles and giveaways to just members with a minimum number of posts to the forum? I'd like to not give away swag to people who walk in off the internet.

Sure. You can see all restrictions options at the right side of raffle posting screen:

5954e9b6570df_3-Submit.png.68a523cb93849

  • 3 weeks later...
Posted

There's a bug in the winners task

Only subclasses of Dispatcher can be instantiated

#0 /home/ing/public_html/forum/system/Theme/Theme.php(727): IPS\_Dispatcher::i()
#1 /home/ing/public_html/forum/system/Theme/Theme.php(824) : eval()'d code(886): IPS\_Theme->getTemplate('global', 'core')
#2 /home/ing/public_html/forum/system/Theme/SandboxedTemplate.php(56): IPS\Theme\class_raffles_front_view->memberRow(Object(IPS\raffles\Raffle), Object(IPS\Member), Array, 1)
#3 /home/ing/public_html/forum/system/Theme/Theme.php(824) : eval()'d code(1730): IPS\Theme\_SandboxedTemplate->__call('memberRow', Array)
#4 /home/ing/public_html/forum/system/Theme/SandboxedTemplate.php(56): IPS\Theme\class_raffles_front_view->raffleWinners(22, Array)
#5 /home/ing/public_html/forum/system/Theme/Theme.php(824) : eval()'d code(720): IPS\Theme\_SandboxedTemplate->__call('raffleWinners', Array)
#6 /home/ing/public_html/forum/system/Theme/SandboxedTemplate.php(56): IPS\Theme\class_raffles_front_submit->updateTopicWithWinners(22, 'giveaway', Array)
#7 /home/ing/public_html/forum/applications/raffles/tasks/Winners.php(160): IPS\Theme\_SandboxedTemplate->__call('updateTopicWith...', Array)
#8 /home/ing/public_html/forum/applications/raffles/tasks/Winners.php(104): IPS\raffles\tasks\_Winners->updateTopicWithResult(Object(IPS\raffles\Raffle), Array)
#9 /home/ing/public_html/forum/system/Task/Task.php(248): IPS\raffles\tasks\_Winners->execute()
#10 /home/ing/public_html/forum/system/Task/Task.php(217): IPS\_Task->run()
#11 /home/ing/public_html/forum/applications/core/interface/task/task.php(60): IPS\_Task->runAndLog()
#12 {main}

 

Posted
2 hours ago, Daniel F said:

There's a bug in the winners task


Only subclasses of Dispatcher can be instantiated

#0 /home/ing/public_html/forum/system/Theme/Theme.php(727): IPS\_Dispatcher::i()
#1 /home/ing/public_html/forum/system/Theme/Theme.php(824) : eval()'d code(886): IPS\_Theme->getTemplate('global', 'core')
#2 /home/ing/public_html/forum/system/Theme/SandboxedTemplate.php(56): IPS\Theme\class_raffles_front_view->memberRow(Object(IPS\raffles\Raffle), Object(IPS\Member), Array, 1)
#3 /home/ing/public_html/forum/system/Theme/Theme.php(824) : eval()'d code(1730): IPS\Theme\_SandboxedTemplate->__call('memberRow', Array)
#4 /home/ing/public_html/forum/system/Theme/SandboxedTemplate.php(56): IPS\Theme\class_raffles_front_view->raffleWinners(22, Array)
#5 /home/ing/public_html/forum/system/Theme/Theme.php(824) : eval()'d code(720): IPS\Theme\_SandboxedTemplate->__call('raffleWinners', Array)
#6 /home/ing/public_html/forum/system/Theme/SandboxedTemplate.php(56): IPS\Theme\class_raffles_front_submit->updateTopicWithWinners(22, 'giveaway', Array)
#7 /home/ing/public_html/forum/applications/raffles/tasks/Winners.php(160): IPS\Theme\_SandboxedTemplate->__call('updateTopicWith...', Array)
#8 /home/ing/public_html/forum/applications/raffles/tasks/Winners.php(104): IPS\raffles\tasks\_Winners->updateTopicWithResult(Object(IPS\raffles\Raffle), Array)
#9 /home/ing/public_html/forum/system/Task/Task.php(248): IPS\raffles\tasks\_Winners->execute()
#10 /home/ing/public_html/forum/system/Task/Task.php(217): IPS\_Task->run()
#11 /home/ing/public_html/forum/applications/core/interface/task/task.php(60): IPS\_Task->runAndLog()
#12 {main}

 

Ok, probably the hasInstance() Will take a look. 

What about this, probably from same user?

Error: Call to undefined method stdClass::language() (0)
#0 /home/kzgaming/public_html/forum/system/Dispatcher/Front.php(93): IPS\Dispatcher\_Standard->init()
#1 /home/kzgaming/public_html/forum/init.php(448) : eval()'d code(15): IPS\Dispatcher\_Front->init()
#2 /home/kzgaming/public_html/forum/system/Dispatcher/Dispatcher.php(103): IPS\Dispatcher\raffles_hook_rafflesCSS->init()
#3 /home/kzgaming/public_html/forum/index.php(12): IPS\_Dispatcher::i()
#4 {main}

He keeps saying that this appears in logs. It also appears for other resources and I don’t see this in other installs I’Ve checked. 

  • 2 weeks later...
  • 2 weeks later...
Posted

On a new location, I tried to newly install raffles.

But I got an error message:

1. you have no permissions to do this.... any database column already exists... (unfortunately didn't remember the name, but had raffles in it...)

Thats impossible! I never used raffles before on this installation... Never ever.

The app didn't install completely, so now I have an entry _app_raffles.... in ACP -> Applications

After that I tried to just "update" the uncomplete version with the same version again.

2. And there is the next error message:

'raffle_description_brief'; check that column/key exists

I've done nothing wrong ;) But anything is wrong.

What should I do next?

Posted (edited)
50 minutes ago, Cyboman said:

On a new location, I tried to newly install raffles.

But I got an error message:

1. you have no permissions to do this.... any database column already exists... (unfortunately didn't remember the name, but had raffles in it...)

Thats impossible! I never used raffles before on this installation... Never ever.

The app didn't install completely, so now I have an entry _app_raffles.... in ACP -> Applications

After that I tried to just "update" the uncomplete version with the same version again.

2. And there is the next error message:

'raffle_description_brief'; check that column/key exists

I've done nothing wrong ;) But anything is wrong.

What should I do next?

Did you read the Manual.pdf as requested in file description? You probably used the old version. 

Leave a PM with ACP access. I’ll take a look tomorrow (if I’m able to) or monday morning. 

Edited by Adriano Faria
  • Recently Browsing   0 members

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