|
Joined: Apr 2004
Posts: 233 Likes: 1
Enthusiast
|
Enthusiast
Joined: Apr 2004
Posts: 233 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. /* 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 */
|
|
|
|
Joined: Apr 2004
Posts: 1,945 Likes: 145
|
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 -
/* PHP CODE HERE */
/* BODY HERE */
$body = <<<EOF
EOF;
Here is another example, if you were going to create one for Google Adsense
/* 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;
|
|
|
|
Joined: Dec 2003
Posts: 6,562 Likes: 78
|
Joined: Dec 2003
Posts: 6,562 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. /* 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
|
|
|
|
Joined: Apr 2004
Posts: 233 Likes: 1
Enthusiast
|
Enthusiast
Joined: Apr 2004
Posts: 233 Likes: 1 |
I get the same error message when trying both the suggestions above.
|
|
|
|
Joined: Dec 2003
Posts: 6,562 Likes: 78
|
Joined: Dec 2003
Posts: 6,562 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
|
|
|
|
Joined: Apr 2004
Posts: 233 Likes: 1
Enthusiast
|
Enthusiast
Joined: Apr 2004
Posts: 233 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. /* PHP CODE HERE */
/* BODY HERE */ $body = <<<EOF Test EOF;
|
|
|
|
Joined: Apr 2004
Posts: 233 Likes: 1
Enthusiast
|
Enthusiast
Joined: Apr 2004
Posts: 233 Likes: 1 |
Here is the contents of the file in question: <?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
|
|
|
|
Joined: Dec 2003
Posts: 6,562 Likes: 78
|
Joined: Dec 2003
Posts: 6,562 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
|
|
|
|
Joined: Apr 2004
Posts: 233 Likes: 1
Enthusiast
|
Enthusiast
Joined: Apr 2004
Posts: 233 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;.
|
|
|
|
Joined: Dec 2003
Posts: 6,562 Likes: 78
|
Joined: Dec 2003
Posts: 6,562 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
|
|
|
|
Joined: Dec 2003
Posts: 6,562 Likes: 78
|
Joined: Dec 2003
Posts: 6,562 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
|
|
|
|
Joined: Apr 2004
Posts: 233 Likes: 1
Enthusiast
|
Enthusiast
Joined: Apr 2004
Posts: 233 Likes: 1 |
I wanted to post what was actually on line 6.
I will try clearing the cache.
|
|
|
|
Joined: Dec 2003
Posts: 6,562 Likes: 78
|
Joined: Dec 2003
Posts: 6,562 Likes: 78 |
here is what shows on my site in the file not cp: <?php
/* PHP CODE HERE */
/* BODY HERE */
$body = <<<EOF
"Test"
EOF;
?>
Blue Man Group There is no such thing as stupid questions. Just stupid answers
|
|
|
|
Joined: Apr 2004
Posts: 233 Likes: 1
Enthusiast
|
Enthusiast
Joined: Apr 2004
Posts: 233 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
|
|
|
|
Joined: Dec 2003
Posts: 6,562 Likes: 78
|
Joined: Dec 2003
Posts: 6,562 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
|
|
|
|
Joined: Apr 2004
Posts: 233 Likes: 1
Enthusiast
|
Enthusiast
Joined: Apr 2004
Posts: 233 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.
|
|
|
|
Joined: Dec 2003
Posts: 6,562 Likes: 78
|
Joined: Dec 2003
Posts: 6,562 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
|
|
|
Bots
by Outdoorking - 04/13/2024 5:08 PM
|
|
|
|
|
|
1 members (1 invisible),
831
guests, and
191
robots. |
Key:
Admin,
Global Mod,
Mod
|
|
|
|