当前位置: 首页>>代码示例>>PHP>>正文


PHP phpthumb_functions::SafeURLread方法代码示例

本文整理汇总了PHP中phpthumb_functions::SafeURLread方法的典型用法代码示例。如果您正苦于以下问题:PHP phpthumb_functions::SafeURLread方法的具体用法?PHP phpthumb_functions::SafeURLread怎么用?PHP phpthumb_functions::SafeURLread使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在phpthumb_functions的用法示例。


在下文中一共展示了phpthumb_functions::SafeURLread方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: image

    } else {
        $phpThumb->ErrorImage('failed to create "new" image (' . $phpThumb->w . 'x' . $phpThumb->h . ')');
    }
} elseif (!$phpThumb->src) {
    $phpThumb->ErrorImage('Usage: ' . $_SERVER['PHP_SELF'] . '?src=/path/and/filename.jpg' . "\n" . 'read Usage comments for details');
} elseif (preg_match('/^(f|ht)tp\\:\\/\\//i', $phpThumb->src)) {
    $phpThumb->DebugMessage('$phpThumb->src (' . $phpThumb->src . ') is remote image, attempting to download', __FILE__, __LINE__);
    if ($phpThumb->config_http_user_agent) {
        $phpThumb->DebugMessage('Setting "user_agent" to "' . $phpThumb->config_http_user_agent . '"', __FILE__, __LINE__);
        ini_set('user_agent', $phpThumb->config_http_user_agent);
    }
    $cleanedupurl = phpthumb_functions::CleanUpURLencoding($phpThumb->src);
    $phpThumb->DebugMessage('CleanUpURLencoding(' . $phpThumb->src . ') returned "' . $cleanedupurl . '"', __FILE__, __LINE__);
    $phpThumb->src = $cleanedupurl;
    unset($cleanedupurl);
    if ($rawImageData = phpthumb_functions::SafeURLread($phpThumb->src, $error, $phpThumb->config_http_fopen_timeout, $phpThumb->config_http_follow_redirect)) {
        $phpThumb->DebugMessage('SafeURLread(' . $phpThumb->src . ') succeeded' . ($error ? ' with messsages: "' . $error . '"' : ''), __FILE__, __LINE__);
        $phpThumb->DebugMessage('Setting source data from URL "' . $phpThumb->src . '"', __FILE__, __LINE__);
        $phpThumb->setSourceData($rawImageData, urlencode($phpThumb->src));
    } else {
        $phpThumb->ErrorImage($error);
    }
}
////////////////////////////////////////////////////////////////
// Debug output, to try and help me diagnose problems
$phpThumb->DebugTimingMessage('phpThumbDebug[7]', __FILE__, __LINE__);
if (@$_GET['phpThumbDebug'] == '7') {
    $phpThumb->phpThumbDebug();
}
////////////////////////////////////////////////////////////////
$phpThumb->GenerateThumbnail();
开发者ID:CrazyBobik,项目名称:allotaxi.test,代码行数:31,代码来源:phpThumb.php

示例2: ImageFilledRectangle

        }
        $new_background_color = phpthumb_functions::ImageHexColorAllocate($phpThumb->gdimg_source, $bghexcolor, false, $alpha);
        ImageFilledRectangle($phpThumb->gdimg_source, 0, 0, $phpThumb->w, $phpThumb->h, $new_background_color);
    } else {
        $phpThumb->ErrorImage('failed to create "new" image (' . $phpThumb->w . 'x' . $phpThumb->h . ')');
    }
} elseif (!$phpThumb->src) {
    $phpThumb->ErrorImage('Usage: ' . $_SERVER['PHP_SELF'] . '?src=/path/and/filename.jpg' . "\n" . 'read Usage comments for details');
} elseif (eregi('^(f|ht)tp\\://', $phpThumb->src)) {
    if ($phpThumb->config_http_user_agent) {
        ini_set('user_agent', $phpThumb->config_http_user_agent);
    }
    $basename = preg_quote(basename($phpThumb->src));
    $encoded = rawurlencode(basename($phpThumb->src));
    $HTTPurl = ereg_replace('(.*)' . $basename . '$', '\\1' . $encoded, $phpThumb->src);
    if ($rawImageData = phpthumb_functions::SafeURLread($HTTPurl, $error)) {
        $phpThumb->setSourceData($rawImageData, urlencode($phpThumb->src));
    } else {
        $phpThumb->ErrorImage($error);
    }
}
////////////////////////////////////////////////////////////////
// Debug output, to try and help me diagnose problems
$phpThumb->DebugTimingMessage('phpThumbDebug[7]', __FILE__, __LINE__);
if (@$_GET['phpThumbDebug'] == '7') {
    $phpThumb->phpThumbDebug();
}
////////////////////////////////////////////////////////////////
$phpThumb->GenerateThumbnail();
////////////////////////////////////////////////////////////////
// Debug output, to try and help me diagnose problems
开发者ID:jankichaudhari,项目名称:yii-site,代码行数:31,代码来源:phpThumb.php

示例3: array

    <tr><th colspan="8">&lt;-- bad . . . . . good --&gt;</th></tr>
    <tr>
        <td bgcolor="red">&nbsp;&nbsp;&nbsp;&nbsp;</td>
        <td bgcolor="orange">&nbsp;&nbsp;&nbsp;&nbsp;</td>
        <td bgcolor="yellow">&nbsp;&nbsp;&nbsp;&nbsp;</td>
        <td bgcolor="olive">&nbsp;&nbsp;&nbsp;&nbsp;</td>
        <td bgcolor="darkgreen">&nbsp;&nbsp;&nbsp;&nbsp;</td>
        <td bgcolor="green">&nbsp;&nbsp;&nbsp;&nbsp;</td>
        <td bgcolor="lightgreen">&nbsp;&nbsp;&nbsp;&nbsp;</td>
        <td bgcolor="lime">&nbsp;&nbsp;&nbsp;&nbsp;</td>
    </tr>
</table>
<table border="1" cellspacing="0" cellpadding="2">
<tr bgcolor="#EEEEEE"><th>Setting</th><th colspan="2">Value</th><th>Comments</th></tr>
<?php 
$versions['raw'] = array('latest' => phpthumb_functions::SafeURLread('http://phpthumb.sourceforge.net/?latestversion=1', $dummy), 'this' => $phpThumb->phpthumb_version);
foreach ($versions['raw'] as $key => $value) {
    eregi('^([0-9\\.]+)\\-?(([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2}))?', $value, $matches);
    @(list($huge, $major, $minor) = @explode('.', @$matches[1]));
    @(list($year, $month, $day, $hour, $min) = @$matches[3]);
    $versions['base'][$key] = $matches[1];
    $versions['huge'][$key] = $huge;
    $versions['major'][$key] = $major;
    $versions['minor'][$key] = $minor;
    $versions['stamp'][$key] = $matches[2];
    $versions['year'][$key] = $year;
    $versions['month'][$key] = $month;
    $versions['day'][$key] = $day;
    $versions['hour'][$key] = $hour;
    $versions['min'][$key] = $min;
    $versions['date'][$key] = @mktime($hour, $min, 0, $month, $day, $year);
开发者ID:jtresca,项目名称:nysurveyor,代码行数:31,代码来源:phpThumb.demo.check.php

示例4: array

		<td style="background-color: red;"       >&nbsp;&nbsp;&nbsp;&nbsp;</td>
		<td style="background-color: orange;"    >&nbsp;&nbsp;&nbsp;&nbsp;</td>
		<td style="background-color: yellow;"    >&nbsp;&nbsp;&nbsp;&nbsp;</td>
		<td style="background-color: olive;"     >&nbsp;&nbsp;&nbsp;&nbsp;</td>
		<td style="background-color: darkgreen;" >&nbsp;&nbsp;&nbsp;&nbsp;</td>
		<td style="background-color: green;"     >&nbsp;&nbsp;&nbsp;&nbsp;</td>
		<td style="background-color: lightgreen;">&nbsp;&nbsp;&nbsp;&nbsp;</td>
		<td style="background-color: lime;"      >&nbsp;&nbsp;&nbsp;&nbsp;</td>
	</tr>
</table>
<table border="1" cellspacing="0" cellpadding="2">
<tr style="background-color: #EEEEEE;"><th>Setting</th><th colspan="2">Value</th><th>Comments</th></tr>
<?php

$versions['raw'] = array(
	'latest' => phpthumb_functions::SafeURLread('http://phpthumb.sourceforge.net/?latestversion=1', $dummy),
	'this'   => $phpThumb->phpthumb_version,
);
foreach ($versions['raw'] as $key => $value) {
	preg_match('#^([0-9\\.]+)\\-?(([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2}))?#i', $value, $matches);
	@list($huge, $major, $minor) = @explode('.', @$matches[1]);
	@list($year, $month, $day, $hour, $min) = @$matches[3];
	$versions['base'][$key]  = $matches[1];
	$versions['huge'][$key]  = $huge;
	$versions['major'][$key] = $major;
	$versions['minor'][$key] = $minor;
	$versions['stamp'][$key] = $matches[2];
	$versions['year'][$key]  = $year;
	$versions['month'][$key] = $month;
	$versions['day'][$key]   = $day;
	$versions['hour'][$key]  = $hour;
开发者ID:hungnv0789,项目名称:vhtm,代码行数:31,代码来源:phpThumb.demo.check.php


注:本文中的phpthumb_functions::SafeURLread方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。