Zen Cart Logo
Forums / All Other Contributions/Addons / Contest System [support thread]

Contest System [support thread]

Views: 57,864

Results 141 to 160 of 408
17 Nov 2009, 3:35 AM
#141
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

Contest System [support thread]

Hi skipwater Theirs one more thing and then I will leave you alone. When a person who has not sign up yet tick the side-box enter the contest, it take them to this page, but when they register or log in it take them to the home page again instead of taking them to the form to fill out to enter.I think it should take them to the form to fill out. Just my opinion. Thank you again in advance.
> **You must be registered

                     and logged in to enter.**
                                                                        
                **Please [Log In](https://www.thegoodshepherdstore.com/login) / register and try again.**
17 Nov 2009, 3:50 AM
#142
skipwater avatar

skipwater

Totally Zenned

Join Date:
Jun 2008
Location:
Washington, DC
Posts:
775
Plugin Contributions:
1

Re: Contest System [support thread]

What you are requesting is not the way ZC works but you could modify /includes/modules/pages/contest/header_php.php file as DrByte shows in this thread.
http://www.zen-cart.com/forum/showpost.php?p=429323&postcount=7

That should do the trick.

Skip

17 Nov 2009, 4:01 AM
#143
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

Re: Contest System [support thread]

skipwater:

What you are requesting is not the way ZC works but you could modify /includes/modules/pages/contest/header_php.php file as DrByte shows in this thread.
http://www.zen-cart.com/forum/showpost.php?p=429323&postcount=7

That should do the trick.

Skip
Thank you I will try that. I do know Return Authorization Request add on works that way. Thats why I was asking. Thanks again.

20 Nov 2009, 3:16 AM
#144
chowdhryrc avatar

chowdhryrc

New Zenner

Join Date:
Jul 2009
Posts:
1
Plugin Contributions:
0

Re: Contest System [support thread]

Hi there
I am trying to install the mod but facing a particular problem
I have installed mod admin profile
which is preventing me to run install-sql-contest-v1.6,php. it does not save this file into permission system as there is no page for admin with this file.

what is the alternate

is there any sql patch available to run this file directly?

please help

rajesh

20 Nov 2009, 3:52 AM
#145
skipwater avatar

skipwater

Totally Zenned

Join Date:
Jun 2008
Location:
Washington, DC
Posts:
775
Plugin Contributions:
1

Re: Contest System [support thread]

chowdhryrc:

Hi there
I am trying to install the mod but facing a particular problem
I have installed mod admin profile
which is preventing me to run install-sql-contest-v1.6,php. it does not save this file into permission system as there is no page for admin with this file.

what is the alternate

is there any sql patch available to run this file directly?

please help

rajesh

You can place this file any where within the site tree and load the file in your browser to run it. BUT you must delete it once you have run the script for security reasons.
An example would be:

www.mysite.com/temp/install-sql-contest-v1.6.php

Skip

22 Nov 2009, 8:13 PM
#146
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

Re: Contest System [support thread]

Hi skipwater I have another question for you. In admin/reports/contest_Prize_Entries when you pull that up you are suppose to be able to Add entries for customers who have purchased products during the contest period. When I tick add customer it doesn't show any Entrants Name or email address. It has the confirm, and cancel buttons but that's all. Am I doing something wrong or is their a bug. Thank You in advance.

23 Nov 2009, 1:28 PM
#147
skipwater avatar

skipwater

Totally Zenned

Join Date:
Jun 2008
Location:
Washington, DC
Posts:
775
Plugin Contributions:
1

Re: Contest System [support thread]

countrycharm:

Hi skipwater I have another question for you. In admin/reports/contest_Prize_Entries when you pull that up you are suppose to be able to Add entries for customers who have purchased products during the contest period. When I tick add customer it doesn't show any Entrants Name or email address. It has the confirm, and cancel buttons but that's all. Am I doing something wrong or is their a bug. Thank You in advance.

There are requirements that need to be meet to have a list of Add Entries for Existing Customers.

  1. The customer had to have purchased something between the start and ending date of the contest.

  2. If 1 above is meet but the customer entered there self they will not show in the list. Because they would already be in the contest.

Skip

23 Nov 2009, 5:37 PM
#148
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

Re: Contest System [support thread]

skipwater:

There are requirements that need to be meet to have a list of Add Entries for Existing Customers.

  1. The customer had to have purchased something between the start and ending date of the contest.

  2. If 1 above is meet but the customer entered there self they will not show in the list. Because they would already be in the contest.

Skip

As many sales I have had recently I just don't understand why no one has entered the contest. That is why I was asking. I thought I was doing something wrong. Thanks for the help.

29 Nov 2009, 6:17 PM
#149
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Contest System [support thread]

Mod Version: 1.6.2
Zen Cart Version: 1.3.8a

FYI.. None of the defined pages appeared in the Define Pages Editor until I copied them to the includes/languages/english/html_includes folder too. So now the define pages for this mod are stored in two locations as follows:

  • includes/languages/english/html_includes
  • includes/languages/english/html_includes/YOUR_TEMPLATE
    I wanted to share this in case anyone else was having the same issue I was. This is pretty a cool module.. Now that I've got it all working I have one issue and I need some help with a change I'm trying to make...

Issue:
Add Entries for Existing Customers does not add customers to the contest. My test contest dates are 01/01/2009 - 12/31/2009, and there are sales during this period. Yet when I click the "Add Customers" button, no customers are added. Is there a fix for this??

Change:
I am trying to get the contest entry form to fill out the customer information (name and e-mail address) when a customer is logged in. I took a look at the contact us form to see how it was done there.. Based on this, in the includes/modules/pages/contest/header_php.php around line 18 I added the following:

    // auto complete when logged in
    if($_SESSION['customer_id']) {
      $sql = "SELECT customers_id, customers_firstname, customers_lastname, customers_password, customers_email_address, customers_default_address_id 
              FROM " . TABLE_CUSTOMERS . " 
              WHERE customers_id = :customersID";
      
      $sql = $db->bindVars($sql, ':customersID', $_SESSION['customer_id'], 'integer');
      $check_customer = $db->Execute($sql);
      $customer_email= $check_customer->fields['customers_email_address'];
      $customer_name= $check_customer->fields['customers_firstname'] . ' ' . $check_customer->fields['customers_lastname'];
    } else {
      $customer_email = NOT_LOGGED_IN_TEXT;
      $customer_name = NOT_LOGGED_IN_TEXT;
    }

// default email and name if customer is logged in
if($_SESSION['customer_id']) {
  $sql = "SELECT customers_id, customers_firstname, customers_lastname, customers_password, customers_email_address, customers_default_address_id 
          FROM " . TABLE_CUSTOMERS . " 
          WHERE customers_id = :customersID";
  
  $sql = $db->bindVars($sql, ':customersID', $_SESSION['customer_id'], 'integer');
  $check_customer = $db->Execute($sql);
  $email= $check_customer->fields['customers_email_address'];
  $name= $check_customer->fields['customers_firstname'] . ' ' . $check_customer->fields['customers_lastname'];
}
```This gets the name in the name field, but not the e-mail address.. I am a bit over my head here, and could use a hand.. What do I need to add, subtract, multiply or divide to get me the rest of the way there..:laugh:
29 Nov 2009, 7:47 PM
#150
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Contest System [support thread]

Figured it out..:clap:It was a SMALL change needed in the:
includes/templates/custom_template/templates/tpl_contest_default.php file to make it all work.

So altogether now..

If you want the contest form to fill in the name and e-mail address for users who are logged in make the following change in the:
includes/templates/custom_template/templates/tpl_contest_default.php file:
Around line 212 find the following code and make the change highlighted in red (add this to this file):

<label class="inputLabel" for="email-address"><?php echo FORM_FIELD_ENTRY_EMAIL; ?></label>
<?php echo zen_draw_input_field('entry_email_address',[B] $email, [/B]($error ? $_POST['entry_email_address'] : $entry_email_address), ' size="40" id="email-address"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>
<br class="clearBoth" /><br />
```Then in the **includes/modules/pages/contest/header_php.php** around line 18, make the changes outlined below.

The form will now automatically fill in the name and address for customers who are logged in.. I thought this was a nice edition to the customer validation code added by BEAZLEYBUB.

Hope others find this useful..

Now I only need to resolve my one remaining issue:
*Issue:
Add Entries for Existing Customers does not add customers to the contest. My test contest dates are 01/01/2009 - 12/31/2009, and there are sales during this period. Yet when I click the "Add Customers" button, no customers are added. Is there a fix for this??*

> **DivaVocals:**
>
> Mod Version: 1.6.2
> Zen Cart Version: 1.3.8a
> 
> FYI.. None of the defined pages appeared in the Define Pages Editor until I copied them to the **includes/languages/english/html_includes** folder too. So now the define pages for this mod are stored in two locations as follows:
> 
> - >
- **includes/languages/english/html_includes**
>
- **includes/languages/english/html_includes/YOUR_TEMPLATE**
>
>  I wanted to share this in case anyone else was having the same issue I was. This is pretty a cool module.. Now that I've got it all working I have one issue and I need some help with a change I'm trying to make...
> 
> Issue:
> Add Entries for Existing Customers does not add customers to the contest. My test contest dates are 01/01/2009 - 12/31/2009, and there are sales during this period. Yet when I click the "Add Customers" button, no customers are added. Is there a fix for this??
> 
> Change:
> I am trying to get the contest entry form to fill out the customer information (name and e-mail address) when a customer is logged in. I took a look at the contact us form to see how it was done there.. Based on this, in the **includes/modules/pages/contest/header_php.php** around line 18 I added the following:
> 
> ```php
    // auto complete when logged in
    if($_SESSION['customer_id']) {
      $sql = "SELECT customers_id, customers_firstname, customers_lastname, customers_password, customers_email_address, customers_default_address_id 
              FROM " . TABLE_CUSTOMERS . " 
              WHERE customers_id = :customersID";
      
      $sql = $db->bindVars($sql, ':customersID', $_SESSION['customer_id'], 'integer');
      $check_customer = $db->Execute($sql);
      $customer_email= $check_customer->fields['customers_email_address'];
      $customer_name= $check_customer->fields['customers_firstname'] . ' ' . $check_customer->fields['customers_lastname'];
    } else {
      $customer_email = NOT_LOGGED_IN_TEXT;
      $customer_name = NOT_LOGGED_IN_TEXT;
    }

// default email and name if customer is logged in
if($_SESSION['customer_id']) {
  $sql = "SELECT customers_id, customers_firstname, customers_lastname, customers_password, customers_email_address, customers_default_address_id 
          FROM " . TABLE_CUSTOMERS . " 
          WHERE customers_id = :customersID";
  
  $sql = $db->bindVars($sql, ':customersID', $_SESSION['customer_id'], 'integer');
  $check_customer = $db->Execute($sql);
  $email= $check_customer->fields['customers_email_address'];
  $name= $check_customer->fields['customers_firstname'] . ' ' . $check_customer->fields['customers_lastname'];
}
```This gets the name in the name field, but not the e-mail address.. I am a bit over my head here, and could use a hand.. What do I need to add, subtract, multiply or divide to get me the rest of the way there..:laugh:
29 Nov 2009, 7:54 PM
#151
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Contest System [support thread]

One more thing.. I have deleted the default contest table record.. Why does the name still continue to appear in the contest winner's list??

29 Nov 2009, 8:18 PM
#152
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Contest System [support thread]

DivaVocals:

One more thing.. I have deleted the default contest table record.. Why does the name still continue to appear in the contest winner's list??

Nevermind.. reading really is fundamental.. :laugh::laugh::laugh: I read this whole support thread before posting and overlooked this in my haste..

skipwater:

You must manually add to the winners list: Admin->Tools->Define Pages Editor
Select from drop drown define_contestwinner.php
Edit as needed

If you are referring to when there is no contest running no.

Skip

29 Nov 2009, 9:25 PM
#153
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Contest System [support thread]

I'm on a roll..:laugh: I decided to take a look at the query in the YOUR_ADMIN/stats_prize_draw.php file. Figured out that it was not adding customers to the contest until the order status ='3". For my test store this = "Shipped". So I get it now, and all is right with the world..

DivaVocals:

Issue:
Add Entries for Existing Customers does not add customers to the contest. My test contest dates are 01/01/2009 - 12/31/2009, and there are sales during this period. Yet when I click the "Add Customers" button, no customers are added. Is there a fix for this??

30 Nov 2009, 5:01 AM
#154
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Contest System [support thread]

Well I've made a BUNCH of change/updatess.. Thought I'd share..

Files Edited

  • Edited: includes/modules/pages/contest/header_php.php

  • Edited: includes/templates/custom_template/templates/tpl_contest_default.php

  • Edited: YOUR_ADMIN/includes/languages/english/stats_prize_draw.php

  • Added: includes\languages\english\html_includes\YOUR_TEMPLATE\define_contest_descrip.php
    Changes Made

  • ~ When a customer is logged in, the contest entry form will automatically fill in their name and e-mail address.

  • ~ Made a minor spelling correction to the admin language file

  • ~ Added contest stylesheet to align the qualifying question correctly. (You can merge the contents of this stylesheet with the store's main stylesheet)

  • ~ Added a contest description define page. Allows you to enter a contest description on the contest page.

  • ~ Updated "Extra Notes" in this readme file to include an explanation for how the "Add Customer" feature works.
    I've bundled this all up and will be submitting it to the downloads section.. Hope I'm not overstepping.. Seeing that I'm new here and all.. :smile:

30 Nov 2009, 1:41 PM
#155
skipwater avatar

skipwater

Totally Zenned

Join Date:
Jun 2008
Location:
Washington, DC
Posts:
775
Plugin Contributions:
1

Re: Contest System [support thread]

DivaVocals:

Well I've made a BUNCH of change/updatess.. Thought I'd share..

Files Edited

  • Edited: includes/modules/pages/contest/header_php.php
  • Edited: includes/templates/custom_template/templates/tpl_contest_default.php
  • Edited: YOUR_ADMIN/includes/languages/english/stats_prize_draw.php
  • Added: includes\languages\english\html_includes\YOUR_TEMPLATE\define_contest_descrip.php

Changes Made

  • ~ When a customer is logged in, the contest entry form will automatically fill in their name and e-mail address.
  • ~ Made a minor spelling correction to the admin language file
  • ~ Added contest stylesheet to align the qualifying question correctly. (You can merge the contents of this stylesheet with the store's main stylesheet)
  • ~ Added a contest description define page. Allows you to enter a contest description on the contest page.
  • ~ Updated "Extra Notes" in this readme file to include an explanation for how the "Add Customer" feature works.

I've bundled this all up and will be submitting it to the downloads section.. Hope I'm not overstepping.. Seeing that I'm new here and all.. :smile:

Wow and all I did was eat all weekend.

Fantastic updates and addons :bigups:

Skip

30 Nov 2009, 3:49 PM
#156
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Contest System [support thread]

skipwater:

Wow and all I did was eat all weekend.

Fantastic updates and addons :bigups:

Skip:laugh: I've been on a mission Skip.. My apologies for the flood of postings earlier.. Call it OVER EXUBERANCE!!! :laugh: Great mod BTW.. I'm glad I could add a little something useful to it, and getting a nod from the man himself (that would be you..:laugh:) is humbling..:yes:

30 Nov 2009, 5:31 PM
#157
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

Re: Contest System [support thread]

DivaVocals:

Well I've made a BUNCH of change/updatess.. Thought I'd share..

Files Edited

  • Edited: includes/modules/pages/contest/header_php.php
  • Edited: includes/templates/custom_template/templates/tpl_contest_default.php
  • Edited: YOUR_ADMIN/includes/languages/english/stats_prize_draw.php
  • Added: includes\languages\english\html_includes\YOUR_TEMPLATE\define_contest_descrip.php

Changes Made

  • ~ When a customer is logged in, the contest entry form will automatically fill in their name and e-mail address.
  • ~ Made a minor spelling correction to the admin language file
  • ~ Added contest stylesheet to align the qualifying question correctly. (You can merge the contents of this stylesheet with the store's main stylesheet)
  • ~ Added a contest description define page. Allows you to enter a contest description on the contest page.
  • ~ Updated "Extra Notes" in this readme file to include an explanation for how the "Add Customer" feature works.

I've bundled this all up and will be submitting it to the downloads section.. Hope I'm not overstepping.. Seeing that I'm new here and all.. :smile:
Has this been uploaded yet? Great add on.

30 Nov 2009, 5:43 PM
#158
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Contest System [support thread]

countrycharm:

Has this been uploaded yet? Great add on.
Thanks!:blush:

My upload yesterday didn't go through.. Just attempted to re-upload just now.. Hopefully this time it goes through, and it gets approved by the Zen Team..

ETA: Just got my upload confirmation!:clap:

5 Dec 2009, 5:16 PM
#159
prepared avatar

prepared

New Zenner

Join Date:
Dec 2009
Posts:
1
Plugin Contributions:
0

Re: Contest System [support thread]

For several reasons, I wanted to offer a contest for non-registered visitors. I soon found that my contest was filled with unwanted spam entries so I embedded reCAPTCHA into the template.

Here is how to do it if you are interested

If you haven't already, go to http://recaptcha.net/whyrecaptcha.html

  1. Sign up for an account.
  2. Register for your Public and Private Key
  3. Download the reCAPTCHA library and upload recaptchalib.php to your cart's root directory.

In /templates/your template/templates/tpl_contest_default.php

Find

} else { // Contest NOT Closed

	// Retrieve Prize details
	$sql_query = "select p.products_id, p.products_image, p.products_price, pd.products_name, pd.products_description from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = pd.products_id and p.products_id ='" . (int)CONTEST_PRIZE_ID . "' and pd.language_id = '" . (int)$_SESSION['languages_id']  . "' limit 1";
	$contest_prize = $db->Execute($sql_query);

		if (!$contest_prize->RecordCount() > 0) {
			// Data base error display warning
			echo '<center><br/><table width="80%" border="0" cellpadding="3" cellspacing="3" bgcolor="#FFFF00" >'.
			'<tr> '.
				'<td align="center"><strong>ADMIN ERROR:</strong> The selected Prize Could Not Be Found.</td>'.
				'</tr>'.
			'</table></center>';
		}

		if (isset($_GET['action']) && ($_GET['action'] == 'process')) {

Insert the following immediately thereafter

// Begin reCAPTCHA code
require_once('recaptchalib.php');
$privatekey = "enter the private key you received";
$resp = recaptcha_check_answer ($privatekey,
                                $_SERVER["REMOTE_ADDR"],
                                $_POST["recaptcha_challenge_field"],
                                $_POST["recaptcha_response_field"]);

if (!$resp->is_valid) {
  die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." .
       "(reCAPTCHA said: " . $resp->error . ")");
}
// End reCAPTCHA code

Be sure to insert your private key where appropriate

Now find

				<?php
				if (CONTEST_QUALIFY == "true") {
					echo FORM_FIELD_QUALIFING_QUESTION.'<br/>';
					// Retrived from Data Base
					echo CONTEST_QUESTION; 
				?>
					<label class="inputLabel" for="entry_qualify_answer"><?php echo FORM_FIELD_QUALIFING_ANSWER; ?></label>
					<?php echo zen_draw_input_field('entry_qualify_answer', $entry_qualify_answer, ' size="1" id="entry_qualify_answer"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>
					<br class="clearBoth" />
				<?php
				} // End Qualify Question

Insert the following immediately thereafter

// Begin reCAPTCHA code
require_once('recaptchalib.php');
$publickey = "enter the public key you received";
echo recaptcha_get_html($publickey);
// End reCAPTCHA code

Remember to enter your public key where appropriate.

Save and test.

Works well for me.

10 Dec 2009, 5:51 AM
#160
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Contest System [support thread]

DivaVocals:

Thanks!:blush:

My upload yesterday didn't go through.. Just attempted to re-upload just now.. Hopefully this time it goes through, and it gets approved by the Zen Team..

ETA: Just got my upload confirmation!:clap:Whoo hoo.. ver 1.6.3 is now available in the downloads section!! :clap: