Previous Thread
Next Thread
Print Thread
Hop To
#256017 11/04/2014 4:15 PM
Joined: Apr 2004
Posts: 232
Likes: 1
D
Enthusiast
Enthusiast
D Offline
Joined: Apr 2004
Posts: 232
Likes: 1
I am working with custom islands in 7.5.8. If I start with just the default contents of the custom island data box (below), I get the error: Parse error: syntax error, unexpected T_STRING in /var/www/vhosts/dennyp.com/httpdocs/ubbthreads/cache_builders/custom/portal_box_2.php on line 6 when I click the Update button.

What is the problem since even the default contents doesn't parse correctly? It seems to follow the layout of the examples in the Wiki.
Quote
/* PHP CODE HERE, IF NECESSARY */

/* DO NOT CHANGE THE LINE BELOW */
$body = <<<EOF

Body of the custom box here

EOF;
/* DO NOT CHANGE THE LINE ABOVE */


DennyP - www.dennyp.com
DennyP Travel
DennyP #256018 11/04/2014 4:26 PM
Joined: Apr 2004
Posts: 1,945
Likes: 145
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 1,945
Likes: 145
It looks like line 6 is the error. "/* DO NOT CHANGE THE LINE ABOVE */"

Remove that last line and give it another shot.


This should work as a bare minimum starting point -
Code
/* PHP CODE HERE */

/* BODY HERE */
$body = <<<EOF
EOF;


Here is another example, if you were going to create one for Google Adsense
Code
/* PHP CODE HERE */

/* BODY HERE */
$body = <<<EOF

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- 160x600 Portal TEXT/IMAGE -->
<ins class="adsbygoogle"
style="display:inline-block;width:160px;height:600px"
data-ad-client="ca-pub-9999999999999999"
data-ad-slot="1234567890"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>

EOF;


Current developer of UBB.threads PHP Forum Software
Current Release: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com
DennyP #256019 11/04/2014 4:34 PM
Joined: Dec 2003
Posts: 6,560
Likes: 78
Joined: Dec 2003
Posts: 6,560
Likes: 78
The new site looks like it has some hidden embedded tags in the code that needs to be removed.
Gizmo needs to fix it.
Anyway try this with out any spaces or line feeds.
Code
/* PHP CODE HERE, IF NECESSARY */

/* DO NOT CHANGE THE LINE BELOW */
$body = <<<EOF

Body of the custom box here

EOF;
/* DO NOT CHANGE THE LINE ABOVE */


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
DennyP #256020 11/04/2014 4:48 PM
Joined: Apr 2004
Posts: 232
Likes: 1
D
Enthusiast
Enthusiast
D Offline
Joined: Apr 2004
Posts: 232
Likes: 1
I get the same error message when trying both the suggestions above.


DennyP - www.dennyp.com
DennyP Travel
DennyP #256021 11/04/2014 4:53 PM
Joined: Dec 2003
Posts: 6,560
Likes: 78
Joined: Dec 2003
Posts: 6,560
Likes: 78
When you post the code you need to make sure there is nothing below that last line.
For example:
EOF;
/* DO NOT CHANGE THE LINE ABOVE */
Put your courser just after the */
and delete.
You probably have some line feeds below that line.
Or in id242s case anything after
EOF;
and delete


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Ruben #256022 11/04/2014 4:57 PM
Joined: Apr 2004
Posts: 232
Likes: 1
D
Enthusiast
Enthusiast
D Offline
Joined: Apr 2004
Posts: 232
Likes: 1
There is nothing after the last semicolon below. I can left-click and drag my cursor over the entire contents and the highlighting stops at the semicolon after EOF on the last line.

Quote
/* PHP CODE HERE */

/* BODY HERE */
$body = <<<EOF
Test
EOF;


DennyP - www.dennyp.com
DennyP Travel
DennyP #256023 11/04/2014 5:02 PM
Joined: Apr 2004
Posts: 232
Likes: 1
D
Enthusiast
Enthusiast
D Offline
Joined: Apr 2004
Posts: 232
Likes: 1
Here is the contents of the file in question:
Quote
<?php
/* PHP CODE HERE */

/* BODY HERE */
$body = "Test"
EOF;
?>
To clarify, this is the file from the server and NOT what is in the control panel portal box. Line 6 is the EOF;

Last edited by DennyP; 11/04/2014 5:16 PM. Reason: Clarification

DennyP - www.dennyp.com
DennyP Travel
DennyP #256024 11/04/2014 5:07 PM
Joined: Dec 2003
Posts: 6,560
Likes: 78
Joined: Dec 2003
Posts: 6,560
Likes: 78
Well I just tried it on another site and your code works fine now.
With that last post what is your error message now?

We posted on top of each other.
Get rid of the first and last line:
<?php
?>

Those two lines are inserted by the software and should not be there
Also:
$body = "Test"
Missing the eof
should be like
$body = <<<EOF
"Test"


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Ruben #256025 11/04/2014 5:13 PM
Joined: Apr 2004
Posts: 232
Likes: 1
D
Enthusiast
Enthusiast
D Offline
Joined: Apr 2004
Posts: 232
Likes: 1
I think I wasn't clear on my last post. That is the contents of the /var/www/vhosts/dennyp.com/httpdocs/ubbthreads/cache_builders/custom/portal_box_2.php file that parsed with the error. The php lines aren't in the portal box in the control panel. Line 6 is the EOF;.


DennyP - www.dennyp.com
DennyP Travel
DennyP #256026 11/04/2014 5:15 PM
Joined: Dec 2003
Posts: 6,560
Likes: 78
Joined: Dec 2003
Posts: 6,560
Likes: 78
Well we should be talking about what is in the cp for the custom island.


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
DennyP #256027 11/04/2014 5:20 PM
Joined: Dec 2003
Posts: 6,560
Likes: 78
Joined: Dec 2003
Posts: 6,560
Likes: 78
If I were you I would opt for the clear cache in the cp.
That should most times delete the files in the cache builders cache and force them to rebuild.
Sometimes you have to manually delete them. Then run the clear cache.


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Ruben #256028 11/04/2014 5:22 PM
Joined: Apr 2004
Posts: 232
Likes: 1
D
Enthusiast
Enthusiast
D Offline
Joined: Apr 2004
Posts: 232
Likes: 1
I wanted to post what was actually on line 6.

I will try clearing the cache.


DennyP - www.dennyp.com
DennyP Travel
DennyP #256029 11/04/2014 5:29 PM
Joined: Dec 2003
Posts: 6,560
Likes: 78
Joined: Dec 2003
Posts: 6,560
Likes: 78
here is what shows on my site in the file not cp:
Code
<?php
/* PHP CODE HERE */



/* BODY HERE */

$body = <<<EOF

"Test"

EOF;
?>


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
DennyP #256030 11/04/2014 5:32 PM
Joined: Apr 2004
Posts: 232
Likes: 1
D
Enthusiast
Enthusiast
D Offline
Joined: Apr 2004
Posts: 232
Likes: 1
When I click on the Clear Cache button I get the same error:

Parse error: syntax error, unexpected T_STRING in /var/www/vhosts/dennyp.com/httpdocs/ubbthreads/cache_builders/custom/portal_box_2.php on line 6


DennyP - www.dennyp.com
DennyP Travel
DennyP #256031 11/04/2014 5:37 PM
Joined: Dec 2003
Posts: 6,560
Likes: 78
Joined: Dec 2003
Posts: 6,560
Likes: 78
Okay do it the hard way.
Ftp to the site:
Goto cache builders/custom
Delete all the files except for index.html
they all start with like
portal_box_1.php
portal_box_2.php
ETC
Then go back to the cp and run clear cache.
it will rebuild all the island files and they should all have a current date.


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Ruben #256032 11/04/2014 5:45 PM
Joined: Apr 2004
Posts: 232
Likes: 1
D
Enthusiast
Enthusiast
D Offline
Joined: Apr 2004
Posts: 232
Likes: 1
Ruben - that appears to have done the trick. I can at least do an Custom Island update with the default information in it. I will work with it more. Thank you very much.


DennyP - www.dennyp.com
DennyP Travel
DennyP #256033 11/04/2014 5:50 PM
Joined: Dec 2003
Posts: 6,560
Likes: 78
Joined: Dec 2003
Posts: 6,560
Likes: 78
Sounds like your server had a hiccup and corrupted the island file.
Or you initially had a bad format entry in the cp and it wrote bad code to the file.
Anyway glad it helped.


Blue Man Group
There is no such thing as stupid questions. Just stupid answers

Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
spam issues
by ECNet - 03/19/2024 11:45 PM
Looking for a forum
by azr - 03/15/2024 11:26 PM
Editing Links in Post
by Outdoorking - 03/15/2024 9:31 AM
Question on barkrowler and the like
by Mors - 02/29/2024 6:51 PM
Member Permissions Help
by domspeak - 02/27/2024 6:31 PM
Who's Online Now
1 members (Ruben), 476 guests, and 111 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)