-3

我在我的 Stream 中添加了一些脚本,因为我在一个网站上工作,但由于某种原因我在第 14 行一直出错 $User_id; 无法正常工作,我多次浏览脚本但找不到错误,它是一个语法错误,但并没有告诉我太多原因,因为我不是 php 专业人士,但我知道有很多人是 :D 但是无论如何,请帮助:)

<?php
include('settings.php');
//Made by Arnem\\
//Settings.php\\
$closed = 2000; //format of time the stream usualy closes\\
$closed2 = '20:00'; //format of same as $closed but with : in the middle of hours : minutes\\
$opend = 1500; //format of time when the stream usualy starts\\
$opend2 = '15:00'; //format of same as $opend but with : in the middle of hours : minutes\\

$openmsg = '<p class=customfont>Streaming status: Online</p>'; //Streaming Online Message\\
$closemsg = '<h1 class=customfont2>Streaming is currently offline!</h1>'; //closed message\\
$closemsg2 = 'Streaming status: Offline'; //Streaming offline message\\
$Streamer_msg = 'Streamer:'; //Message of streamer\\
$Streamer_error = 'ERROR, user not found.'
$User_id = '2';
$userid1 = 'Arnem'; //User that streams songs\\
$userid2 = 'DJ Trolli';
$userid3 = 'Mr. Nobody';
$userid4 = '';
$userid5 = '';
$usr_None = 'None';
$userid = $User_id;
//End of Settings.php\\
//DO NOT CONFIGURE UNDER THIS LINE!\\
$Streamermssg = $Streamer_msg . ' ';
$Streamererror = $Streamer_msg . '';
if ($usersid == NULL) {
$user1 = '<p class=customfont>' . $Streamermssg . $usr_None . '</p>';
} elseif ($usrid == '1') {
$user1 = '<p class=customfont>' . $Streamermssg . $userid1 . '</p>';
} elseif ($userid == '2') {
$user1 = '<p class=customfont>' . $Streamermssg . $userid2 . '</p>';
} elseif ($userid == '3') {
$user1 = '<p class=customfont>' . $Streamermssg . $userid3 . '</p>';
} elseif ($userid == '4') {
$user1 = '<p class=customfont>' . $Streamermssg . $userid4 . '</p>';
} elseif ($userid == '5') {
$user1 = '<p class=customfont>' . $Streamermssg . $userid5 . '</p>';
} else {
$user1 = '<p class=customfont>' . $Streamererror . '</p>';
}

$openmsg3 = '<p class=customfont>' . $openmsg;
$closemsg3 = '<h1 class=customfont2>' . $closemsg;
$closemsg4 = '<p class=customfont>' . $closemsg2 . '</p>';

//Re Configure script\\
$time = gmdate(H)+1 . gmdate(i);

if ($time>$closed) {
$streamer = $Streamermsg . $usr_None . '</p>';
$status1 = $closemsg3;
$status2 = $closemsg4;
} elseif ($time<$opend) {
$streamer = $Streamermsg . $usr_None . '</p>';
$status1 = $closemsg3;
$status2 = $closemsg4;
} else {
$streamer = $Streamermsg2 . $user1;
$status2 = $openmsg3;
}

?>
<!--HTML CODE -->
<html>
<center>
<h1 class="customfont">Welcome to my Stream</h1>
<head>

<title>Sound of Songs</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="swfobject.js"></script>

<style type="text/css">
@font-face {
        font-family: "My Custom Font";
        src: url(http://enderman.tk/stream/custom.ttf) format("truetype");
}
@font-face {
        font-family: "My Custom Font2";
        src: url(http://enderman.tk/stream/custom2.ttf) format("truetype");
}
p.customfont {
        font-family: "My Custom Font";
        color: #ffffff;
}
h1.customfont {
        font-family: "My Custom Font";
        color: #ffffff;
}
h2.customfont {
        font-family: "My Custom Font";
        color: #ffffff;
}
a.customfont {
        font-family: "My Custom Font";
        color: #ffffff;
}
a.customfont:hover {
        font-family: "My Custom Font";
        color: #000000;
}
a.customfont:visited {
        font-family: "My Custom Font";
        color: #3399CC;
}
h1.customfont2 {
        font-family: "My Custom Font";
        color: #FF0000;
}
body
{
background-color: #2c85c7;
}
</style>
<!--FLASH CONTENT-->

</head>
<body>
<div id="flashcontent2">
        <p>
        <strong>Sorry this site have a flash based native radio and needed adobe flash 10+ support. </strong><br />
            <a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Download Flash here.</a>
    </p>
</div>

<script type="text/javascript">
        // <![CDATA[

        var so = new SWFObject("nativeradio2small.swf", "nativeradio2small", "300", "50", "10", "#cccccc");
        so.addParam("scale", "noscale");
        so.addVariable("swfcolor", "2c85c7");
        so.addVariable("swfwidth", "300");
        so.addVariable("swfradiochannel", "Sound of Songs");
        so.addVariable("swfstreamurl", "http://enderman.tk:1234");
        so.addVariable("swfpause", "1");
        so.write("flashcontent2");

        // ]]>
</script>
<p></p>
</body>
<?php echo $status1; ?>
<p class="customfont">Mixes: DJ Trolli</p>
<p class="customfont">Songs found by Arnem</p>
<p class="customfont">And played by Arnem</p>
<p class="customfont">Love from Arnem & DJ Trolli!</p>
<p class="customfont">Stream is up at <?php echo $opend2; ?> - <?php echo $closed2; ?> GMT +1</p>
<?php echo $status2; ?>
<?php echo $streamer; ?>

<br />
<h2 class="customfont">Special Message for our Listeners :)</h2>
<p class="customfont">Want more of DJ Trolli?</p><a href="https://soundcloud.com/djtrolli" class="customfont"> Click Here :)</a>

</center>
</html>
4

3 回答 3

1

第 14 行应该是这样的(末尾有分号):

$Streamer_error = 'ERROR, user not found.' ;

查看 Web 服务器 error.log 以获取错误消息。

于 2013-01-20T14:07:27.017 回答
0

您之前错过了;该行:

$Streamer_error = 'ERROR, user not found.';
//       semi-colon missing here ---------^
于 2013-01-20T14:05:17.793 回答
0

你忘了用;分号结束那句话

请从下一行替换该行:-

$Streamer_error = 'ERROR, user not found.';
于 2013-01-20T14:06:50.430 回答