| HoddzDJ |
10-10-2012 07:30 PM |
Quote:
Originally Posted by sunfighter
(Post 1277757)
No ajax will not correct that. Your php is doing it and we can not see the php. Check your schedule php for the main page php code or a include call to the php file by searching for the file name.
|
Thanks for the tips Sunfighter. The PHP of both index.php and schedule.php can be found below. Hopefully I'll be able to get to the bottom of it with a bit of help.
index.php
PHP Code:
<?php
/* Short and sweet */
define('WP_USE_THEMES', false);
require('./blog/wp-blog-header.php');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Pukka Radio | Not for the faint hearted!</title>
<meta name="google-site-verification" content="6qV_kVo0_SEhZ7P-qeljFkVSfoSdcg4ng0l_pTLEIs0" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="Keywords" content="pukka radio,pukka,radio,online radio,hoddz,madmuffin,stryka,nick-e,slaters,clowny,koopa,medowz,hardcore,hardstyle,hard trance,trance" />
<meta name="Description" content="Your source of free radio. Focusing on the rave scene, with every genre covered. Ranging from Hardcore, Drum & Bass, Dubstep, Techno, Hardstyle, Hard Trance and everything inbetween! Come check us out, we really aren't for the haint hearted..." />
<link rel="stylesheet" href="css/reset.css" />
<link rel="stylesheet" href="css/style.css" />
<meta property="og:site_name" content="Pukka Radio" />
<meta property="og:image" content="http://www.pukkaradio.net/images/logo.og.png" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://www.pukkaradio.net/index.php" />
<meta property="og:title" content="Pukka Radio" />
<meta property="fb:app_id" content="162999380399" />
<!-- begin flash player pop-up script -->
<SCRIPT TYPE='TEXT/JAVASCRIPT'>
var pukkaplayer1Window=null;
function flashplayer(mypage,myname,w,h,pos,infocus){
if (pos == 'random')
{LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
else
{LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
settings='width='+ w + ',height='+ h + ',top=' + TopPosition + ',left=' + LeftPosition + ',scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';flashplayerWindow=window.open('',myname,settings);
if(infocus=='front'){flashplayerWindow.focus();flashplayerWindow.location=mypage;}
if(infocus=='back'){flashplayerWindow.blur();flashplayerWindow.location=mypage;flashplayerWindow.blur();}
}
</script>
<!-- end flash player pop-up script -->
<!-- begin tunein pop-up script -->
<SCRIPT TYPE='TEXT/JAVASCRIPT'>
var tuneinWindow=null;
function tunein(mypage,myname,w,h,pos,infocus){
if (pos == 'random')
{LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
else
{LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
settings='width='+ w + ',height='+ h + ',top=' + TopPosition + ',left=' + LeftPosition + ',scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';tuneinWindow=window.open('',myname,settings);
if(infocus=='front'){tuneinWindow.focus();tuneinWindow.location=mypage;}
if(infocus=='back'){tuneinWindow.blur();tuneinWindow.location=mypage;tuneinWindow.blur();}
}
</script>
<!-- end tunein pop-up script -->
<!-- begin chat pop-up script -->
<SCRIPT TYPE='TEXT/JAVASCRIPT'>
var pukkachatWindow=null;
function pukkachat(mypage,myname,w,h,pos,infocus){
if (pos == 'random')
{LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
else
{LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
settings='width='+ w + ',height='+ h + ',top=' + TopPosition + ',left=' + LeftPosition + ',scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';pukkachatWindow=window.open('',myname,settings);
if(infocus=='front'){pukkachatWindow.focus();pukkachatWindow.location=mypage;}
if(infocus=='back'){pukkachatWindow.blur();pukkachatWindow.location=mypage;pukkachatWindow.blur();}
}
</script>
<!-- end chat pop-up script -->
<!-- begin onmouseover social script -->
<script language="javascript">
<!-- hide script from old browsers
//detect browser:
browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);
if (browserName == "Netscape" && browserVer >= 3) browserVer = "1";
else if (browserName == "Microsoft Internet Explorer" && browserVer == 4) browserVer = "1";
else browserVer = "2";
//preload images:
if (browserVer == 1) {
a1 = new Image(64,64);
a1.src = "images/social-icons/facebook-bw.png";
a2 = new Image(64,64);
a2.src = "images/social-icons/facebook.png";
b1 = new Image(64,64);
b1.src = "images/social-icons/twitter-bw.png";
b2 = new Image(64,64);
b2.src = "images/social-icons/twitter.png";
c1 = new Image(64,64);
c1.src = "images/social-icons/google-bw.png";
c2 = new Image(64,64);
c2.src = "images/social-icons/google+color.png";
d1 = new Image(64,64);
d1.src = "images/social-icons/youtube-bw.png";
d2 = new Image(64,64);
d2.src = "images/social-icons/youtube.png";
}
//image swapping function:
function hiLite(imgDocID, imgObjName, comment) {
if (browserVer == 1) {
document.images[imgDocID].src = eval(imgObjName + ".src");
window.status = comment; return true;
}}
//end hiding -->
</script>
<!-- end onmouseover social scrpt -->
</head>
<body>
<div id="container">
<div id="header">
<div id="header-wrapper">
<div id="logo">
<a href="index.php"><img src="images/header-logo.png" alt="Pukka Radio" width="" height="" border="0" /></a>
</div><!-- end -->
<ul id="navB">
<li><a href="index.php?id=schedule">Schedule</a></li>
<li><a href="http://www.pukkaradio.net/community/" target="_blank">Forums</a></li>
<li><a href="index.php?id=contact">Contact</a></li>
</ul>
<ul id="navA">
<li><a href="index.php?id=home">Home</a></li>
<li><a href="javascript:pukkachat('./chat/index.php','PukkaRadioChat','740','675','center','front');">Chat</a></li>
<li><a href="http://www.pukkaradio.net/blog/" target="_blank">Blog</a></li>
</ul>
</div><!-- #header-wrapper end -->
</div><!-- #header end -->
<?php
// Top level links
if($_GET['id'] == 'schedule')
{ include './sources/schedule.php'; }
if($_GET['id'] == 'autodj')
{ include './sources/autodj.php'; }
elseif($_GET['id'] == 'contact')
{ include './sources/contact.php'; }
// Homepage
else
{ include './sources/home.php'; }
?>
<div id="footer">
<div id="footer-wrapper">
<div class="socialBlock">
<h3 class="socialTitle">Connect with us:<h3>
<ul id="socialicons">
<li><a href="http://www.youtube.com/user/pukkatv" target="social" onMouseOver="hiLite('d','d2','Your Comment Here')" onMouseOut="hiLite('d','d1','')"><img name="d" src="images/social-icons/youtube-bw.png" border="0" width="64" height="64"></a></li>
<li><a href="https://plus.google.com/b/100127745757548011503/100127745757548011503/posts" target="social" onMouseOver="hiLite('c','c2','Your Comment Here')" onMouseOut="hiLite('c','c1','')"><img name="c" src="images/social-icons/google-bw.png" border="0" width="64" height="64"></a></li>
<li><a href="http://www.twitter.com/pukkaradio" target="social" onMouseOver="hiLite('b','b2','Your Comment Here')" onMouseOut="hiLite('b','b1','')"><img name="b" src="images/social-icons/twitter-bw.png" border="0" width="64" height="64"></a></li>
<li><a href="http://www.facebook.com/pukkaradio" target="social" onMouseOver="hiLite('a','a2','Your Comment Here')" onMouseOut="hiLite('a','a1','')"><img name="a" src="images/social-icons/facebook-bw.png" border="0" width="64" height="64"></a></li>
</ul>
</div>
<div id="copyright">
<p>Site built and maintained by Hoddz. Copyright 2007 - 2012 Pukka Radio, all rights reserved.</p>
<p>Pukka Radio streams at high volumes for prolonged periods, hearing protection is optional.</p>
<p>We will not be held responsible for any damaged caused to your hearing either temporarily or permanently.</p>
<p>You have been warned.</p>
</div>
</div><!-- #footer-wrapper end -->
</div><!-- #footer end -->
</body>
</html>
./sources/home.php
PHP Code:
<div id="main">
<div id="primaryContent" class="">
<h1 class="title">Welcome</h1>
<p class="firstP">Pukka Radio is an internet radio station with a difference. We focus on bringing the harder sounds to the masses, from upfront UK Hardcore to Drum & Bass, Trance to Techno and everything in between. We really aren't for the faint hearted.</p>
<div class="clear"></div>
<div class="one-third firstItem">
<h4><span>Latest</span> News</h4><?php $posts = get_posts('numberposts=1&order=DES&orderby=post_date');
foreach ($posts as $post) : start_wp(); ?>
<p class="firstP"><?php the_time('F jS, Y') ?><br /><?php the_content(); ?></p>
<p>You can read up on all of our news over at our blog, just check it out <a href="http://www.pukkaradio.net/blog" target="_blank">here</a>.<?php endforeach; ?></p>
</div><!-- #one-third -->
<div class="one-third">
<h4><span>Todays</span> Live Schedule</span></h4>
<p class="firstP"><?php include ('./sources/schedule-home.php') ?></p>
<p align="center"><a href="?times=Monday">Mon</a> - <a href="?times=Tuesday">Tue</a> - <a href="?times=Wednesday">Wed</a> - <a href="?times=Thursday">Thur</a> - <a href="?times=Friday">Fri</a> - <a href="?times=Saturday">Sat</a> - <a href="?times=Sunday">Sun</a></p>
<p>These are just our live shows for today, don't forget we are on air around the clock and you can see our full weekly schedule <a href="index.php?id=schedule">here</a>.</p><p> </p>
<h4><span>Our</span> Community</span></h4>
<p class="firstP">The whole concept of Pukka Radio is to all unite with the music and that is our only boundary, and we have an active forum and also a great chat room to connect with other listeners and all of our staff. Why not sign up to our forums or jump straight into our chat room and see what it's all about?</p>
</div><!-- #one-third -->
<div class="one-third last">
<h4><span>Tune</span> In</h4>
<p class="firstP">You can tune into Pukka Radio in a few different ways, and we have set them out below so just pick how you wanna tune in and away you go. Should you not be able to tune in, please contact us so we can fix it!</p>
<p align="center"><a href="javascript:flashplayer('./tunein/html5.php','PukkaRadioWebPlayer','450','210','center','front');"><img alt="Tune in using our pop-up player" border="0" src="tunein/flash.png" height="50" width="50" title="Tune in using our pop-up player"></a> <a href="javascript:tunein('http://tunein.com/tuner/?StationId=153291&','PukkaRadioTuneInPlayer','619','350','center','front');"><img alt="Launch Pukka Radio on TuneIn.com" border="0" src="./tunein/tunein.png" height="50" width="50" title="Launch Pukka Radio on TuneIn.com"></a> <a href="javascript:flashplayer('./tunein/html5.php','PukkaRadioWebPlayer','450','210','center','front');"><img alt="Tune in using our pop-up player" border="0" src="tunein/ios.png" height="50" width="50" title="Tune in using our pop-up player"></a></p>
<p>If you an an iPhone/iPad user, you can tune in on the move! Please note that we only stream at 128kbs and this uses a large amount of data transfer per hour so we suggest you only tune in when you are connected to WiFi.</p>
</div><!-- #one-third -->
<div class="clear"></div>
<div class="one-half firstItem">
<h4><span>Featured</span> Event</h4>
<div id="featuredIMG"><?php include ('./featured/sql/event.php'); ?></div>
</div>
<div class="one-half last">
<h4><span>Featured</span> Video</h4>
<div id="featuredVID"><?php include('./featured/sql/youtube.php'); ?></div><br />
<h4><span>Featured</span> SoundCloud</h4>
<div id="featuredSND"><?php include('./featured/sql/soundcloud.php'); ?></div>
</div>
</div><!-- #primaryContent end -->
</div><!-- #main end -->
</div><!-- #container end -->
./sources/schedule-home.php
PHP Code:
<?php
//set local variables
$dbhost = "localhost"; //Database Host
$dbuser = "****"; //Database User
$dbpass = "****"; //Database Password
$dbname = "****"; //Database Name
$serverdate = date('l',time() + 0000); // Set the correct studio day
//connect
$db = mysql_pconnect($dbhost,$dbuser,$dbpass);
mysql_select_db("$dbname",$db);
// create an array with the hours of the day, from 0 to 23
$hours = range(0, 23);
$valid_days = array (
'Sunday',
'Monday',
'Tuesday',
'Wednesday',
'Thursday',
'Friday',
'Saturday',
);
if($_GET['times'] == "" OR !in_array($_GET['times'], $valid_days)) // you should also check if this $_GET['times'] is valid
{
$_GET['times'] = $serverdate;
}
$day = $_GET['times'];
if($_GET['times'] == ""){
$day = date("l",time() + 3600);
$_GET['times'] = date("l",time() + 3600);
}
$result = mysql_query("SELECT * FROM rp_timetable WHERE day = '$day'");
while($slot = mysql_fetch_assoc($result))
{
$today_live_sets = false;
echo "<p class=\"firstP\">\n";
$lastslot = null;
foreach($hours AS $hour)
{
$slot_number = $hour + 1;
if($lastslot === null)
{
$starthour = $hour;
}
if($slot[$slot_number] != "")
{
if(($hour + 1) <= 23 AND $slot[$slot_number + 1] == $slot[$slot_number])
{
$lastslot = $slot[$slot_number];
continue;
}
else
{
$endhour = $hour + 1;
$today_live_sets = true;
printf("%02d00 - %02d00 | <b>%s</b><br />\n", $starthour, $endhour == 24 ? 0 : $endhour, $slot[$slot_number]);
$lastslot = null;
}
}
}
echo "</p>";
if($today_live_sets == false)
{
echo "<p class=\"firstP\">No live sets today!</p>\n";
}
}
?>
|