[SOLVED] Site moved to new host. lost some functionality. [SOLVED]

dormas

Joined: 2006-11-05
Posts: 13
Posted: Thu, 2012-11-01 05:24

SOLUTION:
Turns out my newer HOST upgraded or was already running a newer version of PHP which disallows
URL file-access. Previously ON and is now OFF. I did not bother contacting them (I have not had much luck with the new company)
After countless searches and some revisiting my code. I found this solution.
fopen_url, curl and You
Im kind of glad I kept searching!!! never give up!
-Sam

Code revision:
Was:
<?php @readfile('http://www.mysite.com/gallery2/main.php?g2_view=imageblock.External&g2_blocks=randomImage&g2_show=none&g2_itemId=68&g2_exactSize=450'); ?>

And is now:
<?php
$curl_handle=curl_init();
curl_setopt($curl_handle,CURLOPT_URL,'http://www.mysite.com/gallery2/main.php?g2_view=imageblock.External&g2_blocks=randomImage&g2_itemId=69&g2_show=none&g2_exactSize=450');
curl_exec($curl_handle);
curl_close($curl_handle);
?>

All,
I have been running G2 for some years now. and have a site thats been untouched for about the same time.
I just revisited it and noticed my images were not loading... at least on some of the pages.
What I do know is some 8-12 months ago my hosting site got aquired by another vendor and my site went with it.
I never thought to check and see if all was well.

Things I have tried:
1: Right from a web page:
http://www.mysite.com/gallery2/main.php?g2_view=imageblock.External&g2_blocks=randomImage&g2_show=none&g2_itemId=68&g2_exactSize=450'

Results: I get good images that change.
However when I embed it into a web page... excluding the random text, I get blank space...(no pics)

<body>
<center>Some test text.
<?php @readfile('http://www.flashyourweb.com/gallery2/mediaBlock.php?g2_itemId=32&mode=dynamic&g2_view=dynamicalbum.RandomAlbum&limit=2&useThumb=1&column=4&rss=1');?>
<?php @readfile('http://www.mysite.com/gallery2/main.php?g2_view=imageblock.External&g2_blocks=randomImage&g2_itemId=69&g2_show=none&g2_exactSize=450'); ?>
<?php @readfile('http://www.mysite.com/gallery2/main.php?g2_view=imageblock.External&g2_blocks=randomImage&g2_show=none&g2_itemId=68&g2_exactSize=450'); ?>
Some more test text.
</center>
</body>

Any ideas what could have gone wrong? I have poured over this and just cant seem to find the solution.

TIA- Sam

Obligatory Site info...
Gallery version = 2.2.4 core 1.2.0.6
PHP version = 5.2.13 apache2handler
Webserver = Apache/2.2.15 (Unix) mod_ssl/2.2.15 OpenSSL/0.9.8e-fips-rhel5 DAV/2 Phusion_Passenger/2.2.11 mod_fcgid/2.3.5 SVN/1.5.7 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 PHP/5.2.13
Database = mysqlt 5.0.90-community, lock.system=flock
Toolkits = ArchiveUpload, Exif, ImageMagick, SquareThumb, LinkItemToolkit, Thumbnail
Acceleration = full/900, full/900
Operating system = Linux cp44.myhostcenter.com 2.6.32-042stab062.2 #1 SMP Wed Oct 10 18:28:35 MSK 2012 x86_64
Default theme = slider
gettext = enabled
Locale = en_US
Browser = Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:15.0) Gecko/20100101 Firefox/15.0.1
Rows in GalleryAccessMap table = 28
Rows in GalleryAccessSubscriberMap table = 145
Rows in GalleryUser table = 5
Rows in GalleryItem table = 135
Rows in GalleryAlbumItem table = 11
Rows in GalleryCacheMap table = 3800