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


PHP _get_smiley_array函数代码示例

本文整理汇总了PHP中_get_smiley_array函数的典型用法代码示例。如果您正苦于以下问题:PHP _get_smiley_array函数的具体用法?PHP _get_smiley_array怎么用?PHP _get_smiley_array使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: index

 public function index()
 {
     $this->load->helper('smiley');
     // This is needed only for calling _get_smiley_array().
     $smileys = _get_smiley_array();
     $this->template->set('smileys', $smileys)->enable_parser_body('smileys')->build('smileys');
 }
开发者ID:acamboy,项目名称:starter-public-edition-3,代码行数:7,代码来源:Smileys_controller.php

示例2: index

 /**
  * @brief Wikitest test page.
  */
 function index()
 {
     if (!CheckPermissions('office')) {
         return;
     }
     $this->load->helper('wikitext_smiley');
     // No POST data? just set wikitext to default string
     $wikitext = $this->input->post('wikitext');
     if ($wikitext === FALSE) {
         $wikitext = '==This is the yorker wikitext parser==' . "\n";
         $wikitext .= '*This is an unordered list' . "\n";
         $wikitext .= '*#With an ordered list within' . "\n";
         $wikitext .= '*#And another item' . "\n";
         $wikitext .= "\n";
         $wikitext .= '#This is an ordered list' . "\n";
         $wikitext .= '#*With an unordered list within' . "\n";
         $wikitext .= '#*And another item' . "\n";
         $wikitext .= implode('', array_keys(_get_smiley_array())) . "\n";
     }
     $parsed_wikitext = $wikitext;
     $parsed_wikitext = wikitext_parse_smileys($parsed_wikitext);
     $parsed_wikitext = $this->wikiparser->parse($parsed_wikitext . "\n", 'wiki test');
     $data = array('parsed_wikitext' => $parsed_wikitext, 'wikitext' => $wikitext);
     // Set up the public frame
     $this->main_frame->SetTitle('Wikitext Preview');
     $this->main_frame->IncludeJs('javascript/wikitoolbar.js');
     $this->main_frame->SetContentSimple('test/wikitext', $data);
     // Load the public frame view (which will load the content view)
     $this->main_frame->Load();
 }
开发者ID:TheYorkerArchive,项目名称:codebase-2006-2012,代码行数:33,代码来源:wikitext.php

示例3: wikitext_parse_smileys

/**
 * Parse Smileys
 *
 * Takes a string as input and swaps any contained smileys for wikitext
 *
 * @access	public
 * @param	string	the text to be parsed
 * @param	string	the URL to the folder containing the smiley images
 * @return	string
 */
function wikitext_parse_smileys($str = '', $image_url = 'images/smileys/', $smileys = NULL)
{
    if ($image_url == '') {
        return $str;
    }
    if (!is_array($smileys)) {
        if (FALSE === ($smileys = _get_smiley_array())) {
            return $str;
        }
    }
    // Add a trailing slash to the file path if needed
    $image_url = preg_replace("/(.+?)\\/*\$/", "\\1/", $image_url);
    foreach ($smileys as $key => $val) {
        $str = str_replace($key, '[[image:' . $image_url . $smileys[$key][0] . '|' . $smileys[$key][3] . "]]", $str);
    }
    return $str;
}
开发者ID:TheYorkerArchive,项目名称:codebase-2006-2012,代码行数:27,代码来源:wikitext_smiley_helper.php

示例4: comment_smiles_custom

function comment_smiles_custom($arg = array())
{
    $image_url = getinfo('uploads_url') . 'smiles/';
    $CI =& get_instance();
    $CI->load->helper('smiley_helper');
    $smileys = _get_smiley_array();
    // идея Евгений - http://jenweb.info/page/hide-smileys, http://forum.max-3000.com/viewtopic.php?f=6&t=3192
    echo NR . '<div style="width: 19px; height: 19px; float: right; text-align: right; margin-top: -23px; cursor: pointer; background: url(\'' . getinfo('plugins_url') . 'comment_smiles/bg.gif\') no-repeat;" title="' . t('Показать/скрыть смайлики') . '" class="btn-smiles"></div>' . NR;
    echo '<p style="padding-bottom:5px;" class="comment_smiles">';
    //кусок кода из smiley_helper
    $used = array();
    foreach ($smileys as $key => $val) {
        // Для того, чтобы для смайлов с одинаковыми картинками (например :-) и :))
        // показывалась только одна кнопка
        if (isset($used[$smileys[$key][0]])) {
            continue;
        }
        echo "<a href=\"javascript:void(0);\" onclick=\"addSmile('" . $key . "')\"><img src=\"" . $image_url . $smileys[$key][0] . "\" width=\"" . $smileys[$key][1] . "\" height=\"" . $smileys[$key][2] . "\" title=\"" . $smileys[$key][3] . "\" alt=\"" . $smileys[$key][3] . "\" style=\"border:0;\"></a> ";
        $used[$smileys[$key][0]] = TRUE;
    }
    echo '</p><script>$("p.comment_smiles").hide();</script>';
}
开发者ID:buyvolov,项目名称:cms,代码行数:22,代码来源:index.php

示例5: parse_smileys

 function parse_smileys($str = '', $image_url = '', $smileys = NULL)
 {
     if ($image_url == '') {
         return $str;
     }
     if (!is_array($smileys)) {
         if (FALSE === ($smileys = _get_smiley_array())) {
             return $str;
         }
     }
     // Add a trailing slash to the file path if needed
     $image_url = preg_replace("/(.+?)\\/*\$/", "\\1/", $image_url);
     foreach ($smileys as $key => $val) {
         $str = str_replace($key, "<img src=\"" . $image_url . $smileys[$key][0] . "\" width=\"" . $smileys[$key][1] . "\" height=\"" . $smileys[$key][2] . "\" alt=\"" . $smileys[$key][3] . "\" style=\"border:0;\" />", $str);
     }
     return $str;
 }
开发者ID:jaimeivan,项目名称:smart-restaurant,代码行数:17,代码来源:smiley_helper.php

示例6: parse_smileys

 /**
  * Parse Smileys
  *
  * Takes a string as input and swaps any contained smileys for the actual image
  *
  * @param	string	the text to be parsed
  * @param	string	the URL to the folder containing the smiley images
  * @param	array
  * @return	string
  */
 function parse_smileys($str = '', $image_url = '', $smileys = NULL)
 {
     if ($image_url === '' or !is_array($smileys) && FALSE === ($smileys = _get_smiley_array())) {
         return $str;
     }
     // Add a trailing slash to the file path if needed
     $image_url = rtrim($image_url, '/') . '/';
     foreach ($smileys as $key => $val) {
         $str = str_replace($key, '<img src="' . $image_url . $smileys[$key][0] . '" alt="' . $smileys[$key][3] . '" style="width: ' . $smileys[$key][1] . '; height: ' . $smileys[$key][2] . '; border: 0;" />', $str);
     }
     return $str;
 }
开发者ID:tastyigniter,项目名称:tastyigniter,代码行数:22,代码来源:smiley_helper.php

示例7: editor_markitup

function editor_markitup($args = array())
{
    $options = mso_get_option('editor_markitup', 'plugins', array());
    // получаем опции
    if (!isset($options['preview'])) {
        $options['preview'] = 'aftertext';
    }
    if (!isset($options['previewautorefresh'])) {
        $options['previewautorefresh'] = 'no';
    }
    if (!isset($options['previewPosition'])) {
        $options['previewPosition'] = 'after';
    }
    if ($options['preview'] == 'aftertext') {
        $editor_config['preview'] = 'previewInWindow: "",';
    } else {
        $editor_config['preview'] = 'previewInWindow: "width=960, height=800, resizable=yes, scrollbars=yes",';
    }
    if ($options['previewautorefresh'] == 'no') {
        $editor_config['previewautorefresh'] = 'previewAutoRefresh: false,';
    } else {
        $editor_config['previewautorefresh'] = 'previewAutoRefresh: true,';
    }
    if ($options['previewPosition'] == 'before') {
        $editor_config['previewPosition'] = 'previewPosition: "before",';
    } else {
        $editor_config['previewPosition'] = 'previewPosition: "after",';
    }
    $editor_config['url'] = getinfo('plugins_url') . 'editor_markitup/';
    $editor_config['dir'] = getinfo('plugins_dir') . 'editor_markitup/';
    if (isset($args['content'])) {
        $editor_config['content'] = $args['content'];
    } else {
        $editor_config['content'] = '';
    }
    if (isset($args['do'])) {
        $editor_config['do'] = $args['do'];
    } else {
        $editor_config['do'] = '';
    }
    if (isset($args['posle'])) {
        $editor_config['posle'] = $args['posle'];
    } else {
        $editor_config['posle'] = '';
    }
    if (isset($args['action'])) {
        $editor_config['action'] = ' action="' . $args['action'] . '"';
    } else {
        $editor_config['action'] = '';
    }
    if (isset($args['height'])) {
        $editor_config['height'] = (int) $args['height'];
    } else {
        $editor_config['height'] = (int) mso_get_option('editor_height', 'general', 400);
        if ($editor_config['height'] < 100) {
            $editor_config['height'] = 400;
        }
    }
    # Приведение строк с <br> в первозданный вид
    $editor_config['content'] = preg_replace('"&lt;br\\s?/?&gt;"i', "\n", $editor_config['content']);
    $editor_config['content'] = preg_replace('"&lt;br&gt;"i', "\n", $editor_config['content']);
    // смайлы - код из comment_smiles
    $image_url = getinfo('uploads_url') . 'smiles/';
    $CI =& get_instance();
    $CI->load->helper('smiley_helper');
    $smileys = _get_smiley_array();
    $used = array();
    $smiles = '';
    foreach ($smileys as $key => $val) {
        // Для того, чтобы для смайлов с одинаковыми картинками (например :-) и :))
        // показывалась только одна кнопка
        if (isset($used[$smileys[$key][0]])) {
            continue;
        }
        $im = "<img src='" . $image_url . $smileys[$key][0] . "' title='" . $key . "'>";
        $smiles .= '{name:"' . addcslashes($im, '"') . '", notitle: "1", replaceWith:"' . $key . '", className:"col1-0" },' . NR;
        $used[$smileys[$key][0]] = TRUE;
    }
    if ($smiles) {
        $smiles = NR . "{name:'" . t('Смайлы') . "', openWith:':-)', closeWith:'', className:'smiles', dropMenu: [" . $smiles . ']},';
    }
    require $editor_config['dir'] . 'editor-bb.php';
}
开发者ID:rb2,项目名称:MaxSite-CMS,代码行数:83,代码来源:index.php

示例8: parse_smileys

 function parse_smileys($str = '', $image_url = '', $smileys = null)
 {
     if ($image_url == '') {
         return $str;
     }
     if (!is_array($smileys)) {
         if (false === ($smileys = _get_smiley_array())) {
             return $str;
         }
     }
     // Add a trailing slash to the file path if needed
     $image_url = preg_replace("/(.+?)\\/*\$/", '\\1/', $image_url);
     foreach ($smileys as $key => $val) {
         $str = str_replace($key, '<img src="' . $image_url . $smileys[$key][0] . '" width="' . $smileys[$key][1] . '" height="' . $smileys[$key][2] . '" alt="' . $smileys[$key][3] . '" style="border:0;" />', $str);
     }
     return $str;
 }
开发者ID:gocanto,项目名称:gocanto-pos,代码行数:17,代码来源:smiley_helper.php

示例9: _wikitext_test

 protected function _wikitext_test()
 {
     $this->load->helper('form');
     $this->load->library('wikiparser');
     $this->load->helper('wikitext_smiley');
     // No POST data? just set wikitext to default string
     $wikitext = $this->input->post('wikitext');
     if ($wikitext === FALSE) {
         $wikitext = '==This is the yorker wikitext parser==' . "\n";
         $wikitext .= 'The [[admin/tools/wikitext/flush|flusher]] will allow you to flush the wikitext caches across the website.' . "\n";
         $wikitext .= '*This is an unordered list' . "\n";
         $wikitext .= '*#With an ordered list within' . "\n";
         $wikitext .= '*#And another item' . "\n";
         $wikitext .= "\n";
         $wikitext .= '#This is an ordered list' . "\n";
         $wikitext .= '#*With an unordered list within' . "\n";
         $wikitext .= '#*And another item' . "\n";
         $wikitext .= implode('', array_keys(_get_smiley_array())) . "\n";
     } else {
         if (get_magic_quotes_gpc()) {
             $wikitext = stripslashes($wikitext);
         }
     }
     $parsed_wikitext = $wikitext;
     /// @todo wiktiext tester enable/disable different passes + display mid sections
     $parsed_wikitext = wikitext_parse_smileys($parsed_wikitext);
     $parsed_wikitext = $this->wikiparser->parse($parsed_wikitext . "\n", 'wiki test');
     $data = array('parsed_wikitext' => $parsed_wikitext, 'wikitext' => $wikitext);
     // Set up the public frame
     $this->main_frame->SetTitle('Wikitext Preview');
     $this->main_frame->SetContentSimple('admin/tools/wikitext', $data);
     $this->main_frame->load();
 }
开发者ID:TheYorkerArchive,项目名称:codebase-2006-2012,代码行数:33,代码来源:tools.php


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