Previous Thread
Next Thread
Print Thread
Hop To
Custom Islands #256017 11/04/2014 4:15 PM
Joined: Apr 2004
Posts: 224
DennyP Offline OP
Enthusiast
OP Offline
Enthusiast
Joined: Apr 2004
Posts: 224
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
Re: Custom Islands [Re: DennyP] #256018 11/04/2014 4:26 PM
Joined: Apr 2004
Posts: 1,514
isaac Online Splat
UBB.threads Developer
Online Splat
UBB.threads Developer
Joined: Apr 2004
Posts: 1,514
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 // 7.7.3 released!
isaac @ id242.com // my forum @ CelicaHobby.com
Re: Custom Islands [Re: DennyP] #256019 11/04/2014 4:34 PM
Joined: Dec 2003
Posts: 5,945
Ruben Offline
Offline
Joined: Dec 2003
Posts: 5,945
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
Re: Custom Islands [Re: DennyP] #256020 11/04/2014 4:48 PM
Joined: Apr 2004
Posts: 224
DennyP Offline OP
Enthusiast
OP Offline
Enthusiast
Joined: Apr 2004
Posts: 224
I get the same error message when trying both the suggestions above.


DennyP - www.dennyp.com
DennyP Travel
Re: Custom Islands [Re: DennyP] #256021 11/04/2014 4:53 PM
Joined: Dec 2003
Posts: 5,945
Ruben Offline
Offline
Joined: Dec 2003
Posts: 5,945
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
Re: Custom Islands [Re: Ruben] #256022 11/04/2014 4:57 PM
Joined: Apr 2004
Posts: 224
DennyP Offline OP
Enthusiast
OP Offline
Enthusiast
Joined: Apr 2004
Posts: 224
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
Re: Custom Islands [Re: DennyP] #256023 11/04/2014 5:02 PM
Joined: Apr 2004
Posts: 224
DennyP Offline OP
Enthusiast
OP Offline
Enthusiast
Joined: Apr 2004
Posts: 224
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
Re: Custom Islands [Re: DennyP] #256024 11/04/2014 5:07 PM
Joined: Dec 2003
Posts: 5,945
Ruben Offline
Offline
Joined: Dec 2003
Posts: 5,945
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
Re: Custom Islands [Re: Ruben] #256025 11/04/2014 5:13 PM
Joined: Apr 2004
Posts: 224
DennyP Offline OP
Enthusiast
OP Offline
Enthusiast
Joined: Apr 2004
Posts: 224
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
Re: Custom Islands [Re: DennyP] #256026 11/04/2014 5:15 PM
Joined: Dec 2003
Posts: 5,945
Ruben Offline
Offline
Joined: Dec 2003
Posts: 5,945
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
Re: Custom Islands [Re: DennyP] #256027 11/04/2014 5:20 PM
Joined: Dec 2003
Posts: 5,945
Ruben Offline
Offline
Joined: Dec 2003
Posts: 5,945
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
Re: Custom Islands [Re: Ruben] #256028 11/04/2014 5:22 PM
Joined: Apr 2004
Posts: 224
DennyP Offline OP
Enthusiast
OP Offline
Enthusiast
Joined: Apr 2004
Posts: 224
I wanted to post what was actually on line 6.

I will try clearing the cache.


DennyP - www.dennyp.com
DennyP Travel
Re: Custom Islands [Re: DennyP] #256029 11/04/2014 5:29 PM
Joined: Dec 2003
Posts: 5,945
Ruben Offline
Offline
Joined: Dec 2003
Posts: 5,945
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
Re: Custom Islands [Re: DennyP] #256030 11/04/2014 5:32 PM
Joined: Apr 2004
Posts: 224
DennyP Offline OP
Enthusiast
OP Offline
Enthusiast
Joined: Apr 2004
Posts: 224
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
Re: Custom Islands [Re: DennyP] #256031 11/04/2014 5:37 PM
Joined: Dec 2003
Posts: 5,945
Ruben Offline
Offline
Joined: Dec 2003
Posts: 5,945
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
Re: Custom Islands [Re: Ruben] #256032 11/04/2014 5:45 PM
Joined: Apr 2004
Posts: 224
DennyP Offline OP
Enthusiast
OP Offline
Enthusiast
Joined: Apr 2004
Posts: 224
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
Re: Custom Islands [Re: DennyP] #256033 11/04/2014 5:50 PM
Joined: Dec 2003
Posts: 5,945
Ruben Offline
Offline
Joined: Dec 2003
Posts: 5,945
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

Forum Search
ShoutChat Box
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Horizontal Image Attachment
by ECNet - 09/11/2019 12:17 PM
user profile, after I click Update nothing happens
by PianoWorld - 09/10/2019 12:38 PM
Inline Image Embeds
by ECNet - 09/03/2019 2:38 PM
Paid Subscriptions - Needs More Incentive
by M4TT - 08/25/2019 10:06 PM
Who's Online Now
1 registered members (isaac), 67 guests, and 360 spiders.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Amusing Terain Scenics
Amusing Terain Scenics
by isaac, August 19
Sky places
Sky places
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 7.7.3