Jump to content



- - - - -

Prize Draw Competition help


  • Please log in to reply
119 replies to this topic

#21   random183

random183
  • Members
  • 51 posts
  • Real Name:Becky
  • Gender:Female
  • Location:Earth

Posted 11 November 2008 - 11:11 AM

View PostBetween the Sticks USA, on Nov 11 2008, 03:41 AM, said:

<chirp><chirp>

hell-oooooooooo?

Nobody has an answer?  :(

Why not use the manual SQL Scripts I uploaded?
I couldn't get the automatic ones to work.

Mat

#22   Between the Sticks USA

Between the Sticks USA
  • Members
  • 46 posts
  • Real Name:Victor Tinajero

Posted 11 November 2008 - 01:21 PM

I tried that, & got an error at this stage:

Quote

Run This Script


INSERT INTO `configuration` ( `configuration_id` , `configuration_title` , `configuration_key` , `configuration_value` , `configuration_description` , `configuration_group_id` , `sort_order` , `last_modified` , `date_added` , `use_function` , `set_function` ) VALUES ('', 'Display a qualifing question to enter competition', 'COMPETITION_QUALIFY', 'true', 'Displays the qualifing question and only allows entry upon its completion', '" . $categoryid['configuration_group_id'] . "', 8, '2007-04-06 22:01:43', '0000-00-00 00:00:00', NULL, 'tep_cfg_select_option(array(''true'', ''false''),');

This is what I got:

Quote

MySQL said:

#1064 - You have an error in your SQL syntax near 'configuration_group_id'] . "', 8, '2007-04-06 22:01:43', '0000-00-00 00:00:00', ' at line 1


#23   random183

random183
  • Members
  • 51 posts
  • Real Name:Becky
  • Gender:Female
  • Location:Earth

Posted 11 November 2008 - 02:29 PM

View PostBetween the Sticks USA, on Nov 11 2008, 01:21 PM, said:

I tried that, & got an error at this stage:


This is what I got:

Try This :-

Quote

INSERT INTO `configuration` ( `configuration_id` , `configuration_title` , `configuration_key` , `configuration_value` , `configuration_description` , `configuration_group_id` , `sort_order` , `last_modified` , `date_added` , `use_function` , `set_function` ) VALUES ('', 'Display a qualifing question to enter competition', 'COMPETITION_QUALIFY', 'true', 'Displays the qualifing question and only allows entry upon its completion', XXXXX, 8, '2007-04-06 22:01:43', '0000-00-00 00:00:00', NULL, 'tep_cfg_select_option(array(''true'', ''false''),');

Remember to replace the XXXXX with the number you got from the previous query:-

Quote

SELECT `configuration_group_id` FROM `configuration_group` WHERE `configuration_group_title` = 'Competitions';

Mat

#24   Between the Sticks USA

Between the Sticks USA
  • Members
  • 46 posts
  • Real Name:Victor Tinajero

Posted 11 November 2008 - 04:09 PM

That worked! ThankyouThankyouThankyou!

Edited by Between the Sticks USA, 11 November 2008 - 04:19 PM.


#25   Between the Sticks USA

Between the Sticks USA
  • Members
  • 46 posts
  • Real Name:Victor Tinajero

Posted 11 November 2008 - 04:46 PM

Got it to work, but where do I change the text that states "Click below for a chance to win these spectacular glass goblets" ????!!!!

EDIT: Fixed it.

Edited by Between the Sticks USA, 11 November 2008 - 04:59 PM.


#26   wilma2

wilma2
  • Members
  • 83 posts
  • Real Name:Trish

Posted 25 November 2008 - 05:30 PM

View PostBetween the Sticks USA, on Nov 11 2008, 08:46 AM, said:

Got it to work, but where do I change the text that states "Click below for a chance to win these spectacular glass goblets" ????!!!!

EDIT: Fixed it.

Hi Victor can you tell me how you did it? thanks

#27   random183

random183
  • Members
  • 51 posts
  • Real Name:Becky
  • Gender:Female
  • Location:Earth

Posted 25 November 2008 - 05:35 PM

View Postwilma2, on Nov 25 2008, 05:30 PM, said:

Hi Victor can you tell me how you did it? thanks

It's in catalog\includes\languages\english\competition.php around line 21

Mat

#28   wilma2

wilma2
  • Members
  • 83 posts
  • Real Name:Trish

Posted 25 November 2008 - 05:45 PM

View Postrandom183, on Nov 25 2008, 09:35 AM, said:

It's in catalog\includes\languages\english\competition.php around line 21

Mat
wow Mat thank you for the incredibly fast answer I appreciate it. On another note I have the prize draw on my main page but when someone clicks on it it comes up internal server error is this a host thing?

#29   random183

random183
  • Members
  • 51 posts
  • Real Name:Becky
  • Gender:Female
  • Location:Earth

Posted 25 November 2008 - 10:23 PM

View Postwilma2, on Nov 25 2008, 05:45 PM, said:

wow Mat thank you for the incredibly fast answer I appreciate it. On another note I have the prize draw on my main page but when someone clicks on it it comes up internal server error is this a host thing?

Hi.

I have to admit I'm no expert in this, i just got to know this contribution because it cost me a bit of time to get it working :)
You do have a competition setup?

Otherwise it could be many different things...
1st stage would be to check each modification you did to make sure they're right.
In the past I've found a simple missing character in a language file can cause this error for example.
Another thing to check is your database to make sure the additions went in there properly.
I wouldn't think it's your server, if it can host osCommerce it can do the extra bit for the competitions..

Mat

#30   wilma2

wilma2
  • Members
  • 83 posts
  • Real Name:Trish

Posted 25 November 2008 - 11:47 PM

View Postrandom183, on Nov 25 2008, 02:23 PM, said:

Hi.

I have to admit I'm no expert in this, i just got to know this contribution because it cost me a bit of time to get it working :)
You do have a competition setup?

Otherwise it could be many different things...
1st stage would be to check each modification you did to make sure they're right.
In the past I've found a simple missing character in a language file can cause this error for example.
Another thing to check is your database to make sure the additions went in there properly.
I wouldn't think it's your server, if it can host osCommerce it can do the extra bit for the competitions..

Mat

I did some research and it had to do with the permissions of the file and making them 755 that worked. But i have found I am having another problem in the admin section under reports i only have a capital A nothing else. I also can not set question options. thanks again Mat

#31   johnnybebad

johnnybebad
  • Members
  • 672 posts
  • Real Name:Johnny

Posted 15 December 2008 - 03:18 PM

View Postwilma2, on Nov 25 2008, 11:47 PM, said:

I did some research and it had to do with the permissions of the file and making them 755 that worked. But i have found I am having another problem in the admin section under reports i only have a capital A nothing else. I also can not set question options. thanks again Mat

Had a go with installing thic contribution, but struggling a little bit now.

It works to a fashion but I cant provide any details on answers A, B or C, same goes for when you try and enter it says select a,b or C but theres nothing to select.


Can anyone please advise.

Thanks
Johnny
Getting better with mods but no programmer am I.

#32   johnnybebad

johnnybebad
  • Members
  • 672 posts
  • Real Name:Johnny

Posted 15 December 2008 - 06:37 PM

Hi how would I change it to get radio buttons for the competitors selection?

As it looks better if you have the three radio options to select rather then entering the answer A, B or C in the little box currently provided.

Thanks
Johnny

Edited by johnnybebad, 15 December 2008 - 06:38 PM.

Getting better with mods but no programmer am I.

#33   johnnybebad

johnnybebad
  • Members
  • 672 posts
  • Real Name:Johnny

Posted 16 December 2008 - 12:33 AM

Okay I have got me admin section so I can type individual values for A, B and C rather than type it in text in the question.

And it transfers the information to my database. more luck than skill.

However having trouble getting the A, B and C answers as radio buttons with the options at the side instead of being part of the question.

I can get them the options with radio buttons, but they Don't have A, B and C by there side.

The code I currently have been playing with is

<!-- <td class="main"><span class="main">Please indicate A, B, or C</span>&nbsp;&nbsp;<input type="radio" name="entry_qualify_answer" CHECKED>&nbsp;<span class="inputRequirement">*</span></td>-->
				<td class="main" STYLE="padding:15px;"><b>A</b> <input type="radio" name="entry_qualify_answer" value="A"><?php echo tep_draw_input_field('configuration_value', COMPETITION_ANSWER_A); ?><br><input type="radio" name="entry_qualify_answer" value="B"><?php echo tep_draw_input_field('configuration_value', COMPETITION_ANSWER_B); ?><br>
<input type="radio" name="entry_qualify_answer" value="C"><?php echo tep_draw_input_field('configuration_value', COMPETITION_ANSWER_C); ?><br>

Can anyone tell me how to get this fully  functional so I have :-

A  radio button   answer a
B  radio button   answer b
C  radio button   answer c

I think the submission will be just A, B or C as before rather than the full answer, so the only change is how its presented and selected for submission?

I have the radio buttons in place, the answers a, b and c in place, but just the A is showing and the next two boxes are  no B and C showing, also the answers a, b and c are in a box where the values can be changed by anyone, which defeats the points of having fixed values.

Also have the original script that gives a box for you to enter the answer in which i want to get rid of altogether.

It may be easier to see looking at the code to start with.

Thanks

Edited by johnnybebad, 16 December 2008 - 12:35 AM.

Getting better with mods but no programmer am I.

#34   johnnybebad

johnnybebad
  • Members
  • 672 posts
  • Real Name:Johnny

Posted 16 December 2008 - 09:12 PM

Okay I worked it out and its working.

I have added the information to prize draw contribution.

The files allow:-

1. Insert radio buttons for answers A, B and C
2. To update these values in admin when you setup the prize draw.

The only problem was I did not change the auto database configurer to update the configuration table with 3 new enteries (answer a, b and c)


Any problems give us a shout and I will do my best to help, would be nice if we had one of those calendars where you can select the date rather than type it in.

Thanks
Johnny
Getting better with mods but no programmer am I.

#35   newtest

newtest
  • Members
  • 224 posts
  • Real Name:no its not

Posted 17 December 2008 - 06:47 PM

I just installed this contribution (competition v1.2) and get the following error, It only happens when allow guest to enter is set to false.

Error:
1054 - Unknown column 'competition_code' in 'where clause'

select count(*) as total from customers where customers_email_address = '' and customers_id = '1' AND competition_code = '001'

[TEP STOP]


I have reinstalled it several times and tried to use the manual sql also. Have even tried on stock shop as well.
Any help is appreciated.

oscommerce-2.2ms2-060817
mysql 5
php5

#36   johnnybebad

johnnybebad
  • Members
  • 672 posts
  • Real Name:Johnny

Posted 17 December 2008 - 08:06 PM

View Postnewtest, on Dec 17 2008, 06:47 PM, said:

I just installed this contribution (competition v1.2) and get the following error, It only happens when allow guest to enter is set to false.

Error:
1054 - Unknown column 'competition_code' in 'where clause'

select count(*) as total from customers where customers_email_address = '' and customers_id = '1' AND competition_code = '001'

[TEP STOP]


I have reinstalled it several times and tried to use the manual sql also. Have even tried on stock shop as well.
Any help is appreciated.

oscommerce-2.2ms2-060817
mysql 5
php5

Getting better with mods but no programmer am I.

#37   johnnybebad

johnnybebad
  • Members
  • 672 posts
  • Real Name:Johnny

Posted 17 December 2008 - 08:24 PM

Hi,  I am sorting out my files for the upload to the contribrution. As i messed it up previously.

The mods I mod to the version 1.2 are below:-

1a). the stats_prize_draw.php  in admin

Around line 133 after

tep_db_query("UPDATE `" . TABLE_CONFIGURATION . "` SET `configuration_value` = '" . tep_db_input($HTTP_GET_VARS

['products_id']) . "' WHERE `configuration_key` = 'PRIZE_ID' LIMIT 1;");

  add:-
	tep_db_query("UPDATE `" . TABLE_CONFIGURATION . "` SET `configuration_value` = '" . tep_db_input($HTTP_GET_VARS

['answer_a']) 	  . "' WHERE `configuration_key` = 'COMPETITION_ANSWER_A' LIMIT 1;");
		tep_db_query("UPDATE `" . TABLE_CONFIGURATION . "` SET `configuration_value` = '" . tep_db_input

($HTTP_GET_VARS['answer_b']) 	  . "' WHERE `configuration_key` = 'COMPETITION_ANSWER_B' LIMIT 1;");
		tep_db_query("UPDATE `" . TABLE_CONFIGURATION . "` SET `configuration_value` = '" . tep_db_input

($HTTP_GET_VARS['answer_c']) 	  . "' WHERE `configuration_key` = 'COMPETITION_ANSWER_C' LIMIT 1;");

1b) Around line 380 after

echo '<tr><td class="main" width="15%">Question</td><td class="main" align="left">' . tep_draw_input_field('question', 

'type your question here','size="60", onclick=value=""') . '&nbsp;</td></tr>';

add:-
echo '<tr><td class="main" width="15%">Question</td><td class="main" align="left">' . 

tep_draw_input_field('question', 'type your question here','size="60", onclick=value=""') . '&nbsp;</td></tr>';
		echo '<tr><td class="main" width="15%">Answer A</td><td class="main" align="left">' . 

tep_draw_input_field('answer_a', 'type answer a here','size="30", onclick=value=""') . '&nbsp;</td></tr>';
		echo '<tr><td class="main" width="15%">Answer B</td><td class="main" align="left">' . 

tep_draw_input_field('answer_b', 'type answer b here','size="30", onclick=value=""') . '&nbsp;</td></tr>';
		echo '<tr><td class="main" width="15%">Answer C</td><td class="main" align="left">' . 

tep_draw_input_field('answer_c', 'type answer c here','size="30", onclick=value=""') . '&nbsp;</td></tr>';
		echo '<tr><td class="main" width="15%">Answer</td><td class="main" align="left">' . 

tep_draw_pull_down_menu('answer', $answer_array,'size="1"') . '&nbsp;</td></tr>';





2. swap the following code in catalog/competition.php (this gives radio button options with those previously entered in

admin)


Find the following:-

<td class="main"><?php echo '<span class="main">' . FORM_FIELD_QUALIFING_ANSWER . '</span>&nbsp;&nbsp;' . 

tep_draw_input_field('entry_qualify_answer','','size="1"') . '&nbsp;<span class="inputRequirement">' . 

ENTRY_FIRST_NAME_TEXT . '</span>'; ?></td>


Replace with:-

<td class="main" STYLE="padding:15px;"><b>A</b> <input type="radio" name="entry_qualify_answer" value="A"><?php echo 

COMPETITION_ANSWER_A; ?><br><b>B</b> <input type="radio" name="entry_qualify_answer" value="B"><?php echo 

COMPETITION_ANSWER_B; ?><br><b>C</b> <input type="radio" name="entry_qualify_answer" value="C"><?php echo 

COMPETITION_ANSWER_C; ?><br>&nbsp;&nbsp;</td><td>



3. Need to add to your shops database configuration table


configuration_title         configuration_key        configuration_group_id

Competition Answer A        COMPETITION_ANSWER_A       (number to be same as other competion entry information)
Competition Answer B        COMPETITION_ANSWER_B       (number to be same as other competion entry information)
Competition Answer C        COMPETITION_ANSWER_C       (number to be same as other competion entry information)

To find the number search in the configuration table for %like%  competition under title, then look at the value in

configuration_group_id, when you insert the new entries use the same configuration_group_id.


4a.In catalog/includes/languages/english/competition.php


This replaces the win these goblets text,


Find;-
define('BOX_COMPETITION_INVITE','Click below for a chance to win these spectacular glass goblets<BR>');

replace with

define('BOX_COMPETITION_INVITE','Click below for a chance to win this great prize.<BR>');


4b) This automaically puts the end date of the competition

find:-

define('FORM_COMPETITION_DETAILS','Thank you for visting our site and taking the time to look around.<BR><BR>Before you 

leave, why not enter our free prize draw for a chance to win this fabulous prize.' .
						'<BR><BR>This prize draw will be running until the 25th May 2007.<BR><BR>The 

Winner will be notified by email after this date.<BR><BR><span class="smalltext">(terms & conditions apply)</span>');
  


and replace with ;-



define('FORM_COMPETITION_DETAILS','Thank you for visting our site and taking the time to look around.<BR><BR>Before you 

leave, why not enter our free prize draw for a chance to win this fabulous prize.' .
						'<BR><BR>This prize draw will be running until the  ' . tep_date_long

(COMPETITION_CLOSE_DATE) . '<BR><BR>The Winner will be notified by email after this date.<BR><BR><span 

class="smalltext">(terms & conditions apply)</span>');

Can somone please verify this coding, as I get it to work on my site but i am new to this so it would be great if someone else could check it out.
Getting better with mods but no programmer am I.

#38   jan64

jan64
  • Members
  • 133 posts
  • Real Name:Jan Swart
  • Gender:Male
  • Location:Holland

Posted 20 December 2008 - 05:12 AM

Also after the update's i still getting:

1062 - Duplicate entry 'name@name.nl-0001' for key 2

insert into contest (contestant_name, contestant_email, date_entered, validated, competition_code) values ('name name', 'name@name.nl', now(), 'N', '0001')

Still nobody who has the same problem solved?

regards,
Jan
Dreams can come true, if you help them a littlebit

#39   johnnybebad

johnnybebad
  • Members
  • 672 posts
  • Real Name:Johnny

Posted 20 December 2008 - 12:49 PM

View Postjan64, on Dec 20 2008, 05:12 AM, said:

Also after the update's i still getting:

1062 - Duplicate entry 'name@name.nl-0001' for key 2

insert into contest (contestant_name, contestant_email, date_entered, validated, competition_code) values ('name name', 'name@name.nl', now(), 'N', '0001')

Still nobody who has the same problem solved?

regards,
Jan


Hopefully have the answer later today on this one with some more mods
Getting better with mods but no programmer am I.

#40   johnnybebad

johnnybebad
  • Members
  • 672 posts
  • Real Name:Johnny

Posted 20 December 2008 - 01:47 PM

Okay, I have the answer.

It appears theres a little bit of code missing.


catalog/competition.php

// Check if we have already entered
	$check_email_query = tep_db_query("select count(*) as total from " . TABLE_CONTEST . " where contestant_email = '" . $referrals_data['customers_email_address'] . "' AND competition_code = '" . COMPETITION_CODE . "'");
	$check_email = tep_db_fetch_array($check_email_query);
	if ($check_email['total'] > 0) {
	   $error = true; 
	   $messageStack->add('competition', TEXT_ALREADY_ENTERED);


This should read
// Check if we have already entered
	$check_email_query = tep_db_query("select count(*) as total from " . TABLE_CONTEST . " where contestant_email = '" . $referrals_data['customers_email_address'] . "' AND competition_code = '" . COMPETITION_CODE . "'");
	$check_email = tep_db_fetch_array($check_email_query);
	if ($check_email['total'] > 0) {
	   $error = true; 
	  if ($error == true && $show_invite == true) $messageStack->add('competition', TEXT_ALREADY_ENTERED);

please let me know how you get on, just tried it and it worked for me
Getting better with mods but no programmer am I.