Parse error: syntax error, unexpected $end
ik heb het forum al doorgespit, en ik zie dat het aan een } ligt.. nou ik heb de hele tekst doorgespit... maar ik zie niet waar ik hem vergeten heb... heb alles ingevouwen, en het klopt...
maar toch... de foutmelding...
Parse error: syntax error, unexpected $end in /home/johanlindeman.com/public_html/xml_parse.php on line 158
kunnen er misschien geen tabellen in zoiets?? en zo niet, hoe moet ik dit oplossen??
Code (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<?php
require_once('class_xml.php');
$x = new xml();
$source = file_get_contents("http://www.XXXX.nl/johanlindeman_xml.php");
if (!$x->fetch($source)) {
/*
The class has a 'log' property that contains a log of events. This log is useful for testing and debugging.
*/
echo "<h2>There was a problem parsing your XML!</h2>";
echo $x->log;
exit();
}
//itterate through the available consultents
foreach ($x->data->AVAILABLE[0]->CONSULTANT as $consultant)
{
$boxnumber=$consultant->BOXNUMBER[0]->_text; //Boxnummer
$nickname=$consultant->NICKNAME[0]->_text; //Nickname
$boxstatus=$consultant->ACTIVATED[0]->_text; //Aangemeld of afgemeld
$boxintro=$consultant->INTROSHORT[0]->_text; //Korte intro
$boxintrolong=$consultant->INTROLONG[0]->_text; //Lange intro
$sms_available=$consultant->SMSAVAILABLE[0]->_text; //Doet ook sms
$boximage=$consultant->PHOTO[0]->_text;
$nickname = htmlentities($nickname);
$boxintro= htmlentities($boxintro);//replace strange characters
$boxintro=str_replace("<", "<", $boxintro);
$boxintro=str_replace(">", ">", $boxintro);
$callstatus=$consultant->CALLSTATUS[0]->_text; //In gesprek / beschikbaar
$webcam_available = $consultant->WEBCAMAVAILABLE[0]->_text; //beschikt over webcam ja/nee
$webcamonline=$consultant->WEBCAMONLINE[0]->_text; //heeft webcam aanstaan
$webcamstatus=$consultant->WEBCAMSTATUS[0]->_text; //heeft een chat sessie met klant
$webcamfull=$consultant->WEBCAMFULL[0]->_text; //Webcam heeft maximum clients
$webcamurl=$consultant->WEBCAMURL[0]->_text; //De link om onderstaande form te posten (via javascript)
$webcamform=$consultant->WEBCAMFORM[0]->_text; //Form om te posten voor webcam (deze moet worden geinclude indien webcam)
$table_counter=0;
// $color="#92F77B";
// IF ($boxstatus=='1') {
// $boxstatus= <img src="images/online.jpg" />;
// } else {
// $boxstatus='Offline';
// $color="#FF2E00 ";
//}
// IF ($callstatus=='1') {
// $boxstatus='in gesprek';
// $color="#FF9900 ";
// }
//Check if webcam icon has to be displayed
$displaywebcam=0; //No webcam available
if ($webcam_available == '1') //Consultant has a webcam available
{
if ($webcamonline=='1') //The webcam is Online
{
if ($webcamfull==0) //Room is not full for this consultant
{
if($callstatus==1 & $webcamstatus==0) //Occupied by phone
{
$displaywebcam=2; //status 2, occupied by phone
}
else
{
$displaywebcam=1; //Webcam on
}
}
else
{
$displaywebcam=2; //Status 2, occupied by phone
}
}
}
//Enter form when webcam is available and online
if ($displaywebcam == 1)
{
echo("<form name='frm_".$box_id."' target='_blank' method='POST' action='http://webcam.total-stats.com/webcam_code_full.php'>");
echo("<input type='hidden' name='box_id' value='".$box_id."'>");
echo("<input type='hidden' name='operator_id' value='".$operator_id."'>");
echo("<input type='hidden' name='nickname' value='".$nickname."'>");
echo("<input type='hidden' name='nl_number' value='0909-2221222'>");
echo("<input type='hidden' name='be_number' value='0907/43277'>");
echo("input type='hidden' name='default_selected' value='nl'");
echo("</form>");
}
?>
<div class='consultantbox'>
<table width="344" border="0">
<tr>
<td width="344" height="238" align="left" valign="top" background="images/jlcboxgroot.jpg"><table width="344" border="0">
<tr>
<td colspan="2" align="left" valign="top"><div style="color:#000000; font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold;"><?php echo($nickname);?></div> </td>
<td colspan="2" align="right" valign="top"><span class="stijl8">Boxnr:</span> </td>
<td width="52" align="right" valign="top"><div style="color:#000000; font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold;"><?php echo($boxnumber);?></div></td>
</tr>
<tr>
<td colspan="2" rowspan="2"><img src="<?php echo($boximage);?>" width="175" height="132" align="top" /></td>
<td height="21" colspan="3"><span class="stijl10">Info:</span></td>
</tr>
<tr>
<td height="118" colspan="3" align="left" valign="top"><div style="color:#000000; font-family:Arial, Helvetica, sans-serif; font-size:12px; "><?php echo($boxintro);?></div></td>
</tr>
<tr>
<td width="85"> </td>
<td width="87"> </td>
<td colspan="2"> </td>
<td><div id="BOX" style="color:#000000; font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold;"></div></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td width="82" rowspan="2">
<?php
if($boxstatus == 1)
{
echo '<img src="images/online.jpg" />';
}
else
{
if($callstatus == 1)
{
echo '<img src="images/bezet.jpg" />';
}
else
{
echo '<img src="images/offline.jpg" />';
}
?> </td>
<td colspan="2" rowspan="2"> </td>
</tr>
<tr>
<td> </td>
<td></td>
</tr>
</table></td>
</tr>
</table>
</div>
<?php
if($displaywebcam==1)
{
echo(" <a href='javascript:document.frm_".$box_id.".submit();'><img width='12' height='15' border='0' src='../images/webcam.png'> <b>Klik hier om mij te zien via de Webcam ! </b></a>");
}
if($displaywebcam==2)
{
echo(" <img width='12' height='15' border='0' src='../images/webcam.png'/> <b>Ik ben momenteel bezet via de Webcam</b>");
}
}//loop
?>
require_once('class_xml.php');
$x = new xml();
$source = file_get_contents("http://www.XXXX.nl/johanlindeman_xml.php");
if (!$x->fetch($source)) {
/*
The class has a 'log' property that contains a log of events. This log is useful for testing and debugging.
*/
echo "<h2>There was a problem parsing your XML!</h2>";
echo $x->log;
exit();
}
//itterate through the available consultents
foreach ($x->data->AVAILABLE[0]->CONSULTANT as $consultant)
{
$boxnumber=$consultant->BOXNUMBER[0]->_text; //Boxnummer
$nickname=$consultant->NICKNAME[0]->_text; //Nickname
$boxstatus=$consultant->ACTIVATED[0]->_text; //Aangemeld of afgemeld
$boxintro=$consultant->INTROSHORT[0]->_text; //Korte intro
$boxintrolong=$consultant->INTROLONG[0]->_text; //Lange intro
$sms_available=$consultant->SMSAVAILABLE[0]->_text; //Doet ook sms
$boximage=$consultant->PHOTO[0]->_text;
$nickname = htmlentities($nickname);
$boxintro= htmlentities($boxintro);//replace strange characters
$boxintro=str_replace("<", "<", $boxintro);
$boxintro=str_replace(">", ">", $boxintro);
$callstatus=$consultant->CALLSTATUS[0]->_text; //In gesprek / beschikbaar
$webcam_available = $consultant->WEBCAMAVAILABLE[0]->_text; //beschikt over webcam ja/nee
$webcamonline=$consultant->WEBCAMONLINE[0]->_text; //heeft webcam aanstaan
$webcamstatus=$consultant->WEBCAMSTATUS[0]->_text; //heeft een chat sessie met klant
$webcamfull=$consultant->WEBCAMFULL[0]->_text; //Webcam heeft maximum clients
$webcamurl=$consultant->WEBCAMURL[0]->_text; //De link om onderstaande form te posten (via javascript)
$webcamform=$consultant->WEBCAMFORM[0]->_text; //Form om te posten voor webcam (deze moet worden geinclude indien webcam)
$table_counter=0;
// $color="#92F77B";
// IF ($boxstatus=='1') {
// $boxstatus= <img src="images/online.jpg" />;
// } else {
// $boxstatus='Offline';
// $color="#FF2E00 ";
//}
// IF ($callstatus=='1') {
// $boxstatus='in gesprek';
// $color="#FF9900 ";
// }
//Check if webcam icon has to be displayed
$displaywebcam=0; //No webcam available
if ($webcam_available == '1') //Consultant has a webcam available
{
if ($webcamonline=='1') //The webcam is Online
{
if ($webcamfull==0) //Room is not full for this consultant
{
if($callstatus==1 & $webcamstatus==0) //Occupied by phone
{
$displaywebcam=2; //status 2, occupied by phone
}
else
{
$displaywebcam=1; //Webcam on
}
}
else
{
$displaywebcam=2; //Status 2, occupied by phone
}
}
}
//Enter form when webcam is available and online
if ($displaywebcam == 1)
{
echo("<form name='frm_".$box_id."' target='_blank' method='POST' action='http://webcam.total-stats.com/webcam_code_full.php'>");
echo("<input type='hidden' name='box_id' value='".$box_id."'>");
echo("<input type='hidden' name='operator_id' value='".$operator_id."'>");
echo("<input type='hidden' name='nickname' value='".$nickname."'>");
echo("<input type='hidden' name='nl_number' value='0909-2221222'>");
echo("<input type='hidden' name='be_number' value='0907/43277'>");
echo("input type='hidden' name='default_selected' value='nl'");
echo("</form>");
}
?>
<div class='consultantbox'>
<table width="344" border="0">
<tr>
<td width="344" height="238" align="left" valign="top" background="images/jlcboxgroot.jpg"><table width="344" border="0">
<tr>
<td colspan="2" align="left" valign="top"><div style="color:#000000; font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold;"><?php echo($nickname);?></div> </td>
<td colspan="2" align="right" valign="top"><span class="stijl8">Boxnr:</span> </td>
<td width="52" align="right" valign="top"><div style="color:#000000; font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold;"><?php echo($boxnumber);?></div></td>
</tr>
<tr>
<td colspan="2" rowspan="2"><img src="<?php echo($boximage);?>" width="175" height="132" align="top" /></td>
<td height="21" colspan="3"><span class="stijl10">Info:</span></td>
</tr>
<tr>
<td height="118" colspan="3" align="left" valign="top"><div style="color:#000000; font-family:Arial, Helvetica, sans-serif; font-size:12px; "><?php echo($boxintro);?></div></td>
</tr>
<tr>
<td width="85"> </td>
<td width="87"> </td>
<td colspan="2"> </td>
<td><div id="BOX" style="color:#000000; font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold;"></div></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td width="82" rowspan="2">
<?php
if($boxstatus == 1)
{
echo '<img src="images/online.jpg" />';
}
else
{
if($callstatus == 1)
{
echo '<img src="images/bezet.jpg" />';
}
else
{
echo '<img src="images/offline.jpg" />';
}
?> </td>
<td colspan="2" rowspan="2"> </td>
</tr>
<tr>
<td> </td>
<td></td>
</tr>
</table></td>
</tr>
</table>
</div>
<?php
if($displaywebcam==1)
{
echo(" <a href='javascript:document.frm_".$box_id.".submit();'><img width='12' height='15' border='0' src='../images/webcam.png'> <b>Klik hier om mij te zien via de Webcam ! </b></a>");
}
if($displaywebcam==2)
{
echo(" <img width='12' height='15' border='0' src='../images/webcam.png'/> <b>Ik ben momenteel bezet via de Webcam</b>");
}
}//loop
?>
mijn dank is zeer groot... wie mij hierbij wil helpen
Gewijzigd op 01/01/1970 01:00:00 door Gertjan
gertjan schreef op 26.01.2009 02:46:
hij maakt er wel een zooitje van...
Gebruik voortaan en tags om je code heen. Om php code zet je uiteraard dit:Gebruik je knop om dit te doen.
SanThe.
Edit: Je sluit de 'else' van regel 124 niet af.
Gewijzigd op 01/01/1970 01:00:00 door - SanThe -