First post-beta fixes.

This commit is contained in:
Geoff Humphrey
2010-11-04 15:12:33 +00:00
parent 7705310aa7
commit 4b8c8e762f
10 changed files with 98 additions and 72 deletions

View File

@@ -1222,18 +1222,24 @@ if (($action == "edit") && ($dbTable == "brewing")) {
if (($action == "update") && (($dbTable == "brewing") || ($dbTable == "recipes"))) {
function get_hop_type($time) {
if ($time > 30) $type = "Bittering";
if (($time <= 30) && ($time >= 15)) $type = "Flavor";
if (($time < 15) && ($time >= 0)) $type = "Aroma";
if ($time != "") {
if ($time > 30) $type = "Bittering";
if (($time <= 30) && ($time >= 15)) $type = "Flavor";
if (($time < 15) && ($time >= 0)) $type = "Aroma";
}
else $type = "";
return $type;
}
function get_hop_use($time,$boil_time) {
if ($boil_time == "") $boil_time = 60;
if ($time > $boil_time) $use = "First Wort";
if (($time <= $boil_time) && ($time > 15)) $use = "Boil";
if (($time <= 15) && ($time > 0)) $use = "Aroma";
if ($time <= 0) $use = "Dry Hop";
if ($time != "") {
if ($boil_time == "") $boil_time = 60;
if ($time > $boil_time) $use = "First Wort";
if (($time <= $boil_time) && ($time > 15)) $use = "Boil";
if (($time <= 15) && ($time > 0)) $use = "Aroma";
if ($time <= 0) $use = "Dry Hop";
}
else $use = "";
return $use;
}
$brewBitterness = explode("-", $_POST['brewBitterness']);

View File

@@ -200,11 +200,12 @@ class InputBeerXML {
$fields .= "," . $field;
$values .= ",'" . $value . "'";
}
$fields .= ", brewArchive";
$fields .= ")";
$values .= ", 'N'";
$values .= ")";
$sqlQuery .= $fields . $values;
// echo $sqlQuery . "<br />";
echo $sqlQuery . "<br />";
mysql_select_db($GLOBALS['database_brewing'], $brewing) or die(mysql_error());
$Result1 = mysql_query($sqlQuery, $brewing) or die(mysql_error());
@@ -391,7 +392,9 @@ class InputBeerXML {
$values .= ",'" . $value . "'";
}
$fields .= ", brewArchive";
$fields .= ")";
$values .= ", 'N'";
$values .= ")";
$sqlQuery .= $fields . $values;
//echo $sqlQuery . "<br />";

View File

@@ -1182,12 +1182,15 @@ $xml_output .= "<RECIPES>\n";
$xml_output .= "\t</RECIPE>\n";
$xml_output .= "</RECIPES>\n";
# This line will stream the file to the user rather than spray it across the screen
$nospace = str_replace(" ", "", $row_log['brewName'] );
$nospace = strtr($nospace, $html_remove);
header("Content-Type: application/force-download");
header("Content-Disposition: attachment; filename=".$nospace.".xml");
header("Pragma: no-cache");
header("Expires: 0");
echo $xml_output;
exit();
?>

View File

@@ -19,7 +19,7 @@
</div>
<?php } else { ?>
<?php if ($totalRows_featured > 0) { if (($row_pref['mode'] == "1") || (($row_pref['mode'] == "2") && ($filter == "all"))) include ('featured.inc.php'); } ?>
<?php if ($totalRows_featured > 0) { if (($row_pref['mode'] == "1") || (($row_pref['mode'] == "2") && ($filter == "all"))) { ?><div class="headerContentAdmin">All <?php echo $dbName; ?></div><?php } } ?>
<?php if ($totalRows_featured > 0) { if (($row_pref['mode'] == "1") || (($row_pref['mode'] == "2") && ($filter == "all"))) { ?><div class="headerContentAdmin">All <?php echo $dbName; ?></div><?php } } ?>
<table class="dataTable">
<tr>
<?php if ($style != "all") { ?>

View File

@@ -23,7 +23,7 @@
$query_styles = sprintf("SELECT * FROM styles WHERE brewStyle='%s'", $row_featured['brewStyle']);
$styles = mysql_query($query_styles, $brewing) or die(mysql_error());
$row_styles = mysql_fetch_assoc($styles);
$totalRows_styles = mysql_num_rows($styles);
$totalRows_styles = mysql_num_rows($styles);
// Get real user names
mysql_select_db($database_brewing, $brewing);

View File

@@ -1,55 +1,55 @@
<?php if ($page != "news") { ?>
<div id="<?php if (($page == "brewBlogCurrent") || ($page == "brewBlogDetail") || ($page == "recipeDetail") || ($page == "about")) echo "subtitle"; else echo "subtitleWide"; ?>"><div id="icon"><img src="<?php echo $imageSrc."newspaper.png"; ?>" align="baseline"></div>Club News/Announcements</div>
<?php } ?>
<?php // echo $totalRows_newsGen; ?>
<?php if ($page == "news") { ?>
<table class="dataTable">
<?php if ($totalRows_newsGen > 5) { ?>
<tr>
<td width="90%">&nbsp;</td>
<td width="10%" class="text_9">Limit View To&nbsp;
<?php if (($totalRows_newsGen >= 5) && ($totalRows_newsGen < 15)) { ?><a href="index.php?page=news&sort=<?php echo $sort; ?>&dir=<?php echo $dir; ?>&view=5">5</a>&nbsp;<?php } ?>
<?php if (($totalRows_newsGen >= 15) && ($totalRows_newsGen < 25)) { ?><a href="index.php?page=news&sort=<?php echo $sort; ?>&dir=<?php echo $dir; ?>&view=15">15</a>&nbsp;<?php } ?>
<?php if ($totalRows_newsGen >= 25) { ?><a href="index.php?page=news&sort=<?php echo $sort; ?>&dir=<?php echo $dir; ?>&view=25">25</a>&nbsp;<?php } ?>
News Items</td>
</tr>
<?php } ?>
<?php if (($view != "all") && ($totalRows_newsGen > $view)) { ?>
<tr>
<td width="90%">&nbsp;</td>
<td width="10%" class="text_9 right"><a href="index.php?page=news&sort=<?php echo $sort; ?>&dir=<?php echo $dir; ?>&view=all">All News &gt;&gt;</a></td>
</tr>
<?php } ?>
</table>
<?php } ?>
<table class="dataTable" style="margin-bottom: 15px;">
<tr>
<td class="dataLeft">Members, <?php if ((isset($_SESSION["loginUsername"])) && ($totalRows_newsGen > 0)) { ?><a href="admin/index.php?action=view&dbTable=news">click here</a><?php } else { ?><a href="index.php?page=login">login</a><?php } ?> to view club-only news.</td>
</tr>
</table>
<?php do { ?>
<?php if ($row_news['newsPrivate'] == "Y") { ?>
<div id="headerContent<?php if ($page == "news") echo "Admin"; ?>"><?php echo $row_news['newsHeadline']; ?></div>
<table class="dataTable" style="margin-bottom: 15px;">
<tr>
<td>&nbsp;</td>
<td class="text_9 right bknd_ultra_lt" width="10%" nowrap="nowrap">&nbsp;Posted <?php $date = $row_news['newsDate']; $realdate = dateconvert($date,2); echo $realdate; ?> by <?php echo $row_news['newsPoster']; ?>&nbsp;</td>
</tr>
<tr>
<td colspan="2" style="padding-top: 5px;"><?php if ($page == "news") echo $row_news['newsText']; else { $str = $row_news['newsText']; echo Truncate5($str); } ?></td>
</tr>
<?php if ($page != "news") { ?>
<tr>
<td colspan="2" style="padding-top: 5px;" class="text_9"><div align="right"><a href="index.php?page=news&sort=newsDate&dir=DESC&view=5">Read the Entire Post &gt;&gt;</a></div></td>
</tr>
<?php } ?>
</table>
<?php } } while ($row_news = mysql_fetch_assoc($news));
if (($totalRows_newsGen > 2) && ($page != "news")) { ?>
<table class="dataTable">
<tr>
<td width="90%">&nbsp;</td>
<td width="10%" class="text_9"><a href="index.php?page=news&sort=newsDate&dir=DESC&view=5">More News &gt;&gt;</a></td>
</tr>
</table>
<?php if ($page != "news") { ?>
<div id="<?php if (($page == "brewBlogCurrent") || ($page == "brewBlogDetail") || ($page == "recipeDetail") || ($page == "about")) echo "subtitle"; else echo "subtitleWide"; ?>"><div id="icon"><img src="<?php echo $imageSrc."newspaper.png"; ?>" align="baseline"></div>Club News/Announcements</div>
<?php } ?>
<?php // echo $totalRows_newsGen; ?>
<?php if ($page == "news") { ?>
<table class="dataTable">
<?php if ($totalRows_newsGen > 5) { ?>
<tr>
<td width="90%">&nbsp;</td>
<td width="10%" class="text_9">Limit View To&nbsp;
<?php if (($totalRows_newsGen >= 5) && ($totalRows_newsGen < 15)) { ?><a href="index.php?page=news&sort=<?php echo $sort; ?>&dir=<?php echo $dir; ?>&view=5">5</a>&nbsp;<?php } ?>
<?php if (($totalRows_newsGen >= 15) && ($totalRows_newsGen < 25)) { ?><a href="index.php?page=news&sort=<?php echo $sort; ?>&dir=<?php echo $dir; ?>&view=15">15</a>&nbsp;<?php } ?>
<?php if ($totalRows_newsGen >= 25) { ?><a href="index.php?page=news&sort=<?php echo $sort; ?>&dir=<?php echo $dir; ?>&view=25">25</a>&nbsp;<?php } ?>
News Items</td>
</tr>
<?php } ?>
<?php if (($view != "all") && ($totalRows_newsGen > $view)) { ?>
<tr>
<td width="90%">&nbsp;</td>
<td width="10%" class="text_9 right"><a href="index.php?page=news&sort=<?php echo $sort; ?>&dir=<?php echo $dir; ?>&view=all">All News &gt;&gt;</a></td>
</tr>
<?php } ?>
</table>
<?php } ?>
<table class="dataTable" style="margin-bottom: 15px;">
<tr>
<td class="dataLeft">Members, <?php if ((isset($_SESSION["loginUsername"])) && ($totalRows_newsGen > 0)) { ?><a href="admin/index.php?action=view&dbTable=news">click here</a><?php } else { ?><a href="index.php?page=login">login</a><?php } ?> to view club-only news.</td>
</tr>
</table>
<?php do { ?>
<?php if ($row_news['newsPrivate'] == "Y") { ?>
<div class="headerContent<?php if ($page == "news") echo "Admin"; ?>"><?php echo $row_news['newsHeadline']; ?></div>
<table class="dataTable" style="margin-bottom: 15px;">
<tr>
<td>&nbsp;</td>
<td class="text_9 right bknd_ultra_lt" width="10%" nowrap="nowrap">&nbsp;Posted <?php $date = $row_news['newsDate']; $realdate = dateconvert($date,2); echo $realdate; ?> by <?php echo $row_news['newsPoster']; ?>&nbsp;</td>
</tr>
<tr>
<td colspan="2" style="padding-top: 5px;"><?php if ($page == "news") echo $row_news['newsText']; else { $str = $row_news['newsText']; echo Truncate5($str); } ?></td>
</tr>
<?php if ($page != "news") { ?>
<tr>
<td colspan="2" style="padding-top: 5px;" class="text_9"><div align="right"><a href="index.php?page=news&sort=newsDate&dir=DESC&view=5">Read the Entire Post &gt;&gt;</a></div></td>
</tr>
<?php } ?>
</table>
<?php } } while ($row_news = mysql_fetch_assoc($news));
if (($totalRows_newsGen > 2) && ($page != "news")) { ?>
<table class="dataTable">
<tr>
<td width="90%">&nbsp;</td>
<td width="10%" class="text_9"><a href="index.php?page=news&sort=newsDate&dir=DESC&view=5">More News &gt;&gt;</a></td>
</tr>
</table>
<?php } ?>

View File

@@ -1,5 +1,5 @@
<?php if ($printBrowser == "IE") { ?>
<a href="#" onClick="window.open(SECTIONS.'print.inc.php?page=logPrint&source=log&dbTable=brewing&brewStyle=<?php echo $row_log['brewStyle']; if ($action == "scale") echo "&action=scale&amt=".$amt; ?>&id=<?php echo $row_log['id']; ?>','','height=600,width=800,toolbar=no,resizable=yes,scrollbars=yes'); return false;" title="Print <?php echo $row_log['brewName']; ?>"><img src="<?php echo $imageSrc. $row_colorChoose['themeName']; ?>/button_print_log_<?php echo $row_colorChoose['themeName']; ?>.png" border="0" alt="Print Log"></a>
<a href="#" onClick="window.open('print.php?page=logPrint&source=log&dbTable=brewing&brewStyle=<?php echo $row_log['brewStyle']; if ($action == "scale") echo "&action=scale&amt=".$amt; ?>&id=<?php echo $row_log['id']; ?>&view=print','','height=600,width=800,toolbar=no,resizable=yes,scrollbars=yes'); return false;" title="Print <?php echo $row_log['brewName']; ?>"><img src="<?php echo $imageSrc. $row_colorChoose['themeName']; ?>/button_print_log_<?php echo $row_colorChoose['themeName']; ?>.png" border="0" alt="Print Log"></a>
<?php } else { ?>
<a href="print.php?page=logPrint&source=log&dbTable=brewing&brewStyle=<?php echo $row_log['brewStyle']; if ($action == "scale") echo "&action=scale&amt=".$amt; ?>&id=<?php echo $row_log['id']; ?>&KeepThis=true&TB_iframe=true&height=450&width=700" title="Print <?php echo $row_log['brewName']; ?>" class="thickbox"><img src="<?php echo $imageSrc. $row_colorChoose['themeName']; ?>/button_print_log_<?php echo $row_colorChoose['themeName']; ?>.png" border="0" alt="Print Log"></a>
<?php } ?>

View File

@@ -1,6 +1,6 @@
<?php if ($printBrowser == "IE") { ?>
<?php if (($page == "brewBlogCurrent") || ($page == "brewBlogDetail")) { ?><a href="#" onClick="window.open(SECTIONS.'print.inc.php?page=recipePrint&brewStyle=<?php echo $row_log['brewStyle']; if ($action == "scale") echo "&action=scale&amt=".$amt; ?>&id=<?php echo $row_log['id']; ?>','','height=600,width=800,toolbar=no,resizable=yes,scrollbars=yes'); return false;" title="Print <?php echo $row_log['brewName']; ?>"><img src="<?php echo $imageSrc. $row_colorChoose['themeName']; ?>/button_print_recipe_<?php echo $row_colorChoose['themeName']; ?>.png" border="0" alt="Print Recipe"></a><?php } ?>
<?php if ($page == "recipeDetail") { ?><a href="#" onClick="window.open(SECTIONS.'print.inc.php?page=recipePrint&source=recipe&dbTable=recipes&brewStyle=<?php echo $row_log['brewStyle']; if ($action == "scale") echo "&action=scale&amt=".$amt; ?>&id=<?php echo $row_log['id']; ?>','','height=600,width=800,toolbar=no,resizable=yes,scrollbars=yes'); return false;" title="Print <?php echo $row_log['brewName']; ?>"><img src="<?php echo $imageSrc. $row_colorChoose['themeName']; ?>/button_print_recipe_<?php echo $row_colorChoose['themeName']; ?>.png" border="0" alt="Print Recipe"></a><?php } ?>
<?php if (($page == "brewBlogCurrent") || ($page == "brewBlogDetail")) { ?><a href="#" onClick="window.open('print.php?page=recipePrint&brewStyle=<?php echo $row_log['brewStyle']; if ($action == "scale") echo "&action=scale&amt=".$amt; ?>&id=<?php echo $row_log['id']; ?>&view=print','','height=600,width=800,toolbar=no,resizable=yes,scrollbars=yes'); return false;" title="Print <?php echo $row_log['brewName']; ?>"><img src="<?php echo $imageSrc. $row_colorChoose['themeName']; ?>/button_print_recipe_<?php echo $row_colorChoose['themeName']; ?>.png" border="0" alt="Print Recipe"></a><?php } ?>
<?php if ($page == "recipeDetail") { ?><a href="#" onClick="window.open('print.php?page=recipePrint&source=recipe&dbTable=recipes&brewStyle=<?php echo $row_log['brewStyle']; if ($action == "scale") echo "&action=scale&amt=".$amt; ?>&id=<?php echo $row_log['id']; ?>&view=print','','height=600,width=800,toolbar=no,resizable=yes,scrollbars=yes'); return false;" title="Print <?php echo $row_log['brewName']; ?>"><img src="<?php echo $imageSrc. $row_colorChoose['themeName']; ?>/button_print_recipe_<?php echo $row_colorChoose['themeName']; ?>.png" border="0" alt="Print Recipe"></a><?php } ?>
<?php } else { ?>
<?php if (($page == "brewBlogCurrent") || ($page == "brewBlogDetail")) { ?><a href="print.php?page=recipePrint&brewStyle=<?php echo $row_log['brewStyle']; if ($action == "scale") echo "&action=scale&amt=".$amt; ?>&id=<?php echo $row_log['id']; ?>&KeepThis=true&TB_iframe=true&height=450&width=700" title="Print <?php echo $row_log['brewName']; ?>" class="thickbox"><img src="<?php echo $imageSrc. $row_colorChoose['themeName']; ?>/button_print_recipe_<?php echo $row_colorChoose['themeName']; ?>.png" border="0" alt="Print Recipe"></a><?php } ?>
<?php if ($page == "recipeDetail") { ?><a href="print.php?page=recipePrint&source=recipe&dbTable=recipes&brewStyle=<?php echo $row_log['brewStyle']; if ($action == "scale") echo "&action=scale&amt=".$amt; ?>&id=<?php echo $row_log['id']; ?>&KeepThis=true&TB_iframe=true&height=450&width=700" title="Print <?php echo $row_log['brewName']; ?>" class="thickbox"><img src="<?php echo $imageSrc. $row_colorChoose['themeName']; ?>/button_print_recipe_<?php echo $row_colorChoose['themeName']; ?>.png" border="0" alt="Print Recipe"></a><?php } ?>

View File

@@ -1,2 +1,16 @@
<?php if (($page == "brewBlogCurrent") || ($page == "brewBlogDetail")) { ?><a href="#" onclick="window.open(INCLUDES.'output_beer_xml.inc.php?id=<?php echo $row_log['id']; ?>&source=brewLog&brewStyle=<?php echo $row_log['brewStyle']; ?>','','height=5,width=5, scrollbars=no, toolbar=no, resizable==no, menubar=no'); return false;"><img src="<?php echo $imageSrc. $row_colorChoose['themeName']; ?>/button_beer_xml_<?php echo $row_colorChoose['themeName']; ?>.png" border="0" alt="Output to Beer XML"></a><?php } ?>
<?php if ($page == "recipeDetail") { ?><a href="#" onclick="window.open(INCLUDES.'output_beer_xml.inc.php?id=<?php echo $row_log['id']; ?>&source=recipe&brewStyle=<?php echo $row_log['brewStyle']; ?>','','height=5,width=5, scrollbars=no, toolbar=no, resizable==no, menubar=no'); return false;"><img src="<?php echo $imageSrc. $row_colorChoose['themeName']; ?>/button_beer_xml_<?php echo $row_colorChoose['themeName']; ?>.png" border="0" alt="Output to Beer XML"></a><?php } ?>
<?php if (($page == "brewBlogCurrent") || ($page == "brewBlogDetail")) {
if ($printBrowser == "IE") {
?>
<a href="includes/output_beer_xml.inc.php?id=<?php echo $row_log['id']; ?>&source=brewLog&brewStyle=<?php echo $row_log['brewStyle']; ?>"><img src="<?php echo $imageSrc. $row_colorChoose['themeName']; ?>/button_beer_xml_<?php echo $row_colorChoose['themeName']; ?>.png" border="0" alt="Output to Beer XML"></a>
<?php } else { ?>
<a href="#" onclick="window.open('includes/output_beer_xml.inc.php?id=<?php echo $row_log['id']; ?>&source=brewLog&brewStyle=<?php echo $row_log['brewStyle']; ?>','','height=5,width=5, scrollbars=no, toolbar=no, resizable==no, menubar=no'); return false;"><img src="<?php echo $imageSrc. $row_colorChoose['themeName']; ?>/button_beer_xml_<?php echo $row_colorChoose['themeName']; ?>.png" border="0" alt="Output to Beer XML"></a>
<?php }
} ?>
<?php if ($page == "recipeDetail") {
if ($printBrowser == "IE") { ?>
<a href="includes/output_beer_xml.inc.php?id=<?php echo $row_log['id']; ?>&source=recipe&brewStyle=<?php echo $row_log['brewStyle']; ?>"><img src="<?php echo $imageSrc. $row_colorChoose['themeName']; ?>/button_beer_xml_<?php echo $row_colorChoose['themeName']; ?>.png" border="0" alt="Output to Beer XML"></a>
<?php } else { ?>
<a href="#" onclick="window.open('includes/output_beer_xml.inc.php?id=<?php echo $row_log['id']; ?>&source=recipe&brewStyle=<?php echo $row_log['brewStyle']; ?>','','height=5,width=5, scrollbars=no, toolbar=no, resizable==no, menubar=no'); return false;"><img src="<?php echo $imageSrc. $row_colorChoose['themeName']; ?>/button_beer_xml_<?php echo $row_colorChoose['themeName']; ?>.png" border="0" alt="Output to Beer XML"></a>
<?php }
} ?>

View File

@@ -19,7 +19,7 @@
</div>
<?php } else { ?>
<?php if ($totalRows_featured > 0) { if (($row_pref['mode'] == "1") || (($row_pref['mode'] == "2") && ($filter == "all"))) include ('featured.inc.php'); } ?>
<?php if ($totalRows_featured > 0) { if (($row_pref['mode'] == "1") || (($row_pref['mode'] == "2") && ($filter == "all"))) { ?><div class="headerContentAdmin">All <?php echo $dbName; ?></div><?php } } ?>
<?php if ($totalRows_featured > 0) { if (($row_pref['mode'] == "1") || (($row_pref['mode'] == "2") && ($filter == "all"))) { ?><div class="headerContentAdmin">All <?php echo $dbName; ?></div><?php } } ?>
<table class="dataTable">
<tr>
<?php if ($style != "all") { ?>