diff --git a/comment_body.php b/comment_body.php new file mode 100644 index 0000000..a4e0cbe --- /dev/null +++ b/comment_body.php @@ -0,0 +1,9 @@ + diff --git a/include/comment.php b/include/comment.php index 2550889..c47c158 100644 --- a/include/comment.php +++ b/include/comment.php @@ -223,6 +223,20 @@ class Comment { $this->sDateCreated = date("l F jS Y, H:i"); } + /** + * Displays the body of one comment. + */ + function view_comment_body($iCommentId) + { + $hResult = Comment::grab_comment($iCommentId); + + if ($hResult) + { + $oRow = query_fetch_object($hResult); + Comment::view_app_comment($oRow); + } + } + /** * display a single comment (in $oRow) */ @@ -276,6 +290,27 @@ class Comment { echo html_frame_end(); } + /** + * grab single comment for commentId + */ + function grab_comment($iCommentId) + { + $iCommentId = query_escape_string($iCommentId); + + if($iCommentId) + { + $sQuery = "SELECT from_unixtime(unix_timestamp(appComments.time), \"%W %M %D %Y, %k:%i\") as time, ". + "appComments.commentId, appComments.parentId, appComments.versionId, appComments.userId, appComments.subject, appComments.body, appVersion.appId ". + "FROM appComments, appVersion WHERE appComments.commentId = '$iCommentId'"; + + $hResult = query_appdb($sQuery); + + return $hResult; + } + + return null; + } + /** * grab comments for appId / versionId * if parentId is not -1 only comments for that thread are returned @@ -343,6 +378,25 @@ class Comment { Comment::do_display_comments_nested($hResult); } + /** + * Generates the link to show the comment. + */ + function comment_link($oRow) + { + $sLink = "commentview.php?iAppId={$oRow->appId}&iVersionId=". + "{$oRow->versionId}&iThreadId={$oRow->parentId}"; + + $sOnClick = "showComment('{$oRow->commentId}');"; + + /** + * The return false line in the onClick is used to handle javascript + * being disabled so we can fail gracefully to the old style. + */ + return "
\n"; Comment::do_display_comments_threaded($hResult2, 0); echo "\n"; diff --git a/include/header.php b/include/header.php index ec3dbd8..e877fcb 100644 --- a/include/header.php +++ b/include/header.php @@ -12,6 +12,7 @@ + diff --git a/prototype-1.6.0.2.js b/prototype-1.6.0.2.js new file mode 100644 index 0000000..6385503 --- /dev/null +++ b/prototype-1.6.0.2.js @@ -0,0 +1,4221 @@ +/* Prototype JavaScript framework, version 1.6.0.2 + * (c) 2005-2008 Sam Stephenson + * + * Prototype is freely distributable under the terms of an MIT-style license. + * For details, see the Prototype web site: http://www.prototypejs.org/ + * + *--------------------------------------------------------------------------*/ + +var Prototype = { + Version: '1.6.0.2', + + Browser: { + IE: !!(window.attachEvent && !window.opera), + Opera: !!window.opera, + WebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1, + Gecko: navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') == -1, + MobileSafari: !!navigator.userAgent.match(/Apple.*Mobile.*Safari/) + }, + + BrowserFeatures: { + XPath: !!document.evaluate, + ElementExtensions: !!window.HTMLElement, + SpecificElementExtensions: + document.createElement('div').__proto__ && + document.createElement('div').__proto__ !== + document.createElement('form').__proto__ + }, + + ScriptFragment: '