-
Notifications
You must be signed in to change notification settings - Fork 0
/
onAirPlayer2.php
45 lines (39 loc) · 1.57 KB
/
onAirPlayer2.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?
mysql_connect('localhost','drupal_live','FJ737zGN6UPdwf5D');
mysql_select_db('drupal_live');
if ((date("H")%2) == 1) {
$mydate = date("H") - 1;
} else {
$mydate = date("H");
}
if (date("w") == 0) {
$mydate *= 60;
} else {
$mydate = ((date("w")*24*60)+($mydate*60));
}
$onairnow = mysql_query("SELECT * FROM drup_station_schedule_item WHERE `start` = '$mydate' ORDER BY `schedule_nid` DESC LIMIT 1");
$mydate += 120;
$onairnext = mysql_query("SELECT * FROM drup_station_schedule_item WHERE `start` = '$mydate' ORDER BY `schedule_nid` DESC LIMIT 1");
if (mysql_num_rows($onairnow) > 0) {
$shownameNow = mysql_result($onairnow,'0','program_nid');
$nodequery = mysql_query("SELECT * FROM drup_node WHERE `nid` = '$shownameNow'");
if (mysql_num_rows($nodequery) > 0) {
$shownameNow = mysql_result($nodequery,'0','title');
} else {
$shownameNow = "<a href='' onclick=\"window.open(this.href,'link_window');return false;\"></a>";
}
} else {
$shownameNow = "<a href='' onclick=\"window.open(this.href,'link_window');return false;\"></a>";
}
if (mysql_num_rows($onairnext) > 0) {
$shownameNext = mysql_result($onairnext,'0','program_nid');
$nodequery = mysql_query("SELECT * FROM drup_node WHERE `nid` = '$shownameNext'");
if (mysql_num_rows($nodequery) > 0) {
$shownameNext = mysql_result($nodequery,'0','title');
} else {
$shownameNext = "<a href='' onclick=\"window.open(this.href,'link_window');return false;\"></a>";
}
} else {
$shownameNext = "<a href='' onclick=\"window.open(this.href,'link_window');return false;\"></a>";
}
?>