Mam problem z advanced news system ot?? w pliku index.php mam zamieni? na to
tyle ?e to nie dzia?a jak wchodz? na stronk?, to wyskakuje:
wie kto? jak to naprawi??? powinno tak mniej wi?cej wygl?da?
PHP:
<?php require_once 'engine/init.php'; include 'layout/overall/header.php'; ?>
<link rel="stylesheet" type="text/css" href="news/news.css" />
<h1>News</h1>
<?
$query = "SELECT * FROM znote_news order by date DESC";
$result = mysql_query($query) or die('Something went wrong. Please try again later');
$num_rows = mysql_num_rows($result);
if(empty( $num_rows)){
echo "There are no articles yet.";
if (is_admin($user_data)) {
echo " <a href=\"http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/admin-newnews.php\">Create a new article</a>.";
}
}
while($row = mysql_fetch_array($result)){
echo '<article>';
echo '<h2>'.$row['title'].'</h2>';
echo '<div class="entry-meta">Posted on '.date('F j, Y',$row['date']).'';
if(!empty($row['author'])){
echo ' by '.$row['author'].'</div>';
}else{
echo '</div>';
}
echo '<div class="entry-content">';
echo $row['content'];
echo '</div>';
echo '</article>';
} ?>
<?php include 'layout/overall/footer.php'; ?>
PHP:
News
Create a new article."; } } while($row = mysql_fetch_array($result)){ echo '
'; echo '
'.$row['title'].'
'; echo '
Posted on '.date('F j, Y',$row['date']).''; if(!empty($row['author'])){ echo ' by '.$row['author'].'
'; }else{ echo '
'; } echo '
'; echo $row['content']; echo '
'; echo ''; } ?>