本文整理汇总了PHP中get_images函数的典型用法代码示例。如果您正苦于以下问题:PHP get_images函数的具体用法?PHP get_images怎么用?PHP get_images使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_images函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: include_tinymce
/**
* Writes the basic JS of the editor to $hjs. No editors are actually created.
* Multiple calls are allowed; all but the first should be ignored.
* This is called from init_EDITOR() automatically, but not from EDITOR_replace().
*
* @global string $hjs
* @return void
*/
function include_tinymce()
{
global $adm, $pth, $h, $u, $l, $sn, $hjs;
static $again = FALSE;
if ($again) {
return;
}
$again = TRUE;
if ($adm) {
include_once $pth['folder']['plugins'] . 'tinymce/' . 'links.php';
$imageList = 'var myImageList = new Array(' . get_images($pth['folder']['images']) . ');';
$linkList = 'var myLinkList = new Array(' . get_internal_links($h, $u, $l, $sn, $pth['folder']['downloads']) . ');';
} else {
$imageList = $linkList = '';
}
$hjs .= '
<script language="javascript" type="text/javascript" src="' . $pth['folder']['plugins'] . 'tinymce/' . 'tiny_mce/tiny_mce.js"></script>
<script type="text/javascript" src="' . $pth['folder']['plugins'] . 'tinymce/init.js"></script>
<script type="text/javascript">
/* <![CDATA[ */
' . tinymce_filebrowser() . '
' . $imageList . '
' . $linkList . '
/* ]]> */
</script>
';
}
示例2: get_images_data
function get_images_data($conn, $model)
{
$images = get_images($conn, $model);
//close_db($conn);
$ini = parse_ini_file(SETTINGS, true);
$data = '';
if ($images) {
$data .= "<ul class='ul-bags' id='thumbs_ul'>";
foreach ($images as $image) {
// FIXME handle pagination
$data .= "<li> " . "<a href='/{$ini['dir']['root']}/{$ini['dir']['album']}/{$image['model']}/{$image['file']}' rel=lightbox-bags>" . "<img class='thumb_img' src='/{$ini['dir']['root']}/{$ini['dir']['thumbs']}/{$image['model']}/{$image['file']}'>" . "</a>" . "</li>";
}
$data .= "</ul> <!-- / ul-bags-->";
}
return $data;
}
示例3: create_album
function create_album($id, $sizes)
{
global $params;
$album_path = album_dir($id);
if (is_dir(album_dir($id))) {
//--Create configuration file
if (!file_exists(album_dir($id) . "info.yml")) {
// There could be more parameters if necessary
$info_yaml = Spyc::YAMLDump(array('album_title' => $params['album'], 'album_description' => ''));
if (!($fp = fopen(album_dir($id) . 'info.yml', 'a'))) {
$params['flash'] = 'Album info file could not be created in <code>' . album_dir($id) . 'info.yml</code>.';
render('error');
}
if (!fwrite($fp, $info_yaml)) {
$params['flash'] = 'Could not write to file <code>' . album_dir($id) . 'info.yml</code>.';
render('error');
}
fclose($fp);
}
$originals = get_images(album_dir($id));
//--Create ZIP-Archive to download
//$zip = new PclZip('archive.zip');
foreach ($originals as $image) {
$images[] = album_dir($id) . $image;
}
$zip = new PclZip(album_dir($id) . 'archive.zip');
$test = $zip->create($images, PCLZIP_OPT_REMOVE_ALL_PATH);
if ($test == 0) {
die("Error: " . $zip->errorInfo(true));
}
//--Resize images
foreach ($sizes as $size_name => $size_pixels) {
$resized_album_path = album_dir($id, $size_name);
if (!is_dir($resized_album_path)) {
mkdir($resized_album_path, 0755);
}
foreach ($originals as $photo) {
scale(album_dir($id) . $photo, "{$resized_album_path}/{$photo}", $size_pixels);
}
}
} else {
$params['flash'] = "Resizing the images in <code>{$album_path}</code> failed. Could there be a permission problem?";
render('error');
exit;
}
}
示例4: str_replace
</title>
<link><?php
echo 'http://' . $_SERVER['HTTP_HOST'] . BASE_URL . 'index.php?rss=' . str_replace(" ", "%20", $params['rss']);
?>
</link>
</image>
<?php
if ($params['rss']) {
$albums[] = str_replace("%20", " ", $params['rss']);
} else {
$albums = get_folders(ALBUMS_ROOT);
}
foreach ($albums as $album) {
if (is_dir(ALBUMS_ROOT . '/' . $album)) {
$photos = get_images(ALBUMS_ROOT . '/' . $album);
} else {
$photos = array();
}
$first = true;
foreach ($photos as $photo) {
$title = '<title>' . $photo . '</title>';
$desc = '<description><p><a href="' . 'http://' . $_SERVER['HTTP_HOST'] . str_replace(" ", "%20", BASE_URL . 'albums/' . $album . '/') . $photo . '"><img src="' . 'http://' . $_SERVER['HTTP_HOST'] . str_replace(" ", "%20", BASE_URL . 'albums/' . $album . '/thumb/') . $photo . '" alt="photo" title="" style="float:left; padding-right:10px; padding-bottom:10px;"/></a></p><br clear=all></description>';
$link = '<link>' . 'http://' . $_SERVER['HTTP_HOST'] . str_replace(" ", "%20", BASE_URL . 'albums/' . '/' . $album) . $photo . '</link>';
$last_modified = exif_read_data(ALBUMS_ROOT . '/' . $album . '/' . $photo);
$last_modified = mktime(substr($last_modified['DateTimeOriginal'], 11, 2), substr($last_modified['DateTimeOriginal'], 14, 2), substr($last_modified['DateTimeOriginal'], 17, 2), substr($last_modified['DateTimeOriginal'], 5, 2), substr($last_modified['DateTimeOriginal'], 8, 2), substr($last_modified['DateTimeOriginal'], 0, 4));
if ($last_modified < 950000000) {
$last_modified = filemtime(ALBUMS_ROOT . '/' . $album . '/' . $photo);
}
$pubdate = '<pubDate>' . date("D, d M Y H:i:s T", $last_modified) . '</pubDate>';
$cat = '<category>' . $album . '</category>';
示例5: get_list_trendy
function get_list_trendy($where, $order, $esLayout)
{
global $es_settings, $wpdb, $wp_query;
$paged = isset($_GET['page_no']) ? $_GET['page_no'] : 0;
if (empty($order)) {
$order = get_order();
}
$sql = "SELECT * FROM {$wpdb->prefix}estatik_properties {$where} {$order} LIMIT {$paged}, {$es_settings->no_of_listing}";
$es_my_listing = $wpdb->get_results($sql);
if (!empty($es_my_listing)) {
?>
<h1><?php
echo $wp_query->post->post_title;
?>
</h1>
<div class="es_my_listing">
<div class="es_listing_change">
<?php
if ($es_settings->view_first_on_off == 1) {
include 'es_view_first.php';
}
?>
</div>
<ul class="clearfix <?php
echo es_get_layout($esLayout);
?>
">
<?php
foreach ($es_my_listing as $list) {
$photo_info = get_images($list->prop_id);
$image_url = $photo_info[0];
// $uploaded_images_count = $photo_info[1];
?>
<li class="es_listing_item prop_id-<?php
echo $list->prop_id;
?>
">
<a href="<?php
echo get_permalink($list->prop_id);
?>
"
class="es_my_list_in"
style="background-image: url(<?php
echo $image_url;
?>
)">
</a>
<div class="es_my_list_title">
<h3>
<a href="<?php
echo get_permalink($list->prop_id);
?>
">
<?php
echo es_excerpt($list->prop_address, 90);
?>
</a>
</h3>
<h2><?php
echo get_price($list->prop_price);
?>
</h2>
<div class="description"><?php
echo es_excerpt($list->prop_description, 150);
?>
</div>
<?php
show_specs($list, $photo_info[1], 'black');
?>
<div class="clearfix"></div>
<?php
show_props($list);
?>
</div>
<div class="hover">
<div class="overlay">
<div class="es_my_list_more clearfix">
<a href="<?php
if ($list->prop_latitude != "" && $list->prop_longitude != "") {
echo "{$list->prop_latitude}, {$list->prop_longitude}";
}
?>
" class="es_button es_map_view">
<?php
_e("View on map", 'es-plugin');
?>
</a>
<a href="<?php
//.........这里部分代码省略.........
示例6: write_header
<?php
require 'functions.php';
write_header();
if (!isset($_REQUEST['dir']) || $_REQUEST['dir'] == "" || substr($_REQUEST['dir'], 0, 1) == "." || !is_dir(__DIR__ . '/' . PHOTOS_PATH . $_REQUEST['dir'])) {
$_REQUEST['dir'] = "";
}
echo '<div class=gallery>';
if ($_REQUEST['dir'] !== "") {
show_back(PHOTOS_PATH . $_REQUEST['dir']);
}
list_dirs(get_dirs($_REQUEST['dir']));
list_photos(get_images(PHOTOS_PATH . $_REQUEST['dir']));
echo '</div>';
示例7: smarty_function_init_images
function smarty_function_init_images($params, &$smarty)
{
if (!function_exists('search_obj_array')) {
function search_obj_array($needle, $field, $array = array())
{
if ($array) {
foreach ($array as $key => $data) {
if ($data->all[$field] == $needle) {
return $key;
}
}
}
return false;
}
}
global $class_path, $site, $leht;
extract($params);
if (!isset($name)) {
$name = 'images';
}
if (!isset($parent)) {
$parent = $leht->id;
}
$album = new Objekt(array('objekt_id' => $parent));
$conf = new CONFIG($album->all['ttyyp_params']);
//$alamlist->debug->print_msg();
$files = array();
if ($conf->get('path')) {
$path = (string) $conf->get('path');
$path = preg_replace('#^/#', '', $path);
$path = preg_replace('#/$#', '', $path);
$sql = $site->db->prepare('select objekt_id from obj_folder where relative_path = ?', '/' . $path);
$result = new SQL($sql);
$folder_id = $result->fetchsingle();
if ($folder_id) {
$alamlistSQL = new AlamlistSQL(array('parent' => $folder_id, 'klass' => 'file', 'order' => ' filename ', 'where' => $where));
$alamlistSQL->add_select(" obj_file.filename, obj_file.size, obj_file.kirjeldus ");
$alamlistSQL->add_from("LEFT JOIN obj_file ON objekt.objekt_id=obj_file.objekt_id");
$alamlist = new Alamlist(array('alamlistSQL' => $alamlistSQL));
$files = array();
$new_button = $alamlist->get_edit_buttons(array('tyyp_idlist' => '21', 'publish' => 1));
while ($obj = $alamlist->next()) {
$obj->buttons = $obj->get_edit_buttons(array('tyyp_idlist' => 21, 'nupud' => array('edit', 'delete', 'new')));
$files[] = $obj;
}
}
$path = $site->absolute_path . $path;
include_once $class_path . 'picture.inc.php';
$imgs = get_images($path, $conf->get('path'));
} else {
//veateade et path pole paika pandud or something ...
}
$start_from = 0;
if ($limit) {
$end_at = $limit;
} else {
$end_at = sizeof($imgs);
}
if ($start) {
$total_pages = ceil(sizeof($imgs) / $limit);
$start_from = $start;
$end_at = $start_from + $limit;
}
if ($end_at > sizeof($imgs)) {
$end_at = sizeof($imgs);
}
$j = 0;
$images = array();
for ($i = $start_from; $i < $end_at; $i++) {
$images[$j]->thumb_path = $site->CONF['wwwroot'] . '/' . $imgs[$i]['thumb'];
# relative path
$images[$j]->thumb_height = $imgs[$i]['thumb_height'];
# in pixels
$images[$j]->thumb_width = $imgs[$i]['thumb_width'];
$images[$j]->image_path = $site->CONF['wwwroot'] . '/' . $imgs[$i]['image'];
$images[$j]->image_height = $imgs[$i]['image_height'];
$images[$j]->image_width = $imgs[$i]['image_width'];
$images[$j]->actual_image_path = $site->CONF['wwwroot'] . '/' . $imgs[$i]['actual_image'];
$images[$j]->actual_image_height = $imgs[$i]['actual_image_height'];
$images[$j]->actual_image_width = $imgs[$i]['actual_image_width'];
$images[$j]->actual_image_size =& $images[$j]->size;
# original
$images[$j]->filename = $imgs[$i]['filename'];
$key = search_obj_array($imgs[$i]['filename'], 'filename', $files);
if ($key !== false) {
$images[$j]->id = $files[$key]->all['objekt_id'];
$images[$j]->title = $files[$key]->pealkiri;
$images[$j]->description = $files[$key]->all['kirjeldus'];
$images[$j]->size = $files[$key]->all['size'];
# final display
$images[$j]->buttons = $files[$key]->buttons;
}
$j++;
}
//printr($images);
$smarty->assign(array($name => $images, $name . '_newbutton' => $new_button, $name . '_title' => $album->pealkiri, $name . '_first_image' => $images[0]->image_path, $name . '_last_image' => $images[sizeof($images) - 1]->image_path, $name . '_count' => sizeof($images), $name . '_counttotal' => sizeof($imgs)));
}
示例8: get_header
<?php
get_header();
?>
<?php
the_post();
$image = get_images($post->ID, 'full');
?>
<div class="section bright bald slim project">
<div class="grid_container centered">
<div class="grid_3_3">
<div class="image"><?php
echo $image;
?>
</div>
</div>
<div class="grid_3_3 text">
<h2><?php
echo $post->post_title;
?>
</h2>
<?php
echo $post->post_content;
?>
</div>
</div>
<div class="clear zero">
</div>
</div>
示例9: get_images_linked_html_bysize
function get_images_linked_html_bysize($link = '', $target = '', $template = '', $raw = true, $code = 'html', $before = '', $after = '', $size = '')
{
$images = get_images();
if ($template == 'default') {
$template = '';
}
global $image;
foreach ($images as $image) {
$array_value = '<a href="' . get_image_link($link) . '"' . set_image_link_target($target) . '>';
switch ($size) {
default:
case 'full':
$array_value .= get_image_raw_html($template, $before, $after);
break;
case 'thumb':
$array_value .= get_image_thumb_raw_html($template, $before, $after);
break;
}
$array_value .= '</a>';
if ($code == 'bbcode') {
$array[] = convert_html_to_bbcode($array_value);
} else {
$array[] = $raw ? $array_value : htmlentities($array_value);
}
}
return $array;
}
示例10: usort
<div class="section project <?php
echo $section_class;
?>
">
<div class="grid_container centered">
<div class="grid_3_3">
<h2><?php
echo $key;
?>
</h2>
</div>
<?php
usort($value, 'cmp_date');
$counter = 0;
foreach ($value as $item) {
$image = get_images($item['post']->ID, 'crop');
$href = get_permalink($item['post']->ID);
$counter++;
?>
<a class="block" href="<?php
echo $href;
?>
">
<div class="grid_1_3 left">
<div class="image"><?php
echo $image;
?>
</div>
<div class="text">
<h3 class="bold">
<?php
示例11: scan_for_images
function scan_for_images($albumpath)
{
debuglog("Album Path Is " . $albumpath, "LOCAL IMAGE SCAN");
$result = array();
if (is_dir("prefs/MusicFolders") && $albumpath != ".") {
$albumpath = munge_filepath($albumpath);
$result = array_merge($result, get_images($albumpath));
// Is the album dir part of a multi-disc set?
if (preg_match('/^CD\\s*\\d+$|^disc\\s*\\d+$/i', basename($albumpath))) {
$albumpath = dirname($albumpath);
$result = array_merge($result, get_images($albumpath));
}
// Are there any subdirectories?
$globpath = preg_replace('/(\\*|\\?|\\[)/', '[$1]', $albumpath);
$lookfor = glob($globpath . "/*", GLOB_ONLYDIR);
foreach ($lookfor as $i => $f) {
if (is_dir($f)) {
$result = array_merge($result, get_images($f));
}
}
}
return $result;
}
示例12: set_default_images
function set_default_images()
{
return get_images("http://img.amy.gy/obtainium");
}
示例13: basename
$filename = basename(__FILE__);
$module['ADR-Zones']['NPC'] = $filename;
return;
}
$phpbb_root_path = "./../";
require $phpbb_root_path . 'extension.inc';
require './pagestart.' . $phpEx;
include_once $phpbb_root_path . 'adr/includes/adr_global.' . $phpEx;
if (isset($HTTP_POST_VARS['mode']) || isset($HTTP_GET_VARS['mode'])) {
$mode = isset($HTTP_POST_VARS['mode']) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode'];
$mode = htmlspecialchars($mode);
} else {
$mode = "";
}
// WYSIWYG IMAGE VIEWER
$xxx_images = get_images("adr/images/zones/npc");
$filename_list = get_filenames($xxx_images);
if (isset($HTTP_POST_VARS['add']) || isset($HTTP_GET_VARS['add'])) {
adr_template_file('admin/config_adr_npc_edit_body.tpl');
$template->assign_block_vars('npc_add', array());
$s_hidden_fields = '<input type="hidden" name="mode" value="savenew" />';
//
//BEGIN lists
//
//destinations lists
$zone_list = '<select name="npc_zone[]" size="4" multiple>';
$zone_list .= '<option value="0" SELECTED class="post">' . $lang['Adr_zone_acp_zones_all'] . '</option>';
$sql = "SELECT * FROM " . ADR_ZONES_TABLE . "\r\n\t\t\tORDER BY zone_id ASC";
if (!($result = $db->sql_query($sql))) {
message_die(GENERAL_ERROR, 'Could not query area list', '', __LINE__, __FILE__, $sql);
}
示例14: smarty_function_init_albums
function smarty_function_init_albums($params, &$smarty)
{
global $site, $leht, $template, $class_path;
$content_template =& $leht->content_template;
$albumlist = array();
##############
# default values
extract($params);
if (!isset($name)) {
$name = 'albumlist';
}
if (!isset($thumbnail_type)) {
$thumbnail_type = 'first';
}
if (!isset($parent)) {
$parent = $leht->id;
}
switch ($on_create) {
case "publish":
$publish = 1;
break;
case "hide":
$publish = 0;
break;
default:
$publish = 0;
}
# for language compatibility, replace with search string existing db field name
$order = preg_replace('#\\btitle\\b#i', "pealkiri", $order);
$order = preg_replace('#\\bdate\\b#i', "aeg", $order);
$parent_id = trim($parent);
if ($parent_id) {
$alamlist = new Alamlist(array(parent => $parent_id, klass => "album", start => $start, limit => $limit, asukoht => $position, order => $order, where => $where));
# if parameter "limit" is provided then "counttotal" element is needed (shows total rows)
if (isset($limit)) {
$alamlist_count = new Alamlist(array(parent => $parent_id, klass => "album", asukoht => $position, on_counter => 1));
}
##############
# load variables
$new_button = $alamlist->get_edit_buttons(array(tyyp_idlist => "16", publish => $publish));
while ($obj = $alamlist->next()) {
$obj->buttons = $obj->get_edit_buttons(array(tyyp_idlist => "16", publish => $publish));
$obj->id =& $obj->objekt_id;
$obj->get_object_href();
//$obj->href = $site->self.'?id='.$obj->objekt_id;
$obj->class = translate_en($obj->all[klass]);
# translate it to english
$obj->is_selected = $leht->parents->on_parent($obj->objekt_id);
$obj->title = $obj->pealkiri;
$obj->date = $site->db->MySQL_ee_short($obj->all['aeg']);
$obj->datetime = $site->db->MySQL_ee($obj->all['aeg']);
$obj->fdate = substr($obj->all['aeg'], 0, strpos($obj->all['aeg'], ' '));
$obj->fdatetime = $obj->all['aeg'];
$obj->last_modified = date('Y', $obj->all['last_modified']) > 1970 ? date('d.m.Y H:i', $obj->all['last_modified']) : '';
## crap data
$obj->flast_modified = $obj->all['last_modified'];
$obj->details_link = $site->self . '?id=' . $obj->objekt_id;
$obj->details_title = $site->sys_sona(array(sona => "loe edasi", tyyp => "kujundus"));
$obj->created_user_id = $obj->all['created_user_id'];
$obj->created_user_name = $obj->all['created_user_name'];
$obj->changed_user_id = $obj->all['changed_user_id'];
$obj->changed_user_name = $obj->all['changed_user_name'];
$obj->created_time = $site->db->MySQL_ee($obj->all['created_time']);
$obj->fcreated_time = $obj->all['created_time'];
$obj->changed_time = $site->db->MySQL_ee($obj->all['changed_time']);
$obj->fchanged_time = $obj->all['changed_time'];
$obj->last_commented_time = $site->db->MySQL_ee($obj->all['last_commented_time']);
$obj->comment_count = $obj->all['comment_count'];
### custom conf parameters
$conf = new CONFIG($obj->all['ttyyp_params']);
$obj->description = $conf->get('desc');
if ($conf->get('path')) {
include_once $class_path . 'picture.inc.php';
# full relative path to the first/random thumbnail
$obj->thumbnail = $site->CONF['wwwroot'] . '/' . get_images($site->absolute_path . $conf->get('path'), $conf->get('path'), $thumbnail_type);
}
#printr($obj->all['ttyyp_params']);
$obj->thumbnail_size = $conf->get('tn_size');
# in pixels
$obj->image_size = $conf->get('pic_size');
# in pixels
$obj->folder_id = $conf->get('folder_id');
# source folder ID
$obj->folder_path = $conf->get('path');
# source folder path, eg "public/images"
### / custom conf parameters
array_push($albumlist, $obj);
}
}
##############
# assign to template variables
$count = $alamlist->rows;
$counttotal = isset($limit) ? $alamlist_count->rows : $count;
$smarty->assign(array($name => $albumlist, $name . '_newbutton' => $new_button, $name . '_counttotal' => $counttotal, $name . '_rows' => $counttotal, $name . '_count' => $count));
}
示例15: error_reporting
error_reporting(E_ALL);
ini_set('display_errors', 'On');
// for production
// error_reporting(E_ALL);
// ini_set('display_errors', 0);
// ini_set("log_errors", 1);
// ini_set("error_log", "/path/to/error_log.log");
require_once '../globals.php';
function get_images($dbh)
{
$query = "SELECT post_id,source_url FROM posts WHERE disq = 0 AND downloaded = 0";
$stmt = $dbh->prepare($query);
$stmt->execute();
$result = $stmt->fetchAll(PDO::FETCH_OBJ);
if (!empty($result)) {
foreach ($result as $row) {
$link = $row->source_url;
$post_id = $row->post_id;
// get image and save to dir
file_put_contents('/path/to/where/images/will/live/' . $post_id . '.jpg', file_get_contents($link));
$query2 = "UPDATE posts SET downloaded = 1 WHERE post_id = '" . $post_id . "'";
$stmt2 = $dbh->prepare($query2);
$stmt2->execute();
echo $post_id . " - image downloaded \n";
}
} else {
echo "No images to import. \n";
}
}
get_images($DBH);