138 lines
2.7 KiB
PHP
138 lines
2.7 KiB
PHP
<?php header('Content-type: application/json');
|
|
|
|
if ( !defined('PATHTOINCLUDES') ) define('PATHTOINCLUDES', $_SERVER["DOCUMENT_ROOT"] . '/cmeter/');
|
|
|
|
include(PATHTOINCLUDES."base.php");
|
|
|
|
include(PATHTOINCLUDES."recordset_xt.php");
|
|
|
|
$em="";
|
|
|
|
|
|
if(isset($_GET["offset"]))
|
|
|
|
{
|
|
|
|
$offset=$_GET["offset"];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$offset=0;
|
|
|
|
}
|
|
|
|
if($offset==""){$offset=0;}
|
|
|
|
|
|
|
|
$sql="SELECT
|
|
|
|
`you_x_tube`.`id`,
|
|
|
|
`you_x_tube`.`vid_id`,
|
|
|
|
`you_x_tube`.`imgurl`
|
|
|
|
FROM
|
|
|
|
`you_x_tube`
|
|
|
|
WHERE `you_x_tube`.`xtube` = 'Y' AND `you_x_tube`.`vid_active` = 'Y'
|
|
|
|
ORDER BY `you_x_tube`.`thesort` ASC
|
|
|
|
LIMIT 3 OFFSET " .$offset;
|
|
|
|
$result=$database->database_query($sql) or $em=$em.$database->database_error();
|
|
|
|
|
|
|
|
$sql2="SELECT count(`you_x_tube`.`id`) AS yid FROM `you_x_tube` WHERE `you_x_tube`.`xtube` = 'Y' AND `you_x_tube`.`vid_active` = 'Y' LIMIT 27 OFFSET 0";
|
|
|
|
$rcount=$database->database_query($sql2);
|
|
|
|
$thecount = $database->database_result($rcount,0);
|
|
|
|
$database->database_free_result($rcount);
|
|
|
|
$rownum=0;
|
|
|
|
$thetubes="";
|
|
|
|
$thetubes=$thetubes."<ul style=\"list-style-type:none;margin:0px auto;padding:0px;clear:both;position:relative;height:63px;\">";
|
|
|
|
|
|
|
|
while ($row = $database->database_fetch_assoc($result)) {
|
|
|
|
$rownum=$rownum+1;
|
|
|
|
if($rownum < 3)
|
|
|
|
{
|
|
|
|
$thetubes=$thetubes."<li style=\"float:left;margin:0px;padding:0px 2px 0 0px;position:relative;\">
|
|
|
|
<img src=\"".$row["imgurl"]."\" width=\"87\" height=\"65\" style=\"display:block;\"/>
|
|
|
|
<a href=\"javascript:view_xtube('".$row["vid_id"]."') \" style=\"font-size:10px;text-decoration:none;\">
|
|
|
|
<img src=\"/images/play_button_sm.png\" width=\"30\" height=\"23\" style=\"position:absolute;bottom:0px;left:57px;width:30px;height:23px;border:none;\" /></a>
|
|
|
|
</li>";
|
|
|
|
}
|
|
|
|
if($rownum==3)
|
|
|
|
{
|
|
|
|
$thetubes=$thetubes."<li style=\"float:left;margin:0px;padding:0px 0px 0 0px;position:relative;\"><img src=\"".$row["imgurl"]."\" width=\"88\" height=\"65\" style=\"display:block;\"/>
|
|
|
|
<a href=\"javascript:view_xtube('".$row["vid_id"]."') \" style=\"font-size:10px;text-decoration:none;\">
|
|
|
|
<img src=\"/images/play_button_sm.png\" width=\"30\" height=\"23\" style=\"position:absolute;bottom:0px;left:58px;width:30px;height:23px;border:none;\" /></a>
|
|
|
|
</li>";
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$thetubes=$thetubes."</ul>";
|
|
|
|
$thetubes=$thetubes."<div style=\"height:1px;margin-top:-1px;overflow:hidden;font-size:0px;\"> </div>";
|
|
|
|
|
|
|
|
$limit=3;
|
|
|
|
$container="thetubes";
|
|
|
|
$page_url="/js/act/get_xtube.php";
|
|
|
|
$navaid=recordsetNav($thecount,$page_url,$container,$offset,$limit,0);
|
|
|
|
$navaid="<div class=\"navaid\" style=\"text-align:right;padding:1px 5px 1px 0;background:#000;font-size:10px;\">".$navaid."</div>";
|
|
|
|
$thetubes=$thetubes.$navaid;
|
|
|
|
|
|
|
|
|
|
|
|
$arr = array ('error'=>$em, 'thecontent'=>$thetubes);
|
|
|
|
echo json_encode($arr);
|
|
|
|
?>
|
|
|
|
|
|
|