vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Add-On Releases - vBulletin Raffles (https://vborg.vbsupport.ru/showthread.php?t=262901)

nhawk 07-02-2011 06:11 PM

I need to know what version of vBulletin you two are running.

The cron draw works fine in 4.1.3 and 4.1.4. (just tested it again) However, if it's not working for you with the $, remove it as Trek did.

So far are the draw date and time goes, it uses vBulletin's TIMENOW so it should match whatever vBulletin is running at. I will look into this a little more though.

EDIT: I just removed the $ from line 195 and it runs for me that way too. So I will remove it in the next update.

Trek 07-02-2011 06:39 PM

I'm running vb 4.1.4 and the latest version of your raffle mod for download here at vb.org.

Like I said, the cron was easy to fix, there's a typo on that line in the source file. Just remove the extra $ and you're set.

The larger issue for me was the time one. Where the dates I set in the adminCP for the raffle, showed differently than when viewing the raffle as a user.

nhawk 07-02-2011 06:44 PM

Quote:

Originally Posted by Trek (Post 2215922)
I'm having a problem with drawing raffles as well. The Task runs as far as I can tell (meaning it's in the log that it ran), but no raffles are drawn that should be. I only have 1 raffle and it should be complete as the draw date is today, that date is on the server and the task was run.

So I ran the task manually and saw no errors on the page, but still no draws.

Thanks for any help, this is my first raffle I was testing giving out a couple free video games to my members and well... hopefully I can get this fixed soon so I don't look like more of an idiot than usual. ;)

Thanks for any help you can provide!

*EDIT* - When I run the raffledraw.php, I get not visual feedback (makes sense, it's a cron), but it runs so quickly and there's no logs, it just feels like it's not doing anything.

There should be entries in the scheduled task log that look something like this..

15 Draw raffles 15:15, 2nd Jul 2011 Start drawing raffles
16 Draw raffles 15:15, 2nd Jul 2011 Draw raffle Test - winner Snog
17 Draw raffles 15:15, 2nd Jul 2011 Finished Drawing Raffles


Quote:

Originally Posted by Trek (Post 2215922)
BUG #1: So I guess the problem is that either the raffle page or the raffle entry page aren't using the same timezone modifiers or something and that's where the confusion started. So I guess that's a bug of some sort. =) Awesome stuff though and donation should be there by the time you read this!

As I said above, I'll look into this more. But I don't see the problem on my dev server or a on live site either.

Quote:

Originally Posted by Trek (Post 2215922)
*EDIT* - Ok, I did that and now am getting the same error as reported by someone else above: Fatal error: Function name must be a string in /home/XXXXX/public_html/includes/cron/raffledraw.php on line 195

I checked that line in the file and it has a $ next to the fetch_phrase function, I removed that and it ran.

I don't see this on either my dev server or a live site. But, removing it (the $) doesn't seem to hurt so it will be in the next update.

Quote:

Originally Posted by Trek (Post 2215922)
BUG #2: At least I think this is a bug, it let the same member win twice... They had 3 tickets in, which is fine, but.. I didn't really want the same guy to win twice as the prizes were the same. I basically wanted one unique winner per draw, is that possible?

If this is a problem, go to Raffle Settings and change 'Allow One Member Multiple Wins' to no.

nhawk 07-02-2011 07:37 PM

I may have this date/time thing sorted out. It's very hard to explain, and I'm running short of time today. I'll try to post an explanation tomorrow morning.

Trek 07-02-2011 08:10 PM

Quote:

Originally Posted by nhawk (Post 2215967)
If this is a problem, go to Raffle Settings and change 'Allow One Member Multiple Wins' to no.

I had already set that, but it didn't appear to matter. I just got your PM though and will reply there.

nhawk 07-03-2011 11:59 AM

Quote:

Originally Posted by Trek (Post 2215922)
...*EDIT* - Ok, I've figured this out. I'll try to be clear, but... I think this is going to be confusing.

The problem is that my server time is in GMT, which is -8 from my time.

When I created the raffle, the only way I was able to get the dates to display correctly on the raffle portion people could see, was to set the draw date for a day LATER than I really wanted it to go. But on the raffle page, it looked like a date earlier than actually set.

So, I've been looking at the raffle page expecting it to draw, but when I edited it, then I saw that the draw date was in fact 7-03-2011, even though it was displaying 7-02-2011 on the raffle page.

So for now, I dropped the date back a day and now it's waiting to draw and I'll run the cron and it should do what it should of.

OK, let's see if I can explain this. It gets complicated so hang in there, there is a fix at the end. ;)

First, this isn't a bug with setting the end date of the raffle.

When you set an end date, the program converts that date to it's proper Unix timestamp.

When it is displayed on the Raffle Edit page, it is displayed in it's originally entered format.

When it is displayed anywhere else, it is displayed in the date/time format chosen by the member viewing the raffle. (the same thing vBulletin itself does with date/time data)

Remember, the time displayed is NOT the time being used by vBulletin. It is just a DISPLAY format. Not a data storage format. All times stored in the database are in your Servers time zone. Not in the time zone you chose to display as a user or the one used as the default display in vBulletin.

Scheduled Tasks use the server's date/time to run. (this is a function of vBulletin, not the Raffle system)

So, in this case...

If you're in the Eastern time zone and you're server is -8 hours from your time zone, and you're expecting the raffle to draw at 10:00am your time. That will never happen with any Scheduled Task in vBulletin. The server time hasn't reached the 10:00am time yet.

By editing the raffle, you actually did nothing to make the task run. The raffle was already waiting to be drawn at 10:00am server time. Which was still somewhere near 8 hours away.

By running the task manually you did find a bug in the one line. But I'm not so sure it's as much a bug as it might be a PHP version difference. I say that because it runs without a hitch on PHP 5.2.4 and PHP 5.2.9 with or without the '$' in that line. Again, I'll remove the '$' from it for compatibilty sake in a release later today.

Back to the time problem and a possible fixes..

If you are on a dedicated server, the fix should be obvious. Change your server's time from your control panel (or via SSH) to match the time zone you want it to match. (may require a server reboot) And if you're using PHP 5.1 or later, you might also need to edit php.ini because it might be using a different time zone. (see first link below) It's as simple as that. But remember, members will see that date as it should be shown for their date/time display choice.

If you're on a shared server, there are a couple of possibilities...

1) If you use PHP 5.1.0 or later and have access to PHP.INI for your site, edit PHP.INI so it includes the date.timezone setting. See this page for more information..
http://www.php.net/manual/en/datetim....date.timezone

2) If you don't have access to PHP.INI and your PHP version is equal or greater than 5.0 you can TRY adding the date_default_timezone_set to vBulletin's config.php. MAKE IT THE FIRST ENTRY AFTER THE COPYRIGHT NOTICE. See this page for more information..
http://www.php.net/manual/en/functio...mezone-set.php

NOTE: Item 2 has not been tested. The worst thing that could happen is vBulletin would refuse to run and you would have to remove that new line from the config file.

3) If neither of those work, or your PHP version is prior to 5.0, you will need to live with the server time for Scheduled Tasks.

Mr Morningstarr 07-03-2011 12:06 PM

How difficult will it be to change it from saying 'raffle' to 'prize draw'?

nhawk 07-03-2011 12:30 PM

Quote:

Originally Posted by Trek (Post 2216019)
I had already set that, but it didn't appear to matter. I just got your PM though and will reply there.

I'm totally unable to duplicate this, even with one member having 20 entries and 1 other with one entry.

I'll continue to see if I can duplicate it.

nhawk 07-03-2011 12:31 PM

Quote:

Originally Posted by Mr Morningstarr (Post 2216182)
How difficult will it be to change it from saying 'raffle' to 'prize draw'?

Not difficult at all.

Edit the phrases in Phrase Manager.

nhawk 07-03-2011 01:15 PM

As an addendum to my post about date/time.

I somewhat overstated what is happening.

The date is being displayed as it should be. But, if you select to have the time displayed with it, that IS a bug. More a missed item than a bug.

The time being displayed on the Raffle pages IS the raw unconverted time that the task is scheduled to run at. It is NOT being converted to the members date/time zone display choice.

I'll see what I can do with that in the next release. ( possibly tomorrow )

In the mean time, do not display the draw time to your members.


All times are GMT. The time now is 03:12 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01437 seconds
  • Memory Usage 1,765KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete