Problem wit thumb in php plus short url script

Update: The content in this post maybe out of date or inaccurate.

Hello and sorry for my English.

My Problem.
i have a webpage with this script php plus advanced short url script.
I have generate a secret kex. but i have no thumbs on my site. I have found this php file for generate the thumb. Here the code from the file:

<?php

if(!defined('ANTI_DIRECT')) exit(header('location: ../'));

function domainThumb($domain,$size='sm') {

        global $_config;

        if($_config['thumbKey']) {
                $failed = 'upload/domainThumbs/_failed.'.$domain.'.jpg';

                if(is_file($failed)) $timeout = time() - filemtime($failed);

                if(!is_file($failed) || $timeout > 1*24*60*60) {
                        $request_url =  "http://images.shrinktheweb.com/xino.php?"
                                        . "Service=".           "ShrinkWebUrlThumbnail"
                                        . "&Action=".           "Thumbnail"
                                        . "&stwaccesskeyid=".   $_config['thumbKey']
                                        . "&stwsize=" .            $size
                                        . "&stwu=" .               $_config['thumbSecretKey']
                                        . "&stwurl=http://www.rhwm.eu" .      $domain;

                        $line = implode(file($request_url));
                        $num_matches = preg_match('/<[^:]*:Thumbnail\\s*(?:Exists=\"((?:true)|(?:false))\")?[^>]*>([^<]*)<\//', $line, $matches);
                        if($num_matches == 1) {
                                $thumbnail = $matches[2];
                                $imagedata = @imagecreatefromjpeg($thumbnail);
                                if($imagedata != '') {
                                        imagejpeg($imagedata,'upload/domainThumbs/'.$domain.'.jpg',90);
                                        if(is_file($failed)) unlink($failed);
                                        return true;
                                } else {
                                        copy('env/pix/pixel.gif',$failed);
                                }
                        }
                }
        }
        return false;
}

?>

I can not find the problem. Please cam you help me ?

Rainer

g0dxilla's picture
g0dxilla
The Lizard King
Offline
Joined: 04/15/2008
Visit g0dxilla's Website

Hey Rainer,

Have you got both of our keys added to the script? If you will notice there are 2 keys highlighted in your lobby.

Can you provide an example page where this is not working?

Best Regards,

Frank

rainercfm (not verified)

Hi

Thank you for your help. Now, i have repair the problem. The problem wars the url in the php file. I have write my url, but in this line i dont write any url.
Now , i have my Thumbs on my Site. And its great.

See my Website niow: http://www.rhwm.eu
and go to the Point: Link-Hits

puravida's picture
puravida
Jedi Warrior
Offline
Joined: 09/01/2007
Visit puravida's Website

Hello,

I do not see any problem with your script, at first glance.

We cannot offer free support for things like this, but one suggestion is that I noticed you are using imagecreatejpeg to open the remote image location. Keep in mind that allow_url_fopen must be set to ON for that to work properly. If that turns out to be your problem and you cannot modify that setting, then you could consider using cURL instead.

Take a look at a relevant article I found by searching the forum for "allow url fopen"

rainercfm (not verified)

Hi

Thank you

I have fix the problem.
The problem is in my php file.
In the php file is this: "&stwurl=http://www.rhwm.eu"
i have now write this : "&stwurl=http://"

an now i have my Thumbs perfect.
See please ma Website : http://rhwm.eu/ShortPopular

But in the php file i can not see the option to the Thumb size.
i will make the Thumbs great. I see in my php file no size.

Thank you.

g0dxilla's picture
g0dxilla
The Lizard King
Offline
Joined: 04/15/2008
Visit g0dxilla's Website

That's great glad to hear it!

Best Regards,
Frank Grogan

rainercfm (not verified)

Thank you for all your help.

Thank you very much.

Rainer from Germany

puravida's picture
puravida
Jedi Warrior
Offline
Joined: 09/01/2007
Visit puravida's Website

You're very welcome Smile

Topic locked

ShrinkTheWeb® (About STW) is another innovation by Neosys Consulting
Contact Us | PagePix Benefits | Learn More | Our Partners | Privacy Policy | Terms of Use

©2015 ShrinkTheWeb. All rights reserved. ShrinkTheWeb is a registered trademark of ShrinkTheWeb.