182 lines
3.5 KiB
PHP
182 lines
3.5 KiB
PHP
<?php header('Content-type: application/json');
|
|
|
|
if ( !defined('PATHTOINCLUDES') ) define('PATHTOINCLUDES', $_SERVER["DOCUMENT_ROOT"] . '/cmeter/');
|
|
|
|
|
|
|
|
include(PATHTOINCLUDES."base.php");
|
|
|
|
include(PATHTOINCLUDES."recordset_yt.php");
|
|
|
|
$em="";
|
|
|
|
|
|
|
|
|
|
if(isset($_GET["offset"]))
|
|
|
|
{
|
|
|
|
$offset=$_GET["offset"];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$offset=0;
|
|
|
|
}
|
|
|
|
if($offset==""){$offset=0;}
|
|
|
|
$page=
|
|
|
|
/*
|
|
|
|
$sql="SELECT
|
|
|
|
`you_x_tube`.`id`,
|
|
|
|
`you_x_tube`.`vid_id`,
|
|
|
|
`you_x_tube`.`width`,
|
|
|
|
`you_x_tube`.`height`,
|
|
|
|
`you_x_tube`.`vid_desc`,
|
|
|
|
`you_x_tube`.`vid_title`
|
|
|
|
FROM
|
|
|
|
`you_x_tube`
|
|
|
|
WHERE `you_x_tube`.`youtube` = 'Y' AND `you_x_tube`.`vid_active` = 'Y'
|
|
|
|
ORDER BY `you_x_tube`.`thesort` ASC
|
|
|
|
LIMIT 3 OFFSET " .$offset;
|
|
|
|
*/
|
|
|
|
|
|
|
|
$sql="SELECT
|
|
|
|
`you_x_tube`.`id`,
|
|
|
|
`you_x_tube`.`vid_id`,
|
|
|
|
`you_x_tube`.`width`,
|
|
|
|
`you_x_tube`.`height`,
|
|
|
|
`you_x_tube`.`vid_desc`,
|
|
|
|
`you_x_tube`.`vid_title`
|
|
|
|
FROM
|
|
|
|
`you_x_tube`
|
|
|
|
WHERE `you_x_tube`.`youtube` = 'Y' AND `you_x_tube`.`vid_active` = 'Y' AND id NOT IN(".$database->database_real_escape_string($_GET["ids"]).")
|
|
|
|
ORDER BY RAND()
|
|
|
|
LIMIT 10";
|
|
|
|
$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`.`youtube` = '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="";
|
|
|
|
$currentids=$_GET["ids"];
|
|
|
|
while ($row = $database->database_fetch_assoc($result)) {
|
|
|
|
if($currentids==""){$currentids=$row["id"];}
|
|
|
|
else{$currentids=$currentids.",".$row["id"];}
|
|
|
|
$rownum=$rownum+1;
|
|
|
|
if($rownum % 2 != 0){$rc="#333";} else{$rc="#000";}
|
|
|
|
$ytimage="https://img.youtube.com/vi/".$row["vid_id"]."/1.jpg";
|
|
|
|
$thetubes=$thetubes."<div class=\"tubes-container\" id=\"tube_post_".$rownum."\" style=\"background:".$rc.";position:relative;\">
|
|
|
|
<div class=\"tubes-container-pad\">
|
|
|
|
<span style=\"position:relative;display:block;float:left;height:60px;width:85px;padding:2px 1px 2px 1px;text-decoration:none;\">
|
|
|
|
<img src=\"".$ytimage."\" width=\"79\" height=\"60\" style=\"padding:1px;background:#707070;border:none;\" />
|
|
|
|
<a href=\"javascript:view_youtube('".$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:1px;left:51px;width:30px;height:23px;border:none;\" /></a>
|
|
|
|
</span>
|
|
|
|
<div>
|
|
|
|
<span class=\"yt_vid_title\"> <a href=\"javascript:view_youtube('".$row["vid_id"]."') \" style=\"font-size:10px;\">".stripslashes($row['vid_title'])."</a></span>
|
|
|
|
</div>
|
|
|
|
<div class=\"yt_vid_desc\" style=\"font-size:10px;\">".stripslashes($row["vid_desc"])."</div>
|
|
|
|
<div class=\"wall-clear\" style=\"height:2px;margin-top:-1px;clear:both;overflow:hidden;\"> </div>
|
|
|
|
</div>
|
|
|
|
</div>";
|
|
|
|
}
|
|
|
|
$thetubes=$thetubes."
|
|
|
|
<script type='text/javascript'>
|
|
|
|
ids=ids+'".$currentids."'
|
|
|
|
|
|
|
|
</script>
|
|
|
|
<div class='morelink'><a href=\"javascript:loadmoreyoutube('".$currentids."');\">More</a></div><strong></strong>
|
|
|
|
";
|
|
|
|
$limit=300;
|
|
|
|
$container="thetubes";
|
|
|
|
$page_url="/js/act/get_youtube.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);
|
|
|
|
?>
|