本文整理汇总了PHP中show_image函数的典型用法代码示例。如果您正苦于以下问题:PHP show_image函数的具体用法?PHP show_image怎么用?PHP show_image使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了show_image函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_show_image_html
/**
* Get the markup to show an image thumbnail
*
* This function is a wrapper for show_image() that returns what show_image() would
* normally simply output.
*
* @param mixed $image An image object, image ID, or array of image values
* @param boolean $die_without_thumbnail Echo nothing if no thumb available? (default behavior
* is to make link to full-sized image if no thumb available)
* @param boolean $show_popup_link Wrap image in link that pops up image popup?
* @param boolean $show_description Place the image description (i.e. short caption) below the image?
* @param string $other_text Text to use instead of image description
* @param boolean $textonly True sets function into textonly mode, which instead of outputting
* image markup outputs a text description linking to image
* @param boolean $show_author Output the value of the author field below the description?
* @param string $link_with_url Wrap the image in a link to this URL instead of to image popup
* @return string XHTML markup
*/
function get_show_image_html($image, $die_without_thumbnail = false, $show_popup_link = true, $show_description = true, $other_text = '', $textonly = false, $show_author = false, $link_with_url = '')
{
ob_start();
show_image($image, $die_without_thumbnail, $show_popup_link, $show_description, $other_text, $textonly, $show_author, $link_with_url);
$result = ob_get_contents();
ob_end_clean();
return $result;
}
示例2: get_teaser_image_markup
function get_teaser_image_markup()
{
$markup_string = '';
$image = $this->passed_vars['teaser_image'];
if (!empty($image)) {
$markup_string .= '<div class="teaserImage">';
ob_start();
show_image(reset($image), false, false, false, '', '', true, '');
$markup_string .= ob_get_contents();
ob_end_clean();
$markup_string .= '</div>';
}
return $markup_string;
}
示例3: list_reviews
/**
* List the reviews
*
* @access public
* @return string
*/
public function list_reviews()
{
$this->load->helper('date');
$this->load->helper('html_output');
$start = $this->input->get_post('start') ? $this->input->get_post('start') : 0;
$limit = $this->input->get_post('limit') ? $this->input->get_post('limit') : MAX_DISPLAY_SEARCH_RESULTS;
$reviews = $this->reviews_model->get_reviews($start, $limit);
$records = array();
if ($reviews !== NULL) {
foreach ($reviews as $review) {
$records[] = array('reviews_id' => $review['reviews_id'], 'date_added' => mdate('%Y/%m/%d', human_to_unix($review['date_added'])), 'reviews_rating' => image('images/stars_' . $review['reviews_rating'] . '.png', sprintf(lang('rating_from_5_stars'), $review['reviews_rating'])), 'products_name' => $review['products_name'], 'reviews_status' => $review['reviews_status'], 'code' => show_image($review['languages_code']));
}
}
$this->output->set_output(json_encode(array(EXT_JSON_READER_TOTAL => $this->reviews_model->get_total(), EXT_JSON_READER_ROOT => $records)));
}
示例4: list_guest_books
/**
* List guest book
*
* @access public
* @return string
*/
public function list_guest_books()
{
$start = $this->input->get_post('start');
$limit = $this->input->get_post('limit');
$start = empty($start) ? 0 : $start;
$limit = empty($limit) ? MAX_DISPLAY_SEARCH_RESULTS : $limit;
$guest_books = $this->guest_book_model->get_guest_books($start, $limit);
$records = array();
if ($guest_books !== NULL) {
foreach ($guest_books as $guest_book) {
$records[] = array('guest_books_id' => $guest_book['guest_books_id'], 'title' => $guest_book['title'], 'email' => $guest_book['email'], 'guest_books_status' => $guest_book['guest_books_status'], 'languages' => show_image($guest_book['code']), 'content' => $guest_book['content'], 'date_added' => mdate('%Y/%m/%d', human_to_unix($guest_book['date_added'])));
}
}
$this->output->set_output(json_encode(array(EXT_JSON_READER_TOTAL => $this->guest_book_model->get_totals(), EXT_JSON_READER_ROOT => $records)));
}
示例5: list_languages
/**
* List languages
*
* @access public
* @return string
*/
public function list_languages()
{
$start = $this->input->get_post('start') ? $this->input->get_post('start') : 0;
$limit = $this->input->get_post('limit') ? $this->input->get_post('limit') : MAX_DISPLAY_SEARCH_RESULTS;
$languages = $this->lang_model->get_languages($start, $limit);
$records = array();
if ($languages !== NULL) {
foreach ($languages as $language) {
$total_definitions = $this->lang_model->get_total_definitions($language['languages_id']);
$languages_name = $language['name'];
//verify that the language is the default language
if ($language['code'] == DEFAULT_LANGUAGE) {
$languages_name .= ' (' . lang('default_entry') . ')';
}
$records[] = array('languages_id' => $language['languages_id'], 'code' => $language['code'], 'total_definitions' => $total_definitions, 'languages_name' => $languages_name, 'languages_flag' => show_image($language['code']));
}
}
$this->output->set_output(json_encode(array(EXT_JSON_READER_TOTAL => $this->lang_model->get_total(), EXT_JSON_READER_ROOT => $records)));
}
示例6: get_images_section
function get_images_section()
{
$str = '';
$str .= '<ul>';
foreach ($this->passed_vars['item_images'] as $image) {
$str .= '<li class="imageChunk">';
$rsi = new reasonSizedImage();
$rsi->set_id($image->id());
$rsi->set_width(400);
// Uncomment if you want to force a height or crop
//$rsi->set_height(300);
//$rsi->set_crop_style('fill');
ob_start();
show_image($rsi, false, true, true, '');
$str .= ob_get_contents();
ob_end_clean();
$str .= '</li>';
}
$str .= '</ul>';
return $str;
}
示例7: get_teaser_image_markup
function get_teaser_image_markup()
{
$markup_string = '';
$image = $this->passed_vars['teaser_image'];
if (!empty($image)) {
$markup_string .= '<div class="teaserImage">';
if (is_array($image)) {
$image = reset($image);
}
$rsi = new reasonSizedImage();
$rsi->set_id($image->id());
$rsi->set_width(600);
$rsi->set_height(600);
$rsi->set_crop_style('fill');
ob_start();
show_image($rsi, true, false, false, '');
$markup_string .= ob_get_contents();
ob_end_clean();
$markup_string .= '</div>';
}
return $markup_string;
}
示例8: print_spacer
}
print_spacer(20);
print_box(format_text($strtable), 'generalbox', 'intro');
print_spacer(20);
// Print the main part of the page ----------------------------------
print_spacer(20);
print_heading(format_string(get_string('correction', 'blended')));
print_box(format_text(get_string('imagepagedesc', 'blended')), 'generalbox', 'intro');
print_spacer(20);
//print $imagepath;
$imgout = get_field('blended_images', 'imgout', 'jobid', $jobid, 'activitycode', $acode, 'pageindex', $pageindex);
//print "<BR>IMGOUT".$imgout;
$imagepath = get_image_src($imgout);
//echo "<BR>IMGPATHNEW";
//print $imagepath;
show_image($imagepath, $course);
if ($navigationpage == "showdetails.php") {
$volver = "{$CFG->wwwroot}/mod/blended/showdetails.php?id={$course->id}&acode={$acode}&jobid={$jobid}";
}
if ($navigationpage == "reviewdetails.php") {
$volver = "{$CFG->wwwroot}/mod/blended/reviewdetails.php?id={$course->id}&acode={$acode}&jobid={$jobid}";
}
print_continue($volver);
echo "<BR><BR><center>";
helpbutton($page = 'image', get_string('pagehelp', 'blended'), $module = 'blended', $image = true, $linktext = true, $text = '', $return = false, $imagetext = '');
echo "</center>";
print_footer($course);
function show_image($imagepath, $course)
{
//print $imagepath;
$src = create_image_url($imagepath, $course);
示例9: set_download_token
$msg .= $msg != "" ? "<p>" . $lang['lightbox_no_images'] : $lang['lightbox_no_images'];
} else {
set_download_token($user_info['lightbox_image_ids']);
$thumbnails = "<table width=\"" . $config['image_table_width'] . "\" border=\"0\" cellpadding=\"" . $config['image_table_cellpadding'] . "\" cellspacing=\"" . $config['image_table_cellspacing'] . "\">\n";
$count = 0;
$bgcounter = 0;
while ($image_row = $site_db->fetch_array($result)) {
if (!$download_allowed && check_permission("auth_download", $image_row['cat_id'])) {
$download_allowed = true;
}
if ($count == 0) {
$row_bg_number = $bgcounter++ % 2 == 0 ? 1 : 2;
$thumbnails .= "<tr class=\"imagerow" . $row_bg_number . "\">\n";
}
$thumbnails .= "<td width=\"" . $imgtable_width . "\" valign=\"top\">\n";
show_image($image_row, "lightbox");
$thumbnails .= $site_template->parse_template("thumbnail_bit");
$thumbnails .= "\n</td>\n";
$count++;
if ($count == $config['image_cells']) {
$thumbnails .= "</tr>\n";
$count = 0;
}
}
// end while
if ($count > 0) {
$leftover = $config['image_cells'] - $count;
if ($leftover >= 1) {
for ($i = 0; $i < $leftover; $i++) {
$thumbnails .= "<td width=\"" . $imgtable_width . "\">\n \n</td>\n";
}
示例10: show_forum
function show_forum($forum, $start, $sort_style, $user)
{
$page_nav = page_links("forum_forum.php?id={$forum->id}&sort={$sort_style}", $forum->threads, THREADS_PER_PAGE, $start);
echo $page_nav;
start_forum_table(array("", tra("Threads"), tra("Posts"), tra("Author"), tra("Views"), "<nobr>" . tra("Last post") . "</nobr>"));
$sticky_first = !$user || !$user->prefs->ignore_sticky_posts;
// Show hidden threads if logged in user is a moderator
//
$show_hidden = is_moderator($user, $forum);
$threads = get_forum_threads($forum->id, $start, THREADS_PER_PAGE, $sort_style, $show_hidden, $sticky_first);
if ($user) {
$subs = BoincSubscription::enum("userid={$user->id}");
}
// Run through the list of threads, displaying each of them
//
$n = 0;
$i = 0;
foreach ($threads as $thread) {
$owner = BoincUser::lookup_id($thread->owner);
if (!$owner) {
continue;
}
$unread = thread_is_unread($user, $thread);
//if ($thread->status==1){
// This is an answered helpdesk thread
if ($user && is_subscribed($thread, $subs)) {
echo '<tr class="row_hd' . $n . '">';
} else {
// Just a standard thread.
echo '<tr class="row' . $n . '">';
}
echo "<td width=\"1%\" class=\"threadicon\"><nobr>";
if ($thread->hidden) {
show_image(IMAGE_HIDDEN, tra("This thread is hidden"), tra("hidden"));
} else {
if ($unread) {
if ($thread->sticky) {
if ($thread->locked) {
show_image(NEW_IMAGE_STICKY_LOCKED, tra("This thread is sticky and locked, and you haven't read it yet"), tra("sticky/locked/unread"));
} else {
show_image(NEW_IMAGE_STICKY, tra("This thread is sticky and you haven't read it yet"), tra("sticky/unread"));
}
} else {
if ($thread->locked) {
show_image(NEW_IMAGE_LOCKED, tra("You haven't read this thread yet, and it's locked"), tra("unread/locked"));
} else {
show_image(NEW_IMAGE, tra("You haven't read this thread yet"), tra("unread"));
}
}
} else {
if ($thread->sticky) {
if ($thread->locked) {
show_image(IMAGE_STICKY_LOCKED, tra("This thread is sticky and locked"), tra("sticky/locked"));
} else {
show_image(IMAGE_STICKY, tra("This thread is sticky"), tra("sticky"));
}
} else {
if ($thread->locked) {
show_image(IMAGE_LOCKED, tra("This thread is locked"), tra("locked"));
} else {
show_image(IMAGE_POST, tra("You read this thread"), tra("read"));
}
}
}
}
echo "</nobr></td>";
$title = cleanup_title($thread->title);
//$titlelength = 9999;
//if (strlen($title) > $titlelength) {
// $title = substr($title, 0, $titlelength)."...";
//}
echo "<td class=\"threadline\"><a href=\"forum_thread.php?id={$thread->id}\"><b>{$title}</b></a><br></td>";
$n = ($n + 1) % 2;
echo '
<td class="numbers">' . ($thread->replies + 1) . '</td>
<td>' . user_links($owner, BADGE_HEIGHT_SMALL) . '</td>
<td class="numbers">' . $thread->views . '</td>
<td class="lastpost">' . time_diff_str($thread->timestamp, time()) . '</td>
</tr>
';
flush();
}
end_table();
echo "<br>{$page_nav}";
// show page links
}
示例11: run
function run()
{
$col = 0;
if (empty($this->images) && !empty($this->request['search_image'])) {
echo 'No images found.';
$this->show_search_function();
} elseif (!empty($this->textonly)) {
echo '<h3>Images</h3>' . "\n";
foreach ($this->images as $id => $image) {
echo '<div class="imageChunk">';
show_image($image, false, true, true, false, true);
echo "</div>";
}
$this->show_search_function();
$this->show_paging();
} else {
echo '<table>';
foreach ($this->images as $id => $image) {
if ($col == 0) {
echo "<tr>";
}
echo "<td align='left' valign='bottom'>";
echo "<div class=\"imageChunk\">";
show_image($image, false, true, true, false, false, false);
echo "</div></td>\n";
$col = ($col + 1) % $this->columns;
if ($col == 0) {
echo "</tr>";
}
}
while ($col != 0) {
$col = ($col + 1) % $this->columns;
echo '<td> </td>';
}
echo '</tr></table>';
$this->show_search_function();
$this->show_paging();
}
}
示例12: foreach
foreach ($additional_image_fields as $key => $val) {
$additional_sql .= ", i." . $key;
}
}
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits" . $additional_sql . ", c.cat_name" . get_user_table_field(", u.", "user_name") . "\n FROM (" . IMAGES_TABLE . " i, " . CATEGORIES_TABLE . " c)\n LEFT JOIN " . USERS_TABLE . " u ON (" . get_user_table_field("u.", "user_id") . " = i.user_id)\n WHERE i.image_active = 1\n {$sql_where_query}\n AND c.cat_id = i.cat_id {$cat_id_sql}\n ORDER BY " . $config['image_order'] . " " . $config['image_sort'] . ", image_id " . $config['image_sort'] . "\n LIMIT {$offset}, {$perpage}";
$result = $site_db->query($sql);
$thumbnails = "<table width=\"" . $config['image_table_width'] . "\" border=\"0\" cellpadding=\"" . $config['image_table_cellpadding'] . "\" cellspacing=\"" . $config['image_table_cellspacing'] . "\">\n";
$count = 0;
$bgcounter = 0;
while ($image_row = $site_db->fetch_array($result)) {
if ($count == 0) {
$row_bg_number = $bgcounter++ % 2 == 0 ? 1 : 2;
$thumbnails .= "<tr class=\"imagerow" . $row_bg_number . "\">\n";
}
$thumbnails .= "<td width=\"" . $imgtable_width . "\" valign=\"top\">\n";
show_image($image_row, "search");
$thumbnails .= $site_template->parse_template("thumbnail_bit");
$thumbnails .= "\n</td>\n";
$count++;
if ($count == $config['image_cells']) {
$thumbnails .= "</tr>\n";
$count = 0;
}
}
// end while
if ($count > 0) {
$leftover = $config['image_cells'] - $count;
if ($leftover >= 1) {
for ($i = 0; $i < $leftover; $i++) {
$thumbnails .= "<td width=\"" . $imgtable_width . "\">\n \n</td>\n";
}
示例13: get_user_table_field
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits" . $additional_sql . ", c.cat_name" . get_user_table_field(", u.", "user_name") . get_user_table_field(", u.", "user_email") . "\n FROM (" . IMAGES_TABLE . " i, " . CATEGORIES_TABLE . " c)\n LEFT JOIN " . USERS_TABLE . " u ON (" . get_user_table_field("u.", "user_id") . " = i.user_id)\n WHERE i.image_id = {$image_id} AND i.image_active = 1 AND c.cat_id = i.cat_id";
$image_row = $site_db->query_firstrow($sql);
$cat_id = isset($image_row['cat_id']) ? $image_row['cat_id'] : 0;
$is_image_owner = $image_row['user_id'] > USER_AWAITING && $user_info['user_id'] == $image_row['user_id'] ? 1 : 0;
if (!check_permission("auth_viewcat", $cat_id) || !check_permission("auth_viewimage", $cat_id) || !$image_row) {
redirect($url);
}
$random_cat_image = defined("SHOW_RANDOM_IMAGE") && SHOW_RANDOM_IMAGE == 0 ? "" : get_random_image($cat_id);
$site_template->register_vars("random_cat_image", $random_cat_image);
unset($random_cat_image);
//-----------------------------------------------------
//--- Show Image --------------------------------------
//-----------------------------------------------------
$image_allow_comments = check_permission("auth_readcomment", $cat_id) ? $image_row['image_allow_comments'] : 0;
$image_name = format_text($image_row['image_name'], 2);
show_image($image_row, $mode, 0, 1);
//--- SEO variables -------------------------------
$meta_keywords = !empty($image_row['image_keywords']) ? strip_tags(implode(", ", explode(",", $image_row['image_keywords']))) : "";
$meta_description = !empty($image_row['image_description']) ? strip_tags($image_row['image_description']) . ". " : "";
$site_template->register_vars(array("detail_meta_description" => $meta_description, "detail_meta_keywords" => $meta_keywords, "prepend_head_title" => $image_name . " - "));
$in_mode = 0;
$sql = "";
if ($mode == "lightbox") {
if (!empty($user_info['lightbox_image_ids'])) {
$image_id_sql = str_replace(" ", ", ", trim($user_info['lightbox_image_ids']));
$sql = "SELECT image_id, cat_id, image_name, image_media_file, image_thumb_file\n FROM " . IMAGES_TABLE . "\n WHERE image_active = 1 AND image_id IN ({$image_id_sql}) AND (cat_id NOT IN (" . get_auth_cat_sql("auth_viewimage", "NOTIN") . ", " . get_auth_cat_sql("auth_viewcat", "NOTIN") . "))\n ORDER BY " . $config['image_order'] . " " . $config['image_sort'] . ", image_id " . $config['image_sort'];
$in_mode = 1;
}
} elseif ($mode == "search") {
if (!isset($session_info['searchid']) || empty($session_info['searchid'])) {
$session_info['search_id'] = $site_sess->get_session_var("search_id");
示例14: switch
$mainContentView = 'view/main_page.html';
if (isset($_GET['mode'])) {
$mode = $_GET['mode'];
switch ($mode) {
case 'main_page':
show_main_page();
break;
case 'gallery':
show_gallery();
break;
case 'img_upload':
show_img_upload();
break;
case 'login':
show_login();
break;
case 'register':
show_register();
break;
case 'image':
show_image();
break;
default:
show_error('404');
}
} else {
show_main_page();
}
//include 'view/head.html';
//include $mainContentView;
//include 'view/foot.html';
示例15: die
die(msg('error', $DLG['file_not_found'] . " <b>({$file})</b>"));
}
if (is_dir($path)) {
die(msg('alert', $DLG['not_file'] . " <b>({$file})</b>"));
}
if (!validate_path($path)) {
die(msg('error', $DLG['invalid_dir'] . " <b>({$dir}{$file})</b>"));
}
$info = swampy_pathinfo($path);
switch ($info['extension']) {
case "jpeg":
case "jpg":
case "gif":
case "png":
case "bmp":
die(show_image($dir . $file));
break;
case "txt":
case "php":
case "js":
die(show_text($path));
break;
case "html":
case "htm":
die(show_html($dir . $file));
break;
default:
die(msg('alert', $DLG['not_supported_format']));
break;
}
function show_image($src)