Author |
Message |
Countryman98
Hangin' Around

Joined: Feb 24, 2005
Posts: 30
|
Posted:
Wed Sep 28, 2005 4:21 am |
|
Hi All,
I am very new to PHPNUKE and php in general and am trying to add this script into the following block but am having now luck. Can someone please give me the correct format to add this :
Any and all help would be very much appreciated.
Code:
echo "<s cript type=\"text/javascript\">\n";
echo "<!--\n";
echo "function openradiowma(){\n";
echo " window.open (\"modules.php?name=Nuke-Cast&file=popup_radio\",\"Radio\",\"toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no,width=345,height=120\");\n";
echo "}\n";
echo "//-->\n";
echo "</S CRIPT>\n\n";
echo "<s cript type=\"text/javascript\">\n";
echo "<!--\n";
echo "function openradiorm(){\n";
echo " window.open (\"modules.php?name=Nuke-Cast&file=popup_radio&op=host1rm\",\"Radio\",\"toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no,width=345,height=120\");\n";
echo "}\n";
echo "//-->\n";
echo "</S CRIPT>\n\n";
|
Into this block :
Code:
require("config2.php");
$db->open("SELECT songlist.*, historylist.listeners as listeners, historylist.requestID as requestID, historylist.date_played as starttime FROM historylist,songlist WHERE (historylist.songID = songlist.ID) AND (songlist.songtype='S') ORDER BY historylist.date_played DESC",1);
$history = $db->rows();
reset($history);
list($key, $song) = each($history);
$listeners = $song["listeners"];
$starttime = strtotime($song["date_played"]);
$curtime = time()-26; //adjust in miliseconds if offset from web host
$secsRemain = (round($song["duration"] / 1000)-($curtime-$starttime));
$pic_cnt = 0;
function PicName()
{
global $pic_cnt;
echo "Picture".$pic_cnt;
}
function NextPicName()
{
global $pic_cnt;
$pic_cnt += 1;
PicName();
}
function PutSongRow(&$song)
{
global $rc, $showpic, $darkrow, $lightrow;
PrepareSong($song);
}
//PutSongRow
$rc=0;
PutSongRow($song);
$mainsong = $song;
?>
<d iv align="center"><i mg id="<? NextPicName(); ?>" onError="PictureFail('<? PicName(); ?>')" src="<? echo $mainsong['picture']; ?>" border="0" width="<? echo $picwidth; ?>"><br><br>
<font size="2" face="arial" color="#000000">
Now Playing:</font><br>
</a>
<fo nt size="2" color="#000000">
<ma rquee width="100%" scrolldelay="100" scrollamount="5"><font class="content"><f ont color="red"><? echo $mainsong['artist'];?> - <? echo $mainsong['title']; ?><font color="#000000"> - <? echo $mainsong['mmss']; ?></marquee></font></b>
</s mall></f ont>
</ d iv><di v align="center"><fo nt size="-3"><font color="#B4B7CA">(Refresh in: <b id="countDownText"></b>)</b></font>
<h r align="center">
<p a lign="center"><font size="2"><font color="#000000" face="arial">Tune In Here Using:<br>
</font></b></font><font size="1" color="#B4B7CA">(CHOOSE PLAYER)<br><br></font>
|
I am trying to make it so that when a listener click on a windowsmedia link for example it opens a windows media player window.
Or realplayer opens a realplayer window.
Code:
<a href="http://66.246.222.54:8840/listen.pls"><img src="/modules/Nuke-Cast/images/real.gif" border=0></a>
<a href="http://66.246.222.54:8840/listen.pls"><img src="/modules/Nuke-Cast/images/winamp.gif" border=0></a>
<a href="http://66.246.222.54:8840/listen.pls"><img src="/modules/Nuke-Cast/images/windowsmedia.gif" border=0></a>
<a href="http://66.246.222.54:8840/listen.pls"><img src="/modules/Nuke-Cast/images/itunes.gif" border=0></a> <br>
<? //<br><img src="/modules/Nuke-Cast/images/radio-logo.gif" border=0>
?>
<br><img src="/modules/Nuke-Cast/images/radio-logo.gif" border=0>
<br><script type="text/javascript" src="/livehelp/livehelp_js.php?relative=Y&department=1&serversession=1&pingtimes=15&username=<? echo $username;?>"></s cript>
<hr>
</f ont></a></p>
<d iv align="center"><font size="2" face="arial">Listeners <b><? echo "$listeners"; ?></b>/40
<d iv align="center">
<d iv align="center"><a href="http://www.hotcountry.co.nz" target="_blank"><font size="1" color="#B4B7CA">(C) Hot Country FM</f ont></a></f ont>
</d iv>
<s cript language="JavaScript">
var countDownInterval = <? echo $secsRemain; ?>;
var countDownTime = countDownInterval + 1;
if (document.all||document.getElementById)
countDown();
else
window.onload = countDown;
function countDown() {
countDownTime--;
if (countDownTime == 0) {
countDownTime = countDownInterval;
window.location.reload();
return;
}
else if (countDownTime < 0)
countDownTime = 30;
if (document.all)
document.all.countDownText.innerText = secsToMins(countDownTime);
else if (document.getElementById)
document.getElementById("countDownText").innerHTML = secsToMins(countDownTime);
counter = setTimeout("countDown()", 1000);
}
function secsToMins(theValue) {
var theMin = Math.floor(theValue / 60);
var theSec = (theValue % 60);
if (theSec < 10)
theSec = "0" + theSec;
return(theMin + ":" + theSec);
}
</s cript>
|
|
|
|
|
 |
kguske
Site Admin

Joined: Jun 04, 2004
Posts: 6437
|
Posted:
Wed Sep 28, 2005 11:09 am |
|
You might want to try Only registered users can see links on this board! Get registered or login! tool. |
_________________ I search, therefore I exist...
Only registered users can see links on this board! Get registered or login! |
|
|
 |
Countryman98

|
Posted:
Wed Sep 28, 2005 11:32 pm |
|
The above dosent seem to work for what im trying to do?
Anyone else out there that can help? |
|
|
|
 |
kguske

|
Posted:
Wed Sep 28, 2005 11:53 pm |
|
Disipal's tool lets you paste raw HTML, Javascript, etc., but not PHP, into a textarea and create a simple Nuke block. You could use this as a starting point with your HTML and Javascript, then add the PHP later.
You might want to copy an existing block that accesses data, and modify it to suit your needs. You'll notice that instead of print or echo, Nuke blocks must set the variable $content.
Finally, there is Only registered users can see links on this board! Get registered or login! that can help. |
|
|
|
 |
Countryman98

|
Posted:
Thu Sep 29, 2005 7:03 pm |
|
Thanks for your help kguske im working on it  |
|
|
|
 |
Raven
Site Admin/Owner

Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Thu Sep 29, 2005 10:49 pm |
|
Personally I do not recommend that block creator except for the simplest of tasks. It's bloated and gets confused often. PHP provides the easiest way to insert javascript into a script. Using the HEREDOC/WHEREDOC syntax: http://www.ravenphpscripts.com/postt28.html |
|
|
|
 |
Countryman98

|
Posted:
Fri Sep 30, 2005 1:00 am |
|
Buggered if i can figure out how to impliment this code into the block.. Am no im not blonde. Can someone show me pretty please  |
|
|
|
 |
|