|
|
|
@ -1053,6 +1053,36 @@ function get_cover($cover_id, $field = null, $root = 1, $flag = true)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function get_local_cover($cover_id, $field = null, $root = 1, $flag = true)
|
|
|
|
|
{
|
|
|
|
|
if (empty($cover_id)) {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
$picture = M('Picture')->where(array('status' => 1))->getById($cover_id);
|
|
|
|
|
if ($field == 'path') {
|
|
|
|
|
if (!empty($picture['url']) && get_tool_status('qiniu_storage') == 1) {
|
|
|
|
|
$picture['path'] = $picture['url'];
|
|
|
|
|
} else {
|
|
|
|
|
if ($picture['water'] && MODULE_NAME != 'Admin' && $flag && (C('watermark.status') == 1)) {
|
|
|
|
|
|
|
|
|
|
$rp = realpath(dirname(__FILE__) . '/../../../');
|
|
|
|
|
|
|
|
|
|
if (is_file($rp . $picture['water'])) {
|
|
|
|
|
$field = 'water';
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if ($root == 1) {
|
|
|
|
|
$picture['path'] = __ROOT__ . $picture['path'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
return empty($field) ? $picture : $picture[$field];
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function get_file($cover_id, $field = null)
|
|
|
|
|
{
|
|
|
|
|