Previous Thread
Next Thread
Print Thread
Hop To
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
R
Former Developer
Former Developer
R Offline
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.

Code
<?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
SD Offline
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 Code

<?php
/* PHP CODE HERE */

/* BODY HERE */
$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 Code

<?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>';
	  }
?>


is destined to fail wink

Joined: Dec 2006
Posts: 1,235
veteran
veteran
Joined: Dec 2006
Posts: 1,235
Cheers SD. laugh

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. smile


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
PHP 8 bug in membermanage.tmpl
by phoenix011235 - 09/08/2026 7:47 PM
Are any of these legitmate?
by Baldeagle - 09/06/2026 1:37 PM
After server reboot
by Morgan - 09/02/2026 8:27 AM
Email Settings
by Outdoorking - 05/13/2026 2:44 AM
Who's Online Now
0 members (), 166 guests, and 137 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Ride safe!
Ride safe!
by Morgan, December 7
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Powered by UBB.threads™ PHP Forum Software 8.1.0
(Snapshot build 20260527)