File: /home/httpd/html/seekya.com/DEAD/beta/listing.php
<? session_start();
include("includes/connect.php");
include("includes/func.php");
$showpaging=1;
if ($_GET["category_id"]!='')
{
$sql="select * from video_master where video_category='".$_GET["category_id"]."' and video_status=1 order by 1 desc";
$sqlcount="select count(*) from video_master where video_category='".$_GET["category_id"]."' and video_status=1";
$strtitle=str_replace("_"," ",$_GET["category_name"]);
}
if ($_GET["top"]!='')
{
$sql="select *,(video_votes/video_votes_count) as rank from video_master where video_status=1 and video_votes_count<>0 order by (video_votes/video_votes_count) desc";
$sqlcount="select count(*) from video_master where video_status=1";
$strtitle="Top Rated Videos";
}
if ($_GET["q"]!='')
{
if ($_GET['matchis'] == "exact")
{
$sql="select * from video_master where video_title like '%".$_GET["q"]."%' and video_status=1 ";
$sqlcount="select count(*) from video_master where video_title like '%".$_GET["q"]."%' and video_status=1";
}
//For Advance search
$tempword=split(" ",$_GET['q']);
for($i=0; $i<count($tempword); $i++)
{
if ($i==0)
$allstr.="((video_title like '%".$tempword[$i]."%' OR video_description like '%".$tempword[$i]."%')";
else
$allstr.="and (video_title like '%".$tempword[$i]."%' OR video_description like '%".$tempword[$i]."%')";
if ($i==0)
$anystr.="((video_title like '%".$tempword[$i]."%' OR video_description like '%".$tempword[$i]."%')";
else
$anystr.="OR (video_title like '%".$tempword[$i]."%' OR video_description like '%".$tempword[$i]."%')";
}
$allstr.=")";
$anystr.=")";
if ($_GET['matchis'] == "all")
{
$sql="select * from video_master where ".$allstr ." and video_status=1";
$sqlcount="select count(*) from video_master where ".$allstr ." and video_status=1";
}
if ($_GET['matchis'] == "any")
{
$sql="select * from video_master where ".$anystr ." and video_status=1";
$sqlcount="select count(*) from video_master where ".$anystr ." and video_status=1";
}
if ($_GET['video_size'] != "")
{
if ($_GET['video_size1'] == "1")
$sql.=" and video_size <='".$_GET['video_size']."'";
$sqlcount.=" and video_size <='".$_GET['video_size']."'";
if ($_GET['video_size1'] == "2")
$sql.=" and video_size >='".$_GET['video_size']."'";
$sqlcount.=" and video_size <='".$_GET['video_size']."'";
}
if ($_GET['votes'] != "")
{
$sql.=" and (video_votes/video_votes_count >='".$_GET['votes']."')";
$sqlcount.=" and (video_votes/video_votes_count >='".$_GET['votes']."')";
}
if ($_GET['video_category'] != "")
{
$sql.=" and video_category =".$_GET['video_category'];
$sqlcount.=" and video_category =".$_GET['video_category'];
}
//END advance search
$strtitle="Search Results";
}
if ($sql=='')
{
$sql="select * from video_master where video_status=1";
$sqlcount="select count(*) from video_master where video_status=1";
}
if ($sqlcount=='')
{
$sql="select * from video_master where video_status=1";
$sqlcount="select count(*) from video_master where video_status=1";
}
$ps = 2;
$pg = new paging;
$pg->setpages($sqlcount);
$sql .= $pg->getlimit();
if ($_GET["user"]!='')
{
$sql="select my_fav_video,first_name,user_profile as user_profile from user_master where user_id=".$_GET["user"];
$cmd = mysql_query($sql);
$rs = mysql_fetch_array($cmd);
$sql="select * from video_master where video_code in (0".$rs[0].")";
$strtitle=$rs["first_name"]." Favorite Videos";
$metatitle=$strtitle;
$myurl="http://www.riotvideo.com/Favorite".$_GET["user"].".html";
}
if ($_GET["userown"]!='')
{
$sql="select V.*,U.first_name,U.user_profile as user_profile from video_master V,user_master U where V.video_status=1 and U.user_id=V.user_id and V.user_id=".$_GET["userown"];
$strtitle=$rs["first_name"]." Videos";
$metatitle=$strtitle;
$myurl="http://www.riotvideo.com/Member".$_GET["userown"].".html";
}
$cmdhome = mysql_query($sql);
include("header.php");
//include("welcome.php");
?>
<?while ($rshome = mysql_fetch_array($cmdhome))
{?>
<div class="middlecontainer">
<div class="breakme2"></div>
<div class="width100">
<strong>
<?=$rshome["video_date"];?>
</strong>
<a href="video.php?video_title=<?=$rshome["video_title"];?>" class="heading"><strong><?=$rshome["video_title"];?></strong></a>
</div>
<div class="width25 left">
<div class="marginmid">
<a href="video.php?video_title=<?=$rshome["video_title"];?>">
<?if (str_contains(strtolower($rshome["video_image"]), "http://")) {?>
<img src="<?=$rshome["video_image"];?>" width="115" height="103" border="0" class="picborder" />
<?}
else
{
if ($rshome["video_image"]!='') {?>
<img src="videoimages/<?=$rshome["video_image"];?>" width="115" height="103" border="0" class="picborder" />
<?}
}?>
</a>
</div>
</div>
<div class="width70 left">
<div class="marginmid">
<p>Type: <strong><a href="#">Video</a></strong></p>
<p><strong>Description:</strong></p>
<p><?=$rshome["video_description"];?></p>
<br />
<strong><?if ($rshome["video_warning"]!='') echo $rshome["video_warning"];?></strong>
<p> <img src="images/user_friend.gif" width="24" height="24" border="0" align="absmiddle" /> <a href="javascript:onClick=openWin('friend.php?video_code=<?=$rshome["video_code"];?>&name=<?=$rshome["video_title"];?>', 'width=450, height=330');"><strong>Send To A Friend</strong> </a> <img src="images/user_comment.gif" width="24" height="24" border="0" align="absmiddle" /> <a href="video.php?video_title=<?=$rshome["video_title"];?>#post"><strong>User Comment</strong></a></p>
</div>
</div>
<div class="breakme2"></div>
</div>
<!--watch out for this thing -->
<?}?>
<!--watch out for this thing -->
<?
include("footer.php");
?>
<script>
function openWin(argURL, argSize) {
window.open(argURL, "x_win" + (new Date()).getTime(), "resizable=yes,scrollbars=yes," + argSize);
}
</script>