本文整理汇总了PHP中TBGSettings::isCommentImagePreviewEnabled方法的典型用法代码示例。如果您正苦于以下问题:PHP TBGSettings::isCommentImagePreviewEnabled方法的具体用法?PHP TBGSettings::isCommentImagePreviewEnabled怎么用?PHP TBGSettings::isCommentImagePreviewEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TBGSettings
的用法示例。
在下文中一共展示了TBGSettings::isCommentImagePreviewEnabled方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __
disabled<?php
}
?>
>
<option value=0<?php
if (!TBGSettings::isCommentImagePreviewEnabled()) {
?>
selected<?php
}
?>
><?php
echo __("Don't show image previews of attached images in comments");
?>
</option>
<option value=1<?php
if (TBGSettings::isCommentImagePreviewEnabled()) {
?>
selected<?php
}
?>
><?php
echo __('Show image previews of attached images in comments');
?>
</option>
</select>
</td>
</tr>
<tr>
<td class="config_explanation" colspan="2"><?php
echo __('If you have problems with spam images, turn this off');
?>
示例2: _parse_internallink
protected function _parse_internallink($matches)
{
$href = html_entity_decode($matches[4]);
if (isset($matches[6]) && $matches[6]) {
$title = $matches[6];
} else {
$title = $href;
if (isset($matches[7]) && $matches[7]) {
$title .= $matches[7];
}
}
$namespace = $matches[3];
if (strtolower($namespace) == 'category') {
if (substr($matches[2], 0, 1) != ':') {
$this->addCategorizer($href);
return '';
}
}
if (strtolower($namespace) == 'wikipedia') {
if (TBGContext::isCLI()) {
return $href;
}
$options = explode('|', $title);
$title = (array_key_exists(5, $matches) && strpos($matches[5], '|') !== false ? '' : $namespace . ':') . array_pop($options);
return link_tag('http://en.wikipedia.org/wiki/' . $href, $title);
}
if (in_array(strtolower($namespace), array('image', 'file'))) {
$retval = $namespace . ':' . $href;
if (!TBGContext::isCLI()) {
$options = explode('|', $title);
$filename = $href;
$issuemode = (bool) (isset($this->options['issue']) && $this->options['issue'] instanceof TBGIssue);
$articlemode = (bool) (isset($this->options['article']) && $this->options['article'] instanceof TBGWikiArticle);
$file = null;
$file_link = $filename;
$caption = $filename;
if ($issuemode) {
$file = $this->options['issue']->getFileByFilename($filename);
} elseif ($articlemode) {
$file = $this->options['article']->getFileByFilename($filename);
}
if ($file instanceof TBGFile) {
$caption = !empty($options) ? array_pop($options) : $file->getDescription();
$caption = $caption != '' ? $caption : $file->getOriginalFilename();
$file_link = make_url('showfile', array('id' => $file->getID()));
}
if (($file instanceof TBGFile && $file->isImage() || $articlemode) && (strtolower($namespace) == 'image' || $issuemode) && TBGSettings::isCommentImagePreviewEnabled()) {
$divclasses = array('image_container');
$style_dimensions = '';
foreach ($options as $option) {
$optionlen = strlen($option);
if (substr($option, $optionlen - 2) == 'px') {
if (is_numeric($option[0])) {
$style_dimensions = ' width: ' . $option[0] . ';';
break;
} else {
$style_dimensions = ' height: ' . substr($option[0], 1) . ';';
break;
}
}
}
if (in_array('thumb', $options)) {
$divclasses[] = 'thumb';
}
if (in_array('left', $options)) {
$divclasses[] = 'icleft';
}
if (in_array('center', $options)) {
$divclasses[] = 'iccenter';
}
if (in_array('right', $options)) {
$divclasses[] = 'icright';
}
$retval = '<div class="' . join(' ', $divclasses) . '"';
if ($issuemode) {
$retval .= ' style="float: left; clear: left;"';
}
$retval .= '>';
$retval .= image_tag($file_link, array('alt' => $caption, 'title' => $caption, 'style' => $style_dimensions, 'class' => 'image'), true);
if ($caption != '') {
$retval .= '<br>' . $caption;
}
$retval .= link_tag($file_link, image_tag('icon_open_new.png', array('style' => 'margin-left: 5px;')), array('target' => 'new_window_' . rand(0, 10000), 'title' => __('Open image in new window')));
$retval .= '</div>';
} else {
$retval = link_tag($file_link, $caption . image_tag('icon_open_new.png', array('style' => 'margin-left: 5px;')), array('target' => 'new_window_' . rand(0, 10000), 'title' => __('Open file in new window')));
}
}
return $retval;
//$file_id = TBGFilesTable::get
}
if ($namespace == 'TBG') {
if (TBGContext::isCLI()) {
return $href;
}
$options = explode('|', $title);
$title = array_pop($options);
return link_tag(make_url($href), $title);
// $this->parse_image($href,$title,$options);
}
//.........这里部分代码省略.........
示例3: _parse_internallink
//.........这里部分代码省略.........
$type = $type_matches[1][0];
}
}
}
if ($type == 'object') {
$code = object_tag($href, $width, $height);
} else {
$code = iframe_tag($href, $width, $height);
}
return $code;
}
if (in_array(mb_strtolower($namespace), array('image', 'file'))) {
$retval = $namespace . ':' . $href;
if (!TBGContext::isCLI()) {
$options = explode('|', $title);
$filename = $href;
$issuemode = (bool) (isset($this->options['issue']) && $this->options['issue'] instanceof TBGIssue);
$articlemode = (bool) (isset($this->options['article']) && $this->options['article'] instanceof TBGWikiArticle);
$file = null;
$file_link = $filename;
$caption = $filename;
if ($issuemode) {
$file = $this->options['issue']->getFileByFilename($filename);
} elseif ($articlemode) {
$file = $this->options['article']->getFileByFilename($filename);
}
if ($file instanceof TBGFile) {
$caption = !empty($options) ? array_pop($options) : htmlentities($file->getDescription(), ENT_COMPAT, TBGContext::getI18n()->getCharset());
$caption = $caption != '' ? $caption : htmlentities($file->getOriginalFilename(), ENT_COMPAT, TBGContext::getI18n()->getCharset());
$file_link = make_url('showfile', array('id' => $file->getID()));
} else {
$caption = !empty($options) ? array_pop($options) : false;
}
if (($file instanceof TBGFile && $file->isImage() || $articlemode) && (mb_strtolower($namespace) == 'image' || $issuemode) && TBGSettings::isCommentImagePreviewEnabled()) {
$divclasses = array('image_container');
$style_dimensions = '';
foreach ($options as $option) {
$optionlen = mb_strlen($option);
if (mb_substr($option, $optionlen - 2) == 'px') {
if (is_numeric($option[0])) {
$style_dimensions = ' width: ' . $option . ';';
break;
} else {
$style_dimensions = ' height: ' . mb_substr($option, 1) . ';';
break;
}
}
}
if (in_array('thumb', $options)) {
$divclasses[] = 'thumb';
}
if (in_array('left', $options)) {
$divclasses[] = 'icleft';
}
if (in_array('center', $options)) {
$divclasses[] = 'iccenter';
}
if (in_array('right', $options)) {
$divclasses[] = 'icright';
}
$retval = '<div class="' . join(' ', $divclasses) . '"';
if ($issuemode) {
$retval .= ' style="float: left; clear: left;"';
}
$retval .= '>';
$retval .= image_tag($file_link, array('alt' => $caption, 'title' => $caption, 'style' => $style_dimensions, 'class' => 'image'), true);