Skip to content

Commit

Permalink
Use CommonMark-defined text on webpages
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesse-V committed Sep 23, 2015
1 parent b93b6a8 commit b027033
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 73 deletions.
15 changes: 10 additions & 5 deletions contact_us.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
$_STYLESHEETS_ = array("/assets/css/contact_us.css");
require_once($_SERVER['DOCUMENT_ROOT'].'/assets/common/header.php');
$_SESSION['customer'] = true;

require_once("assets/CommonMark.php");
use League\CommonMark\CommonMarkConverter;
$converter = new CommonMarkConverter();
?>

<div class="mapWrapper">
Expand All @@ -14,11 +18,12 @@
</a>
</div>

<p>
Driving directions to our place would be as follows:
<br><br>
At mile 5.5 Big Lake road you will come to South Port Marina. Echo Lake Drive is the next left after the entrance to the marina. Go 1.25 miles down Echo Lake Drive; the road will fork, the left is unmarked and the right is labeled "Gondor Rd". Take the unmarked left fork. This road leads down a long straight stretch, and our place is 1.25 miles down the road. There is a locked gate with a big yellow sign that keeps our community private and quiet, so be sure to call us before you come out so that we can make sure that the gate is open. The entrance of our driveway is marked by a beehive, a yellow road-grader, and is straight ahead once you see our neighbor's horse corral.
</p>
<?php
$filename = "text/contact_us.txt";
$contents = fread(fopen($filename, "r"), filesize($filename));
echo $converter->convertToHtml($contents);
?>

<p class="address">
Alaska Wildflower Honey
<br>7449 S. Babcock Blvd.
Expand Down
21 changes: 21 additions & 0 deletions education.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php //opening HTML
$_TITLE_ = "Education";
$_STYLESHEETS_ = array("/assets/css/education.css");
require_once($_SERVER['DOCUMENT_ROOT'].'/assets/common/header.php');
$_SESSION['customer'] = true;

require_once("assets/CommonMark.php");
use League\CommonMark\CommonMarkConverter;
$converter = new CommonMarkConverter();
?>

<?php
$filename = "text/education/home.txt";
$contents = fread(fopen($filename, "r"), filesize($filename));
echo $converter->convertToHtml($contents);
?>

<?php
$_JS_ = array();
require_once($_SERVER['DOCUMENT_ROOT'].'/assets/common/footer.php'); //closing HTML
?>
17 changes: 17 additions & 0 deletions education_guide.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php //opening HTML
$_TITLE_ = "Winter Season - Education";
$_STYLESHEETS_ = array('/assets/css/education_documents.css');
require_once($_SERVER['DOCUMENT_ROOT'].'/assets/common/header.php');
$_SESSION['customer'] = true;

require_once($_SERVER['DOCUMENT_ROOT']."/assets/CommonMark.php");
use League\CommonMark\CommonMarkConverter;
$converter = new CommonMarkConverter();

$filename = "text/education/guide_text.txt";
$contents = fread(fopen($filename, "r"), filesize($filename));
echo $converter->convertToHtml($contents);

$_JS_ = array();
require_once($_SERVER['DOCUMENT_ROOT'].'/assets/common/footer.php'); //closing HTML
?>
24 changes: 6 additions & 18 deletions honey.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,15 @@
$_STYLESHEETS_ = array("/assets/css/honey.css");
require_once($_SERVER['DOCUMENT_ROOT'].'/assets/common/header.php');
$_SESSION['customer'] = true;
?>

<div class="images">
<img src="assets/images/half_pound.gif" alt="Half-pound container of honey."/>
<img src="assets/images/single_hive.gif" alt="Single beehive."/>
<img src="assets/images/half_pound.gif" alt="Half-pound container of honey."/>
</div>

<h3>WHY OUR HONEY IS DIFFERENT</h3>
<p>Our hives are located in an area that is free of large agricultural development. The nectar that is gathered from the wild plants is free of the chemical influence associated with agriculture. We manage our hives in such a manner that antibiotics or chemicals are not necessary to maintain the health of the hives. This assures that the honey that is produced is as free from contamination as possible.
</p>

<h3>TASTE</h3>
<p>Just as the aroma varies from flower to flower, the taste of the nectar does as well. The taste of honey is determined largely by the nectar that the bees use to produce it. Most commercial honey comes from clover. This explains the similar taste that is found between most of the major brands in the stores. The taste that you find in our honey comes from a wide variety of wildflowers that are found on and near our family homestead. The major contributing flower sources are: Fireweed, Wild Sitka Rose, Wild Raspberry, Labrador Tea, and Alaska Spirea, Many other flowers are mixed in as well to a lesser degree. The taste of our honey is truly an Alaskan bouquet.
</p>
require_once("assets/CommonMark.php");
use League\CommonMark\CommonMarkConverter;
$converter = new CommonMarkConverter();

<h3>HARVEST AND PROCESSING</h3>
<p>We believe that honey is in its purest form when it is in the hive. Every step in the process of getting honey from the comb and into a bottle has the potential to degrade the quality of the original honey. Our harvest and processing methods are aimed at preserving as much as possible the purity and taste of comb honey. A slide show of our harvesting process and all the things that go on in the honey room can be found on this site, on <a href="harvest_n_processing.php">this page</a>.
</p>
$filename = "text/honey.txt";
$contents = fread(fopen($filename, "r"), filesize($filename));
echo $converter->convertToHtml($contents);

<?php
$_JS_ = array();
require_once($_SERVER['DOCUMENT_ROOT'].'/assets/common/footer.php'); //closing HTML
?>
33 changes: 18 additions & 15 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,33 @@
$_STYLESHEETS_ = array("/assets/css/index.css");
require_once($_SERVER['DOCUMENT_ROOT'].'/assets/common/header.php');
$_SESSION['customer'] = true;

require_once("assets/CommonMark.php");
use League\CommonMark\CommonMarkConverter;
$converter = new CommonMarkConverter();
?>

<div class="left half">
<p>Alaska Wildflower Honey is a small beekeeping operation that is run by the Victors family on Fish Creek in Big Lake, Alaska. We have between 60 and 100 hives and keep many of our bees near where we live. We run several yards of bees with each yard having up to 25 hives in it. This keeps the bees spread out over the general area and assures that there will be enough forage for all the colonies.
</p>
<p>When we began beekeeping our yards were all located in the area that was extensively burned with a major wildfire in 1996. This fire changed the growth from mature birch and spruce forest to many open areas of fireweed and wildflowers. Bees will forage in a range that is within a mile and a half of their hive. Our yards are placed so that within this range there is little else to forage on except the natural wild vegetation. While this still is the case, as the forest has recovered there have been less open areas for the fields of wildflowers and good bee forage has been reduced. An aerial view of our area and the location of some of our yards is in our picture gallery: <a href="aerial_view.php">AERIAL VIEW</a>. In addition to our home yards we have hives placed in the Wasilla area and other areas of Big Lake to add variety to the pollen and honey that we collect. Our locations are selected to avoid areas where industry, heavy agriculture and extensive road traffic are of concern. We believe that whatever toxins are applied to plants or settle in the roadside ditches and vegetation have the potential to be taken up by plant roots and may very well show up in the honey that local hives produce. We avoid these areas to ensure that the quality of our honey stays the best that you can find anywhere.
</p>
<p>We also have a dealership in beekeeping supplies through Mann Lake Ltd. and carry supplies for the local beekeepers. Although we are able to offer all of the items that are listed in the <a href="http://www.mannlakeltd.com/">MANN LAKE CATALOG</a> we don't have all the items in stock. We have increased inventory each year and have a wide variety of beekeeping supplies on hand all year. By bringing supplies to Alaska on pallets we can save on the cost of shipping, so our prices are likely to be less you can find elsewhere. A list of <a href="order_supplies.php">SUPPLIES</a> is located on this site that we have on hand most all the time.
</p>
<p>We are also the largest supplier of package bees in the entire state. We believe that the quality of our bees, queens and the service that we provide is the reason that we continue to grow. In the spring, we import packages of bees from Northern California to stock our hives. We also import many additional packages for the local beekeepers association SABA (South-central Alaska Beekeepers Association) as well as other beekeepers in the area. Packages are delivered in mid April to various areas of the region. We guarantee our packages and queens to arrive in good shape with well mated queens ready to lay. If you are interested in ordering bees, please visit the <a href="stevesbees_home.php">PACKAGE BEES</a> page. Orders for spring delivery need to be placed by the end of February (earlier if possible) to ensure availability.
</p>
<p>South-central Alaska Beekeepers Association is a group of beekeepers that get together each month in Eagle River just outside Anchorage. Our membership is about 150 members. It is a great group of people who share an enthusiasm for beekeeping. They now have a website of their own, <a href="http://www.sababeekeepers.com/">www.sababeekeepers.com</a>.
</p>

<?php
$filename = "text/homepage/left_side.txt";
$contents = fread(fopen($filename, "r"), filesize($filename));
echo $converter->convertToHtml($contents);
?>

</div>
<div class="right half">
<div class="right_image">
<img src="assets/images/hives_in_grass.gif" alt="Five beehives in our beeyard, tucked away behind grass."/>
<p>Our hives behind our house on Fish Creek</p>
</div>
<h3>CLASSES</h3>
<p>Beekeeping classes are taught in the spring of each year. Our comprehensive class will provide you with more than enough information to make you feel comfortable working with the bees to gather a seasonable crop. Classes begin in the early spring (late February or March) and provide enough time to order bees and build or purchase all equipment that you will need to be successful. Call us for more details.
</p>
<p>When we started our business, our primary focus was on obtaining an abundant supply of the highest quality honey that we could gather from the homestead. As the land has slowly recovered from the fire that swept through our area, our focus has gradually shifted from producing honey as our main product to diversifying into the sale of equipment and bees to other beekeepers. Over the years we have steadily reduced the number of hives that we run during the busy summer. Virginia's battle with cancer helped us to focus on the importance of spending time with our growing children. The reduction of the number of hives has allowed us to take advantage of the summertime for family activities. We still produce a fair bit of honey and strive to have a supply available throughout the year. We have reduced our outlets to All About Herbs on the Palmer Wasilla Highway. Of course we still sell direct from our house in Big Lake.
</p>

<?php
$filename = "text/homepage/right_side.txt";
$contents = fread(fopen($filename, "r"), filesize($filename));
echo $converter->convertToHtml($contents);
?>

</div>

<?php
Expand Down
12 changes: 9 additions & 3 deletions order_supplies.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@
"/assets/css/order_supplies.css");
require_once($_SERVER['DOCUMENT_ROOT'].'/assets/common/header.php');
$_SESSION['customer'] = true;

require_once("assets/CommonMark.php");
use League\CommonMark\CommonMarkConverter;
$converter = new CommonMarkConverter();
?>

<div id="introLeft">
<h1>Supplies Store</h1>

<p>We offer a variety of beekeeping products, ranging from common items such as beehive components, tools, and processing equipment to rarer and specialty items. We carry primarily Mann Lake products, as well as some of our own. We are the largest distributor of beekeeping supplies in the state of Alaska. We hope you will find this store efficient and convenient.</p>
<?php
$filename = "text/supplies/top_introduction.txt";
$contents = fread(fopen($filename, "r"), filesize($filename));
echo $converter->convertToHtml($contents);
?>
</div>

<div id="introRight">
Expand Down
38 changes: 6 additions & 32 deletions stevesbees_home.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,16 @@
$_TITLE_ = "StevesBees.com Home";
$_STYLESHEETS_ = array("/assets/css/stevesbees_home.css");
require_once($_SERVER['DOCUMENT_ROOT'].'/assets/common/header.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/assets/php/databaseConnect.secret');
$_SESSION['customer'] = true;
global $db;

$filename = "text/stevesbees_news.txt";
$contents = fread(fopen($filename, "r"), filesize($filename));

$newsSQL = $db->query("SELECT * FROM News ORDER BY ID DESC");
if (!$newsSQL)
die("A fatal database issue was encountered in home.php, News query. Specifically, ".$db->error);
require_once("assets/CommonMark.php");
use League\CommonMark\CommonMarkConverter;

echo "<h1>Steve's Bees - Packages of Honeybees</h1>";
while ($newsRecord = $newsSQL->fetch_assoc())
echo translateToHTML($newsRecord);


function wrapParagraphs(&$item1, $key)
{
$item1 = "<p>$item1</p>";
}


function translateToHTML($markedupObj)
{
$paragraphs = preg_split('/\n/', $markedupObj['content']);
array_walk($paragraphs, 'wrapParagraphs');
$content = implode("", $paragraphs);

$content = preg_replace('/\n\r/', "<p>$1</p>", $content); //paragraphs
$content = preg_replace('/\*\*([^\*]+)\*\*/', "<b>$1</b>", $content); //bold
$content = preg_replace('/\*([^\*]+)\*/', "<i>$1</i>", $content); //italic

return '<div class="newsPiece">
<h3>'.$markedupObj['date'].'</h3>
<p><b>'.$markedupObj['title'].'</b></p>
'.$content.'
</div>';
}
$converter = new CommonMarkConverter();
echo $converter->convertToHtml($contents);
?>

<!--
Expand Down

0 comments on commit b027033

Please sign in to comment.