当前位置: 首页>>代码示例>>PHP>>正文


PHP Image::get_tag_list方法代码示例

本文整理汇总了PHP中Image::get_tag_list方法的典型用法代码示例。如果您正苦于以下问题:PHP Image::get_tag_list方法的具体用法?PHP Image::get_tag_list怎么用?PHP Image::get_tag_list使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Image的用法示例。


在下文中一共展示了Image::get_tag_list方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: display_page

 public function display_page(Image $image, $editor_parts)
 {
     global $page;
     $page->set_title("Image {$image->id}: " . html_escape($image->get_tag_list()));
     $page->set_heading(html_escape($image->get_tag_list()));
     $page->add_block(new Block(null, $this->build_info($image, $editor_parts), "main", 10));
 }
开发者ID:thelectronicnub,项目名称:shimmie2,代码行数:7,代码来源:view.theme.php

示例2: display_page

 public function display_page(Page $page, Image $image, $editor_parts)
 {
     $metatags = str_replace(" ", ", ", html_escape($image->get_tag_list()));
     $page->set_title("Image {$image->id}: " . html_escape($image->get_tag_list()));
     $page->add_header("<meta name=\"keywords\" content=\"{$metatags}\">");
     $page->set_heading(html_escape($image->get_tag_list()));
     $page->add_block(new Block("Navigation", $this->build_navigation($image), "left", 0));
     $page->add_block(new Block(null, $this->build_info($image, $editor_parts), "main", 10));
     //$page->add_block(new Block(null, $this->build_pin($image), "main", 11));
 }
开发者ID:kmcasto,项目名称:shimmie2,代码行数:10,代码来源:theme.php

示例3: display_page

 public function display_page(Image $image, $editor_parts)
 {
     global $page;
     $h_metatags = str_replace(" ", ", ", html_escape($image->get_tag_list()));
     $page->set_title("Image {$image->id}: " . html_escape($image->get_tag_list()));
     $page->add_html_header("<meta name=\"keywords\" content=\"{$h_metatags}\">");
     $page->add_html_header("<meta property=\"og:title\" content=\"{$h_metatags}\">");
     $page->add_html_header("<meta property=\"og:type\" content=\"article\">");
     $page->add_html_header("<meta property=\"og:image\" content=\"" . make_http($image->get_thumb_link()) . "\">");
     $page->add_html_header("<meta property=\"og:url\" content=\"" . make_http(make_link("post/view/{$image->id}")) . "\">");
     $page->set_heading(html_escape($image->get_tag_list()));
     $page->add_block(new Block(null, $this->build_pin($image), "subtoolbar", 0));
     $page->add_block(new Block(null, $this->build_info($image, $editor_parts), "left", 20));
 }
开发者ID:CrandellWS,项目名称:shimmie2,代码行数:14,代码来源:view.theme.php

示例4: build_thumb_html

 /**
  * Generic thumbnail code; returns HTML rather than adding
  * a block since thumbs tend to go inside blocks...
  *
  * @param Image $image
  * @return string
  */
 public function build_thumb_html(Image $image)
 {
     global $config;
     $i_id = (int) $image->id;
     $h_view_link = make_link('post/view/' . $i_id);
     $h_thumb_link = $image->get_thumb_link();
     $h_tip = html_escape($image->get_tooltip());
     $h_tags = strtolower($image->get_tag_list());
     $extArr = array_flip(array('swf', 'svg', 'mp3'));
     //List of thumbless filetypes
     if (!isset($extArr[$image->ext])) {
         $tsize = get_thumbnail_size($image->width, $image->height);
     } else {
         //Use max thumbnail size if using thumbless filetype
         $tsize = get_thumbnail_size($config->get_int('thumb_width'), $config->get_int('thumb_height'));
     }
     $custom_classes = "";
     if (class_exists("Relationships")) {
         if (property_exists($image, 'parent_id') && $image->parent_id !== NULL) {
             $custom_classes .= "shm-thumb-has_parent ";
         }
         if (property_exists($image, 'has_children') && $image->has_children == TRUE) {
             $custom_classes .= "shm-thumb-has_child ";
         }
     }
     return "<a href='{$h_view_link}' class='thumb shm-thumb shm-thumb-link {$custom_classes}' data-tags='{$h_tags}' data-post-id='{$i_id}'>" . "<img id='thumb_{$i_id}' title='{$h_tip}' alt='{$h_tip}' height='{$tsize[1]}' width='{$tsize[0]}' src='{$h_thumb_link}'>" . "</a>\n";
 }
开发者ID:thelectronicnub,项目名称:shimmie2,代码行数:34,代码来源:basethemelet.class.php

示例5: build_thumb_html

 public function build_thumb_html(Image $image, $query = null)
 {
     global $config;
     //Aargh I don't want to copy/past
     $tags = $image->get_tag_list();
     $tags = str_replace("/", "", $tags);
     $tags = str_replace(" ", "-", $tags);
     $tags = preg_replace("/^\\.+/", "", $tags);
     $h_view_link = make_link("post/view/{$image->id}/{$tags}", $query);
     $h_thumb_link = $image->get_thumb_link();
     // Removes the size tag if the file is an mp3
     if ($image->ext == 'mp3') {
         $iitip = $image->get_tooltip();
         $mp3tip = array("0x0");
         $h_tip = str_replace($mp3tip, " ", $iitip);
         // Makes it work with a variation of the default tooltips (I.E $tags // $filesize // $size)
         $justincase = array("   //", "//   ", "  //", "//  ", "  ");
         if (strstr($h_tip, "  ")) {
             $h_tip = html_escape(str_replace($justincase, "", $h_tip));
         } else {
             $h_tip = html_escape($h_tip);
         }
     } else {
         $h_tip = html_escape($image->get_tooltip());
     }
     // If file is flash or svg then sets thumbnail to max size.
     if ($image->ext == 'swf' || $image->ext == 'svg') {
         $tsize = get_thumbnail_size($config->get_int('thumb_width'), $config->get_int('thumb_height'));
     } else {
         $tsize = get_thumbnail_size($image->width, $image->height);
     }
     return "<a href='{$h_view_link}'><img title='{$h_tip}' alt='{$h_tip}' " . "width='{$tsize[0]}' height='{$tsize[1]}' src='{$h_thumb_link}' /></a>";
 }
开发者ID:nsuan,项目名称:shimmie2,代码行数:33,代码来源:themelet.class.php

示例6: get_tag_editor_html

 public function get_tag_editor_html(Image $image)
 {
     global $user;
     $tag_links = array();
     foreach ($image->get_tag_array() as $tag) {
         $h_tag = html_escape($tag);
         $u_tag = url_escape($tag);
         $h_link = make_link("post/list/{$u_tag}/1");
         $tag_links[] = "<a href='{$h_link}'>{$h_tag}</a>";
     }
     $h_tag_links = implode(" ", $tag_links);
     $h_tags = html_escape($image->get_tag_list());
     return "\n\t\t\t<tr>\n\t\t\t\t<th width='50px'>Tags</th>\n\t\t\t\t<td>\n\t\t" . ($user->can("edit_image_tag") ? "\n\t\t\t\t\t<span class='view'>{$h_tag_links}</span>\n\t\t\t\t\t<input class='edit autocomplete_tags' type='text' name='tag_edit__tags' value='{$h_tags}' id='tag_editor' autocomplete='off'>\n\t\t" : "\n\t\t\t\t\t{$h_tag_links}\n\t\t") . "\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t";
 }
开发者ID:thelectronicnub,项目名称:shimmie2,代码行数:14,代码来源:theme.php

示例7: thumb

 /**
  * @param Image $image
  * @return string
  */
 private function thumb(Image $image)
 {
     global $database;
     $cached = $database->cache->get("rss-thumb:{$image->id}");
     if ($cached) {
         return $cached;
     }
     $link = make_http(make_link("post/view/{$image->id}"));
     $tags = html_escape($image->get_tag_list());
     $owner = $image->get_owner();
     $thumb_url = $image->get_thumb_link();
     $image_url = $image->get_image_link();
     $posted = date(DATE_RSS, $image->posted_timestamp);
     $content = html_escape("<p>" . $this->theme->build_thumb_html($image) . "</p>" . "<p>Uploaded by " . html_escape($owner->name) . "</p>");
     $data = "\n\t\t<item>\n\t\t\t<title>{$image->id} - {$tags}</title>\n\t\t\t<link>{$link}</link>\n\t\t\t<guid isPermaLink=\"true\">{$link}</guid>\n\t\t\t<pubDate>{$posted}</pubDate>\n\t\t\t<description>{$content}</description>\n\t\t\t<media:thumbnail url=\"{$thumb_url}\"/>\n\t\t\t<media:content url=\"{$image_url}\"/>\n\t\t</item>\n\t\t";
     $database->cache->set("rss-thumb:{$image->id}", $data, 3600);
     return $data;
 }
开发者ID:JarJak,项目名称:shimmie2,代码行数:22,代码来源:main.php

示例8: intval

 /**
  * Constructor
  * @param Image $img
  */
 function __construct(Image $img)
 {
     global $config;
     // author
     $author = $img->get_owner();
     $this->author = $author->name;
     $this->creator_id = intval($author->id);
     // file
     $this->height = intval($img->height);
     $this->width = intval($img->width);
     $this->file_ext = $img->ext;
     $this->file_size = intval($img->filesize);
     $this->file_url = make_http($img->get_image_link());
     $this->md5 = $img->hash;
     // meta
     $this->change = intval($img->id);
     //DaFug is this even supposed to do? ChangeID?
     // Should be JSON specific, just strip this when converting to XML
     $this->created_at = array('n' => 123456789, 's' => strtotime($img->posted), 'json_class' => 'Time');
     $this->id = intval($img->id);
     $this->parent_id = null;
     if (defined('ENABLED_EXTS')) {
         if (strstr(ENABLED_EXTS, 'rating') !== false) {
             // 'u' is not a "valid" rating
             if ($img->rating == 's' || $img->rating == 'q' || $img->rating == 'e') {
                 $this->rating = $img->rating;
             }
         }
         if (strstr(ENABLED_EXTS, 'numeric_score') !== false) {
             $this->score = $img->numeric_score;
         }
     }
     $this->source = $img->source;
     $this->status = 'active';
     //not supported in Shimmie... yet
     $this->tags = $img->get_tag_list();
     $this->has_children = false;
     $this->has_comments = false;
     $this->has_notes = false;
     // thumb
     $this->preview_height = $config->get_int('thumb_height');
     $this->preview_width = $config->get_int('thumb_width');
     $this->preview_url = make_http($img->get_thumb_link());
     // sample (use the full image here)
     $this->sample_height = intval($img->height);
     $this->sample_width = intval($img->width);
     $this->sample_url = make_http($img->get_image_link());
 }
开发者ID:thelectronicnub,项目名称:shimmie2,代码行数:52,代码来源:main.php

示例9: get_tag_editor_html

 public function get_tag_editor_html(Image $image)
 {
     $script = "\n\t\t\t<script type='text/javascript'>\n\t\t\t\$().ready(function() {\n\t\t\t\t\$('#tag_editor').autocomplete('" . make_link("api/internal/tag_list/complete") . "', {\n\t\t\t\t\twidth: 320,\n\t\t\t\t\tmax: 15,\n\t\t\t\t\thighlight: false,\n\t\t\t\t\tmultiple: true,\n\t\t\t\t\tmultipleSeparator: ' ',\n\t\t\t\t\tscroll: true,\n\t\t\t\t\tscrollHeight: 300,\n\t\t\t\t\tselectFirst: false\n\t\t\t\t});\n\t\t\t});\n\t\t\t</script>\n\t\t";
     $h_tags = html_escape($image->get_tag_list());
     return "\n\t\t\t<tr>\n\t\t\t\t<td width='50px'>Tags</td>\n\t\t\t\t<td width='300px'><input type='text' name='tag_edit__tags' value='{$h_tags}' id='tag_editor'></td>\n\t\t\t</tr>\n\t\t\t{$script}\n\t\t";
 }
开发者ID:nsuan,项目名称:shimmie2,代码行数:6,代码来源:theme.php

示例10: get_tag_editor_html

 public function get_tag_editor_html(Image $image)
 {
     $h_tags = html_escape($image->get_tag_list());
     return "<tr><td width='50px'>Tags</td><td width='300px'><input type='text' name='tag_edit__tags' value='{$h_tags}'></td></tr>";
 }
开发者ID:kmcasto,项目名称:shimmie2,代码行数:5,代码来源:theme.php


注:本文中的Image::get_tag_list方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。