Skip to content

Commit

Permalink
Fixed Update Bug (Deleting of Custom Styles)
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffhumphrey committed Sep 1, 2015
1 parent 06b2f68 commit 7e7d0d0
Show file tree
Hide file tree
Showing 28 changed files with 2,763 additions and 1,607 deletions.
3 changes: 2 additions & 1 deletion admin/default.admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ function toggleChecked(status) {
<div class="error">There is a known issue with printing from the Firefox browser. To print all pages properly, RIGHT CLICK on the print link and choose "Open Link in New Tab." Then, use Firefox's native printing function (Edit > Print) to print your documents. Be aware that you should use the browser's File > Page Setup... function to specify portrait or landscape, margins, etc.</div>
<?php } ?>
<?php
if (($totalRows_log > 0) && ($_SESSION['prefsStyleSet'] == "BJCP2008") && ($_SESSION['userLevel'] == 0)) {
if (($totalRows_log > 0) && ($_SESSION['prefsStyleSet'] == "BJCP2008") && ($_SESSION['userLevel'] == 0)) {

include(DB.'admin_judging_tables.db.php');

$query_flights = sprintf("SELECT id FROM %s", $judging_flights_db_table);
Expand Down
218 changes: 109 additions & 109 deletions includes/db/output_entries_export_winner.db.php

Large diffs are not rendered by default.

278 changes: 139 additions & 139 deletions includes/db/output_labels_awards.db.php

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions includes/db/styles.db.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
}

else $styleSet = $_SESSION['prefsStyleSet'];
$query_styles = sprintf("SELECT * FROM %s WHERE brewStyleVersion='%s'",$styles_db_table,$styleSet);
$query_styles = sprintf("SELECT * FROM %s WHERE (brewStyleVersion='%s' OR brewStyleOwn='custom')",$styles_db_table,$styleSet);
if ($view != "default") {
$explodies = explode("-",$view);
$query_styles .= sprintf(" AND brewStyleGroup='%s' AND brewStyleNum='%s'",$explodies[0],$explodies[1]);
Expand All @@ -31,7 +31,7 @@
$totalRows_styles = mysql_num_rows($styles);

if ($section != "list") {
$query_styles2 = sprintf("SELECT * FROM %s WHERE brewStyleVersion='%s'",$styles_db_table,$_SESSION['prefsStyleSet']);
$query_styles2 = sprintf("SELECT * FROM %s WHERE (brewStyleVersion='%s' OR brewStyleOwn='custom')",$styles_db_table,$_SESSION['prefsStyleSet']);
if (($section == "judge") && ($go == "judge")) $query_styles2 .= " AND brewStyleActive='Y' ORDER BY brewStyleGroup,brewStyleNum";
elseif ($section == "brew") $query_styles2 .= " AND brewStyleActive='Y' AND brewStyleGroup > '28' AND brewStyleReqSpec = '1'";
else $query_styles2 .= " AND brewStyleActive='Y' ORDER BY brewStyleGroup,brewStyleNum";
Expand Down
4 changes: 2 additions & 2 deletions includes/process/process_brewing.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@

// Get style name from broken parts
mysql_select_db($database, $brewing);
$query_style_name = sprintf("SELECT * FROM %s WHERE brewStyleVersion='%s' AND brewStyleGroup='%s' AND brewStyleNum='%s'",$styles_db_table, $_SESSION['prefsStyleSet'],$styleFix,$style[1]);
$query_style_name = sprintf("SELECT * FROM %s WHERE (brewStyleVersion='%s' OR brewStyleOwn='custom') AND brewStyleGroup='%s' AND brewStyleNum='%s'",$styles_db_table, $_SESSION['prefsStyleSet'],$styleFix,$style[1]);
$style_name = mysql_query($query_style_name, $brewing) or die(mysql_error());
$row_style_name = mysql_fetch_assoc($style_name);

Expand Down Expand Up @@ -508,7 +508,7 @@
else $styleFix = $style[0];

// Get style name from broken parts
$query_style_name = sprintf("SELECT * FROM %s WHERE brewStyleVersion='%s' AND brewStyleGroup='%s' AND brewStyleNum='%s'",$styles_db_table,$_SESSION['prefsStyleSet'],$styleFix,$style[1]);
$query_style_name = sprintf("SELECT * FROM %s WHERE (brewStyleVersion='%s' OR brewStyleOwn='custom') AND brewStyleGroup='%s' AND brewStyleNum='%s'",$styles_db_table,$_SESSION['prefsStyleSet'],$styleFix,$style[1]);
$style_name = mysql_query($query_style_name, $brewing) or die(mysql_error());
$row_style_name = mysql_fetch_assoc($style_name);
$check = $row_style_name['brewStyleOwn'];
Expand Down
4 changes: 2 additions & 2 deletions includes/process/process_judging_flight_check.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
if (in_array($row_check_received['id'],$empty_array)) {

// First, get the id of the entry's style category/subcategory
$query_style = sprintf("SELECT id FROM %s WHERE brewStyleVersion='%s' AND brewStyleGroup='%s' AND brewStyleNum='%s'",$styles_db_table,$_SESSION['prefsStyleSet'],$row_check_received['brewCategorySort'],$row_check_received['brewSubCategory']);
$query_style = sprintf("SELECT id FROM %s WHERE (brewStyleVersion='%s' OR brewStyleOwn='custom') AND brewStyleGroup='%s' AND brewStyleNum='%s'",$styles_db_table,$_SESSION['prefsStyleSet'],$row_check_received['brewCategorySort'],$row_check_received['brewSubCategory']);
$style = mysql_query($query_style, $brewing) or die(mysql_error());
$row_style = mysql_fetch_assoc($style);
//echo $query_style."<br>";
Expand Down Expand Up @@ -74,7 +74,7 @@
if (!in_array($row_check_received['id'],$flight_array)) {

// First, get the id of the entry's style category/subcategory
$query_style = sprintf("SELECT id FROM %s WHERE brewStyleVersion='%s' AND brewStyleGroup='%s' AND brewStyleNum='%s'",$styles_db_table,$_SESSION['prefsStyleSet'],$row_check_received['brewCategorySort'],$row_check_received['brewSubCategory']);
$query_style = sprintf("SELECT id FROM %s WHERE (brewStyleVersion='%s' OR brewStyleOwn='custom') AND brewStyleGroup='%s' AND brewStyleNum='%s'",$styles_db_table,$_SESSION['prefsStyleSet'],$row_check_received['brewCategorySort'],$row_check_received['brewSubCategory']);
$style = mysql_query($query_style, $brewing) or die(mysql_error());
$row_style = mysql_fetch_assoc($style);
//echo $query_style."<br>";
Expand Down
4 changes: 2 additions & 2 deletions includes/process/process_judging_tables.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
$row_table_style = mysql_fetch_assoc($table_style);
//echo $query_table_style."<br>";

$query_style = sprintf("SELECT id FROM %s WHERE brewStyleVersion='%s' AND brewStyleGroup='%s' AND brewStyleNum='%s'",$styles_db_table,$_SESSION['prefsStyleSet'],$row_entry['brewCategorySort'],$row_entry['brewSubCategory']);
$query_style = sprintf("SELECT id FROM %s WHERE (brewStyleVersion='%s' OR brewStyleOwn='custom') AND brewStyleGroup='%s' AND brewStyleNum='%s'",$styles_db_table,$_SESSION['prefsStyleSet'],$row_entry['brewCategorySort'],$row_entry['brewSubCategory']);
$style = mysql_query($query_style, $brewing) or die(mysql_error());
$row_style = mysql_fetch_assoc($style);
//echo $query_style."<br>";
Expand Down Expand Up @@ -293,7 +293,7 @@

//echo $query_entry."<br>";

$query_style = sprintf("SELECT id FROM $styles_db_table WHERE brewStyleVersion='%s' AND brewStyleGroup='%s' AND brewStyleNum='%s'", $styles_db_table,$_SESSION['prefsStyleSet'],$row_entry['brewCategorySort'],$row_entry['brewSubCategory']);
$query_style = sprintf("SELECT id FROM $styles_db_table WHERE (brewStyleVersion='%s' OR brewStyleOwn='custom') AND brewStyleGroup='%s' AND brewStyleNum='%s'", $styles_db_table,$_SESSION['prefsStyleSet'],$row_entry['brewCategorySort'],$row_entry['brewSubCategory']);
$style = mysql_query($query_style, $brewing) or die(mysql_error());
$row_style = mysql_fetch_assoc($style);

Expand Down
2 changes: 1 addition & 1 deletion includes/process/process_styles.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
if ($_SESSION['prefsStyleSet'] == "BJCP2008") $category_end = 28;
if ($_SESSION['prefsStyleSet'] == "BJCP2015") $category_end = 34;
mysql_select_db($database, $brewing);
$query_style_name = sprintf("SELECT brewStyleGroup FROM %s WHERE brewStyleVersion='%s' AND brewStyleGroup >= %s ORDER BY id DESC LIMIT 1", $styles_db_table, $_SESSION['prefsStyleSet'], $category_end);
$query_style_name = sprintf("SELECT brewStyleGroup FROM %s WHERE (brewStyleVersion='%s' OR brewStyleOwn='custom') AND brewStyleGroup >= %s ORDER BY id DESC LIMIT 1", $styles_db_table, $_SESSION['prefsStyleSet'], $category_end);
$style_name = mysql_query($query_style_name, $brewing) or die(mysql_error());
$row_style_name = mysql_fetch_assoc($style_name);

Expand Down
33 changes: 16 additions & 17 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,24 +135,23 @@
<?php

if (TESTING) {
echo $_SERVER['HTTP_USER_AGENT'];
if ($fx) echo "FIREFOX Detected";
print_r($_SESSION);
echo $tz; echo "<br>".$timezone_offset; echo "<br>".$_SESSION['prefsTimeZone']; echo "<br>".date('T');
echo "User Agent: ".$_SERVER['HTTP_USER_AGENT']."<br>";
if ($fx) echo "FIREFOX Detected<br>";

echo $section."<br>";
echo "User: ".$query_user."<br>";
echo "Brewer: ".$query_brewer."<br>";
echo "Name: ".$query_name."<br>";
echo "Prefs: ".$query_prefs."<br>";
echo "Comp Info: ".$row_contest_info."<br>";
echo "Tables: ".$query_tables."<br>";
echo $entry_window_open."<br>";
echo $registration_open."<br>";
echo judging_date_return()."<br>";
echo $remaining_entries."<br>";
echo $today."<br>";
echo $_SESSION['dataCheck'.$prefix_session]."<br>";
echo "Time Zone Name: ".$tz."<br>";
echo "Time Zone: ".date('T')."<br>";
echo "Time Zone Offset: ".$timezone_offset."<br>";
echo "Time Zone Preferences: ".$_SESSION['prefsTimeZone']."<br>";
echo "<p>";
echo "Section: ".$section."<br>";
echo "Entry Window Status: ".$entry_window_open."<br>";
echo "Registration Status: ".$registration_open."<br>";
echo "Judging Status: ".judging_date_return()."<br>";
echo "Remaining Entries: ".$remaining_entries."<br>";
echo "</p>";
echo "<p>Session Variables: ";
print_r($_SESSION);
echo "</p>";
}

if ($section != "admin") { ?>
Expand Down
4 changes: 2 additions & 2 deletions lib/admin.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ function table_score_data($eid,$score_table,$suffix) {
$row_entries = mysql_fetch_assoc($entries);
$style = $row_entries['brewCategorySort'].$row_entries['brewSubCategory'];

$query_styles = sprintf("SELECT brewStyle FROM %s WHERE brewStyleVersion='%s' AND brewStyleGroup='%s' AND brewStyleNum='%s'", $prefix."styles",$_SESSION['prefsStyleSet'],$row_entries['brewCategorySort'],$row_entries['brewSubCategory']);
$query_styles = sprintf("SELECT brewStyle FROM %s WHERE (brewStyleVersion='%s' OR brewStyleOwn='custom') AND brewStyleGroup='%s' AND brewStyleNum='%s'", $prefix."styles",$_SESSION['prefsStyleSet'],$row_entries['brewCategorySort'],$row_entries['brewSubCategory']);
$styles = mysql_query($query_styles, $brewing) or die(mysql_error());
$row_styles = mysql_fetch_assoc($styles);

Expand Down Expand Up @@ -732,7 +732,7 @@ function received_entries() {
mysql_select_db($database, $brewing);
$style_array = array();

$query_styles = sprintf("SELECT brewStyle FROM %s WHERE brewStyleVersion='%s'", $prefix."styles",$_SESSION['prefsStyleSet']);
$query_styles = sprintf("SELECT brewStyle FROM %s WHERE (brewStyleVersion='%s' OR brewStyleOwn='custom')", $prefix."styles",$_SESSION['prefsStyleSet']);
$styles = mysql_query($query_styles, $brewing) or die(mysql_error());
$row_styles = mysql_fetch_array($styles);

Expand Down
22 changes: 11 additions & 11 deletions lib/common.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1367,7 +1367,7 @@ function style_convert($number,$type,$base_url="") {
$styles_db_table = $prefix."styles";

mysql_select_db($database, $brewing);
$query_style = sprintf("SELECT brewStyleNum,brewStyleGroup,brewStyle,brewStyleVersion,brewStyleReqSpec FROM %s WHERE brewStyleGroup='%s' AND brewStyleVersion='%s'",$styles_db_table,$number,$_SESSION['prefsStyleSet']);
$query_style = sprintf("SELECT brewStyleNum,brewStyleGroup,brewStyle,brewStyleVersion,brewStyleReqSpec FROM %s WHERE brewStyleGroup='%s' AND (brewStyleVersion='%s' OR brewStyleOwn='custom')",$styles_db_table,$number,$_SESSION['prefsStyleSet']);
$style = mysql_query($query_style, $brewing) or die(mysql_error());
$row_style = mysql_fetch_assoc($style);

Expand Down Expand Up @@ -1672,7 +1672,7 @@ function style_convert($number,$type,$base_url="") {
//
case "9":
$number = explode("^",$number);
$query_style = sprintf("SELECT brewStyleNum,brewStyleGroup,brewStyle,brewStyleVersion,brewStyleReqSpec,brewStyleStrength,brewStyleCarb,brewStyleSweet FROM %s WHERE brewStyleGroup='%s' AND brewStyleNum='%s' AND brewStyleVersion='%s'",$styles_db_table,$number[0],$number[1],$_SESSION['prefsStyleSet']);
$query_style = sprintf("SELECT brewStyleNum,brewStyleGroup,brewStyle,brewStyleVersion,brewStyleReqSpec,brewStyleStrength,brewStyleCarb,brewStyleSweet FROM %s WHERE brewStyleGroup='%s' AND brewStyleNum='%s' AND (brewStyleVersion='%s' OR brewStyleOwn='custom')",$styles_db_table,$number[0],$number[1],$_SESSION['prefsStyleSet']);
$style = mysql_query($query_style, $brewing) or die(mysql_error());
$row_style = mysql_fetch_assoc($style);
$style_convert = $row_style['brewStyleGroup']."^".$row_style['brewStyleNum']."^".$row_style['brewStyle']."^".$row_style['brewStyleVersion']."^".$row_style['brewStyleReqSpec']."^".$row_style['brewStyleStrength']."^".$row_style['brewStyleCarb']."^".$row_style['brewStyleSweet'];
Expand Down Expand Up @@ -1855,7 +1855,7 @@ function get_table_info($input,$method,$id,$dbTable,$param) {
$input = explode("^",$input);

/*
$query_style = sprintf("SELECT brewStyleNum,brewStyleGroup FROM $styles_db_table WHERE brewStyleNum='%s' AND brewStyleGroup='%s' AND brewStyleVersion='%s'",$input[0],$input[1],$_SESSION['prefsStyleSet']);
$query_style = sprintf("SELECT brewStyleNum,brewStyleGroup FROM $styles_db_table WHERE brewStyleNum='%s' AND brewStyleGroup='%s' AND (brewStyleVersion='%s' OR brewStyleOwn='custom'))",$input[0],$input[1],$_SESSION['prefsStyleSet']);
$style = mysql_query($query_style, $brewing) or die(mysql_error());
$row_style = mysql_fetch_assoc($style);
echo $query_style."<br>";
Expand Down Expand Up @@ -2332,7 +2332,7 @@ function winner_check($id,$judging_scores_db_table,$judging_tables_db_table,$bre
$entry = mysql_query($query_entry, $brewing) or die(mysql_error());
$row_entry = mysql_fetch_assoc($entry);

$query_style = sprintf("SELECT brewStyle FROM %s WHERE brewStyleVersion='%s' AND brewStyleGroup='%s' AND brewStyleNum='%s'", $prefix."styles", $_SESSION['prefsStyleSet'], $row_entry['brewCategorySort'],$row_entry['brewSubCategory']);
$query_style = sprintf("SELECT brewStyle FROM %s WHERE (brewStyleVersion='%s' OR brewStyleOwn='custom') AND brewStyleGroup='%s' AND brewStyleNum='%s'", $prefix."styles", $_SESSION['prefsStyleSet'], $row_entry['brewCategorySort'],$row_entry['brewSubCategory']);
$style = mysql_query($query_style, $brewing) or die(mysql_error());
$row_style = mysql_fetch_assoc($style);

Expand Down Expand Up @@ -3003,7 +3003,7 @@ function limit_subcategory($style,$pref_num,$pref_exception_sub_num,$pref_except
if ($style_break[0] <= 9) $style_num = "0".$style_break[0];
else $style_num = $style_break[0];

$query_style = sprintf("SELECT id FROM %s WHERE brewStyleVersion='%s' AND brewStyleGroup='%s' AND brewStyleNum='%s'",$prefix."styles",$_SESSION['prefsStyleSet'],$style_num,$style_break[1]);
$query_style = sprintf("SELECT id FROM %s WHERE (brewStyleVersion='%s' OR brewStyleOwn='custom') AND brewStyleGroup='%s' AND brewStyleNum='%s'",$prefix."styles",$_SESSION['prefsStyleSet'],$style_num,$style_break[1]);
$style = mysql_query($query_style, $brewing) or die(mysql_error());
$row_style = mysql_fetch_assoc($style);

Expand Down Expand Up @@ -3037,7 +3037,7 @@ function highlight_required($msg,$method,$version) {

if ($method == "0") { // mead cider sweetness

$query_check = sprintf("SELECT brewStyleSweet FROM %s WHERE brewStyleVersion='%s' AND brewStyleGroup='%s' AND brewStyleNum='%s'", $prefix."styles",$version,$explodies[1],$explodies[2]);
$query_check = sprintf("SELECT brewStyleSweet FROM %s WHERE (brewStyleVersion='%s' OR brewStyleOwn='custom') AND brewStyleGroup='%s' AND brewStyleNum='%s'", $prefix."styles",$version,$explodies[1],$explodies[2]);
$check = mysql_query($query_check, $brewing) or die(mysql_error());
$row_check = mysql_fetch_assoc($check);
$totalRows_check = mysql_num_rows($check);
Expand All @@ -3050,7 +3050,7 @@ function highlight_required($msg,$method,$version) {

if ($method == "1") { // special ingredients REQUIRED beer/mead/cider

$query_check = sprintf("SELECT brewStyleReqSpec FROM %s WHERE brewStyleVersion='%s' AND brewStyleGroup='%s' AND brewStyleNum='%s'", $prefix."styles",$version,$explodies[1],$explodies[2]);
$query_check = sprintf("SELECT brewStyleReqSpec FROM %s WHERE (brewStyleVersion='%s' OR brewStyleOwn='custom') AND brewStyleGroup='%s' AND brewStyleNum='%s'", $prefix."styles",$version,$explodies[1],$explodies[2]);
$check = mysql_query($query_check, $brewing) or die(mysql_error());
$row_check = mysql_fetch_assoc($check);

Expand All @@ -3061,7 +3061,7 @@ function highlight_required($msg,$method,$version) {

if ($method == "2") { // mead cider carb

$query_check = sprintf("SELECT brewStyleCarb FROM %s WHERE brewStyleVersion='%s' AND brewStyleGroup='%s' AND brewStyleNum='%s'", $prefix."styles",$version,$explodies[1],$explodies[2]);
$query_check = sprintf("SELECT brewStyleCarb FROM %s WHERE (brewStyleVersion='%s' OR brewStyleOwn='custom') AND brewStyleGroup='%s' AND brewStyleNum='%s'", $prefix."styles",$version,$explodies[1],$explodies[2]);
$check = mysql_query($query_check, $brewing) or die(mysql_error());
$row_check = mysql_fetch_assoc($check);

Expand All @@ -3072,7 +3072,7 @@ function highlight_required($msg,$method,$version) {

if ($method == "3") { // mead strength

$query_check = sprintf("SELECT brewStyleStrength FROM %s WHERE brewStyleVersion='%s' AND brewStyleGroup='%s' AND brewStyleNum='%s'", $prefix."styles",$version,$explodies[1],$explodies[2]);
$query_check = sprintf("SELECT brewStyleStrength FROM %s WHERE (brewStyleVersion='%s' OR brewStyleOwn='custom') AND brewStyleGroup='%s' AND brewStyleNum='%s'", $prefix."styles",$version,$explodies[1],$explodies[2]);
$check = mysql_query($query_check, $brewing) or die(mysql_error());
$row_check = mysql_fetch_assoc($check);

Expand Down Expand Up @@ -3149,7 +3149,7 @@ function styles_active($method) {

if ($method == 0) { // Active Styles

$query_styles = sprintf("SELECT brewStyleGroup FROM %s WHERE brewStyleVersion='%s' AND brewStyleActive='Y' ORDER BY brewStyleGroup ASC",$prefix."styles",$_SESSION['prefsStyleSet']);
$query_styles = sprintf("SELECT brewStyleGroup FROM %s WHERE (brewStyleVersion='%s' OR brewStyleOwn='custom') AND brewStyleActive='Y' ORDER BY brewStyleGroup ASC",$prefix."styles",$_SESSION['prefsStyleSet']);
$styles = mysql_query($query_styles, $brewing) or die(mysql_error());
$row_styles = mysql_fetch_assoc($styles);
$totalRows_styles = mysql_num_rows($styles);
Expand All @@ -3171,7 +3171,7 @@ function styles_active($method) {

if ($method == 2) {

$query_styles = sprintf("SELECT brewStyleGroup,brewStyleNum,brewStyle FROM %s WHERE brewStyleVersion='%s' AND brewStyleActive='Y' ORDER BY brewStyleGroup,brewStyleNum ASC",$prefix."styles",$_SESSION['prefsStyleSet']);
$query_styles = sprintf("SELECT brewStyleGroup,brewStyleNum,brewStyle FROM %s WHERE (brewStyleVersion='%s' OR brewStyleOwn='custom') AND brewStyleActive='Y' ORDER BY brewStyleGroup,brewStyleNum ASC",$prefix."styles",$_SESSION['prefsStyleSet']);
$styles = mysql_query($query_styles, $brewing) or die(mysql_error());
$row_styles = mysql_fetch_assoc($styles);
$totalRows_styles = mysql_num_rows($styles);
Expand Down
4 changes: 2 additions & 2 deletions lib/process.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ function check_carb_sweetness($style,$styleSet) {
if (preg_match("/^[[:digit:]]+$/",$style[0])) $style_0 = sprintf('%02d',$style[0]);
else $style_0 = $style[0];

$query_brews = sprintf("SELECT brewStyleCarb,brewStyleSweet FROM %s WHERE brewStyleGroup = '%s' AND brewStyleNum = '%s' AND brewStyleVersion='%s'", $prefix."styles", $style_0, $style[1], $styleSet);
$query_brews = sprintf("SELECT brewStyleCarb,brewStyleSweet FROM %s WHERE brewStyleGroup = '%s' AND brewStyleNum = '%s' AND (brewStyleVersion='%s' OR brewStyleOwn='custom')", $prefix."styles", $style_0, $style[1], $styleSet);
$brews = mysql_query($query_brews, $brewing) or die(mysql_error());
$row_brews = mysql_fetch_assoc($brews);

Expand All @@ -222,7 +222,7 @@ function check_mead_strength($style,$styleSet) {
if (preg_match("/^[[:digit:]]+$/",$style[0])) $style_0 = sprintf('%02d',$style[0]);
else $style_0 = $style[0];

$query_brews = sprintf("SELECT brewStyleStrength FROM %s WHERE brewStyleGroup = '%s' AND brewStyleNum = '%s' AND brewStyleVersion='%s'", $prefix."styles", $style_0, $style[1], $styleSet);
$query_brews = sprintf("SELECT brewStyleStrength FROM %s WHERE brewStyleGroup = '%s' AND brewStyleNum = '%s' AND (brewStyleVersion='%s' OR brewStyleOwn='custom')", $prefix."styles", $style_0, $style[1], $styleSet);
$brews = mysql_query($query_brews, $brewing) or die(mysql_error());
$row_brews = mysql_fetch_assoc($brews);

Expand Down
Loading

0 comments on commit 7e7d0d0

Please sign in to comment.