|
|
|
|
Joined: Dec 2006
Posts: 1,235
veteran
|
|
veteran
Joined: Dec 2006
Posts: 1,235 |
I decided to change the number of Top Posters to 10 from 5 but when I click Submit it returns the following error:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/myserverpath/ubbthreads/cache_builders/custom/portal_box_3.php on line 34
Any ideas?
|
|
|
|
|
Joined: Dec 2006
Posts: 1,235
veteran
|
|
veteran
Joined: Dec 2006
Posts: 1,235 |
Line 34:
$postid=$rowid['POST_ID'];
|
|
|
|
|
Joined: Jun 2006
Posts: 9,242 Likes: 1
Former Developer
|
|
Former Developer
Joined: Jun 2006
Posts: 9,242 Likes: 1 |
Can you post the full code in your custom/portal_box_3.php file?
|
|
|
|
|
Joined: Dec 2006
Posts: 1,235
veteran
|
|
veteran
Joined: Dec 2006
Posts: 1,235 |
OK, I downloaded it from the server but it hasn't formatted correctly so I've separated the lines as below and the error is now showing on line 38. <?php
/* PHP CODE HERE */
/* BODY HERE */
$body = <<<EOF
<?php
// Open and select database
$link = mysql_connect('server','username','password');
if (!$link)
{
die('Cannot connect to server: '.mysql_error());
}
$db = mysql_select_db('database',$link);
if (!$db)
{
die('Cannot select database: '. mysql_error());
}
// Find out post id's
$query = "SELECT * FROM ubbt_TOPICS ORDER BY TOPIC_VIEWS DESC";
$result = mysql_query($query);
if (!$result)
{
die('Cannot read from database: '.mysql_error());
}
// Build table
for ($i=0; $i <$num_results; $i++)
{
$rowid = mysql_fetch_array($result);
$postid=$rowid['POST_ID'];
$queryposting = "SELECT * FROM ubbt_POSTS where TOPIC_SUBJECT=".$topicsubject."";
$resultposting = mysql_query($queryposting);
if (!$result)
{
die('Cannot read from database: '.mysql_error());
}
echo '<div style="float:right">'.$topicviews.'</div>';
echo '<div style="float:right">'.$topicsubject.'</div>';
}
?>
EOF;
?>
|
|
|
|
|
Joined: Dec 2006
Posts: 1,235
veteran
|
|
veteran
Joined: Dec 2006
Posts: 1,235 |
I'm now getting exactly the same error when I try to clear the cache ( admin/doclearcache.php ), update General Display Settings ( admin/dogen_display.php ), update Profiles ( admin/doprofiles.php ), etc.
|
|
|
|
|
Joined: Apr 2007
Posts: 3,940 Likes: 1
Former Developer
|
|
Former Developer
Joined: Apr 2007
Posts: 3,940 Likes: 1 |
yah, you need to totally kill that one. it's totally screwed up. just replace that portal_box_3.php with:
<?php
$body = <<<EOF
EOF;
?>
there are too many errors in that puppy to even begin to try to debug. dunno what someone was trying to do there.. this code:
<?php
$link = mysql_connect('server','username','password');
if (!$link)
{
die('Cannot connect to server: '.mysql_error());
}
$db = mysql_select_db('database',$link);
if (!$db)
{
die('Cannot select database: '. mysql_error());
}
$query = "SELECT * FROM ubbt_TOPICS ORDER BY TOPIC_VIEWS DESC";
$result = mysql_query($query);
if (!$result)
{
die('Cannot read from database: '.mysql_error());
}
for ($i=0; $i <$num_results; $i++)
{
$rowid = mysql_fetch_array($result);
$postid=$rowid['POST_ID'];
$queryposting = "SELECT * FROM ubbt_POSTS where TOPIC_SUBJECT=".$topicsubject."";
$resultposting = mysql_query($queryposting);
if (!$result)
{
die('Cannot read from database: '.mysql_error());
}
echo '<div style="float:right">'.$topicviews.'</div>';
echo '<div style="float:right">'.$topicsubject.'</div>';
}
?>
is destined to fail 
|
|
|
|
|
Joined: Dec 2006
Posts: 1,235
veteran
|
|
veteran
Joined: Dec 2006
Posts: 1,235 |
Cheers SD.  Haven't got a clue what happened to portal_box_3 but I've cleared it as you suggested and we're back to normal again. 
|
|
|
|
0 members (),
171
guests, and
128
robots. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
|
|
|