GetSimple Support Forum

Full Version: strange behaviour of file_get_content
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hello
I'm trying to convert a function I'm using to get page excerpt into a plugin.
I've got some problems with it
In plugin's code when I use
$loaduserfile = @file_get_contents('data/pages/'.$page.'.xml');
and echo the output, I get only content of <pubDate> part of xml file
(example: Mon, 15 Nov 2010 10:41:09 +1030) and not even 1 char more, while function placed in theme/functions.php works fine.

Using
$loaduserfile = @file_get_contents(GSDATAPATH.$page.'.xml');
doesn't load file.

Is there any explanation ?
yojoe Wrote:In plugin's code when I use
$loaduserfile = @file_get_contents('data/pages/'.$page.'.xml');
and echo the output, I get only content of <pubDate> part of xml file

Look at the source of the output, you'll see the full xml file.
Or try this: echo htmlspecialchars($loaduserfile);


yojoe Wrote:Using
$loaduserfile = @file_get_contents(GSDATAPATH.$page.'.xml');
doesn't load file.

Is there any explanation ?

Use GSDATAPAGESPATH instead ;-)
hmmmm....I'm not a pure dev, so I thought I'd get a plain char to char output, and I'll be able to see it as it was fetched.Then I'll see what I can do with it to make it useful.

Thx for a hint about gsdatapagespath, again I don;t $&%(! know why I haven't noticed it on list of constants :\

I feel I have all needed info, and will accomplish v0.00...1 of the plugin.