When you click on 'full article' or 'comments' it goes to a page where you can see the comments or article there.
Instead of it going to the 'article' or 'comments' in that page, i would like it to popup. I tried messing around with it, but it didn't really work.
// ************************************************************
// The following code initiates the archive page numbers at
// the bottom of the news page - Part 1.
//
// $postlimit is the number of news articles to display per
// page.
// ************************************************************
$query = "SELECT news_id FROM news_articles";
$result = mysql_query($query)
or die (mysql_error());
$newsrows = mysql_num_rows($result);
if (empty($offset)) {
$offset = "0";
}
// ************************************************************
// Get news articles from SQL.
//
// If comments are to be displayed ($action == comments),
// the query will be different; only one article will be
// selected.
// ************************************************************
$query = "SELECT * FROM news_articles WHERE news_id = '$news_id' LIMIT 1";
$result = mysql_query($query)
or die (mysql_error());
} else {
// Get all non-sticky news articles
$query = "SELECT * FROM news_articles WHERE sticky = '' OR sticky = 'off' ORDER BY news_id DESC LIMIT $offset,$postlimit";
$result = mysql_query($query)
or die (mysql_error());
// ************************************************************
// Display the sticky post (if there is one) and
// if comments are not being viewed.
// ************************************************************
$query = "SELECT * FROM news_articles WHERE sticky = 'on'";
$sticky = mysql_query($query)
or die (mysql_error());
// ************************************************************
// Begin loop to display articles until $postlimit is
// reached.
// ************************************************************
// ************************************************************
// Count the number of comments associated with each
// article.
// ************************************************************
$query = "SELECT com_id FROM news_comments WHERE news_id = '$news_id'";
$comments = mysql_query($query);
$comments = mysql_num_rows($comments);
// ************************************************************
// Set some variables for the HTML output
// ************************************************************
// ************************************************************
// Begin HTML output for each news article.
//
// Edit this section if you want to customize the layout
// of the news articles on your page.
//
// Printer friendly page opens in new window.
// ************************************************************
echo "
<table align='center' border='0' width='$tablewidth' cellpadding='0' cellspacing='1' bgcolor='$rgb_border'>
<tr>
<td bgcolor='$rgb_title' colspan='2'><font size='$fontsize' face='$fontface' color='$fontcolor'> <b><font size='$fontsize'>$title</font></b> - <i>Posted by $poster on $date</i></font></td>
</tr>
<tr>
<td bgcolor='$rgb_article' colspan='2'>
echo "<div align='center'><font size='$fontsize' face='$fontface' color='$fontcolor'>You must enter your name.<p><a href='$PHP_SELF?action=email&news_id=$news_id'>Go Back</a></font></div>";
} else if (empty($email)) {
echo "<div align='center'><font size='$fontsize' face='$fontface' color='$fontcolor'>You must enter your email address.<p><a href='$PHP_SELF?action=email&news_id=$news_id'>Go Back</a></font></div>";
} else if (empty($sendemail)) {
echo "<div align='center'><font size='$fontsize' face='$fontface' color='$fontcolor'>You must enter your friend's email address.<p><a href='$PHP_SELF?action=email&news_id=$news_id'>Go Back</a></font></div>";
} else {
$query = "SELECT news_id,title,snippet FROM news_articles WHERE news_id = '$news_id'";
$result = mysql_query($query)
or die (mysql_error());
echo "<div align='center'><font size='$fontsize' face='$fontface' color='$fontcolor'>Username is a required field!<p><a href='$PHP_SELF?action=comments&news_id=$news_id'>Go Back</a></font></div>";
} else if (empty($comment)) {
echo "<div align='center'><font size='$fontsize' face='$fontface' color='$fontcolor'>Comment is a required field!<p><a href='$PHP_SELF?action=comments&news_id=$news_id'>Go Back</a></font></div>";
} else if ($count > $com_size) {
echo "<div align='center'><font size='$fontsize' face='$fontface' color='$fontcolor'>Your comment must be fewer then $com_size characters, it's $count.<p><a href='$PHP_SELF?action=comments&news_id=$news_id'>Go Back</a></font></div>";
} else {
$query = "INSERT INTO news_comments (news_id, guest, email, date, comment, guest_ip)
VALUES ('$news_id', '$username', '$email', '$date', '$comment', '$ip')";
$result = mysql_query($query)
or die (mysql_error());
echo "<div align='center'><font size='$fontsize' face='$fontface' color='$fontcolor'>Thanks $username, your comment was added succesfully!<p><a href='$PHP_SELF?action=comments&news_id=$news_id'>View Your Comment</a></font></div>";
}
// ************************************************************
// Display the article's comments if submit was not clicked
// ************************************************************
} else {
$news_id = $_GET['news_id'];
$query = "SELECT * FROM news_comments WHERE news_id = '$news_id'";
$result = mysql_query($query)
or die (mysql_error());
// ************************************************************
// Display the Add Comments form
// ************************************************************