$cutoff_window) { $judgemonth = date("F",mktime(0,0,0,$tm,$td,$ty)); $judgemonthnum = date("m",mktime(0,0,0,$tm,$td,$ty)); $judgeyear = date("Y",mktime(0,0,0,$tm,$td,$ty)); $td_eom = date("t",mktime(0,0,0,$tm,$td,$ty)); $daysleft = $td_eom - $td + $cutoff_window +1; $display_year_month = date("Y-m",mktime(0,0,0,$tm,$td,$ty)); $current_year_month = $display_year_month; } else { $judgemonth = date("F",mktime(0,0,0,$tm-1,$td,$ty)); $judgemonthnum = date("m",mktime(0,0,0,$tm-1,$td,$ty)); $judgeyear = date("Y",mktime(0,0,0,$tm-1,$td,$ty)); $daysleft = $cutoff_window - $td +1; $display_year_month = date("Y-m",mktime(0,0,0,$tm-1,$td,$ty)); $current_year_month = $display_year_month; } } else { if ($td > $cutoff_window) { $current_year_month = date("Y-m",mktime(0,0,0,$tm,$td,$ty)); $current_month_word = date("F",mktime(0,0,0,$tm,$td,$ty)); } else { $current_year_month = date("Y-m",mktime(0,0,0,$tm-1,$td,$ty)); $current_month_word = date("F",mktime(0,0,0,$tm-1,$td,$ty)); } if ($display_year_month > $current_year_month) { print "You may NOT view any statistics beyond $current_month_word!
"; exit; } $judgemonth = date("F",mktime(0,0,0,substr($display_year_month,5,2),1,substr($display_year_month,0,4))); $judgemonthnum = date("m",mktime(0,0,0,substr($display_year_month,5,2),1,substr($display_year_month,0,4))); $judgeyear = date("Y",mktime(0,0,0,substr($display_year_month,5,2),1,substr($display_year_month,0,4))); } $query4 = mysqli_query($con,"select distinct mp_month_total, mp_date from monthly_prizes where mp_date < '$current_year_month' "); $overall_new = 0; if ($query_data4 = mysqli_fetch_array($query4)) { do { $t_prize_money = $query_data4["mp_month_total"]; $tot_prize_money = substr($t_prize_money,1); $thedate = $query_data4["mp_date"]; $overall_new = $overall_new + $tot_prize_money; $mprize_amt[$thedate] = $t_prize_money; # echo "$t_prize_money $thedate $overall_new
"; } while($query_data4 = mysqli_fetch_array($query4)); } $total_awards= $overall_new + $old_awards_total; $total_awards = number_format($total_awards); $query4b = mysqli_query($con,"select distinct mp_month_total from monthly_prizes where mp_date = '$current_year_month' "); $query_data4b = mysqli_fetch_row($query4b); $total_prize_money = $query_data4b[0]; print "

The Poetic Link Winners & Statistics
"; print "$$total_awards in Total Awards have been Distributed to Date... "; print "We're about to ADD $total_prize_money more to that Total!

"; $countback = 0; $already_displayed_year = ""; do { $show_year = date("Y",mktime(0,0,0,(substr($current_year_month,5,2))- $countback,1,substr($current_year_month,0,4))); $show_month = date("F",mktime(0,0,0,(substr($current_year_month,5,2))- $countback,1,substr($current_year_month,0,4))); $show_year_month = date("Y-m",mktime(0,0,0,(substr($current_year_month,5,2))- $countback,1,substr($current_year_month,0,4))); if ($show_year_month <> $display_year_month && $show_year == $judgeyear) { if ($show_year_month == $current_year_month) { print "Click Here for $show_month $show_year when $total_prize_money will be awarded.
"; } else { print "Click Here for $show_month $show_year when $mprize_amt[$show_year_month] was awarded.
"; } } else if ($show_year <> $judgeyear && $show_year <> $already_displayed_year) { if ($show_year."-01" < $first_statistical_month) $use_this_date = $first_statistical_month; else if ($show_year == substr($current_year_month,0,4)) $use_this_date = $current_year_month; else $use_this_date = $show_year."-01"; print "Click Here for the $show_year Prize Year!
"; $already_displayed_year = $show_year; } $countback++; } while ($show_year_month > $first_statistical_month); #$poem_strength_required = 0; $total_prize_money = "$0.00"; $total_prize_count = 0; $idx = 1; do { $poet_prize[$idx] = ""; } while ($poet_prize[++$idx] <> ""); $tres1 = mysqli_query($con,"SELECT * FROM monthly_prizes where mp_date = '$display_year_month' "); if ($rowt1 = mysqli_fetch_array($tres1)) { $poem_strength_required = $rowt1["mp_poem_strength_required"]; $total_prize_money = $rowt1["mp_month_total"]; $total_prize_count = mysqli_num_rows($tres1); do { $p_or_c = $rowt1["mp_p_or_c"]; $place = $rowt1["mp_place"]; $prize = $rowt1["mp_prize"]; if ($p_or_c == "P") { $poet_prize[$place] = $prize; } } while($rowt1 = mysqli_fetch_array($tres1)); } else { $no_prizes_yet = "true"; } $query7 = mysqli_query($con,"select p_poem_num from poetry where p_date like '$display_year_month%'"); $month_poems = mysqli_num_rows($query7); $query8 = mysqli_query($con,"select sum(cm_poems_critiqued) from critiquers_monthly where cm_date = '$display_year_month'"); $query_data8 = mysqli_fetch_row($query8); $month_critiques = $query_data8[0]; if ($current_year_month == $display_year_month) { if ($no_prizes_yet) { print "

The Prizes have not yet been added for $judgemonth $judgeyear.
"; print "If they have not been added by the 15th of $judgemonth, please alert the Administrator.
"; } else { print "

$judgemonth $judgeyear Poet Standings and Prizes they Win If they HOLD Position!
"; print "There will be a total of $total_prize_money Distributed to $total_prize_count Winners for the month of $judgemonth $judgeyear!
"; } print "$judgemonth has received $month_poems Poems & "; print "$month_critiques Poem Critiques so far.

"; } else { print "

$judgemonth $judgeyear Poet Standings and Prizes they Were Awarded!!!
"; print "There was a total of $total_prize_money Distributed for the month of $judgemonth $judgeyear!
"; print "$judgemonth received $month_poems Poems & "; print "$month_critiques Poem Critiques.

"; } // determine if there is a historical order and if so use it here for the $result array $result = mysqli_query($con,"SELECT pm_poet_id, pm_poem_num, pm_times_critiqued, p_title, p_date, u_fullname FROM poems_monthly, users, poetry where p_poet_id = u_id and pm_poem_num = p_poem_num and p_display <> 'N' and pm_date = '$display_year_month' and u_account_locked = '' and pm_historical_order <> '' order by pm_historical_order "); if (!mysqli_num_rows($result)) { // if no historical order then go by voting points $query_voting = mysqli_query($con,"select cm_voting_choices, cm_voting_power from critiquers_monthly where cm_voting_choices <> '' and cm_date = '$display_year_month' "); if ($row_voting = mysqli_fetch_assoc($query_voting)) { do { $personal_voting_power = $row_voting["cm_voting_power"]; $voting_choices_array = explode (",",$row_voting["cm_voting_choices"]); $counter = 0; while (list ($key, $val) = each ($voting_choices_array)) { $counter++; $points_to_add = $personal_voting_power * ($maximum_voting_choices +1 - $counter); $new_array[$val] = $new_array[$val] + $points_to_add; } } while ($row_voting = mysqli_fetch_assoc($query_voting)); $update = mysqli_query($con,"update poems_monthly set pm_voting_points = 0 where pm_date = '$display_year_month' "); arsort($new_array); while (list ($key, $val) = each ($new_array)) { # echo "$key => $val
"; $update = mysqli_query($con,"update poems_monthly set pm_voting_points = $val where pm_poem_num = $key "); } } // since no historical order was found, use the voting points for $result array $result = mysqli_query($con,"SELECT pm_poet_id, pm_poem_num, pm_times_critiqued, pm_voting_points, p_title, p_date, u_fullname FROM poems_monthly, users, poetry where p_poet_id = u_id and pm_poem_num = p_poem_num and p_display <> 'N' and pm_date = '$display_year_month' and u_account_locked = '' and pm_voting_points > 0 order by pm_voting_points desc "); } if ($row = mysqli_fetch_array($result)) { print "The Standings below are sorted by the RED Column, from Highest to Lowest!
"; // print "After the $hidden_voting_after_nth_day"; // print "th day of voting all results below will be hidden until midnight on the $cutoff_window"; // print "th day, at which time ONLY The TOP Poem from every poet will show up on the list below! This will be the Final Standings.

"; print "Due to requests for removal of hidden voting after the $hidden_voting_after_nth_day"; print "th, standings will now remain visible. On midnight of the $cutoff_window"; print "th day, ONLY the TOP Poem from every poet will show up on the list below! This will be the Final Standings.

"; print ""; print ""; $counter = 0; do { $foundit = "N"; $poet_id = $row["pm_poet_id"]; $idx = 1; $poet_id = strtolower($poet_id); // turn off hidden feature by removing this line // if ($td > $hidden_voting_after_nth_day || $current_year_month <> $display_year_month) { # This shows EVERY poem until the last day when each poet's TOP poem is only shown if ($current_year_month <> $display_year_month) { # This shows EVERY poem until the last day when each poet's TOP poem is only shown do { $this_used_id = strtolower($used_id[$idx]); if ($poet_id == $this_used_id) { $foundit = "Y"; } } while (($idx++ < $counter) && ($foundit <> "Y")); if ($td <= $cutoff_window && $current_year_month == $display_year_month) $hide_poem_winners = "yes"; else $hide_poem_winners = ""; } if ($foundit <> "Y") { $counter++; $used_id[$counter] = $poet_id; $poem_num = $row["pm_poem_num"]; $poem_title = $row["p_title"]; $poem_title = "$poem_title"; $fullname = $row["u_fullname"]; $poem_date = $row["p_date"]; $voting_points = $row["pm_voting_points"]; //removed $strength = $row["pm_poem_strength"]; $times_critiqued = $row["pm_times_critiqued"]; print ""; } } while($row = mysqli_fetch_array($result)); print "
"; print "Prize
Award
"; print "
"; print "Poet
Rank
"; print "
"; print "Poet Name"; print ""; print "Poem Title"; print ""; print "Voting
Points
"; print "
"; print "Times
Critiqued
"; print "
"; print "Poem Date"; print "
"; print "$poet_prize[$counter]"; print ""; print "$counter"; print ""; if ($hide_poem_winners && $hidden <> "") { print "$hidden"; } else { print "$fullname"; } print ""; if ($hide_poem_winners && $hidden <> "") { print "$hidden"; } else { print "$poem_title"; } print ""; if ($hide_poem_winners && $hidden <> "") { print "$hidden"; } else { if ($voting_points == 0) print "N/A"; else print "$voting_points"; } print ""; if ($hide_poem_winners && $hidden <> "") { print "$hidden"; } else { print "$times_critiqued"; } print ""; if ($hide_poem_winners && $hidden <> "") { print "$hidden"; } else { print "$poem_date"; } print "
"; print "

"; # print "Total Poets Listed for $judgemonth $judgeyear: $counter

"; $countback = 0; $already_displayed_year = ""; do { $show_year = date("Y",mktime(0,0,0,(substr($current_year_month,5,2))- $countback,1,substr($current_year_month,0,4))); $show_month = date("F",mktime(0,0,0,(substr($current_year_month,5,2))- $countback,1,substr($current_year_month,0,4))); $show_year_month = date("Y-m",mktime(0,0,0,(substr($current_year_month,5,2))- $countback,1,substr($current_year_month,0,4))); if ($show_year_month <> $display_year_month && $show_year == $judgeyear) { if ($show_year_month == $current_year_month) { print "Click Here for $show_month $show_year when $total_prize_money will be awarded.
"; } else { print "Click Here for $show_month $show_year when $mprize_amt[$show_year_month] was awarded.
"; } } else if ($show_year <> $judgeyear && $show_year <> $already_displayed_year) { if ($show_year."-01" < $first_statistical_month) $use_this_date = $first_statistical_month; else if ($show_year == substr($current_year_month,0,4)) $use_this_date = $current_year_month; else $use_this_date = $show_year."-01"; print "Click Here for the $show_year Prize Year!
"; $already_displayed_year = $show_year; } $countback++; } while ($show_year_month > $first_statistical_month); } else { print "*** Voting has NOT YET BEGUN for the $judgemonth $judgeyear Poems! It will begin on the 1st of the new month. ***

"; } include "return_tag.html"; print "


"; # ************************************************************************************************************************ # ************************************************************************************************************************ # ************************************************************************************************************************ # Critiquer Rating Scores Below! # ************************************************************************************************************************ # ************************************************************************************************************************ # ************************************************************************************************************************ $total_prize_money = "$0.00"; $total_prize_count = 0; $idx = 1; do { $critiquer_prize[$idx] = ""; } while ($critiquer_prize[++$idx] <> ""); $tres1 = mysqli_query($con,"SELECT * FROM monthly_prizes where mp_date = '$display_year_month' "); if ($rowt1 = mysqli_fetch_array($tres1)) { $total_prize_money = $rowt1["mp_month_total"]; $total_prize_count = mysqli_num_rows($tres1); do { $p_or_c = $rowt1["mp_p_or_c"]; $place = $rowt1["mp_place"]; $prize = $rowt1["mp_prize"]; if ($p_or_c == "C") { $critiquer_prize[$place] = $prize; } } while($rowt1 = mysqli_fetch_array($tres1)); } else { $no_prizes_yet = "true"; } if ($current_year_month == $display_year_month) { if ($no_prizes_yet) { print "

The Prizes have not yet been added for $judgemonth $judgeyear.
"; print "If they have not been added by the 15th of $judgemonth, please alert the Administrator.
"; } else { print "

$judgemonth $judgeyear Critiquer Standings and Prizes they Win If they HOLD Position!
"; print "There will be a total of $total_prize_money Distributed to $total_prize_count Winners for the month of $judgemonth $judgeyear!
"; } print "$judgemonth has received $month_poems Poems & "; print "$month_critiques Poem Critiques so far.

"; } else { print "

$judgemonth $judgeyear Critiquer Standings and the Prizes the Were Awarded!!!
"; print "There was a total of $total_prize_money Distributed for the month of $judgemonth $judgeyear!
"; print "$judgemonth received $month_poems Poems & "; print "$month_critiques Poem Critiques.

"; } print "

"; # necessary to break the centering format if ($current_year_month == $display_year_month) { print "You must have a Critiquer Rating of at least $least_acceptable_critiquer_rating to have Voting Power above 0. "; print "If your Voting Power is at least $minimum_voting_power_required_for_prize_eligibility you will be eligible for the Critiquer "; print "Prizes at month end. This list is sorted two different ways. For those Eligible for Prizes, the list is sorted by "; print "Critiquer Rating, then Voting Power. For those NOT Eligible for Prizes, the list is sorted by Voting Power, then Critiquer Rating. "; print "You gain the most Critiquer Rating by giving Very Careful and accurate Critiques. You gain the most Voting Power by "; print "picking the poems at the TOP of the Critiquing list.

"; print "It may help to think of yourself as a flower. Your Nectar (Critiquer Rating) is of course the most valuable thing "; print "that you have. If you rush to Bloom too Quickly by raising your Voting Power above $minimum_voting_power_required_for_prize_eligibility "; print "(so that you are eligible for prizes), you will likely sacrifice the Quality of your nectar in the process! "; print "You will have focused on Quantity instead of Quality of your Critiques. The best flowers are those that "; print "finally bloom with the Best Nectar! A flower that blooms with Sour Nectar will NOT attract Butterflies (Prizes). "; print "Who cares if it takes you nearly the entire month to bloom? That you finally DO bloom is what matters.

"; } print ""; $result2 = mysqli_query($con,"select u_id, u_fullname, cm_poem_critiquing_points as pts, cm_num_diff_poets as num, cm_critiquer_rating, cm_prize_eligibility, cm_voting_power, cm_poem_critiquing_points, cm_poems_critiqued, cm_num_diff_poets from users, critiquers_monthly where u_id = cm_critiquer_id and cm_date = '$display_year_month' and u_account_locked = '' and cm_historical_order <> '' order by cm_historical_order, cm_critiquer_rating desc "); if (!mysqli_num_rows($result2)) { $result2a = mysqli_query($con,"select u_id, u_fullname, cm_poem_critiquing_points as pts, cm_num_diff_poets as num, cm_critiquer_rating, cm_prize_eligibility, cm_voting_power, cm_poem_critiquing_points, cm_poems_critiqued, cm_num_diff_poets from users, critiquers_monthly where u_id = cm_critiquer_id and cm_date = '$display_year_month' and u_account_locked = '' and cm_voting_power >= $minimum_voting_power_required_for_prize_eligibility and cm_poems_critiqued > 0 order by cm_critiquer_rating desc, cm_voting_power desc, cm_poem_critiquing_points desc "); $result2b = mysqli_query($con,"select u_id, u_fullname, cm_poem_critiquing_points as pts, cm_num_diff_poets as num, cm_critiquer_rating, cm_prize_eligibility, cm_voting_power, cm_poem_critiquing_points, cm_poems_critiqued, cm_num_diff_poets from users, critiquers_monthly where u_id = cm_critiquer_id and cm_date = '$display_year_month' and u_account_locked = '' and cm_voting_power < $minimum_voting_power_required_for_prize_eligibility and cm_poems_critiqued > 0 order by cm_voting_power desc, cm_critiquer_rating desc, cm_poem_critiquing_points desc "); } if ($row2 = mysqli_fetch_array($result2)) 1; else if ($row2 = mysqli_fetch_array($result2a)) 1; else if ($row2 = mysqli_fetch_array($result2b)) 1; if ($row2) { print ""; print ""; $counter = 0; do { $counter++; $critiquer_id = $row2["u_id"]; $fullname = $row2["u_fullname"]; $rating = $row2["cm_critiquer_rating"]; $prize_eligibility = $row2["cm_prize_eligibility"]; $voting_power = $row2["cm_voting_power"]; $points = $row2["cm_poem_critiquing_points"]; $num_critiqued = $row2["cm_poems_critiqued"]; $num_diff_poets_critiqued = $row2["cm_num_diff_poets"]; print ""; if ($row2 = mysqli_fetch_array($result2)) 1; if (!mysqli_num_rows($result2)) { if ($row2 = mysqli_fetch_array($result2a)) 1; else if ($row2 = mysqli_fetch_array($result2b)) 1; } } while($row2); print "
"; print "Prize
Award
"; print "
"; print "Critiquer
Rank
"; print "
"; print "Critiquer Name"; print ""; print "Critique
Points
"; print "
"; print "Poems
Critiqued
"; print "
"; print "Num of Diff
Poets Critiqued
"; print "
"; print "Critiquer
Rating
"; print "
"; print "Prize
Eligibility
"; print "
"; print "End Of Month
Voting Power
"; print "
"; print "$critiquer_prize[$counter]"; print ""; print "$counter"; print ""; print "$fullname"; print ""; print "$points"; print ""; print "$num_critiqued"; print ""; print "$num_diff_poets_critiqued"; if ($prize_eligibility == "Y") { print ""; print "$rating"; } else { print ""; print "$rating"; } if ($prize_eligibility == "Y") { print ""; print "$prize_eligibility"; } else { print ""; print "$prize_eligibility"; } if ($voting_power > 0) { print ""; print "$voting_power"; } else { print ""; print "$voting_power"; } print "
"; print "

"; # print "Total Critiquers Listed for $judgemonth $judgeyear: $counter

"; } else { print "Sorry, no critiquers meet the requirements for $judgemonth $judgeyear at this time!

"; } if ($current_year_month == $display_year_month) { print "You must have a Critiquer Rating of at least $least_acceptable_critiquer_rating to have Voting Power above 0. "; print "If your Voting Power is at least $minimum_voting_power_required_for_prize_eligibility you will be eligible for the Critiquer "; print "Prizes at month end. This list is sorted two different ways. For those Eligible for Prizes, the list is sorted by "; print "Critiquer Rating, then Voting Power. For those NOT Eligible for Prizes, the list is sorted by Voting Power, then Critiquer Rating. "; print "You gain the most Critiquer Rating by giving Very Careful and accurate Critiques. You gain the most Voting Power by "; print "picking the poems at the TOP of the Critiquing list.

"; print "It may help to think of yourself as a flower. Your Nectar (Critiquer Rating) is of course the most valuable thing "; print "that you have. If you rush to Bloom too Quickly by raising your Voting Power above $minimum_voting_power_required_for_prize_eligibility "; print "(so that you are eligible for prizes), you will likely sacrifice the Quality of your nectar in the process! "; print "You will have focused on Quantity instead of Quality of your Critiques. The best flowers are those that "; print "finally bloom with the Best Nectar! A flower that blooms with Sour Nectar will NOT attract Butterflies (Prizes). "; print "Who cares if it takes you nearly the entire month to bloom? That you finally DO bloom is what matters.

"; } $countback = 0; $already_displayed_year = ""; do { $show_year = date("Y",mktime(0,0,0,(substr($current_year_month,5,2))- $countback,1,substr($current_year_month,0,4))); $show_month = date("F",mktime(0,0,0,(substr($current_year_month,5,2))- $countback,1,substr($current_year_month,0,4))); $show_year_month = date("Y-m",mktime(0,0,0,(substr($current_year_month,5,2))- $countback,1,substr($current_year_month,0,4))); if ($show_year_month <> $display_year_month && $show_year == $judgeyear) { if ($show_year_month == $current_year_month) { print "Click Here for $show_month $show_year when $total_prize_money will be awarded.
"; } else { print "Click Here for $show_month $show_year when $mprize_amt[$show_year_month] was awarded.
"; } } else if ($show_year <> $judgeyear && $show_year <> $already_displayed_year) { if ($show_year."-01" < $first_statistical_month) $use_this_date = $first_statistical_month; else if ($show_year == substr($current_year_month,0,4)) $use_this_date = $current_year_month; else $use_this_date = $show_year."-01"; print "Click Here for the $show_year Prize Year!
"; $already_displayed_year = $show_year; } $countback++; } while ($show_year_month > $first_statistical_month); include "return_tag.html"; include "archives_bottom.html"; include "return_tag.html"; ?>