本文整理汇总了PHP中getImageSrc函数的典型用法代码示例。如果您正苦于以下问题:PHP getImageSrc函数的具体用法?PHP getImageSrc怎么用?PHP getImageSrc使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getImageSrc函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addEventToZip
function addEventToZip($eid, $mid, $zip)
{
$query = "SELECT Id, MonitorId, StartTime, Frames FROM Events WHERE Id={$eid}";
$results = dbFetchAll($query);
$scale = max(reScale(SCALE_BASE, '100', ZM_WEB_DEFAULT_SCALE), SCALE_BASE);
foreach ($results as $result) {
for ($counter = 1; $counter <= $result['Frames']; $counter++) {
$event['Id'] = $result['Id'];
$event['StartTime'] = $result['StartTime'];
$event['MonitorId'] = $result['MonitorId'];
$imageData = getImageSrc($event, $counter, $scale, isset($_REQUEST['show']) && $_REQUEST['show'] == "capt");
$imagePath = $imageData['thumbPath'];
$eventPath = $imageData['eventPath'];
$dImagePath = sprintf("%s/%0" . ZM_EVENT_IMAGE_DIGITS . "d-diag-d.jpg", $eventPath, $counter);
$rImagePath = sprintf("%s/%0" . ZM_EVENT_IMAGE_DIGITS . "d-diag-r.jpg", $eventPath, $counter);
$frames[] = viewImagePath($imagePath);
}
$zip->addDirectory("events/" . $event['MonitorId']);
$zip->addDirectory("events/" . $event['MonitorId'] . "/" . $event['Id']);
}
$i = 0;
$filesString = "";
foreach ($frames as $frame) {
$i++;
$filesName = sprintf("%0" . ZM_EVENT_IMAGE_DIGITS . "d-capture.jpg", $i);
$filesString .= "\nframes.push(\"events/" . $mid . "/" . $eid . "/" . $filesName . "\");";
$zip->addLargeFile($frame, "events/" . $mid . "/" . $eid . "/" . $filesName);
}
return $filesString;
}
示例2: getSearch
public function getSearch()
{
$categoryId = Input::get('categoryid');
$search = Input::get('query');
$objects = null;
if ($categoryId) {
// Category Image
if ($featuredImageId = ObjectMeta::getValue($categoryId, '_featured_image')) {
$featuredImageUrl = getImageSrc($featuredImageId, 'thumbnail');
}
// Get objects where in category
$objects = Object::Where('type', 'object_type')->whereExists(function ($query) use($categoryId) {
$query->select(DB::raw(1))->from('object_meta')->whereRaw(DB::getTablePrefix() . 'object_meta.object_id = ' . DB::getTablePrefix() . 'objects.id')->where('meta_key', '_category_id')->where('meta_value', $categoryId);
})->select(DB::raw('substr(name, 14) as field_name'))->get()->toArray();
$types = array_map(function ($v) {
return $v['field_name'];
}, $objects);
if (!empty($types)) {
$objects = Object::whereIn('type', $types);
}
}
if ($objects) {
$objects = $objects->select(array('objects.id', DB::raw('"/uploads/' . $featuredImageUrl . '"' . ' as featured_image'), 'objects.name', 'objects.title', 'objects.excerpt'))->get();
}
return $objects;
}
示例3: getCategories
public function getCategories($id = null)
{
//Config::set('laravel-debugbar::config.enabled', false);
$categories = Object::where('objects.type', 'category')->where('parent_id', $id)->select(array('objects.id', 'objects.title', 'objects.name'))->get();
$response = $categories;
foreach ($categories as $category) {
if ($contentImageId = ObjectMeta::getValue($category->id, '_content_image')) {
if ($contentImageUrl = getImageSrc($contentImageId, 'medium')) {
$category['contentImageUrl'] = '/uploads/' . $contentImageUrl;
}
}
if ($featuredImageId = ObjectMeta::getValue($category->id, '_featured_image')) {
if ($featuredImageUrl = getImageSrc($featuredImageId, 'thumbnail')) {
$category['featuredImageUrl'] = '/uploads/' . $featuredImageUrl;
}
}
$category['childrenCount'] = Object::where('objects.type', 'category')->where('parent_id', $category['id'])->count();
$category['itemsCount'] = ObjectMeta::join('objects', 'object_meta.object_id', '=', 'objects.id')->where('meta_key', '_category_id')->where('meta_value', $category['id'])->where('objects.type', '<>', 'category')->groupBy('object_id')->count();
}
// $categories = Object::leftJoin('objects as t1', function($join) {
// $join->on('objects.id', '=', 't1.parent_id');
// })
// ->where('objects.type', 'category')
// //->whereNull('objects.parent_id')
// ->where('t1.parent_id', $id)
// ->select(DB::raw('jini_t1.*'))
// ->get();
//print_r($categories);
//
// $response = array(
// 'categories' => $categories
// //'contentImage' =>
// );
return response()->json($categories);
}
示例4: default
public function default()
{
$default = "assets/images/default.jpg";
if (FileSystem::exists($default) && FileSystem::isImage($default)) {
return getImageSrc($default, $this->width, $this->height);
}
return null;
}
示例5: getEdit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function getEdit($id)
{
$object = Object::find($id);
$parent_id = $object->parent_id;
$categories = Object::where('type', 'category')->where('id', '!=', $id)->get();
if ($imageObjectId = $object->getValue('_featured_image')) {
$featuredImage = getImageSrc($imageObjectId, 'thumbnail');
}
if ($imageObjectId = $object->getValue('_content_image')) {
$contentImage = getImageSrc($imageObjectId, 'thumbnail');
}
$toolTip = $object->getValue('_tooltip');
return view('admin.category.create_edit', compact('object', 'parent_id', 'categories', 'featuredImage', 'contentImage', 'toolTip'));
}
示例6: getEdit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function getEdit($id)
{
$object = Object::find($id);
$parent_id = $object->parent_id;
$categories = Object::where('type', 'category')->where('id', '!=', $id)->get();
if ($imageObjectId = $object->getValue('_featured_image')) {
// $featuredImage = getImageSrc($imageObjectId, 'thumbnail');
$featuredImage = 'cropped/' . getTheImageSize(getImageSrc($imageObjectId), '_featured_image');
}
if ($imageObjectId = $object->getValue('_content_image')) {
// $contentImage = getImageSrc($imageObjectId, 'thumbnail');
$contentImage = 'cropped/' . getTheImageSize(getImageSrc($imageObjectId), '_content_image');
}
$toolTip = $object->getValue('_tooltip');
$keywords = $object->keywords->implode('content', ', ');
return view('admin.category.create_edit', compact('object', 'parent_id', 'categories', 'featuredImage', 'contentImage', 'toolTip', 'keywords'));
}
示例7: processCategory
private function processCategory(&$category)
{
if ($contentImageId = ObjectMeta::getValue($category->id, '_content_image')) {
if ($contentImageUrl = getImageSrc($contentImageId, 'medium')) {
$category['contentImageUrl'] = '/uploads/' . $contentImageUrl;
}
}
if ($featuredImageId = ObjectMeta::getValue($category->id, '_featured_image')) {
if ($featuredImageUrl = getImageSrc($featuredImageId, 'small')) {
$category['featuredImageUrl'] = '/uploads/' . $featuredImageUrl;
// $path = __DIR__ . '/../../../public/uploads/' . $featuredImageUrl;
// echo $path . '<br />' . file_exists($path) . '<br />';
// if (file_exists($path)) {
// $type = pathinfo($path, PATHINFO_EXTENSION);
// $data = file_get_contents($path);
// $category['featuredImageUrl'] = base64_encode($data);
// }
}
}
$category['childrenCount'] = Object::where('objects.type', 'category')->where('parent_id', $category['id'])->count();
$category['itemsCount'] = ObjectMeta::join('objects', 'object_meta.object_id', '=', 'objects.id')->where('meta_key', '_category_id')->where('meta_value', $category['id'])->where('objects.type', '<>', 'category')->groupBy('object_id')->count();
return $category;
}
示例8: dbFetchOne
}
} else {
$frame = dbFetchOne('SELECT * FROM Frames WHERE EventId = ? AND Score = ?', NULL, array($eid, $event['MaxScore']));
}
$maxFid = $event['Frames'];
$firstFid = 1;
$prevFid = $frame['FrameId'] - 1;
$nextFid = $frame['FrameId'] + 1;
$lastFid = $maxFid;
$alarmFrame = $frame['Type'] == 'Alarm';
if (isset($_REQUEST['scale'])) {
$scale = validInt($_REQUEST['scale']);
} else {
$scale = max(reScale(SCALE_BASE, $event['DefaultScale'], ZM_WEB_DEFAULT_SCALE), SCALE_BASE);
}
$imageData = getImageSrc($event, $frame, $scale, isset($_REQUEST['show']) && $_REQUEST['show'] == "capt");
$imagePath = $imageData['thumbPath'];
$eventPath = $imageData['eventPath'];
$dImagePath = sprintf("%s/%0" . ZM_EVENT_IMAGE_DIGITS . "d-diag-d.jpg", $eventPath, $frame['FrameId']);
$rImagePath = sprintf("%s/%0" . ZM_EVENT_IMAGE_DIGITS . "d-diag-r.jpg", $eventPath, $frame['FrameId']);
$focusWindow = true;
xhtmlHeaders(__FILE__, translate('Frame') . " - " . $event['Id'] . " - " . $frame['FrameId']);
?>
<body>
<div id="page">
<div id="header">
<div id="headerButtons">
<?php
if (ZM_RECORD_EVENT_STATS && $alarmFrame) {
echo makePopupLink('?view=stats&eid=' . $event['Id'] . '&fid=' . $frame['FrameId'], 'zmStats', 'stats', translate('Stats'));
}
示例9: getImage
function getImage($device)
{
global $config;
return '<img src="' . getImageSrc($device) . '" />';
}
示例10: sprintf
$map_init = "[" . $config['leaflet']['default_lat'] . ", " . $config['leaflet']['default_lng'] . "], " . sprintf("%01.0f", $config['leaflet']['default_zoom']);
$temp_output .= 'var map = L.map(\'leaflet-map\').setView(' . $map_init . ');
L.tileLayer(\'//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png\', {
attribution: \'© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors\'
}).addTo(map);
var markers = L.markerClusterGroup();
var redMarker = L.AwesomeMarkers.icon({
icon: \'server\',
markerColor: \'red\', prefix: \'fa\', iconColor: \'white\'
});
var greenMarker = L.AwesomeMarkers.icon({
icon: \'server\',
markerColor: \'green\', prefix: \'fa\', iconColor: \'white\'
});
';
foreach (dbFetchRows("SELECT `device_id`,`hostname`,`os`,`status`,`lat`,`lng` FROM `devices` LEFT JOIN `locations` ON `devices`.`location`=`locations`.`location` WHERE `disabled`=0 AND `ignore`=0 AND `lat` != '' AND `lng` != '' ORDER BY `status` ASC, `hostname`") as $map_devices) {
$icon = 'greenMarker';
if ($map_devices['status'] == 0) {
$icon = 'redMarker';
}
$temp_output .= "var title = '<a href=\"" . generate_device_url($map_devices) . "\"><img src=\"" . getImageSrc($map_devices) . "\" width=\"32\" height=\"32\" alt=\"\">" . $map_devices['hostname'] . "</a>';\n var marker = L.marker(new L.LatLng(" . $map_devices['lat'] . ", " . $map_devices['lng'] . "), {title: title, icon: {$icon}});\n marker.bindPopup(title);\n markers.addLayer(marker);\n";
}
$temp_output .= 'map.addLayer(markers);
</script>';
} else {
$temp_output = 'Mapael engine not supported here';
}
unset($common_output);
$common_output[] = $temp_output;
示例11: dbFetchOne
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
if (!canView('Events')) {
$_REQUEST['view'] = "error";
return;
}
$event = dbFetchOne('select E.*,M.Name as MonitorName from Events as E, Monitors as M where E.Id = ? and E.MonitorId = M.Id', NULL, array($_REQUEST['eid']));
$frame = dbFetchOne('select * from Frames where EventID = ? and Score = ?', NULL, array($_REQUEST['eid'], $event['MaxScore']));
$scale = getDeviceScale($event['Width'], $event['Height'], 2.2);
$image1 = getImageSrc($event, 1, $scale);
if ($frame['Type'] == 'Alarm') {
$image2 = getImageSrc($event, $frame['FrameId'], $scale);
} else {
$image2 = getImageSrc($event, intval($event['Frames'] / 2), $scale);
}
xhtmlHeaders(__FILE__, translate('Event') . ' - ' . $_REQUEST['eid']);
?>
<body>
<div id="page">
<div id="content">
<table id="contentTable" class="major">
<tr>
<th scope="row"><?php
echo translate('Name');
?>
</th>
<td><?php
echo htmlentities($event['Name']);
echo $event['Archived'] ? "(" . translate('Archived') . ")" : "";
示例12: getFrameImage
function getFrameImage()
{
$eventId = $_REQUEST['id'][0];
$frameId = $_REQUEST['id'][1];
$sql = 'select * from Frames where EventId = ? and FrameId = ?';
if (!($frame = dbFetchOne($sql, NULL, array($eventId, $frameId)))) {
$frame = array();
$frame['EventId'] = $eventId;
$frame['FrameId'] = $frameId;
$frame['Type'] = "Virtual";
}
$event = dbFetchOne('select * from Events where Id = ?', NULL, array($frame['EventId']));
$frame['Image'] = getImageSrc($event, $frame, SCALE_BASE);
return $frame;
}
示例13: getEdit
//.........这里部分代码省略.........
$field['label'] = 'Occupation';
$field['type'] = 'text';
$field['instructions'] = '';
$field['required'] = 0;
$values = $this->getFieldValues($id, $field);
$fieldControls[] = view('admin.partials.form.text', compact('field', 'values'));
// Address
$uniqueId = Hash::getUniqueId();
$field = array();
$field['id'] = '_field_address';
$field['name'] = 'address';
$field['label'] = 'Address';
$field['type'] = 'map';
$field['instructions'] = '';
$field['required'] = 0;
$values = $this->getFieldValues($id, $field);
$fieldControls[] = view('admin.partials.form.map', compact('field', 'values', 'uniqueId'));
// French
$field = array();
$field['id'] = '_field_french_speakers';
$field['name'] = 'french_speakers';
$field['label'] = 'French Speakers';
$field['type'] = 'boolean';
$field['instructions'] = '';
$field['required'] = 0;
$values = $this->getFieldValues($id, $field);
$fieldControls[] = view('admin.partials.form.boolean', compact('field', 'values'));
// Address
$field = array();
$field['id'] = '_field_phone';
$field['name'] = 'phone';
$field['label'] = 'Phone';
$field['type'] = 'tel';
$field['instructions'] = '';
$field['required'] = 0;
$values = $this->getFieldValues($id, $field);
$fieldControls[] = view('admin.partials.form.tel', compact('field', 'values'));
// Email
$field = array();
$field['id'] = '_field_email';
$field['name'] = 'email';
$field['label'] = 'Email';
$field['type'] = 'email';
$field['instructions'] = '';
$field['required'] = 0;
$values = $this->getFieldValues($id, $field);
$fieldControls[] = view('admin.partials.form.email', compact('field', 'values'));
foreach ($fieldsRows as $fieldRow) {
$field = unserialize($fieldRow['meta_value']);
$fields[] = $field;
//$field['value'] = $object->getValue($field['id']);
$values = array();
$valuesMeta = ObjectMeta::where('object_id', $id)->where('meta_key', 'LIKE', $field['id'] . '%')->get();
foreach ($valuesMeta as $valueMeta) {
$valueMetaKey = str_replace($field['id'], '', $valueMeta['meta_key']);
if (substr($valueMetaKey, 0, 1) == '-') {
$valueMetaKey = substr($valueMetaKey, 1);
}
$value = $valueMeta['meta_value'];
if ($value == '1') {
$value = 'on';
}
if ($valueMetaKey) {
$values[$valueMetaKey] = $value;
} else {
$values[] = $value;
}
}
$uniqueId = Hash::getUniqueId();
switch ($field['type']) {
case 'text':
$fieldControls[] = view('admin.partials.form.text', compact('field', 'values', 'uniqueId'));
break;
case 'wysiwyg':
$fieldControls[] = view('admin.partials.form.wysiwyg', compact('field', 'values', 'uniqueId'));
break;
case 'map':
$fieldControls[] = view('admin.partials.form.map', compact('field', 'values', 'uniqueId'));
break;
case 'tel':
$fieldControls[] = view('admin.partials.form.tel', compact('field', 'values', 'uniqueId'));
break;
case 'boolean':
$fieldControls[] = view('admin.partials.form.boolean', compact('field', 'values', 'uniqueId'));
break;
}
}
}
}
if (isset($object)) {
if ($imageObjectId = $object->getValue('_featured_image')) {
$featuredImage = getImageSrc($imageObjectId, 'thumbnail');
}
if ($imageObjectId = $object->getValue('_content_image')) {
$contentImage = getImageSrc($imageObjectId, 'thumbnail');
}
//d
}
return view('admin.object.create_edit', compact('object', 'fields', 'values', 'fieldControls', 'featuredImage', 'contentImage'));
}
示例14: getImage
function getImage($device)
{
return '<img src="' . getImageSrc($device) . '" />';
}
示例15: array
if ($result['disabled'] == 1) {
$highlight_colour = '#808080';
} else {
if ($result['ignored'] == 1 && $result['disabled'] == 0) {
$highlight_colour = '#000000';
} else {
if ($result['status'] == 0 && $result['ignore'] == 0 && $result['disabled'] == 0) {
$highlight_colour = '#ff0000';
} else {
if ($result['status'] == 1 && $result['ignore'] == 0 && $result['disabled'] == 0) {
$highlight_colour = '#008000';
}
}
}
}
$device[] = array('name' => $name, 'hostname' => $result['hostname'], 'device_id' => $result['device_id'], 'colours' => $highlight_colour, 'device_image' => getImageSrc($result), 'device_hardware' => $result['hardware'], 'device_os' => $config['os'][$result['os']]['text'], 'version' => $result['version'], 'location' => $result['location'], 'plugin' => $result['mplug_type']);
}
//end foreach
}
//end if
$json = json_encode($device);
die($json);
} else {
if ($_REQUEST['type'] == 'iftype') {
// Device search
if (is_admin() === true || is_read() === true) {
$results = dbFetchRows("SELECT `ports`.ifType FROM `ports` WHERE `ifType` LIKE '%" . $search . "%' GROUP BY ifType ORDER BY ifType LIMIT " . $limit);
} else {
$results = dbFetchRows("SELECT `I`.ifType FROM `ports` AS `I`, `devices` AS `D`, `devices_perms` AS `P`, `ports_perms` AS `PP` WHERE ((`P`.`user_id` = ? AND `P`.`device_id` = `D`.`device_id`) OR (`PP`.`user_id` = ? AND `PP`.`port_id` = `I`.`port_id` AND `I`.`device_id` = `D`.`device_id`)) AND `D`.`device_id` = `I`.`device_id` AND (`ifType` LIKE '%" . $search . "%') GROUP BY ifType ORDER BY ifType LIMIT " . $limit, array($_SESSION['user_id'], $_SESSION['user_id']));
}
if (count($results)) {