當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Settings::isCommentImagePreviewEnabled方法代碼示例

本文整理匯總了PHP中thebuggenie\core\framework\Settings::isCommentImagePreviewEnabled方法的典型用法代碼示例。如果您正苦於以下問題:PHP Settings::isCommentImagePreviewEnabled方法的具體用法?PHP Settings::isCommentImagePreviewEnabled怎麽用?PHP Settings::isCommentImagePreviewEnabled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在thebuggenie\core\framework\Settings的用法示例。


在下文中一共展示了Settings::isCommentImagePreviewEnabled方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _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 (!framework\Context::isCLI()) {
             $options = explode('|', $title);
             $filename = $href;
             $issuemode = (bool) (isset($this->options['issue']) && $this->options['issue'] instanceof \thebuggenie\core\entities\Issue);
             $articlemode = (bool) (isset($this->options['article']) && $this->options['article'] instanceof Article);
             $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 \thebuggenie\core\entities\File) {
                 $caption = !empty($options) ? array_pop($options) : htmlentities($file->getDescription(), ENT_COMPAT, framework\Context::getI18n()->getCharset());
                 $caption = $caption != '' ? $caption : htmlentities($file->getOriginalFilename(), ENT_COMPAT, framework\Context::getI18n()->getCharset());
                 $file_link = make_url('showfile', array('id' => $file->getID()));
             } else {
                 $caption = !empty($options) ? array_pop($options) : false;
             }
             if (($file instanceof \thebuggenie\core\entities\File && $file->isImage() || $articlemode) && (mb_strtolower($namespace) == 'image' || $issuemode) && \thebuggenie\core\framework\Settings::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);
開發者ID:underblaze,項目名稱:thebuggenie-4.1.0,代碼行數:67,代碼來源:TextParser.php

示例2: __

 disabled<?php 
}
?>
>
                <option value=0<?php 
if (!\thebuggenie\core\framework\Settings::isCommentImagePreviewEnabled()) {
    ?>
 selected<?php 
}
?>
><?php 
echo __("Don't show image previews of attached images in comments");
?>
</option>
                <option value=1<?php 
if (\thebuggenie\core\framework\Settings::isCommentImagePreviewEnabled()) {
    ?>
 selected<?php 
}
?>
><?php 
echo __('Show image previews of attached images in comments');
?>
</option>
            </select>
            <?php 
echo config_explanation(__('If you have problems with spam images, turn this off'));
?>
        </td>
    </tr>
    <tr>
開發者ID:pkdevboxy,項目名稱:thebuggenie,代碼行數:31,代碼來源:_general.inc.php


注:本文中的thebuggenie\core\framework\Settings::isCommentImagePreviewEnabled方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。