php blocks

Well that's it, I just pulled my last hair out so now I have to ask. (can't find what I need in a search either)

I've created a page in page builder, Arcade, now I'm trying to get index.php to run within it, (free games room script)

I've tried an html block and php block but I either get a blank white screen or my page with no block at all.

If I type in the url it all works fine,

Is this even possible? Or am I now bald for nothing?

I've included the file index.php that I'm trying to run within the block just in case someone can help with this.

index.php · 1.9K · 54 downloads
Quote · 21 Feb 2011

First of all:

Have you done the right modifications to the code to make Dolphin accept the php blocks?

If not please follow this thread:

http://www.boonex.com/unity/forums/#topic/Add-PHP-blocks-to-Pagebuilder-for-D7.htm

If you have already done it, please in your php ini switch on the display_errors = On

I think it's probably something wrong with the path to the file.

Web Development, Multimedia Design and Social Media.
Quote · 21 Feb 2011

When using a PHP block make sure the code is placed in the block WITHOUT the opening and closing php tags <?PHP and the ?> are not to be included when used in a block.

https://www.deanbassett.com
Quote · 21 Feb 2011

Thanks

The code changes in that post for BxDolPageViewAdmin.php "have not been done"

So even though I used Deanos tools 1.8.1 to add a php block to my new page do I need to make these changes?

I'm running 7.0.4

And yes I knew to exclude the <?PHP and the ?>

Thanks for the help guys,

Quote · 21 Feb 2011

No. The blocks mod is not needed if your using my tools.

The other possible issue might be that it's not finding the includes it needs.

For example this is one of your includes.

require_once("./includes/corefunctions.php"); // Load the AMCMS3 functions


Now. this is going to try and look for this one folder back relative from the folder the page the block is loading on. Thats what the ./ does. These loads are relative so may not be correct when used in a dolphin block.

So try replacing these with the full path to where these files reside on your server.

https://www.deanbassett.com
Quote · 21 Feb 2011

Thanks Deano

I'll give that a try and will let you know,

Quote · 21 Feb 2011

Just entered the full path throughout that index.php file with no better luck.

Did get this error though,

PHP Parse error:  syntax error, unexpected '<' in /home/******/public_html/inc/classes/BxDolPageView.php(597) : eval()'d code on line 1

I've removed the <?PHP and the ?> from the php block.

Quote · 21 Feb 2011

There is no reason for that error if the php tags were removed.

Do you have the dolphin page block cache turned on? If so, shut it off or try clearing your cache files.

https://www.deanbassett.com
Quote · 21 Feb 2011

Could you please attach that file here.

We will check it

Web Development, Multimedia Design and Social Media.
Quote · 21 Feb 2011

All cache were off but cleared the cache via ftp anyway,

I'm not getting the error any more, just a blank white screen.

Thanks Yobilab, here are the files.

BxDolPageViewAdmin.php · 29.3K · 81 downloads
index.php · 1.9K · 50 downloads
Quote · 21 Feb 2011

To prevent this, I often just create my php content or widget in its own directory.  For example, lets say, I want to present my photos from the database in a unique way.  Of course, I'm going to have to use PHP to do this.  This is how I would approach it:

 

1)  Create a directory with a name like "uniquephotos" in the root of dolphin

2)  Create my script using something like the script below, (then naming it something like "myphotos.php")(:

$querystring ("SELECT * FROM bx_photos_main");

while ($rows = mysql_fetch_assoc($querystring)) {

$ID = $PhotoID;

echo "<div> <img src=" . $pathtophotos . $PhotoID . ".jpg" </div>"...

}....yadda, yadda, yadda....(of course, this is dummy mock-up code

3) Save the file to the newly created "uniquephotos" directory

4)  Create my Php Block using Deanos Tools or the PHP Block Mod and in that box, simply do an include or a require like this

include('uniquephotos/myphotos.php');

5) Done.

----------------------------------

I do it this way because it allows me to quickly create little mods without cluttering up my blocks with coding.  Hope this helps someone with some ideas.

Quote · 21 Feb 2011

 

All cache were off but cleared the cache via ftp anyway,

I'm not getting the error any more, just a blank white screen.

Thanks Yobilab, here are the files.

mhh the file is fine..

There must be somwthing wrong in the php code you are trying to include.

Web Development, Multimedia Design and Social Media.
Quote · 21 Feb 2011

Thanks for the input Chap1978

I tried the include, page comes up but no block displayed,

received this error.

PHP Warning:  include() [<a href='function.include'>function.include</a>]: Failed opening 'http://*******.com/arcadem/index.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/********/public_html/inc/classes/BxDolPageView.php(597) : eval()'d code on line 1

Quote · 22 Feb 2011

 

Thanks for the input Chap1978

I tried the include, page comes up but no block displayed,

received this error.

PHP Warning:  include() [<a href='function.include'>function.include</a>]: Failed opening 'http://*******.com/arcadem/index.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/********/public_html/inc/classes/BxDolPageView.php(597) : eval()'d code on line 1

As I said this is a problem with the include.

Be sure to give that the full path.

Could you please paste here the include function you are using and tell us where you have exactly placed this file?

Web Development, Multimedia Design and Social Media.
Quote · 22 Feb 2011

Want to thank you guys for all the effort you're putting into this.

The include I tried is,

include 'http://*******.com/arcadem/index.php';

and the file is in,

http://*****.com/arcadem/index.php

Quote · 22 Feb 2011

 

Want to thank you guys for all the effort you're putting into this.

The include I tried is,

include 'http://*******.com/arcadem/index.php';

and the file is in,

http://*****.com/arcadem/index.php

Is the file in the same domain name where Dolphin is installed?

Web Development, Multimedia Design and Social Media.
Quote · 22 Feb 2011

I would use a relative path

include ('arcadem/index.php');

Then manually clear your cache via FTP, then clear your browser cache.  90% of the time when I see this message it's a caching issue.

Quote · 22 Feb 2011

Send me your web address...I will try to check it out.

Quote · 22 Feb 2011

Yes, Dolphin is installed to the root of my domain.

If I type in the url

http://*****.com/arcadem/index.php

the arcade script and all the games work perfectly.

Just can't get it going within a php block.

Quote · 22 Feb 2011

Yes I think chap is right.

You should not use the http address on your include function..

Web Development, Multimedia Design and Social Media.
Quote · 22 Feb 2011

Odd, when I use the full url in the include include 'http://*******.com/arcadem/index.php'; I get the page up but with no block,

when I use   include 'arcadem/index.php'; I get a blank white screen.

Quote · 22 Feb 2011

Please provide a screenshot that shows what you say for "no block"

Web Development, Multimedia Design and Social Media.
Quote · 22 Feb 2011

I have to go now.

If you do not find anyone else able to help you with this, PM me and tomorrow I 'll give it a deeper look.

Or send a mail at test@yobilab.com

Bye for now

Web Development, Multimedia Design and Social Media.
Quote · 22 Feb 2011

Are you putting the include statement in parentheses like:

 

include('arcadem/index.php');

Quote · 22 Feb 2011

Which page are you trying to add this to?  I'm at the site, but don't know where the block is supposed to be located.  Please advise.

Quote · 22 Feb 2011

This is it,

include('arcadem/index.php');

Just get a white screen now.

Quote · 22 Feb 2011

Still trying to get this to work and might have just made some headway, that is if anyone can tell me what this error is about.

PHP Warning:  require_once() [<a href='function.require-once'>function.require-once</a>]: URL file-access is disabled in the server configuration in /home/******/public_html/inc/classes/BxDolPageView.php(597) : eval()'d code on line 1

Quote · 23 Feb 2011

Well that does not make sense. The error means that allow_url_fopen is off. That PHP setting is supposed to be on. It's one of dolphins requirements per this doc. http://www.boonex.com/trac/dolphin/wiki/DolTech

The reason i say it makes no sense, is because if this php option is indeed off you should be having problems with some features of dolphin. If fact, you can't properly register a dolphin licence key without this option on.

https://www.deanbassett.com
Quote · 23 Feb 2011

Checked and  allow_url_fopen is on.

No doubt a result of all my screwing about with this script,

thanks to all who tried to help with this, time to move on.

Quote · 23 Feb 2011
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.