0) { $query = "SELECT pagename FROM `category` where `type` = 'video' and `catscript` = '$category'"; $result = mysql_query($query) or die(mysql_error()); while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { foreach ($line as $col_value) { $x++; if ($x == 1) { $pagename = $col_value; } } $x = 0; } $redir = "/videos/$pagename/"; if ($page>1) { $redir .= "$page/"; } header("HTTP/1.1 301 Moved Permanently"); header("location:$redir"); exit; } } elseif ($category=="animation") { header("HTTP/1.1 301 Moved Permanently"); header("location:/videos/funny-videos/"); exit; } // ================ Old url checks ================ if (!$show && !$category) { $show="new"; } if (!$page) { $page="1"; } if ($page > 1) { $pbit = " | Page $page"; } if ($show=="new") { $qby="featureid"; $qorder="desc"; $h1title="New Videos"; $title="New Funny Videos and Funny Video Clips"; $qex=" and `nsfw` != 'yes'"; $pagename="videos/"; $canonical = "http://www.nearlygood.com/videos/"; $desc = "The latest funny videos and funny video clips every day along with thousands of new videos, free videos and funny videos. All of our videos work on Apple devices."; $keyw = "new videos, new video clips, funny videos, free videos, iphone videos, ipad videos"; } elseif ($show=="search") { if (!$search || strlen($search)<1 || $search=="" || strpos($search,'girls-gone-wild') !== false) { header("location:/videos/"); } $sarray=explode("/",$search); if ($sarray[1]) { $search = $sarray[0]; header("HTTP/1.1 301 Moved Permanently"); header("location:/search.php?search=$search"); } if (strlen($search) > strlen(preg_replace("/[^A-Za-z0-9-]/","",$search))) { $search = ereg_replace("[^A-Za-z0-9]", "", $search); header("location:/$search-videos/"); } if (strlen($search) > 50) { $search = substr($search,0,50); header("location:/$search-videos/"); } if (strlen($search) > 20 && strlen($search) == strlen(str_replace("-","",$search))) { header("location:/videos/pages.html"); } if (strlen(str_replace("-videos","",$search)) < strlen($search)) { $search = str_replace("-videos","",$search); header("HTTP/1.1 301 Moved Permanently"); header("location:/$search-videos/"); } if (strlen(str_replace("find-","",$search)) < strlen($search)) { $search = str_replace("find-","",$search); header("HTTP/1.1 301 Moved Permanently"); header("location:/$search-videos/"); } if (strlen(str_replace("--","-",$search)) < strlen($search)) { $search = str_replace("--","-",$search); header("HTTP/1.1 301 Moved Permanently"); header("location:/$search-videos/"); } // Spelling replace $contents = "videos"; include ('/home/ngood/public_html/inc/spelling.php'); $strim = trim(str_replace("-"," ",$search)); if (strlen($strim) < strlen($search)) { $search = str_replace(" ","-",$strim); header("HTTP/1.1 301 Moved Permanently"); header("location:/$search-videos/"); } $pagename .= "$search-videos/"; $canonical .= "$search-videos/"; $surl = $search; $search = str_replace("-"," ",$search); if (strlen($search) > 3) { $pagequery = "SELECT id,content,folder,filename,name,dateadded,description,tags,stat_rating,uploader,oldfilename, MATCH(filename,name,category1,category2,description,tags,uploader,keydesc) AGAINST ('$search' IN BOOLEAN MODE) AS `searchscore` FROM `files` WHERE MATCH(filename,name,category1,category2,description,tags,uploader,keydesc) AGAINST ('$search' IN BOOLEAN MODE) and `content` = 'video' and `status` = 'live' and `showwhere` != 'nowhere'"; $gamequery = "SELECT id, MATCH(filename,name,category1,category2,description,tags,uploader,keydesc) AGAINST ('$search' IN BOOLEAN MODE) AS `searchscore` FROM `files` WHERE MATCH(filename,name,category1,category2,description,tags,uploader,keydesc) AGAINST ('$search' IN BOOLEAN MODE) and `content` = 'game' and `status` = 'live' and `showwhere` != 'nowhere'"; $pictquery = "SELECT id, MATCH(filename,name,category1,category2,description,tags,uploader,keydesc) AGAINST ('$search' IN BOOLEAN MODE) AS `searchscore` FROM `files` WHERE MATCH(filename,name,category1,category2,description,tags,uploader,keydesc) AGAINST ('$search' IN BOOLEAN MODE) and `content` = 'picture' and `status` = 'live' and `showwhere` != 'nowhere'"; $jokequery = "SELECT id, MATCH(filename,name,category1,category2,description,tags,uploader,keydesc) AGAINST ('$search' IN BOOLEAN MODE) AS `searchscore` FROM `files` WHERE MATCH(filename,name,category1,category2,description,tags,uploader,keydesc) AGAINST ('$search' IN BOOLEAN MODE) and `content` = 'joke' and `status` = 'live' and `showwhere` != 'nowhere'"; $linkquery = "SELECT id, MATCH(filename,name,category1,category2,description,tags,uploader,keydesc) AGAINST ('$search' IN BOOLEAN MODE) AS `searchscore` FROM `files` WHERE MATCH(filename,name,category1,category2,description,tags,uploader,keydesc) AGAINST ('$search' IN BOOLEAN MODE) and `content` = 'link' and `status` = 'live' and `showwhere` != 'nowhere'"; $qby="searchscore"; } else { $pagequery = "SELECT id,content,folder,filename,name,dateadded,description,tags,stat_rating,uploader,oldfilename FROM `files` WHERE `content` = 'video' and `name` LIKE '%$search%' and `status` = 'live' and `showwhere` != 'nowhere' or `content` = 'video' and `description` LIKE '%$search%' and `status` = 'live' and `showwhere` != 'nowhere' or `content` = 'video' and `tags` LIKE '%$search%' and `status` = 'live' and `showwhere` != 'nowhere'"; $gamequery = "SELECT id FROM `files` WHERE `content` = 'game' and `name` LIKE '%$search%' and `status` = 'live' and `showwhere` != 'nowhere' or `content` = 'game' and `description` LIKE '%$search%' and `status` = 'live' and `showwhere` != 'nowhere' or `content` = 'game' and `tags` LIKE '%$search%' and `status` = 'live' and `showwhere` != 'nowhere'"; $pictquery = "SELECT id FROM `files` WHERE `content` = 'picture' and `name` LIKE '%$search%' and `status` = 'live' and `showwhere` != 'nowhere' or `content` = 'picture' and `description` LIKE '%$search%' and `status` = 'live' and `showwhere` != 'nowhere' or `content` = 'picture' and `tags` LIKE '%$search%' and `status` = 'live' and `showwhere` != 'nowhere'"; $jokequery = "SELECT id FROM `files` WHERE `content` = 'joke' and `name` LIKE '%$search%' and `status` = 'live' and `showwhere` != 'nowhere' or `content` = 'joke' and `description` LIKE '%$search%' and `status` = 'live' and `showwhere` != 'nowhere' or `content` = 'joke' and `tags` LIKE '%$search%' and `status` = 'live' and `showwhere` != 'nowhere'"; $linkquery = "SELECT id FROM `files` WHERE `content` = 'link' and `name` LIKE '%$search%' and `status` = 'live' and `showwhere` != 'nowhere' or `content` = 'link' and `description` LIKE '%$search%' and `status` = 'live' and `showwhere` != 'nowhere' or `content` = 'link' and `tags` LIKE '%$search%' and `status` = 'live' and `showwhere` != 'nowhere'"; $qby = "stat_score"; } $qorder="desc"; $h1title=ucwords($search) . " Videos"; $title=ucwords($search) . " Videos and " . ucwords($search) . " Video Clips"; if ($SHOW_NSFW==0) { $qex=" and `nsfw` != 'yes'"; } else { $qex=""; } $selectresult = mysql_query("$pagequery and `nsfw` != 'yes'"); $sfwres = mysql_num_rows($selectresult); $selectresult = mysql_query("$pagequery and `nsfw` = 'yes'"); $nsfwres = mysql_num_rows($selectresult); $resultcount = $sfwres+$nsfwres; $selectresult = mysql_query("$gamequery"); $gamescount = mysql_num_rows($selectresult); $selectresult = mysql_query("$pictquery"); $picscount = mysql_num_rows($selectresult); $selectresult = mysql_query("$jokequery"); $jokescount = mysql_num_rows($selectresult); $selectresult = mysql_query("$linkquery"); $linkscount = mysql_num_rows($selectresult); if (strlen($search)<30 && strlen($search)>3 && $resultcount > 0) { // save search $timeline = time(); $timein = $timeline-648000; // 7 days mysql_query("INSERT INTO `tags` VALUES ('','video','$search','$timeline')") or die(mysql_error()); $selectresult = mysql_query("SELECT id from `toptags` where `tag` = '$search' and `content` = 'video'"); $searchfound = mysql_num_rows($selectresult); if ($searchfound > 0) { $selectresult = mysql_query("SELECT id from `tags` where `content` = 'video' and `tag` = '$search' and `timeline` > '$timein'"); $tagres = mysql_num_rows($selectresult); mysql_query("UPDATE `toptags` SET `searchs` = '$tagres',`timeline` = '$timeline',`results` = '$resultcount',`sfwres` = '$sfwres',`nsfwres` = '$nsfwres' WHERE `tag` = '$search' and `content` = 'video'") or die(mysql_error()); } elseif ($resultcount > 0) { mysql_query("INSERT INTO `toptags` VALUES ('','video','$search','1','$timeline','$resultcount','$sfwres','$nsfwres')") or die(mysql_error()); } } $pagequery .= "$qex"; $desc = "$search videos and $search video clips. New $search videos every day along with thousands of $search videos, free videos and funny videos. All of our videos work on Apple devices."; $keyw = "$search videos, $search video, $search vids, $search vid, $search video clips, new videos, new video clips, funny videos, free videos, iphone videos, ipad videos"; } elseif ($category) { $query = "SELECT cat,catname,descrip,nsfw FROM `category` where `pagename` = '$category'"; $result = mysql_query($query) or die(mysql_error()); while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { foreach ($line as $col_value) { $x++; if ($x == 1) { $catref = $col_value; } if ($x == 2) { $catname = $col_value; } if ($x == 3) { $catdesc = $col_value; } if ($x == 4) { $nsfw = $col_value; } } $x = 0; } $altcatname = str_replace(" Videos","",$catname); $pagename="videos/$category/"; $canonical = "http://www.nearlygood.com/videos/$category/"; if ($show=="top") { $qby="stat_score"; $h1title="Top $catname"; $title = "Top " . ucwords($catdesc); $pagename .= "top/"; $canonical .= "top/"; $desc = "Top $catname and hot $catname every day along with thousands of new videos, free videos and funny videos. All of our videos work on Apple devices."; $keyw = "top " . strtolower($catname) . ", hot " . strtolower($catname) . ", new videos, new video clips, funny videos, free videos, iphone videos, ipad videos"; } else { $qby="id"; $h1title="$catname"; $title = ucwords($catdesc); $desc = "$catname and new $catname, aswell as new funny videos every day along with thousands of new videos, free videos and funny videos. All of our videos work on Apple devices."; $keyw = strtolower($catname) . ", new videos, new video clips, funny videos, free videos, iphone videos, ipad videos"; } $qorder="desc"; $qex=""; $pagequery = "`files` where `content` = 'video' and `category1` = '$catref' and `showwhere` = 'everywhere' and `status` = 'live' or `content` = 'video' and `category2` = '$catref' and `showwhere` = 'everywhere' and `status` = 'live'"; } elseif ($show=="top") { $qby="stat_score"; $qorder="desc"; $h1title="Top Videos"; $title="Popular Funny Videos and Funny Video Clips"; $qex=" and `nsfw` != 'yes'"; $pagename="videos/top/"; $canonical = "http://www.nearlygood.com/videos/top/"; $desc = "The best videos on the net. We have all the top videos and hot videos every day along with thousands of new videos, free videos and funny videos. All of our videos work on Apple devices."; $keyw = "top videos, hot videos, new videos, new video clips, funny videos, free videos, iphone videos, ipad videos"; } if ($page!=1) { $canonical .= "$page/"; } if (!$pagequery) { $pagequery = "`files` where `content` = 'video' and `showwhere` = 'everywhere' and `status` = 'live'$qex"; } $st = 0; $listshow = 15; if (!$search) { $selectresult = mysql_query("SELECT id FROM $pagequery"); } else { $selectresult = mysql_query("$pagequery"); } $filecount = mysql_num_rows($selectresult); $listshow2 = $listshow - 1; if ($page == 1) { $st = 0; } else { $st = ($page * $listshow) - $listshow; } $first = ($page * $listshow) - $listshow2; $last = ($page * $listshow); if ($last > $filecount) { $last = $filecount; } $pages = ceil($filecount/$listshow); if ($pbit) { $desc .= str_replace(" | "," ",$pbit); $keyw .= strtolower(str_replace(" | ",", ",$pbit)); } $ogtitle = "$title"; $title = $title . $pbit; $ogurl = "http://www.nearlygood.com/$pagename"; if ($page!=1) { $ogurl = "http://www.nearlygood.com/$pagename" . "$page/"; } $tab = "video"; include ('/home/ngood/public_html/inc/header.php'); ?>

Watch more Videos, share videos and find the latest funny videos at Viduu.
0) { print "
There are $nsfwres nsfw videos which match your search - Click here to include them
\n"; } if ($search && $filecount==0) { ?>

Sorry, we couldn't find any videos to match what you were looking for. Try these instead:

Popular Video Tags