Skip to content

Commit

Permalink
Merge pull request #29 from ynotradio/feature/year-end-poll-2022
Browse files Browse the repository at this point in the history
update yearendpoll and yearendstaffpicks. Fix bug on yearendpoll
  • Loading branch information
tjnicolaides committed Mar 19, 2023
2 parents 129a168 + 217e95a commit 19f676d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
28 changes: 14 additions & 14 deletions src/yearendpoll.php
Expand Up @@ -6,7 +6,7 @@

$page_file = "yearendpoll.php";
$page_title = "Year End Poll";
$poll_end_datetime = strtotime("12/21/21 12pm");
$poll_end_datetime = strtotime("12/21/22 12pm");

require "functions/main_fns.php";
require "functions/year_end_poll_fns.php";
Expand All @@ -17,16 +17,16 @@
$current_poll = $_GET['poll'];
$polls = get_poll_names();

$votes = $_POST['year_end_votes'];
$poll_form = $_POST['poll'];
$votes = isset($_POST['year_end_votes']) ? $_POST['year_end_votes'] : [];
$poll_form = isset($_POST['poll']) ? $_POST['poll'] : null;

$vote_count = ($_POST['write_in_value'] == '') ? count($votes) : count($votes) + 1;

if ($vote_count != max_picks_for($poll_form)) {
if (isset($_POST['year_end_votes']) && $vote_count != max_picks_for($poll_form)) {
echo "<div class=\"row\" id=\"flash\">\n
<div class=\"twelve columns top-spacer_20 center error\">Wow, this is embarrassing...<br>It seems that you didn't pick enough, please try again.</div>\n
\n</div>";
} else {
} else if (isset($_POST['year_end_votes']) ) {
if (has_voted($ip, $poll_form) == false) {
$insert = add_votes_for($poll_form, $votes);

Expand Down Expand Up @@ -63,7 +63,7 @@

echo "<div class=\"row\">";
if ($new_contestant == 1) {
echo "<div class=\"twelve columns top-spacer_20 center success\">Good luck and thanks for voting in Y-Not's 2021 Year End Poll!<br>Find out all the results when we countdown The Top 221 Songs of 2021, <br>December 27<sup>th</sup> thru 30<sup>th</sup> .</div>";
echo "<div class=\"twelve columns top-spacer_20 center success\">Good luck and thanks for voting in Y-Not's 2022 Year End Poll!<br>Find out all the results when we countdown The Top 221 Songs of 2022, <br>December 27<sup>th</sup> thru 30<sup>th</sup> .</div>";
} elseif ($new_contestant == "missing_values") {
echo "<div class=\"twelve columns top-spacer_20 center error\">Sorry! <br> Seems like you may be missing some value(s), please try again.</div>";
} else {
Expand All @@ -79,7 +79,7 @@
<?php if (date("Y-m-d H:i:s", time()) <= date("Y-m-d H:i:s ", $poll_end_datetime)) { ?>

<div class="twelve columns"><div class="center top-spacer_20 bottom-spacer_20" style="max-width: 100%">
<img src="https://i.imgur.com/p7LzXZv.gif" alt="YNot Year End Poll 2021" style="max-width: 100%">
<img src="https://i.imgur.com/LmLYUmy.gif" alt="YNot Year End Poll 2022" style="max-width: 100%">
</div>

<!-- <div class="six columns"><div class="center top-spacer_20 bottom-spacer_20"><img src="https://i.imgur.com/LGccI17.jpg" style="max-width: 100%" /></div> -->
Expand All @@ -89,13 +89,13 @@

<div class="column twelve">

<p>As the year winds down, it's time to pick all of your favorite music, movies, TV, and more from 2021! Cast your votes and you could win an <b>Apple TV</b> with 3 months of <i>Apple TV+</i> included and the chance to play your own top 20 songs of the year on Y-Not Radio!
<p>As the year winds down, it's time to pick all of your favorite music, movies, TV, and more from 2022! Cast your votes and you could win an <b>Apple TV</b> with 3 months of <i>Apple TV+</i> included and the chance to play your own top 20 songs of the year on Y-Not Radio!
<br><br>
Vote now thru Dec. 20th. Then we'll count down <i>The Top 221 of 2021</i> from December 27th thru 30th! <i>You can sponsor a 10 song block of the countdown by making a $25 donation <a href="https://www.paypal.com/paypalme/ynotradio/25" target=_blank>here</a></i>.
Vote now thru Dec. 21st. Then we'll count down <i>The Top 222 of 2022</i> from December 27th thru 30th! <i>You can sponsor a 10 song block of the countdown by making a $25 donation <a href="https://www.paypal.com/paypalme/ynotradio/25" target=_blank>here</a></i>.
<br><br>
Need some ideas? Check out the Y-Not DJs best of lists <a href="yearendstaffpicks.php">here</a>.</p>

<!-- <p><em>Y-Not Radio’s 2021 Year End Poll is brought to you by <strong>goPuff.</strong> goPuff delivers food & drinks, cleaning supplies, home needs, over-the-counter medication and more in just minutes. 24/7 in most areas and late night everywhere else to bring you what you need, when you need it most. <a href="https://gopuff.com/" target="_blank">Download the goPuff app</a> and use code: <strong>YNOT</strong> for $5 off your first two orders! New customers only. </em></p>
<!-- <p><em>Y-Not Radio’s 2022 Year End Poll is brought to you by <strong>goPuff.</strong> goPuff delivers food & drinks, cleaning supplies, home needs, over-the-counter medication and more in just minutes. 24/7 in most areas and late night everywhere else to bring you what you need, when you need it most. <a href="https://gopuff.com/" target="_blank">Download the goPuff app</a> and use code: <strong>YNOT</strong> for $5 off your first two orders! New customers only. </em></p>
<div class="center">
<p><a href="https://gopuff.com/"><img src="https://i.imgur.com/gaPe8zc.jpg" alt="goPuff advertisement" /></p>
</div> -->
Expand All @@ -104,8 +104,8 @@
</div>

<div class="center social">
<a href="https://twitter.com/share" class="twitter-share-button" data-text="Check out @YNotRadio's 2021 Year End Poll #YNotYearEndPoll" data-count="none" data-via="YNotRadio">Tweet</a><script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>
<div class="fb-like" data-href="http://www.ynotradio.net/yearendpoll.php?2021" data-send="true" data-width="450" data-show-faces="false"></div>
<a href="https://twitter.com/share" class="twitter-share-button" data-text="Check out @YNotRadio's 2022 Year End Poll #YNotYearEndPoll" data-count="none" data-via="YNotRadio">Tweet</a><script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>
<div class="fb-like" data-href="http://www.ynotradio.net/yearendpoll.php?2022" data-send="true" data-width="450" data-show-faces="false"></div>
</div>
<?php
require "partials/_year_end_poll_dashboard.php" ?>
Expand Down Expand Up @@ -141,9 +141,9 @@
} //end of else
} else {
echo "<div class=\"center top-spacer_20 bottom-spacer_20\">
<img src=\"https://i.imgur.com/p7LzXZv.gif\" alt=\"YNot Year End Poll 2021\" style=\"max-width: 100%\">
<img src=\"https://i.imgur.com/p7LzXZv.gif\" alt=\"YNot Year End Poll 2022\" style=\"max-width: 100%\">
</div>
<p>Thanks to everyone who voted in Y-Not's 2021 Year End Poll! Voting is now closed and we'll be tabulating over the holiday. Tune in from December 27th - 30th to hear all the results in Y-Not’s Top 221 of 2021 countdown, starting at 10am each day. In the meantime, check out the Y-Not DJs' <a href=\"yearendstaffpicks.php\">top albums and songs</a>!</p>
<p>Thanks to everyone who voted in Y-Not's 2022 Year End Poll! Voting is now closed and we'll be tabulating over the holiday. Tune in from December 27th - 30th to hear all the results in Y-Not’s Top 221 of 2021 countdown, starting at 10am each day. In the meantime, check out the Y-Not DJs' <a href=\"yearendstaffpicks.php\">top albums and songs</a>!</p>
</div>
<div class=\"center\">
</div>";
Expand Down
4 changes: 2 additions & 2 deletions src/yearendstaffpicks.php
Expand Up @@ -13,7 +13,7 @@
<div class="twelve columns content" style="white-space:nowrap;">

<div class="twelve" style="display:inline-block;">
<div class="twelve columns" style="max-width: 100%"><div class="center top-spacer_20 bottom-spacer_20" ><img src="https://i.imgur.com/p7LzXZv.gif" alt="YNot Year End Poll 2021" style="max-width: 100%" ></div>
<div class="twelve columns" style="max-width: 100%"><div class="center top-spacer_20 bottom-spacer_20" ><img src="https://i.imgur.com/LmLYUmy.gif" alt="YNot Year End Poll 2022" style="max-width: 100%" ></div>

<!-- <div class="six columns"><div class="center top-spacer_20 bottom-spacer_20"><a href="https://gopuff.onelink.me/QbZT/YNotRadio"><img src="https://i.imgur.com/HYYkf7G.png" style="max-width: 100%" /></a></div> -->
</div>
Expand All @@ -31,7 +31,7 @@
<div class="twelve columns top-spacer_20">
<table width="100%" border="0" cellspacing="5">
<tr>
<td bgcolor="#666666"><div align="center"><strong><a href="yearendpoll.php">Go back to 2021 YEAR END POLL</a></strong></div></td>
<td bgcolor="#666666"><div align="center"><strong><a href="yearendpoll.php">Go back to 2022 YEAR END POLL</a></strong></div></td>
<!-- <td bgcolor="#CCCCCC"><div align="center"><strong><a href="pages.php?page=yearendpoll2019">YEAR END POLL RESULTS</a></strong></div></td> -->
<!-- <td bgcolor="#CCCCCC"><div align="center"><strong><a href="yearendstaffpicks.php">Y-NOT STAFF FAVORITES</a></strong></div></td> -->
</tr>
Expand Down

0 comments on commit 19f676d

Please sign in to comment.