diff -u -r -N glview-0.0.1.orig/comment.php glview-0.0.1/comment.php
--- glview-0.0.1.orig/comment.php 2004-11-02 22:20:47.000000000 -0600
+++ glview-0.0.1/comment.php 2004-11-09 20:31:46.129458576 -0600
@@ -13,15 +13,25 @@
$poster_ar = $tmp_ar['poster'];
$num = count($msg_ar);
if (is_array($msg_ar) and count($msg_ar) > 0) {
+ $article_id = $msg_ar['article_id'];
$message_date = stripslashes($msg_ar['comment_date']);
$message_subject = stripslashes($msg_ar['comment_subject']);
$message_text = stripslashes($msg_ar['comment_text']);
+ $message_pid = $msg_ar['parent_id'];
}
if (is_array($poster_ar)) {
$poster_name = stripslashes($poster_ar['name']);
$articles_total = $poster_ar['stats']['articles'];
$comments_total = $poster_ar['stats']['comments'];
}
+$board_info = queryBoardInfo($bid);
+$site_url = $board_info['site_url'];
+$art_url = $site_url . "/article.php?story=$article_id";
+$art_href = "Comment: ";
+$art_href .= "$art_url";
+$msg_url = $art_url . "&mode=flat#c" . $mid;
+$msg_href = "Article: ";
+$msg_href .= "$msg_url";
pageHeader(true,$title); tableOpen(true,array('width'=>'100%'));
?>
@@ -70,6 +80,12 @@
+ echo $art_href; ?>
+ echo $msg_href; ?>
+ |
+
+
+ |
echo $message_text; ?>
|
diff -u -r -N glview-0.0.1.orig/docs/ChangeLog glview-0.0.1/docs/ChangeLog
--- glview-0.0.1.orig/docs/ChangeLog 2004-11-03 18:44:15.000000000 -0600
+++ glview-0.0.1/docs/ChangeLog 2004-11-09 22:06:38.258123488 -0600
@@ -4,6 +4,11 @@
*glview-0.0.1 (03 Nov 2004)
+ 11 Nov 2004; Mike Green docs/ChangeLog,
+ comment.php, includes/app.functions.php:
+
+ Added links to articles and comments when viewing a comment.
+
03 Nov 2004; Mike Green docs/ChangeLog:
Unleashed glview upon the world.
diff -u -r -N glview-0.0.1.orig/includes/app.functions.php glview-0.0.1/includes/app.functions.php
--- glview-0.0.1.orig/includes/app.functions.php 2004-11-02 22:25:07.000000000 -0600
+++ glview-0.0.1/includes/app.functions.php 2004-11-09 20:06:33.550405544 -0600
@@ -583,7 +583,7 @@
if (!$qid = queryArticle($board_id,$message_id)) {
return false;
} else {
- $msg_ar = db_fetch_array($qid);
+ $msg_ar = db_fetch_array($qid);
}
$poster_id = $msg_ar['poster_id'];
@@ -713,7 +713,7 @@
return false;
}
-$sql = "select comment_id,site_id,poster_id,";
+$sql = "select comment_id,site_id,article_id,poster_id,parent_id,";
$sql .= "comment_date,comment_subject,comment_text ";
$sql .= "from " . DBN . ".comment_ids where site_id=$board_id ";
$sql .= "and comment_id=$message_id limit 1";
@@ -1009,6 +1009,23 @@
/*****************************************************************************
*
*****************************************************************************/
+function queryBoardInfo($board_id='') {
+
+if (!is_numeric($board_id)) { return false; }
+
+$fl = "site_id,site_nick,site_url,articles,comments,posters,locked";
+$sql = "select $fl from " . DBN . ".site_ids ";
+$sql .= "where site_id=$board_id limit 1";
+if (!$qid = db_query($sql)) {
+ return false;
+ } else {
+ return db_fetch_array($qid);
+ }
+}
+
+/*****************************************************************************
+ *
+ *****************************************************************************/
function queryBoardsInfo($orderby='site_nick') {
$orderby = addslashes($orderby);