File: /home/httpd/html/seekya.com/DEAD/beta/listing.php.bak2
<? 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))
{?>
<tr>
<td>
<strong><?=$rshome["video_date"];?></strong>
<a href="video.php?video_title=<?=$rshome["video_title"];?>" class="heading"><strong><?=$rshome["video_title"];?></strong></a>
<table width="95%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td><table width="13%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="100%" border="0" cellspacing="1" cellpadding="3">
<tr>
<td><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" />
<?}
else
{
if ($rshome["video_image"]!='') {?>
<img src="videoimages/<?=$rshome["video_image"];?>" width="115" height="103" border="0" />
<?}
}?>
</a> </td>
</tr>
</table></td>
</tr>
</table>
<p class="text"> </p>
<p class="text">Type: <span class="bodylinks">
<strong><a href="#" class="bodylinks">Video</a></strong></span></p>
<p class="text"><strong>Description:</strong>
<?=$rshome["video_description"];?>
<br />
<strong>
<?if ($rshome["video_warning"]!='') echo $rshome["video_warning"];?>
</strong><a href="javascript:onClick=openWin('friend.php?video_code=<?=$rshome["video_code"];?>&name=<?=$rshome["video_title"];?>', 'width=450, height=330');"><br />
<img src="images/sendtofriend.gif" border="0" /></a> <a href="video.php?video_title=<?=$rshome["video_title"];?>#post"><br />
<img src="images/comment.gif" border="0" /></a></p></td>
</tr>
</table>
</td>
</tr>
<?}?>
<?
include("footer.php");
?>
<script>
function openWin(argURL, argSize) {
window.open(argURL, "x_win" + (new Date()).getTime(), "resizable=yes,scrollbars=yes," + argSize);
}
</script>