<?php
if(file_exists('config.php')){
}else{
header("Location:install/");
}
include('config.php');
 include("headertop.php"); 
/////////mySQL Connect////////////////
mysql_connect($dbloc, $dbuser, $dbpass);
mysql_select_db($db);
$results = mysql_query("SELECT * FROM allgenres order by id desc limit 0, 1");
while($rows = mysql_fetch_array( $results )) {
$ok=$rows['fname'];
echo '<html>
<title>Melero Video - Share and watch your videos with friends, family, and everyone you know.</title>
<table cellpadding=0 bgcolor=white width=90% align=center><td width=100% align=center bgcolor=white>'; ?>
<?php echo '
 <object width="100%" height="540" data="http://releases.flowplayer.org/swf/flowplayer-3.1.5.swf" type="application/x-shockwave-flash">        
<param name="movie" value="http://releases.flowplayer.org/swf/flowplayer-3.1.5.swf" />        
<param name="allowfullscreen" value="true" />        
<param name="allowscriptaccess" value="always" />        
<param name="flashvars" value='. "'". 'config={"plugins":{"pseudo":{"url":"flowplayer.pseudostreaming-3.1.3.swf"},"controls":{"backgroundColor":"#000000","backgroundGradient":"low"}},"clip":{"provider":"pseudo","url":"songs/'. $ok. '"},"playlist":[{"provider":"pseudo","url":"songs/'. $ok. '"}]}'. "'". ' />   </object>
</td></table>

<table height=100% valign=top align=center width=90%>
<td width=80% bgcolor=white valign=top>
<table width=100%>
<td><font size=6><b>Latest</td>
</td></table>
<table width=100%>';
}
$result = mysql_query("SELECT * FROM allgenres order by id desc limit 0, 45");
// keeps getting the next row until there are no more to get
$cols = 3; # Number of columns to display 
$colCtr = 1; 
while($row = mysql_fetch_array( $result )) {
echo '<script>
function openWin'. $row['id']. '()
{
window.open("stream.php?='. $row['id']. '","_blank");
}
</script>';
$sname = substr($row['vname'], 0, 50);
if($row['image']==''){
$row['image']='nophoto.png';
}
$adnum+=1;
$ar=array(5,16,29,42);
if (in_array("$adnum", $ar)) {
?>
<td width=300 height=250 valign=top>
<script type='text/javascript'>
(function(w) {
w.MobileMonetizer=w.MobileMonetizer||{}; var t={ID:'2439',category:'21'};
for(var a in t) w.MobileMonetizer[a]=t[a];
var d=document,h=d.getElementsByTagName('head')[0],j=d.createElement('script');
j.setAttribute('src','//www.adsoptimal.com/advertisement/manual.js');
h.appendChild(j);
})(window);
</script>
<div class="adsoptimal-slot" style="width: 300px; height: 250px;"></div>
</td>
<?php
}else{
echo '<td width=300 height=250 valign=top><a href=stream.php?='. $row['id']. '><img src="thumbs/'. $row['image']. '" width=280 height=250 alt="'. $sname. '" title="'. $sname. '"><font size=2><br><b>'. $sname. '<b></a><br><font size=1> by '. $row['userid']. ' '. $row['downloads'].  ' views</td>'; 
}
if($adnum >= 43){ 
}else{
if($colCtr == 3){ 
$colCtr=0;
echo '</table><table width=100% border=0 cellpadding=2 cellspacing=0><tr><td bgcolor=#F5F5F5 width=100% height=1></td></table><table width=100%><tr>'; 
}else{}
}
$colCtr++; 
}
?>
</table></td></table>
<?php include("headerbottom.php"); ?>
</body></html>
