View file dotwidgeta/showarticle.php

File size: 1.96Kb
<?php


include("./admin/dotwidgeta_config.php"); 


include("./admin/connect_db.php"); 


$metatitle = $sitename . " - Articles";


include($file_path.$header_file);


include($file_path."includes/nav.inc");





// SELECT from articles table


$select = "SELECT id, title, content, DATE_FORMAT(datecreated, '%M, %Y')as datecreated, aid";


$from   = " FROM articles";


$where  = " WHERE id=$id";





$articles = mysql_query($select . $from . $where);


if (!$articles) {


  echo("<P>Error retrieving articles from database!<BR>".


       "Error: " . mysql_error());


  exit();


}





while ($article = mysql_fetch_array($articles)) {


  $id       = $article["id"];


  $title = $article["title"];


  $content = $article["content"];


  $aid = $article["aid"];


  $datecreated = $article["datecreated"];


}





// SELECT from authors table


$authors = mysql_query("SELECT id, name, byline, pic_url FROM article_authors where id= $aid ");


if (!$authors) {


  echo("<P>Error retrieving author data from database!<BR>".


       "Error: " . mysql_error());


}





while ($author = mysql_fetch_array($authors)) {


  $authname = $author["name"];


  $byline = $author["byline"];


  $pic_url = $author["pic_url"];


}





if($pic_url != "") {


	$showpic = "<img src=\"" . $pic_url . "\" style=\"float:left;\">";


}





if($use_markup != "Yes") {

  include($file_path."includes/convert_content.inc");


  include($file_path."includes/convert_byline.inc");


}




?>





<hr>


<h4><? echo($title); ?></h4>


<table width="100%" cellpadding=5>


<tr valign="top">


	<td class="DOCLABEL">by <b><? echo($authname); ?></b><? echo($showpic); ?></td>


	<td class="DOCLABEL"><? echo($datecreated); ?></td>


</tr>


</table>





<hr>





<p>





<?php 


echo($content); 


?>





</p>


<hr>


<p>





<?php


echo($byline); 


?>





</p>


<br><br>





<?php include($file_path.$footer_file); ?>