oneField($database->prepareSql($sql = "SELECT title FROM articles WHERE id='{$_GET['itemId']}'"))); $breadcrumb['News'] = "viewArticle.wik"; $breadcrumb[$title] = "viewArticle.wik?articleId={$_GET['itemId']}"; $breadcrumb['Comments'] = $_SERVER['REQUEST_URI']; break; case 'recipe': $title = stripslashes($database->oneField($database->prepareSql($sql = "SELECT title FROM articles WHERE id='{$_GET['itemId']}'"))); $breadcrumb['The Wire'] = "viewGossip.wik"; $breadcrumb[$title] = "viewGossip.wik?articleId={$_GET['itemId']}"; $breadcrumb['Comments'] = $_SERVER['REQUEST_URI']; $_GET['itemType'] = 'recipes'; echo $_GET['itemType']; break; case 'interview': $title = stripslashes($database->oneField($database->prepareSql($sql = "SELECT title FROM articles WHERE id='{$_GET['itemId']}'"))); $breadcrumb['Interviews'] = "viewInterviews.wik"; $breadcrumb[$title] = "viewInterviews.wik?articleId={$_GET['itemId']}"; $breadcrumb['Comments'] = $_SERVER['REQUEST_URI']; $_GET['itemType'] = 'article'; break; case 'video': $title = stripslashes($database->oneField($database->prepareSql($sql = "SELECT title FROM videos WHERE id='{$_GET['itemId']}'"))); $breadcrumb['CrackTv'] = "videoCategories.wik"; $breadcrumb[$title] = "sportsTv.wik?videoId={$_GET['itemId']}"; $breadcrumb['Comments'] = $_SERVER['REQUEST_URI']; break; case 'track': $title = stripslashes($database->oneField($database->prepareSql($sql = "SELECT title FROM tracks WHERE id='{$_GET['itemId']}'"))); $breadcrumb['Featured Audio'] = "viewMusic.wik"; $breadcrumb[$title] = "javascript:launchPlayer({$_GET['itemId']})"; $breadcrumb['Comments'] = $_SERVER['REQUEST_URI']; break; case 'officialVideo': $title = stripslashes($database->oneField($database->prepareSql($sql = "SELECT title FROM officialvideos WHERE id='{$_GET['itemId']}'"))); $breadcrumb['Featured Video'] = "viewVideo.wik"; $breadcrumb[$title] = "viewVideo.wik?videoId={$_GET['itemId']}"; $breadcrumb['Comments'] = $_SERVER['REQUEST_URI']; break; case 'mixtape': $title = stripslashes($database->oneField($database->prepareSql($sql = "SELECT title FROM mixTapes WHERE id='{$_GET['itemId']}'"))); $breadcrumb['Mixtapes'] = "mixTapes.wik"; $breadcrumb[$title] = "#"; $breadcrumb['Comments'] = $_SERVER['REQUEST_URI']; break; default: showError("Invalid item."); break; } if (loggedIn()) { $addCommentDisplay = new displayManager('addComment'); $addCommentDisplay->addPlaceHolder('COLS', '90'); $addCommentDisplay->addPlaceHolder('ITEMTYPE', $_GET['itemType']); $addCommentDisplay->addPlaceHolder('ITEMID', stripslashes($_GET['itemId'])); } else { $addCommentDisplay = new displayManager('addCommentNotLoggedIn'); } $addCommentDisplay->addPlaceHolder('CURRENT_URL', urlencode("/showComments.wik?itemType={$_GET['itemType']}&itemId={$_GET['itemId']}")); if (!$title) { showError("Invalid item."); } include('PaginateIt.wik'); $pagination = new PaginateIt; $pagination->SetLinksFormat( '<< Back', ' | ', 'Next >>' ); $pagination->SetItemsPerPage(50); if (isset($_GET['page']) && is_numeric($_GET['page'])) { $pagination->SetCurrentPage($_GET['page']); } else { $pagination->SetCurrentPage(1); } $pagination->setItemCount($database->oneField($database->prepareSql("SELECT COUNT(*) FROM itemcomments WHERE itemId=:id AND itemType=':type'", array('id' => $_GET['itemId'], 'type' => $_GET['itemType'])))); $sqlId = $database->prepareSql("SELECT itemcomments.*, authentication.profileName, authentication.displayName FROM itemcomments JOIN authentication ON itemcomments.userId = authentication.userId WHERE itemcomments.itemId= $_GET[itemId] AND itemcomments.itemType= $_GET[itemType] ORDER BY id DESC " . $pagination->GetSqlLimit(), array('id' => $_GET['itemId'], 'type' => $_GET['itemType'])); $comments = $database->multipleRows($sqlId); if (!$comments) { $errorDisplay = new displayManager('error'); $errorDisplay->addPlaceHolder('ERROR', "There are no comments here."); $commentContent = $display->addPlaceHolder('CONTENT', $errorDisplay->outputHtml(true)); } else { $commentDisplay = new displayManager('wideComment'); $commentHtml = null; foreach($comments as $temp => $comment) { $commentDisplay->addPlaceHolder('COMMENT_ID', $comment['id']); $commentDisplay->addPlaceHolder('PROFILENAME', stripslashes($comment['profileName'])); $commentDisplay->addPlaceHolder('DISPLAYNAME', stripslashes($comment['displayName'])); $commentDisplay->addPlaceHolder('SIGNATURE', getSignature($comment['userId'], &$database)); $commentDisplay->addPlaceHolder('COMMENT', htmlentities(stripslashes($comment['comment']))); $commentDisplay->addPlaceHolder('DATE', date('F j, y g:ia', $comment['timestamp'])); $commentDisplay->addPlaceHolder('AVATAR', getAvatar($comment['userId'], 64)); $commentHtml .= $commentDisplay->outputHtml(true); $commentDisplay->reset(); } $commentContent = $commentHtml . "\t\t\t\t\t\t\t\t" . $pagination->GetPageLinks(); } $commentsDisplay->addPlaceHolder('COMMENTS', $commentContent); $commentsDisplay->addPlaceHolder('TITLE', $title); $commentsDisplay->addPlaceHolder('ADD_COMMENT', $addCommentDisplay->outputHtml(true)); /******** LOGIN PANEL *+* 0000181 20070531 4:41 ********/ require_once("./loginBox.inc.wik"); /******** LOGIN STATUS *+* 0000191 20070709 1:58P ********/ require_once("./loginStatus.inc.wik"); $display->addPlaceHolder('CONTENT', $commentsDisplay->outputHtml(true)); outputTemplate(&$display); ?>