本文整理汇总了PHP中Art::validate_type方法的典型用法代码示例。如果您正苦于以下问题:PHP Art::validate_type方法的具体用法?PHP Art::validate_type怎么用?PHP Art::validate_type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Art
的用法示例。
在下文中一共展示了Art::validate_type方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor
* Art constructor, takes the UID of the object and the
* object type.
*/
public function __construct($uid, $type = 'album')
{
$this->type = Art::validate_type($type);
$this->uid = $uid;
}
示例2: define
define('NO_SESSION', '1');
require_once 'lib/init.php';
// Check to see if they've got an interface session or a valid API session, if not GTFO
if (!Session::exists('interface', $_COOKIE[AmpConfig::get('session_name')]) && !Session::exists('api', $_REQUEST['auth'])) {
debug_event('image', 'Access denied, checked cookie session:' . $_COOKIE[AmpConfig::get('session_name')] . ' and auth:' . $_REQUEST['auth'], 1);
exit;
}
// If we aren't resizing just trash thumb
if (!AmpConfig::get('resize_images')) {
$_GET['thumb'] = null;
}
// FIXME: Legacy stuff - should be removed after a version or so
if (!isset($_GET['object_type'])) {
$_GET['object_type'] = 'album';
}
$type = Art::validate_type($_GET['object_type']);
/* Decide what size this image is */
switch ($_GET['thumb']) {
case '1':
/* This is used by the now_playing stuff */
$size['height'] = '75';
$size['width'] = '75';
break;
case '2':
$size['height'] = '128';
$size['width'] = '128';
break;
case '3':
/* This is used by the flash player */
$size['height'] = '80';
$size['width'] = '80';