} } if (@$_SERVER['HTTP_REFERER']) { $phpthumb->ErrorImage('&md5s=' . $md5s); } else { die('&md5s=' . $md5s); } } foreach ($PHPTHUMB_CONFIG as $key => $value) { $keyname = 'config_' . $key; $phpthumb->{$keyname} = $value; } //////////////////////////////////////////////////////////////// // Debug output, to try and help me diagnose problems if (@$_GET['phpthumbDebug'] == '1') { $phpthumb->phpthumbDebug(); } //////////////////////////////////////////////////////////////// $parsed_url_referer = parse_url(@$_SERVER['HTTP_REFERER']); if ($phpthumb->config_nooffsitelink_require_refer && !in_array(@$parsed_url_referer['host'], $phpthumb->config_nohotlink_valid_domains)) { $phpthumb->ErrorImage('config_nooffsitelink_require_refer enabled and ' . (@$parsed_url_referer['host'] ? '"' . $parsed_url_referer['host'] . '" is not an allowed referer' : 'no HTTP_REFERER exists')); } $parsed_url_src = parse_url(@$_GET['src']); if ($phpthumb->config_nohotlink_enabled && $phpthumb->config_nohotlink_erase_image && eregi('^(f|ht)tp[s]?://', @$_GET['src']) && !in_array(@$parsed_url_src['host'], $phpthumb->config_nohotlink_valid_domains)) { $phpthumb->ErrorImage($phpthumb->config_nohotlink_text_message); } //////////////////////////////////////////////////////////////// // You may want to pull data from a database rather than a physical file // If so, uncomment the following $SQLquery line (modified to suit your database) // Note: this must be the actual binary data of the image, not a URL or filename // see http://www.billy-corgan.com/blog/archive/000143.php for a brief tutorial on this section