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

Contest System [support thread]

Views: 57,864

Results 21 to 40 of 408
31 Jan 2009, 4:14 PM
#21
sunflowertami avatar

sunflowertami

Zen Follower

Join Date:
Jun 2008
Posts:
267
Plugin Contributions:
0

Contest System [support thread]

:clap: YIPEE!!! that did it! Thanks!!!

skipwater:

sunflowertami and HeathenMagic

Here is the fix for your cherry_zen template and I have test on others and seems to work on all.
Replace this file with the zip attached here. Or you can just edit as below.
/includes/languages/english/html_includes/YOUR_TEMPLATE /define_contestend.php

<!-- bof define_contestend --> <div class='centerColumn' id='contest'> <h1 id='contest-heading'><?php echo HEADING_TITLE; ?></h1> <div id='contest-content' class='content'>
<table border="0" width="100%" cellspacing="10" cellpadding="10">
	<tr>
		<td class="pageHeading"" width=100% align="center" valign="top">
		<font size="5"><strong>CONTEST HAS ENDED</strong></font><br/>
		</td>
	</tr>
	<tr>
		<td class="main" align="center">
		<p class="biggerText"> <strong>There Will be a NEW contest soon please check back.</strong></p>
		</td>
	</tr>
</table>
<!-- eof define_contestend DO NOT close with the two div -->
9 Feb 2009, 8:10 AM
#22
chefouvi avatar

chefouvi

New Zenner

Join Date:
Dec 2008
Posts:
15
Plugin Contributions:
0

Re: Contest System [support thread]

Hi SkipWater,
Thanks for a great Mod.
I just have a question.
I have admin profiles installed so it is denying me to run the install-sql-contest-v1.3.php file.
Could you please give me the sql statements to run so that I can run them through Phpadmin or zencart sql patch installer?

I'd really appreciate it.

Thanks for such great work.

Chefouvi

9 Feb 2009, 2:13 PM
#23
skipwater avatar

skipwater

Totally Zenned

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

Re: Contest System [support thread]

chefouvi:

Hi SkipWater,
Thanks for a great Mod.
I just have a question.
I have admin profiles installed so it is denying me to run the install-sql-contest-v1.3.php file.
Could you please give me the sql statements to run so that I can run them through Phpadmin or zencart sql patch installer?

I'd really appreciate it.

Thanks for such great work.

Chefouvi

After reading kuroi's Admin Profiles Support Thread it seems all you have to do is give yourself permission to run the file. http://www.zen-cart.com/forum/showpost.php?p=677173&postcount=673

You will also have to give yourself permission to run the admin side of Contest System.

Skip

21 Feb 2009, 7:38 AM
#24
beadfaery avatar

beadfaery

New Zenner

Join Date:
Aug 2008
Posts:
26
Plugin Contributions:
0

Re: Contest System [support thread]

Hi,
I've just installed this mod and am very excited to get it up and running.
I've gone wrong somewhere though :wacko:
I've uploaded all the files.....but there is nothing in my Admin-config :wacko:

Dumb question....but......:blush:
I assume I need to install an sql into the 'install SQL patches' area in my admin.....but where is this sql patch in the mod?

21 Feb 2009, 12:25 PM
#25
beadfaery avatar

beadfaery

New Zenner

Join Date:
Aug 2008
Posts:
26
Plugin Contributions:
0

Re: Contest System [support thread]

OK....have been trying to figure this out for hours now :frusty:

what do you mean by "run the install-sql-contest-v1.3.php file." ???
How and where do I do this :wacko:

This is driving me crazy :dontgetit.....I know when I get the answer it's going to be obvious LOL! :P

21 Feb 2009, 6:29 PM
#26
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

Re: Contest System [support thread]

beadfaery:

OK....have been trying to figure this out for hours now :frusty:

what do you mean by "run the install-sql-contest-v1.3.php file." ???
How and where do I do this :wacko:

This is driving me crazy :dontgetit.....I know when I get the answer it's going to be obvious LOL! :P

you need open that file in your browser, so go to your_domain.com/admin(or whatever your admin is called)/install-sql-contest-v1.3.php. Once it's done you just need to click the back button to get back to the admin panel and you will see the 2 menus, 1 in configuration and one in reports.

21 Feb 2009, 11:58 PM
#27
beadfaery avatar

beadfaery

New Zenner

Join Date:
Aug 2008
Posts:
26
Plugin Contributions:
0

Re: Contest System [support thread]

lankeeyankee:

you need open that file in your browser, so go to your_domain.com/admin(or whatever your admin is called)/install-sql-contest-v1.3.php. Once it's done you just need to click the back button to get back to the admin panel and you will see the 2 menus, 1 in configuration and one in reports.
Thank you, thank you, THANK YOU :clap:

Now I have one more problem still....when I click on 'Contest Prize Entries' in Reports, I get an error page (500 Internal Server Error) that says:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

any idea what's wrong?:dontgetit

22 Feb 2009, 10:58 AM
#28
beadfaery avatar

beadfaery

New Zenner

Join Date:
Aug 2008
Posts:
26
Plugin Contributions:
0

Re: Contest System [support thread]

It's OK :smile:
I've worked it all out and it's up and running :clap:

Thanks again for such a fantastic mod!! :bigups:

2 Mar 2009, 11:54 PM
#29
divaboutiques avatar

divaboutiques

Zen Follower

Join Date:
Feb 2007
Location:
Worldwide Web
Posts:
191
Plugin Contributions:
0

Re: Contest System [support thread]

Itrying to figure out 2 problems I'm having:

1st. I am getting an error on the Contestants Entries that is showing in the admin panel

This is the error
1146 Table 'divabou_zc2.contest' doesn't exist
in:
[SELECT contest.date_entered, COUNT(*) contestant_count FROM contest contest GROUP BY contest.date_entered ORDER BY contest.date_entered DESC limit 10]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.


2nd. I would like to know how to add the picture of the item I am giving away in the "Enter to win" side box?

3 Mar 2009, 2:51 AM
#30
skipwater avatar

skipwater

Totally Zenned

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

Re: Contest System [support thread]

divaboutiques:

Itrying to figure out 2 problems I'm having:

1st. I am getting an error on the Contestants Entries that is showing in the admin panel

This is the error
1146 Table 'divabou_zc2.contest' doesn't exist
in:
[SELECT contest.date_entered, COUNT(*) contestant_count FROM contest contest GROUP BY contest.date_entered ORDER BY contest.date_entered DESC limit 10]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.


2nd. I would like to know how to add the picture of the item I am giving away in the "Enter to win" side box?

Item 1.
Change old line to new line.

//  old line
$contest_query = "SELECT `contest`.`date_entered`, COUNT(*) contestant_count FROM `contest` `contest` GROUP BY `contest`.`date_entered` ORDER BY `contest`.`date_entered` DESC limit 10";
// new line
$contest_query = "SELECT " .TABLE_CONTEST. " .`date_entered`, COUNT(*) contestant_count FROM `contest` `contest` GROUP BY `contest`.`date_entered` ORDER BY `contest`.`date_entered` DESC limit 10";

Item 2.
Locate /includes/templates/YOUR_TEMPLATE/sideboxes/tpl_contest_sidebox.php
and add/replace lines as shown below. This is going to hard code the image so every time you change your prize you will need to change this image. I will most likely add this to a update.

// Link to contest Page
$content .='<a href="'.zen_href_link("contest").'">Enter Our Contest</a><br />';
// Uncomment the below line and change image name and location to meet your needs.
// $content .='<a href="'.zen_href_link("contest").'"><img src="images/click_to_enter_contest.gif" alt="Our Contest" border="0" title="ENTER TO WIN - Our contest gives away one prize to the winning contestent."/></a>';
  $content .= '</div>';

As an added option you can place a link shown below to any definepage on your site.

<?php echo '<a href="'.zen_href_link("contest").'"><img src="images/click_to_enter_contest.gif" alt="Our Contest" border="0" title="ENTER TO WIN - Our contest gives away one prize to the winning contestent."/></a>';?>

Skip

4 Mar 2009, 6:20 PM
#31
divaboutiques avatar

divaboutiques

Zen Follower

Join Date:
Feb 2007
Location:
Worldwide Web
Posts:
191
Plugin Contributions:
0

Re: Contest System [support thread]

I tried to both the correct coding and the first coding still left a different error:

  1. This is the new error I get for the admin display
    1146 Table 'divabou_zc2.contest' doesn't exist
    in:
    [SELECT zen_contest .date_entered, COUNT(*) contestant_count FROM contest contest GROUP BY contest.date_entered ORDER BY contest.date_entered DESC limit 10]
    If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

  2. This is what I did for my photo to show with the code you left

Link to contest Page
$content .='<a href="'.zen_href_link("contest").'">Enter Our Contest</a><br />';
// Uncomment the below line and change image name and location to meet your needs.
// $content .='<a href="http://divaboutiques.com/store/index.php?main_page=contest'.zen_href_link("contest").'"><img src="images/FN90302RD.jpg" alt="Our Contest" border="0" title="ENTER TO WIN - Our contest gives away one prize to the winning contestent."/></a>';
$content .= '</div>';

I don't know if I added the image photo in the wrong area, but when I uploaded the file I received this error on my front page.

Parse error: syntax error, unexpected T_STRING in /home/divabou/public_html/store/includes/templates/diva/sideboxes/tpl_contest_sidebox.php on line 16

4 Mar 2009, 6:42 PM
#32
divaboutiques avatar

divaboutiques

Zen Follower

Join Date:
Feb 2007
Location:
Worldwide Web
Posts:
191
Plugin Contributions:
0

Re: Contest System [support thread]

Okay so I went back in to play around with the code to see if I placed the image somewhere wrong. I chenged it to this:

// Link to contest Page
$content .='<a href="'.zen_href_link("contest").'">Enter Our Contest</a><br />';
// Uncomment the below line and change image name and location to meet your needs.
// $content .='<a href="'.zen_href_link("contest").'"><img src="/store/images/FN90302RD.jpg" alt="Our Contest" border="0" title="ENTER TO WIN - Our contest gives away one prize to the winning contestent."/></a>';
  $content .= '</div>'; 

This error went away:

 
Parse error: syntax error, unexpected T_STRING in /home/divabou/public_html/store/includes/templates/diva/sideboxes/tpl_contest_sidebox.php on line 16

But the image is still not showing up in the contest sidebox????:frusty:

4 Mar 2009, 8:10 PM
#33
skipwater avatar

skipwater

Totally Zenned

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

Re: Contest System [support thread]

divaboutiques:

I tried to both the correct coding and the first coding still left a different error:

  1. This is the new error I get for the admin display
    1146 Table 'divabou_zc2.contest' doesn't exist
    in:
    [SELECT zen_contest .date_entered, COUNT(*) contestant_count FROM contest contest GROUP BY contest.date_entered ORDER BY contest.date_entered DESC limit 10]
    If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

  2. This is what I did for my photo to show with the code you left

Link to contest Page
$content .='<a href="'.zen_href_link("contest").'">Enter Our Contest</a><br />';
// Uncomment the below line and change image name and location to meet your needs.
// $content .='<a href="http://divaboutiques.com/store/index.php?main_page=contest'.zen_href_link("contest").'"><img src="images/FN90302RD.jpg" alt="Our Contest" border="0" title="ENTER TO WIN - Our contest gives away one prize to the winning contestent."/></a>';
$content .= '</div>';

I don't know if I added the image photo in the wrong area, but when I uploaded the file I received this error on my front page.

Parse error: syntax error, unexpected T_STRING in /home/divabou/public_html/store/includes/templates/diva/sideboxes/tpl_contest_sidebox.php on line 16

I am assuming that the contest systems is working.
and there is a contest table in your data base.

  1. This should fix your admin stat error
$contest_query = "SELECT `divabou_zc2.contest`.`date_entered`, COUNT(*) contestant_count FROM `contest` `contest` GROUP BY `contest`.`date_entered` ORDER BY `contest`.`date_entered` DESC limit 10";
  1. need to uncomment line so remove the two //
$content .='<a href="'.zen_href_link("contest").'"><img src="/store/images/FN90302RD.jpg" alt="Our Contest" border="0" title="ENTER TO WIN - Our contest gives away one prize to the winning contestent."/></a>';
4 Mar 2009, 8:52 PM
#34
divaboutiques avatar

divaboutiques

Zen Follower

Join Date:
Feb 2007
Location:
Worldwide Web
Posts:
191
Plugin Contributions:
0

Re: Contest System [support thread]

I am assuming that the contest systems is working.
and there is a contest table in your data base.

  1. This should fix your admin stat error

PHP Code:
$contest_query = "SELECT divabou_zc2.contest.date_entered, COUNT(*) contestant_count FROM contest contest GROUP BY contest.date_entered ORDER BY contest.date_entered DESC limit 10";

  1. need to uncomment line so remove the two //

PHP Code:
$content .='<a href="'.zen_href_linkCOLOR=#007700.'"><img src="/store/images/FN90302RD.jpg" alt="Our Contest" border="0" title="ENTER TO WIN - Our contest gives away one prize to the winning contestent."/></a>';
[/COLOR]

  1. I'm getting this error now

1146 Table 'divabou_zc2.contest' doesn't exist
in:
[SELECT divabou_zc2.contest.date_entered, COUNT(*) contestant_count FROM contest contest GROUP BY contest.date_entered ORDER BY contest.date_entered DESC limit 10]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

  1. Your suggestion worked and now the picture is showing, but it is showing very BIGGGGGGGG, how can I scale down the picture to fit the box now?
4 Mar 2009, 9:19 PM
#35
skipwater avatar

skipwater

Totally Zenned

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

Re: Contest System [support thread]

  1. Your suggestion worked and now the picture is showing, but it is showing very BIGGGGGGGG, how can I scale down the picture to fit the box now?

You must add width and height or resize the image.
This example is 100px X 100px:

$content .='<a href="'.zen_href_link("contest").'"><img src="/store/images/FN90302RD.jpg" width="100" height="100" alt="Our Contest" border="0" title="ENTER TO WIN - Our contest gives away one prize to the winning contestent."/></a>'; 
4 Mar 2009, 9:35 PM
#36
skipwater avatar

skipwater

Totally Zenned

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

Re: Contest System [support thread]

As for item 1. I was sleeping on that one here should be the right code.

$contest_query = "SELECT `date_entered`, COUNT(*) contestant_count FROM " .TABLE_CONTEST. " GROUP BY `date_entered` ORDER BY `date_entered` DESC limit 10";
4 Mar 2009, 11:22 PM
#37
divaboutiques avatar

divaboutiques

Zen Follower

Join Date:
Feb 2007
Location:
Worldwide Web
Posts:
191
Plugin Contributions:
0

Re: Contest System [support thread]

Thank you:clap:
Thank you:clap:
Thank you:clap:
It worked!

15 Mar 2009, 7:12 AM
#38
sonjamichelle avatar

sonjamichelle

New Zenner

Join Date:
Mar 2009
Posts:
21
Plugin Contributions:
0

Re: Contest System [support thread]

Using:

Zen Cart 1.3.8a
Database Patch Level: 1.3.8
v1.3.8 [2009-03-10 15:49:55] (Fresh Installation)
Server OS: Linux 2.6.18-92.1.10.el5PAE
Database: MySQL 5.0.67.d7-ourdelta-log
Server Date: 03/15/2009 00:04:42
Database Date: 03/15/2009 00:04:42
Server Up Time: 00:04:42 up 10 days, 8:01, 0 users, load average: 2.35, 3.07, 2.52
HTTP Server: Apache
PHP Version: 5.2.8 (Zend: 2.2.0)
PHP Memory Limit: 64M
PHP Safe Mode: Off
PHP File Uploads: On
Max Size: 8M
POST Max Size: 8M
Database Data Size: 1,590 kB
Database Index Size: 909 kB

http://www.hillcountrytactical.com/catalog

When I try to enter the contest I get the following error.

1054 Unknown column 'contest_code' in 'where clause'
in:
[select count(*) as total from customers where customers_email_address = '[email protected]' and customers_id = '0' AND contest_code = '25']

The "contest" table exists with columns:

id
contestant_name
contestant_email
contestant_ip_address
date_entered
validated
contest_code
OMIT

Searching the net, this error seems to stem from changes with "join" from ver 4 to ver 5.

I am NOT a SQL person so I don't even know where to begin to deug this.

One other problem I noticed is that when I goto the contest report screen and choose to add customers who purchased during the contest period, I see no customers to add.

15 Mar 2009, 4:56 PM
#39
skipwater avatar

skipwater

Totally Zenned

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

Re: Contest System [support thread]

sonjamichelle

Open this file /includes/templates/YOUR_TEMPLATE/templates/tpl_contest_default.php
and find around line 96

$check_members_email_query = "select count(*) as total from " . TABLE_CUSTOMERS . " where customers_email_address = '" . zen_db_input($entry_email_address) . "' and customers_id = '" . (int)$customer_id . "' AND contest_code = '" . CONTEST_CODE . "'";

Replace with this

$check_members_email_query = "select count(*) as total from " . TABLE_CUSTOMERS . " where customers_email_address = '" . zen_db_input($entry_email_address) . "' and customers_id = '" . (int)$customer_id . "'";

Add Customers Button
There is no list created prior to the adding of customers to a contest.
If you wish to pick customers from a list, this can only happen after adding them to the contest. Then you can go through the list and delete the unwanted ones.

This patch and others will be added to the version 1.4 update.

15 Mar 2009, 11:43 PM
#40
sonjamichelle avatar

sonjamichelle

New Zenner

Join Date:
Mar 2009
Posts:
21
Plugin Contributions:
0

Re: Contest System [support thread]

Re: Patch

Worked like a charm!! Thank you very much!!

RE: Add Customers Button

On the adding of customers, when you goto the admin section from reports/contest prize entries, there's a add customers button. Clicking that button yields;

Contest Prize Entries
Add Entries for Existing Customers

Add entries for customers who have brought products during the contest period.

Contest Dates 03/10/2009 - 03/17/2009 Entrants Name Email Address

By the text of this page it makes me think that it will pull data on customers who made purchases and list them. I can then add them to the current contest from here based on the fact they made a purchase during the contest dates.

Did I misunderstand the purpose of this particular page?

The word in red; is that a typo? :unsure:

Oh, just a possible bug heads up, nothing major. But if you choose not to use a qualifying question, the submit button disappears.

Again, thanks for the quick patch!!!!