Previous Thread
Next Thread
Print Thread
Hop To
#264374 10/18/2020 6:25 AM
Joined: Jun 2006
Posts: 998
Likes: 25
Old Hand
Old Hand
Joined: Jun 2006
Posts: 998
Likes: 25
Hi

I submitted a new custom island and got this info

Quote
Parsi error: syntax error, unexpected 'php' (T_STRING) in /xxxx/xxx/xxxx/xxxxx/cache_builders/custom/portal_box_52.php on line 4

same goes when I try to do anything with the custom island layout in admin..
Any ideas of what it might be?

Last edited by Morgan; 10/18/2020 7:55 AM.

Morgan Johansson
BritBike Forum
https://www.britbike.com/forums/ubbthreads.php
Joined: Dec 2003
Posts: 6,628
Likes: 85
Joined: Dec 2003
Posts: 6,628
Likes: 85
Can you post the complete coding in that island?
Meaning open portal_box_52.php copy the contents and post it here


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Joined: Jun 2006
Posts: 998
Likes: 25
Old Hand
Old Hand
Joined: Jun 2006
Posts: 998
Likes: 25
First I used a amazon affiliate link Then I just used the word test.
I am not home right now


Morgan Johansson
BritBike Forum
https://www.britbike.com/forums/ubbthreads.php
Joined: Dec 2003
Posts: 6,628
Likes: 85
Joined: Dec 2003
Posts: 6,628
Likes: 85
I am assuming you have the UBB required tags missing in the island or placed in the wrong area where you can mix php and html.
That is why I mentioned to post the code.


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Joined: Jun 2006
Posts: 998
Likes: 25
Old Hand
Old Hand
Joined: Jun 2006
Posts: 998
Likes: 25
It will be a couple hours more until I get home
I grabbed amazon affiliate code for a thumbnail photo and put it were it should be. It was In a iframe Code. Iwas going to use it in the left column
Got the error and now I seem to get error simply taking another custom island and changing a letter or word in a sentence.
Something is wrong

Last edited by Morgan; 10/18/2020 1:20 PM.

Morgan Johansson
BritBike Forum
https://www.britbike.com/forums/ubbthreads.php
Joined: Dec 2003
Posts: 6,628
Likes: 85
Joined: Dec 2003
Posts: 6,628
Likes: 85
Because the island has bad code so it affects all the islands till you fix it.
What will confuse you is the error says portal-box-52.
But when you goto custom islands it may or may not have the same number.
That is why I said to post content from the php file.
To make sure we are dealing with the bad island.
Remember that the default tags need to be kept in place.
And php needs to be in a separate area from html code.
Because the error says line 4 I am assuming you placed the iframe in the php section instead of the html section.
Look at the sample text below.(included in v7.7.4 above where you make a entry).
If the error was in the html section it would be in around line 6 with this sample
If it was posted above the $body = <<<EOF or below the EOF; it would be incorrect.
Because it is a html tag

Code
/* PHP CODE HERE, IF NECESSARY */

the php body of your custom box here

/* DO NOT CHANGE THE LINE BELOW. IT IS REQUIRED. */
$body = <<<EOF

the html body of your custom box here

EOF;
/* DO NOT CHANGE THE LINE ABOVE. IT IS REQUIRED. */

Last edited by Ruben; 10/18/2020 3:24 PM. Reason: added comment

Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Joined: Jun 2006
Posts: 998
Likes: 25
Old Hand
Old Hand
Joined: Jun 2006
Posts: 998
Likes: 25
Ruben I cannot do anything in the Portal & Islands section
not in Portal, Column layout, Post islands, Custom islands etc.
I keep getting the
Parsi error: syntax error, unexpected 'php' (T_STRING) in /xxxx/xxx/xxxx/xxxxx/cache_builders/custom/portal_box_52.php on line 4
message.

I remember putting the Amazon code in the html section of the new cuptom island I created, but Have changed it now by editing the file in on the server via ftp
/cache_builders/custom/portal_box_52.php

Dang I have no clue except I must have broken something when creating the island.

Last edited by Morgan; 10/18/2020 3:27 PM.

Morgan Johansson
BritBike Forum
https://www.britbike.com/forums/ubbthreads.php
Joined: Dec 2003
Posts: 6,628
Likes: 85
Joined: Dec 2003
Posts: 6,628
Likes: 85
Post the contents of the file!
You need to ftp to your site.


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Joined: Jun 2006
Posts: 16,367
Likes: 126
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,367
Likes: 126
You'll need to post the raw contents of the file specified (/xxxx/xxx/xxxx/xxxxx/cache_builders/custom/portal_box_52.php) in order to have us troubleshoot why its not working.

It sounds like you entered <?php in the custom island editor; items in the editor are already an open PHP file, so no <?php ?> should be needed (when using the editor). Note that when opening the file outside of the editor you'll see the standard <?php ?> at the beginning/end of the file.


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Jun 2006
Posts: 998
Likes: 25
Old Hand
Old Hand
Joined: Jun 2006
Posts: 998
Likes: 25
Below is what it looks like on the server when I view it



Quote
<?php
/* PHP CODE HERE, IF NECESSARY */

the php body of your custom box here

/* DO NOT CHANGE THE LINE BELOW. IT IS REQUIRED. */
$body = <<<EOF

the html body of your custom box here

EOF;
/* DO NOT CHANGE THE LINE ABOVE. IT IS REQUIRED. */
?>


Morgan Johansson
BritBike Forum
https://www.britbike.com/forums/ubbthreads.php
Joined: Jun 2006
Posts: 998
Likes: 25
Old Hand
Old Hand
Joined: Jun 2006
Posts: 998
Likes: 25
No not when I edit it
it looks like

/* PHP CODE HERE, IF NECESSARY */

the php body of your custom box here

/* DO NOT CHANGE THE LINE BELOW. IT IS REQUIRED. */
$body = <<<EOF

the html body of your custom box here

EOF;
/* DO NOT CHANGE THE LINE ABOVE. IT IS REQUIRED. */



but when I then view it on the server it looks like

<?php
/* PHP CODE HERE, IF NECESSARY */

the php body of your custom box here

/* DO NOT CHANGE THE LINE BELOW. IT IS REQUIRED. */
$body = <<<EOF

the html body of your custom box here

EOF;
/* DO NOT CHANGE THE LINE ABOVE. IT IS REQUIRED. */
?>


Morgan Johansson
BritBike Forum
https://www.britbike.com/forums/ubbthreads.php
Joined: Jun 2006
Posts: 16,367
Likes: 126
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,367
Likes: 126
That looks like a stock file; what does the one you edited look like... It should be this on your local system (if this is the line from your error log):
/cache_builders/custom/portal_box_52.php


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Jun 2006
Posts: 998
Likes: 25
Old Hand
Old Hand
Joined: Jun 2006
Posts: 998
Likes: 25
When I created the new custom island it gave an error mentioned in OP
I edited the file portal_box_52.php direct in the ftp program via view/edit in that software

but beware I cannot change any file not even Control Panel >>Portal & Islands>> Portal and no islands either it gives same error message


Morgan Johansson
BritBike Forum
https://www.britbike.com/forums/ubbthreads.php
Joined: Jun 2006
Posts: 998
Likes: 25
Old Hand
Old Hand
Joined: Jun 2006
Posts: 998
Likes: 25
When I submit it writes to the php file but the CP answers with

Parsi error: syntax error, unexpected 'php' (T_STRING) in /xxxx/xxx/xxxx/xxxxx/cache_builders/custom/portal_box_52.php on line 4

everytime when I submit something


Morgan Johansson
BritBike Forum
https://www.britbike.com/forums/ubbthreads.php
Joined: Jun 2006
Posts: 998
Likes: 25
Old Hand
Old Hand
Joined: Jun 2006
Posts: 998
Likes: 25
I wonder can I delete the /cache_builders/custom/portal_box_52.php using ftp software?
What would happen then? does it affect anything bad

I'm asking cause I can add an old cuptom island to the left kolumn but not the one named /cache_builders/custom/portal_box_52.php


Morgan Johansson
BritBike Forum
https://www.britbike.com/forums/ubbthreads.php
Joined: Jun 2006
Posts: 998
Likes: 25
Old Hand
Old Hand
Joined: Jun 2006
Posts: 998
Likes: 25
It works now.. I changed

from
Quote
/* PHP CODE HERE, IF NECESSARY */

the php body of your custom box here

/* DO NOT CHANGE THE LINE BELOW. IT IS REQUIRED. */
$body = <<<EOF

the html body of your custom box here

EOF;
/* DO NOT CHANGE THE LINE ABOVE. IT IS REQUIRED. */


to

Quote
/* PHP CODE HERE, IF NECESSARY */


/* DO NOT CHANGE THE LINE BELOW. IT IS REQUIRED. */
$body = <<<EOF

the html body of your custom box here

EOF;
/* DO NOT CHANGE THE LINE ABOVE. IT IS REQUIRED. */



Sorry to bother you guys with this

Last edited by Morgan; 10/18/2020 4:26 PM.

Morgan Johansson
BritBike Forum
https://www.britbike.com/forums/ubbthreads.php
Joined: Apr 2004
Posts: 1,973
Likes: 154
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 1,973
Likes: 154
For 7.7.5, I've updated the phrases to possibly make more sense for those less technically inclined

the Example block will now read as:
Code
/* YOUR PHP CODE GOES IN THIS TOP SECTION */


/* YOUR HTML GOES BETWEEN THE EOF HEREDOCS BELOW */
$body = <<<EOF





EOF;

HEREDOC explanation is here:
https://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc

Screenshot of 7.7.5 on creating a new Custom Island is attached:
Attachments
20201019_00-09-13.PNG


current developer of UBB.threads php forum software
current release: UBB.threads 8.0.0 // wip: UBB.threads 8.0.1
isaac @ id242.com // my forum @ CelicaHobby.com
Joined: Apr 2004
Posts: 1,973
Likes: 154
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 1,973
Likes: 154
An example of a 160x600 skyscraper Google Ad custom island is:
Code
/* YOUR PHP CODE GOES IN THIS TOP SECTION */

/* YOUR HTML GOES BETWEEN THE EOF HEREDOCS BELOW */
$body = <<<EOF

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

EOF;


current developer of UBB.threads php forum software
current release: UBB.threads 8.0.0 // wip: UBB.threads 8.0.1
isaac @ id242.com // my forum @ CelicaHobby.com
Joined: Apr 2004
Posts: 1,973
Likes: 154
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 1,973
Likes: 154
An example of an 250x620 skyscraper Amazon random set of products custom island is:
Code
/* YOUR PHP CODE GOES IN THIS TOP SECTION */

$input = array(B08H8X23ZB,B08H8VZ6PV,B08CFSZLQ4,B07YMNLXL3);
$rand_keys = array_rand($input, 4);
$item1 = $input[$rand_keys[0]];
$item2 = $input[$rand_keys[1]];
$item3 = $input[$rand_keys[2]];
$item4 = $input[$rand_keys[3]];

/* YOUR HTML GOES BETWEEN THE EOF HEREDOCS BELOW */
$body = <<<EOF

<div style="padding:0;">
<script>
amzn_assoc_placement = "adunit0";
amzn_assoc_tracking_id = "amazon-20";
amzn_assoc_ad_mode = "manual";
amzn_assoc_ad_type = "smart";
amzn_assoc_marketplace = "amazon";
amzn_assoc_region = "US";
amzn_assoc_title = "Shop Amazon Deals";
amzn_assoc_linkid = "abc123xyz890";
amzn_assoc_search_bar = "false";
amzn_assoc_asins = "$item1,$item2,$item3,$item4";
amzn_assoc_size = "250x620";
</script>
<script src="//z-na.amazon-adsystem.com/widgets/onejs?MarketPlace=US"></script>
</div>

EOF;
You can add more products by adding more product codes to the $input array at the top. Use comas to separate each.


current developer of UBB.threads php forum software
current release: UBB.threads 8.0.0 // wip: UBB.threads 8.0.1
isaac @ id242.com // my forum @ CelicaHobby.com
Joined: Jun 2006
Posts: 998
Likes: 25
Old Hand
Old Hand
Joined: Jun 2006
Posts: 998
Likes: 25
I think I screwed up using my small iPhone instead of using my computer.
My feedback to Isaac is that after creating the new custom island with the faulty pasting it made the Whole portal show same error message not only the created island


Morgan Johansson
BritBike Forum
https://www.britbike.com/forums/ubbthreads.php
Joined: Apr 2004
Posts: 1,973
Likes: 154
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 1,973
Likes: 154
Originally Posted by Morgan
I think I screwed up using my small iPhone instead of using my computer.
My feedback to Isaac is that after creating the new custom island with the faulty pasting it made the Whole portal show same error message not only the created island
That is correct. And there is a warning on the Custom Portal Island editor about that exactly.

The warning reads:
Quote
Warning: Invalid PHP code that has syntax errors can result in breaking the entire portal.

The control panel does not use any code from custom islands, so you should be able to visit the control panel and correct your php syntax errors.


current developer of UBB.threads php forum software
current release: UBB.threads 8.0.0 // wip: UBB.threads 8.0.1
isaac @ id242.com // my forum @ CelicaHobby.com
2 members like this: Gizmo, Morgan
Joined: Dec 2003
Posts: 6,628
Likes: 85
Joined: Dec 2003
Posts: 6,628
Likes: 85
Pretty much the same issue if in the WOL agent list if you add blank line feeds or blank carriage returns.


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Joined: Apr 2004
Posts: 1,973
Likes: 154
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 1,973
Likes: 154
Originally Posted by Ruben
Pretty much the same issue if in the WOL agent list if you add blank line feeds or blank carriage returns.

That was fixed for version 7.7.4, released 2020-03-07
https://www.ubbcentral.com/changelog.php#774

[FIXED] CP: Fixed the long-standing bug of the Whos Online list being empty when an additional new line (blank line) was added to the end of the Robots/Crawlers (Search Engines) list.

It was also fixed in a number of other locations.


current developer of UBB.threads php forum software
current release: UBB.threads 8.0.0 // wip: UBB.threads 8.0.1
isaac @ id242.com // my forum @ CelicaHobby.com
Joined: Dec 2003
Posts: 6,628
Likes: 85
Joined: Dec 2003
Posts: 6,628
Likes: 85
isaac.

Thank You
I guess I never noticed because I always check for blank spaces and goto the end and and press delete to clear out same every time I edit it.


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Joined: Dec 2003
Posts: 6,628
Likes: 85
Joined: Dec 2003
Posts: 6,628
Likes: 85
I think I finally figured out Morgans issue.
He literally used the example code in the island note and placed the text to be replaced in the island code.
Such as :
1.the php body of your custom box here
2.the html body of your custom box here

Item one would break the island because it is not php code and should have been deleted (left blank) because PHP was not used for the island.
This is just a notation of where you would place your php code.
Item two would work if left in the code because it would be accepted.
But it would display "the html body of your custom box here" in the island.
Again this text should have been deleted and if needed replaced with the actual html code desired.


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Ruben #264406 10/20/2020 11:33 AM
Joined: Jun 2006
Posts: 998
Likes: 25
Old Hand
Old Hand
Joined: Jun 2006
Posts: 998
Likes: 25
Originally Posted by Ruben
I think I finally figured out Morgans issue.


Ruben you are pretty much right, I used my iPhone 6S which is small and when pasting the amazon code I must have done something wrong with my thick fingers which gave the initial error.
I probably then copied and pasted the example code and it still did not work so I created this thread asking for help.
During the process I noticed the text "the php body of your custom box here" and deleted it and suddenly it worked.
Next step was to replace the "the html body of your custom box here" text with a proper code and it worked as intended.

Thanks to this thread and Rubens replies it got my brain thinking correctly and you know what it happened in the past too.

Thanks to everyone who chipped in with thoughts!🙏👍


PS now I need to get confidence and knowledge how to upgrade from MySQL 5.6 to 5.7.. but that's another thread.. wink


Morgan Johansson
BritBike Forum
https://www.britbike.com/forums/ubbthreads.php

Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Not allowing attachment over 2m
by ehill - 12/03/2024 3:16 PM
New Admin Here
by SenecaFlyer - 12/02/2024 4:14 PM
Post Counts zeroed out
by Baldeagle - 11/03/2024 3:05 PM
Who's Online Now
1 members (ehill), 1,124 guests, and 128 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.1
(Snapshot build 20240918)