<?
/*	*******************************************************
	** NAME:			article
	** CREATED:			11/7/01 12:13
	*******************************************************
	** DESCRIPTION:
	** 	article reader and browser.
	**
	*******************************************************
	** HISTORY:
	**
	**
	**
	**
	*******************************************************
	** ANY CHANGES THAT RESULT IN ERRORS MAY HAVE TO FIXED
	** AT _SUBSTANTIAL_ EXTRA COST!!
	*******************************************************
*/

/* INITIALIZE */
	//require_once '/home/sites/site7/includes/application_top.php';
	require_once '/home2/mergener/public_html/vhosts/weddingconnections.com/includes/application_top.php';
	$html_title = "Wedding Planning Tips, Themes, Traditions, Guides and Articles"; // Define the page's html <title> in then html_header
	$message = '<a href="http://www.weddingconnections.com/articles">More Articles</a>';
	$message2 = '';
/* START HTML */



	//Check of amount of info passed.
		$get = $_GET;
		if (!isset($REQUEST_URI)) {
			$message = "<br><h1 align='center'>Wedding Planning <br>Tips, Themes, Traditions, Guides and Articles<p></h1>";
			$template_file = "listarticles.template.php";

		} else {
			$pathparts = explode('/', $REQUEST_URI);
			$pathsize = sizeof($pathparts);

			if ($pathsize > 1) {
				//check article title aginst DB
				$pathfilename = urldecode($pathparts[1]);
				$qid_checkarticle = db_query("
					SELECT *
					FROM mergener_wedcon.tbl_Articles
					WHERE Filename = '$pathfilename'
				");

				if (! db_num_rows($qid_checkarticle)) {
					$message =  "<p><b>Sorry that article is not in our records.</b><br>Please select on of the following.</p>";
					$template_file = "listarticles.template.php";
				}
				else {
					$article_row = db_fetch_object($qid_checkarticle);
					$Article_ID = $r->Article_ID;
					$html_title = $r->Title;

					$template_file = "article.template.php";

				}
			}
		}


require_once DIR_FS_INCLUDES . 'html_header.php';
echo '<br><div align="right">' . $message2 .  $message . '</div>';
echo "<div align=left class=bodytext2>";
require_once $template_file;
echo "</div>";

?>

<p>
<hr width=600>
<p>
		<table width=630 cellpadding=4 cellspacing=4 line-height=2em><tr><td>
		<div class=bodytext2 align=left>
		
		<a href="http://www.weddingconnections.com/articles">More Wedding Connections Articles</a><br>
		<a href="http://www.weddingconnections.com/national_bystate_me.php">Search Local Resources</a><p>
		<!-- AddThis Button BEGIN -->
			<script type="text/javascript">var addthis_config = {"data_track_clickback":true};</script>
			<a class="addthis_button" href="http://www.addthis.com/bookmark.php?v=250&amp;username=meinc">
			<img src="http://s7.addthis.com/static/btn/v2/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/></a>
			<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#username=meinc"></script><br>
		<!-- AddThis Button END -->
		 
		</div>
		</td></tr>
		</table>


<p>
<!-- the table below adds a box light blue around the text
		<table width=630 cellpadding=0 cellspacing=0><tr><td>
		<p class="vendorbackground-bottop">&nbsp
		</td></tr>
		<tr><td class=vendorbackground-botmid>
		<div class=bodytext2 align=center>
		<script type="text/javascript" align="right" src="http://w.sharethis.com/button/sharethis.js#publisher=23bdb7e9-82ce-4d45-8708-3223585f4e94&amp;type=website"></script> Article<p>
		<a href="http://www.weddingconnections.com/articles">More Wedding Connections Articles</a><br>
		<a href="http://www.weddingconnections.com/national.php">Search Local Resources</a><br> 
		</div>
		</td></tr>
		<td>
		<p class="vendorbackground-botbot">&nbsp
		</td></tr>
		</table>
-->

<?php
	include_once DIR_FS_INCLUDES . 'html_footer.php';
?>
