16, 'New Soca' => 17, 'Soca' => 18, 'Pan' => 19, 'Reggae' => 20, 'Chutney' => 21, 'Hip Hop' => 22, 'RnB' => 23, 'Latin' => 25, 'Parang' => 26, 'Bollywood' => 27, 'Carnival' => 29, 'Places' => 30, 'Your Videos' => 28 ); $categoryImages = array ( 'Vintage' => 'noImg.png', 'New Soca' => 'noImg.png', 'Soca' => 'noImg.png', 'Pan' => 'noImg.png', 'Reggae' => 'noImg.png', 'Chutney' => 'noImg.png', 'Hip Hop' => 'noImg.png', 'RnB' => 'noImg.png', 'Latin' => 'noImg.png', 'Parang' => 'noImg.png', 'Bollywood' => 'noImg.png', 'Carnival' => 'noImg.png', 'Places' => 'noImg.png', 'Your Videos' => 'noImg.png' ); $categoryArray = array_flip($categories); if (isset($_GET['videoId'])) { $values = array('id' => $_GET['videoId']); $isGroup = $database->oneField($database->prepareSql("SELECT `group` FROM videos WHERE id=':id'", $values)); $sqlId = $database->prepareSql("SELECT DISTINCT authentication.displayName, authentication.profileName, videos.title, videos.adult, videos.added, videos.id, videos.filename, videos.categoryId, videos.caption, videos.`desc`, itemratings.views, itemratings.comments, itemratings.rating, itemratings.votes FROM videos JOIN authentication ON videos.itemId=authentication.userId JOIN itemratings ON videos.id=itemratings.itemId WHERE itemratings.itemType='video' AND videos.id=':id'", $values); if ($isGroup) { $sqlId = $database->prepareSql("SELECT DISTINCT groups.groupName, groups.groupUrl, videos.title, videos.adult, videos.added, videos.id, videos.filename, videos.categoryId, videos.caption, videos.`desc`, itemratings.views, itemratings.comments, itemratings.rating, itemratings.votes FROM videos JOIN groups ON videos.itemId=groups.Id JOIN itemratings ON videos.id=itemratings.itemId WHERE itemratings.itemType='video' AND videos.id=':id'", $values); $video = $database->oneRow($sqlId); } else { $sqlId = $database->prepareSql("SELECT DISTINCT authentication.displayName, authentication.profileName, videos.title, videos.adult, videos.added, videos.id, videos.filename, videos.categoryId, videos.caption, videos.`desc`, itemratings.views, itemratings.comments, itemratings.rating, itemratings.votes FROM videos JOIN authentication ON videos.itemId=authentication.userId JOIN itemratings ON videos.id=itemratings.itemId WHERE itemratings.itemType='video' AND videos.id=':id'", $values); $video = $database->oneRow($sqlId); } if (!$video) { showError("Invalid item."); } else { if ($isGroup) { $video['profileName'] = '+' . $video['groupUrl']; $video['displayName'] = $video['groupName']; } if ($video['adult'] == 1) { if (!loggedIn()) { showError("You must be logged in to view videos designated as adult"); } else { if (!isset($_COOKIE['hhc-adult-'.$_SESSION['user']['id']])) { showError("
You must accept the following terms to view this video.
I certify that I am eighteen years or older. I understand that I may find materials that are graphic and offensive to some people. It is the responsibility of the adults to restrict use of this site to the adult members of their household. Neither WikiLime nor its affiliates condone or support pornography or obscenity.
Please signify your understanding of these conditions of use by clicking \"I Accept\" below.
"); } } } registerView($_GET['videoId'], 'video', null, &$database); if (loggedIn()) { $addTagDisplay = new displayManager('addTag'); $addTagDisplay->addPlaceHolder('ITEMID', $_GET['videoId']); $addCommentDisplay = new displayManager('addComment'); $addCommentDisplay->addPlaceHolder('COLS', '20'); $addCommentDisplay->addPlaceHolder('ITEMTYPE', 'video'); $addCommentDisplay->addPlaceHolder('ITEMID', $_GET['videoId']); } else { $addTagDisplay = new displayManager('addTagNotLoggedIn'); $addCommentDisplay = new displayManager('addCommentNotLoggedIn'); } $addCommentDisplay->addPlaceHolder('CURRENT_URL', urlencode($_SERVER['REQUEST_URI'])); $addTagDisplay->addPlaceHolder('CURRENT_URL', urlencode($_SERVER['REQUEST_URI'])); $breadcrumb[$categoryArray[$video['categoryId']]] = "/islandTv.wik?categoryId={$video['categoryId']}"; $categoryImage = $categoryImages[$categoryArray[$video['categoryId']]]; $sqlId = $database->prepareSql("SELECT DISTINCT itemcomments.id, itemcomments.userId, itemcomments.timestamp, itemcomments.comment, authentication.displayName, authentication.profileName FROM itemcomments JOIN authentication ON itemcomments.userId=authentication.userId WHERE itemcomments.itemType='video' AND itemcomments.itemId={$video['id']} ORDER BY itemcomments.id ASC LIMIT 10"); $comments = $database->multipleRows($sqlId); if (!$comments) { $errorDisplay = new displayManager('error2'); $errorDisplay->addPlaceHolder('ERROR', "There are no comments on this video."); $commentHtml = $errorDisplay->outputHtml(true); } else { $commentDisplay = new displayManager('comment'); $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('COMMENT', htmlentities(stripslashes($comment['comment']))); $commentDisplay->addPlaceHolder('SIGNATURE', getSignature($comment['userId'], &$database)); $commentDisplay->addPlaceHolder('DATE', date('F j, y g:ia', $comment['timestamp'])); $commentDisplay->addPlaceHolder('AVATAR', getAvatar($comment['userId'], 64)); $commentHtml .= $commentDisplay->outputHtml(true); $commentDisplay->reset(); } if ($video['comments'] > 10) { $commentHtml .= "Showing only the ten most recent comments. Show all comments.
"; } } /********** BEG FLASH **********/ //$flashVars = "{$settings['url']}{$video['filename']}"; //$flashScript = ''; if (loggedIn()) { if ($_SESSION['user']['email'] == 'wikilime@wikilime.com') { $flashScript = ''; } } /********** END FLASH **********/ /******** VIDEO TAG CLOUD *+* 0000184 20070709 5:54P ********/ require_once("./tagcloud_video.inc.wik"); $videoDisplay = new displayManager('cracktvVideo'); $breadcrumb[stripslashes($video['title'])] = $_SERVER['REQUEST_URI']; $videoDisplay->addPlaceHolder('VIDEOTITLE', stripslashes($video['title'])); $videoDisplay->addPlaceHolder('FLASHVARS', $flashVars); $videoDisplay->addPlaceHolder('MINIFLASHVARS', $miniflashVars); $videoDisplay->addPlaceHolder('FLASHURL', $settings['url']); $videoDisplay->addPlaceHolder('CAPTION', stripslashes($video['caption'])); $videoDisplay->addPlaceHolder('DESCRIPTION', nl2br(stripslashes($video['desc']))); $videoDisplay->addPlaceHolder('PROFILENAME', stripslashes($video['profileName'])); $videoDisplay->addPlaceHolder('DISPLAYNAME', stripslashes($video['displayName'])); $videoDisplay->addPlaceHolder('VIDEOID', stripslashes($video['id'])); $videoDisplay->addPlaceHolder('VOTES', stripslashes($video['votes'])); $videoDisplay->addPlaceHolder('VIDEO_SCRIPT', $flashScript); $videoDisplay->addPlaceHolder('CATEGORYIMAGE', $categoryImage); $videoDisplay->addPlaceHolder('CATEGORYNAME', $categoryArray[$video['categoryId']]); $videoDisplay->addPlaceHolder('CATEGORYID', $video['categoryId']); $videoDisplay->addPlaceHolder('CURRENT_RATING', rating2px($video['rating'])); $videoDisplay->addPlaceHolder('TAGS', $tagHtml); $videoDisplay->addPlaceHolder('VIEWS', number_format($video['views'])); $videoDisplay->addPlaceHolder('COMMENTCOUNT', number_format($video['comments'])); $videoDisplay->addPlaceHolder('COMMENTS', $commentHtml); $videoDisplay->addPlaceHolder('DATE', date('F j, y g:00a', $video['added'])); $videoDisplay->addPlaceHolder('ADD_COMMENT', $addCommentDisplay->outputHtml(true)); $videoDisplay->addPlaceHolder('ADD_TAG', $addTagDisplay->outputHtml(true)); $videoDisplay->addPlaceHolder('IMAGE', $video['filename']); $crackTvDisplay->addPlaceHolder('CONTENT', $videoDisplay->outputHtml(true)); } } else { $videoContent = null; include('PaginateIt.wik'); $pagination = new PaginateIt; $pagination->SetItemsPerPage(20); if (isset($_GET['page']) && is_numeric($_GET['page'])) { $pagination->SetCurrentPage($_GET['page']); } else { $pagination->SetCurrentPage(1); } if (isset($_GET['tag'])) { $breadcrumb['Tag: ' . $_GET['tag']] = $_SERVER['REQUEST_URI']; $values = array('tag' => $_GET['tag']); $pagination->setItemCount($database->oneField($database->prepareSql("SELECT DISTINCT COUNT(*) FROM videos JOIN videoTagging ON videos.id=videoTagging.videoId WHERE videoTagging.tag=':tag' AND videos.`from`='user'", $values))); $sqlId = $database->prepareSql("SELECT DISTINCT videos.filename, videos.title, videos.id, itemratings.views, itemratings.comments, itemratings.rating, itemratings.votes FROM videos JOIN itemratings ON videos.id=itemratings.itemId JOIN videoTagging ON videos.id=videoTagging.videoId WHERE itemratings.itemType='video' AND videos.`from`='user' AND videoTagging.tag=':tag' ORDER by videos.id DESC " . $pagination->GetSqlLimit(), $values); $videos = $database->multipleRows($sqlId); } else if (isset($_GET['category'])) { $breadcrumb[$categoryArray[$_GET['category']]] = $_SERVER['REQUEST_URI']; $categoryImage = $categoryImages[$categoryArray[$_GET['category']]]; $categoryHeaderDisplay = new displayManager('cracktvCategoryHeader'); $categoryHeaderDisplay->addPlaceHolder('CATEGORYNAME', $categoryArray[$_GET['category']]); $categoryHeaderDisplay->addPlaceHolder('CATEGORYIMAGE', $categoryImage); $videoContent .= $categoryHeaderDisplay->outputHtml(true); $values = array('id' => $_GET['category']); $pagination->setItemCount($database->oneField($database->prepareSql("SELECT DISTINCT COUNT(*) FROM videos WHERE `from`='user' AND categoryId=':id'", $values))); $sqlId = $database->prepareSql("SELECT DISTINCT videos.filename, videos.title, videos.id, itemratings.views, itemratings.comments, itemratings.rating, itemratings.votes FROM videos JOIN itemratings ON videos.id=itemratings.itemId WHERE itemratings.itemType='video' AND `from`='user' AND videos.categoryId=':id' ORDER by videos.id DESC " . $pagination->GetSqlLimit(), $values); $videos = $database->multipleRows($sqlId); } if (isset($_GET['tag']) || isset($_GET['category'])) { if (!$videos) { $errorDisplay = new displayManager('error2'); $errorDisplay->addPlaceHolder('ERROR', "There are no videos on this page, add one by clicking here"); $videoContent = $errorDisplay->outputHtml(true); } else { $gridHeaderDisplay = new displayManager('cracktvGridHeader'); $gridRowDisplay = new displayManager('cracktvGridRow'); $gridHtml = null; foreach($videos as $temp => $video) { $gridRowDisplay->addPlaceHolder('TITLE', stripslashes($video['title'])); $gridRowDisplay->addPlaceHolder('IMAGE', $video['filename']); $gridRowDisplay->addPlaceHolder('VIEWS', number_format($video['views'])); $gridRowDisplay->addPlaceHolder('COMMENTS', number_format($video['comments'])); $gridRowDisplay->addPlaceHolder('CURRENT_RATING', rating2px($video['rating'])); $gridRowDisplay->addPlaceHolder('VIDEOID', $video['id']); $gridHtml .= $gridRowDisplay->outputHtml(true); $gridRowDisplay->reset(); } $gridHeaderDisplay->addPlaceHolder('CONTENT', $gridHtml); $videoContent .= $gridHeaderDisplay->outputHtml(true) . "\t\t\t\t\t\t\t" . $pagination->GetPageLinks(); /******** TAG CLOUD INCLUDE *+* 0000184 20070710 3:52P ********/ require_once("./tagcloud_videocategory.inc.wik"); } } else { $categoryDisplay = new displayManager('videoCategories'); $categories = array ( 'Vintage' => 16, 'NewSoca' => 17, 'Soca' => 18, 'Pan' => 19, 'Reggae' => 20, 'Chutney' => 21, 'HipHop' => 22, 'RnB' => 23, 'Latin' => 25, 'Parang' => 26, 'Bollywood' => 27, 'Carnival' => 29, 'Places' => 30, 'YourMusic' => 28 ); #require('tags.wik'); #$tagging = new videoTagging(&$database); foreach($categories as $name => $id) { $countTotal = $database->oneField($database->prepareSql("SELECT COUNT(*) FROM videos WHERE categoryId=$id")); $countToday = $database->oneField($database->prepareSql("SELECT COUNT(*) FROM videos WHERE categoryId=$id AND added > " . (time() - 86400))); $categoryDisplay->addPlaceHolder(strtoupper($name) . '_TOTAL', $countTotal); // $categoryDisplay->addPlaceHolder(strtoupper($name) . '_TODAY', $countToday); $tagHtml = null; /* // *_* 0000192 20070710 1:24P $tags = $tagging->getCategoryTags($id, 4); if ($tags) { #$totalTags = null; #$totalTags = join('~|~', $tags); #echo trim(substr($totalTags, 0, 30), '~|') . '' . print_r(explode('~|~', substr($totalTags, 0, 10)), true) . '';
// *_* 0000192 20070710 1:11P
//foreach(explode('~|~', substr($totalTags, 0, 20)) as $tag) {
foreach($tags as $tag) {
//$tagHtml .= "" . stripslashes($tag) . " ";
// *_* 0000192 20070709 12:30P Rowena
$tagHtml .= "" . stripslashes($tag) . " ";
}
} */
$categoryDisplay->addPlaceHolder(strtoupper($name) . '_TAGS', $tagHtml);
}
$videoContent = $categoryDisplay->outputHtml(true);
}
$crackTvDisplay->addPlaceHolder('CONTENT', $videoContent);
}
/******** 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', $crackTvDisplay->outputHtml(true));
outputTemplate(&$display);
?>