Deano's "Add PHP blocks" mod works, or doesn't.

Hi,

A weird problem with Deano's excellent mod is driving me a little crazy right now.  I'm adding PHP blocks to various pages and then using them to call HTML pages in the blocks.  The weird thing: it works great on some pages and on others I just get errors:

Works on: profile, home, friends, mail

Doesn't work on: photos home, videos home

The blocks (mostly) appear but instead of the HTML page I get this error message in the block:

Warning: file_get_contents(rotat1.html) [function.file-get-contents]: failed to open stream: No such file or directory in /home/alan/public_html/sbuddies.com/inc/classes/BxDolPageView.php(572) : eval()'d code on line

Continuing weirdness:  I added the block to the All Members page and it doesn't appear at all.

Has anyone else had this problem?  Any suggestions?

Thanks!

AL

Quote · 9 May 2010

You should contact Deano, since he is the one behind the modification.

BoonEx Certified Host: Zarconia.net - Fully Supported Shared and Dedicated for Dolphin
Quote · 9 May 2010

Yea sure. Pawn them off on me because they can't write proper PHP code.

Anyhow. The mod does little more than give you access to whats already built into dolphin. Dolphin can already do PHP blocks. My mod just allows you to add and edit them. It does not do any processing of them.

Anyhow. It's not the mod, it's your code. The error it shows is a dead giveaway of the problem.

file_get_contents(rotat1.html)

You have no path specified there so it expects to find that file in the same path the page block is generate in.

profile, home, friends, mail and several others are in the same location. Root of the site.

photos home, videos home are both modules and the results are generated by the module so the path it's in is different.

You need to specify full path or url to the file you want to include so it can find it regardless of what page it is on.

There are also dolphin functions and classes that if you are using any, may or may not work on all pages.

You are only showing file_get_contents which is a built-in php function, so it is available everywhere, but that will not be the case for some dolphin specific functions.

In any case it boils down to your code, not the mod, so figure out what you did wrong in the code.

https://www.deanbassett.com
Quote · 10 May 2010

Thanks Deano - it's fixed, and I am, as you point out, an idiot ;)

Quote · 10 May 2010

from experience on a multitude of sites, the mod works perfectly.

Regards,

DosDawg

When a GIG is not enough --> Terabyte Dolphin Technical Support - Server Management and Support
Quote · 10 May 2010

Yea sure. Pawn them off on me because they can't write proper PHP code.

You're getting the idea.

BoonEx Certified Host: Zarconia.net - Fully Supported Shared and Dedicated for Dolphin
Quote · 10 May 2010
 
 
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.