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


PHP convert_html函数代码示例

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


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

示例1: plugin_group_convert

function plugin_group_convert()
{
    global $_group_msg;
    $auth_key = auth::get_user_info();
    if (empty($auth_key['group'])) {
        return '';
    }
    $argv = func_get_args();
    $i = count($argv);
    if ($i < 2) {
        return <<<EOD
<div>
        <label>{$_group_msg['group']}</label>:
        {$auth_key['group']}
</div>

EOD;
    }
    $msg = $argv[$i - 1];
    array_pop($argv);
    if (in_array($auth_key['group'], $argv)) {
        return convert_html(str_replace("\r", "\n", $msg));
    }
    return '';
}
开发者ID:aterai,项目名称:pukiwiki-plus-i18n,代码行数:25,代码来源:group.inc.php

示例2: plugin_submenu_convert

/**
 * Submenu Plugin
 *
 * @author     sonots
 * @license    http://www.gnu.org/licenses/gpl.html GPL v2
 * @link       http://lsx.sourceforge.jp/?Plugin%2Fsubmenu.inc.php
 * @version    $Id: submenu.inc.php,v 1.1 2007-02-24 16:28:39Z sonots $
 * @package    plugin
 */
function plugin_submenu_convert()
{
    global $vars;
    $args = func_get_args();
    $body = array_pop($args);
    $body = str_replace("\r", "\n", str_replace("\r\n", "\n", $body));
    $options = array('prefix' => '', 'filter' => '', 'except' => '');
    foreach ($args as $arg) {
        list($key, $val) = array_pad(explode('=', $arg), 2, '');
        $options[$key] = $val;
    }
    if ($options['prefix'] != '') {
        if (strpos($vars['page'], $options['prefix']) !== 0) {
            return '';
        }
    }
    if ($options['filter'] != '') {
        if (!preg_match('/' . str_replace('/', '\\/', $options['filter']) . '/', $vars['page'])) {
            return '';
        }
    }
    if ($options['except'] != '') {
        if (preg_match('/' . str_replace('/', '\\/', $options['except']) . '/', $vars['page'])) {
            return '';
        }
    }
    return convert_html($body);
}
开发者ID:orangeal2o3,项目名称:pukiwiki-plugin,代码行数:37,代码来源:submenu.inc.php

示例3: plugin_showrss_action

function plugin_showrss_action()
{
    global $vars, $cache;
    // if (PKWK_SAFE_MODE) die_message('PKWK_SAFE_MODE prohibit this');
    if (Auth::check_role('safemode')) {
        Utility::dieMessage('PKWK_SAFE_MODE prohibits this');
    }
    if ($vars['feed']) {
        // ajaxによる読み込み
        $target = $vars['feed'];
        list($data, $time, $reason) = plugin_showrss_get_rss($vars['feed'], 1, true);
        $header = Header::getHeaders('aplication/xml', $time);
        if (empty($reason)) {
            Header::writeResponse($header, Response::STATUS_CODE_200, $data);
        } else {
            // とりあえずXMLでエラー
            Header::writeResponse($header, Response::STATUS_CODE_200, '<?xml version="1.0" encoding="UTF-8"?><response><error>1</error><message>' . Utility::htmlsc($reason) . '</message></response>');
        }
        exit;
    }
    $body = '';
    foreach (array('xml', 'mbstring') as $extension) {
        ${$extension} = extension_loaded($extension) ? '&color(green){Found};' : '&color(red){Not found};';
        $body .= '| ' . $extension . ' extension | ' . ${$extension} . ' |' . "\n";
    }
    return array('msg' => 'showrss_info', 'body' => convert_html($body));
}
开发者ID:logue,项目名称:pukiwiki_adv,代码行数:27,代码来源:showrss.inc.php

示例4: plugin_ls_convert

function plugin_ls_convert()
{
    global $vars;
    $with_title = FALSE;
    if (func_num_args()) {
        $args = func_get_args();
        $with_title = in_array('title', $args);
    }
    $prefix = $vars['page'] . '/';
    $pages = array();
    foreach (get_existpages() as $page) {
        if (strpos($page, $prefix) === 0) {
            $pages[] = $page;
        }
    }
    natcasesort($pages);
    $ls = array();
    foreach ($pages as $page) {
        $comment = '';
        if ($with_title) {
            list($comment) = get_source($page);
            // 見出しの固有ID部を削除
            $comment = preg_replace('/^(\\*{1,3}.*)\\[#[A-Za-z][\\w-]+\\](.*)$/', '$1$2', $comment);
            $comment = '- ' . ereg_replace('^[-*]+', '', $comment);
        }
        $ls[] = "-[[{$page}]] {$comment}";
    }
    return convert_html($ls);
}
开发者ID:geoemon2k,项目名称:source_wiki,代码行数:29,代码来源:ls.inc.php

示例5: plugin_edit_preview

function plugin_edit_preview()
{
    global $vars;
    global $_title_preview, $_msg_preview, $_msg_preview_delete;
    $page = isset($vars['page']) ? $vars['page'] : '';
    // Loading template
    if (isset($vars['template_page']) && is_page($vars['template_page'])) {
        $vars['msg'] = join('', get_source($vars['template_page']));
        // Cut fixed anchors
        $vars['msg'] = preg_replace('/^(\\*{1,3}.*)\\[#[A-Za-z][\\w-]+\\](.*)$/m', '$1$2', $vars['msg']);
    }
    $vars['msg'] = preg_replace(PLUGIN_EDIT_FREEZE_REGEX, '', $vars['msg']);
    $postdata = $vars['msg'];
    if (isset($vars['add']) && $vars['add']) {
        if (isset($vars['add_top']) && $vars['add_top']) {
            $postdata = $postdata . "\n\n" . @join('', get_source($page));
        } else {
            $postdata = @join('', get_source($page)) . "\n\n" . $postdata;
        }
    }
    $body = $_msg_preview . '<br />' . "\n";
    if ($postdata == '') {
        $body .= '<strong>' . $_msg_preview_delete . '</strong>';
    }
    $body .= '<br />' . "\n";
    if ($postdata) {
        $postdata = make_str_rules($postdata);
        $postdata = explode("\n", $postdata);
        $postdata = drop_submit(convert_html($postdata));
        $body .= '<div id="preview">' . $postdata . '</div>' . "\n";
    }
    $body .= edit_form($page, $vars['msg'], $vars['digest'], FALSE);
    return array('msg' => $_title_preview, 'body' => $body);
}
开发者ID:KimuraYoichi,项目名称:PukiWiki,代码行数:34,代码来源:edit.inc.php

示例6: plugin_bubbles_convert

function plugin_bubbles_convert()
{
    switch (func_num_args()) {
        case 2:
            list($title, $body) = func_get_args();
            $title = htmlspecialchars($title);
            break;
        case 1:
            list($body) = func_get_args();
            break;
        default:
            return FALSE;
    }
    $lines = preg_replace(array("[\\r|\\n]", "[\\r]"), array("\n", "\n"), $body);
    $lines = preg_replace(array("'<p>'si", "'</p>'si"), array("", ""), convert_html($lines));
    static $bubbles = FALSE;
    if ($bubbles === FALSE) {
        global $head_tags;
        $head_tags[] = ' <link rel="stylesheet" href="' . SKIN_URI . 'bubbles.css" type="text/css" media="screen" charset="utf-8" />';
        $head_tags[] = ' <script type="text/javascript" charset="utf-8" src="' . SKIN_URI . 'bubbles.js"></script>';
        $bubbles = TRUE;
    }
    return <<<EOD
  <div class="bubble">
    <div class="rounded">
      <blockquote>
        <p>{$lines}</p>
      </blockquote>
    </div>
    <cite class="rounded"><strong>{$title}</strong></cite>
  </div>
EOD;
}
开发者ID:aterai,项目名称:pukiwiki-plus-i18n,代码行数:33,代码来源:bubbles.inc.php

示例7: plugin_expand_convert

function plugin_expand_convert()
{
    global $script;
    $numargs = func_num_args();
    if ($numargs == 3) {
        list($width, $height, $source) = func_get_args();
        $width = intval($width);
        $height = intval($height);
    } else {
        if ($numargs == 2) {
            list($width, $source) = func_get_args();
            $width = intval($width);
        } else {
            if ($numargs == 1) {
                list($source) = func_get_args();
                $width = PLUGIN_EXPAND_DEFAULT_WIDTH;
            } else {
                return _('#expand: invalid arguments');
            }
        }
    }
    if (!isset($width) || $width < PLUGIN_EXPAND_MIN_WIDTH) {
        return _('#expand: too few width. ') . $width;
    }
    if (isset($height) && $height < PLUGIN_EXPAND_MIN_HEIGHT) {
        return _('#expand: too few height. ') . $height;
    }
    $lines = preg_replace(array("[\\r|\\n]", "[\\r]"), array("\n", "\n"), $source);
    $lines = preg_replace(array("'<p>'si", "'</p>'si"), array("", ""), convert_html($lines));
    return '<div style="width:' . $width . 'px;overflow:hidden;">' . $lines . '</div>' . '<form method="post" action="' . $script . '"><textarea name="fullcontents" rows="1" cols="1" style="display:none;">' . htmlspecialchars($source) . '</textarea><input type="image" name="submit" src="' . PLUGIN_EXPAND_ICON . '" style="float:right;" alt="' . _('Click to all views') . '" />' . '<input type="hidden" name="cmd" value="expand" /></form>';
}
开发者ID:aterai,项目名称:pukiwiki-plus-i18n,代码行数:31,代码来源:expand.inc.php

示例8: plugin_epre_convert

/**
 * Show Converted HTML Output as a Pre-formatted Text
 *
 * @author     sonots
 * @license    http://www.gnu.org/licenses/gpl.html GPL v2
 * @link       http://lsx.sourceforge.jp/?Plugin%2Fepre.inc.php
 * @version    $Id: epre.inc.php,v 1.1 2007-02-24 16:28:39Z sonots $
 * @package    plugin
 */
function plugin_epre_convert()
{
    $args = func_get_args();
    $lines = array_pop($args);
    $lines = str_replace("\r", "\n", $lines);
    return '<pre>' . htmlspecialchars(convert_html($lines)) . '</pre>';
}
开发者ID:orangeal2o3,项目名称:pukiwiki-plugin,代码行数:16,代码来源:epre.inc.php

示例9: plugin_style_convert

/**
 * CSS Style Plugin
 *  
 * @author     sonots
 * @license    http://www.gnu.org/licenses/gpl.html GPL v2
 * @link       http://lsx.sourceforge.jp/?Plugin%2Fstyle.inc.hp
 * @version    $Id: style.inc.php,v 1.5 2008-01-04 19:02:47Z sonots $
 * @package    plugin
 */
function plugin_style_convert()
{
    $args = func_get_args();
    $end = end($args);
    if (substr($end, -1) == "\r") {
        $body = array_pop($args);
    }
    $options = array('style' => NULL, 'class' => NULL, 'addstyle' => NULL, 'addclass' => NULL, 'putclass' => NULL, 'putstyle' => NULL, 'end' => FALSE);
    foreach ($args as $arg) {
        list($key, $val) = array_pad(explode('=', $arg, 2), 2, TRUE);
        if (array_key_exists($key, $options)) {
            $options[$key] = $val;
        } else {
            // default
            $options['style'] = $arg;
        }
    }
    $open = '';
    $open .= !is_null($options['class']) ? ' class="' . htmlspecialchars($options['class']) . '"' : '';
    $open .= !is_null($options['style']) ? ' style="' . htmlspecialchars($options['style']) . '"' : '';
    $open = $open != '' ? '<div' . $open . '>' . "\n" : '';
    if (isset($body)) {
        $body = str_replace("\r", "\n", $body);
        $body = convert_html($body);
        plugin_style_replace_leadingtag($body, $options['addstyle'], $options['addclass'], $options['putstyle'], $options['putclass']);
    }
    $close = isset($body) && $open != '' || $options['end'] ? '</div>' : '';
    return $open . $body . $close;
}
开发者ID:orangeal2o3,项目名称:pukiwiki-plugin,代码行数:38,代码来源:style.inc.php

示例10: plugin_update_entities_action

function plugin_update_entities_action()
{
    global $script, $vars;
    global $_entities_messages;
    if (PKWK_READONLY) {
        die_message('PKWK_READONLY prohibits this');
    }
    $msg = $body = '';
    if (empty($vars['action']) || empty($vars['adminpass']) || !pkwk_login($vars['adminpass'])) {
        $msg =& $_entities_messages['title_update'];
        $items = plugin_update_entities_create();
        $body = convert_html(sprintf($_entities_messages['msg_usage'], join("\n" . '-', $items)));
        $body .= <<<EOD
<form method="POST" action="{$script}">
 <div>
  <input type="hidden" name="plugin" value="update_entities" />
  <input type="hidden" name="action" value="update" />
  <label for="_p_update_entities_adminpass">{$_entities_messages['msg_adminpass']}</label>
  <input type="password" name="adminpass" id="_p_update_entities_adminpass" size="20" value="" />
  <input type="submit" value="{$_entities_messages['btn_submit']}" />
 </div>
</form>
EOD;
    } else {
        if ($vars['action'] == 'update') {
            plugin_update_entities_create(TRUE);
            $msg =& $_entities_messages['title_update'];
            $body =& $_entities_messages['msg_done'];
        } else {
            $msg =& $_entities_messages['title_update'];
            $body =& $_entities_messages['err_invalid'];
        }
    }
    return array('msg' => $msg, 'body' => $body);
}
开发者ID:geoemon2k,项目名称:source_wiki,代码行数:35,代码来源:update_entities.inc.php

示例11: plugin_links_action

function plugin_links_action()
{
    global $script, $post, $vars, $foot_explain;
    global $_links_messages;
    if (PKWK_READONLY) {
        die_message('PKWK_READONLY prohibits this');
    }
    $msg = $body = '';
    if (empty($vars['action']) || empty($post['adminpass']) || !pkwk_login($post['adminpass'])) {
        $msg =& $_links_messages['title_update'];
        $body = convert_html($_links_messages['msg_usage']);
        $body .= <<<EOD
<form method="POST" action="{$script}">
 <div>
  <input type="hidden" name="plugin" value="links" />
  <input type="hidden" name="action" value="update" />
  <label for="_p_links_adminpass">{$_links_messages['msg_adminpass']}</label>
  <input type="password" name="adminpass" id="_p_links_adminpass" size="20" value="" />
  <input type="submit" value="{$_links_messages['btn_submit']}" />
 </div>
</form>
EOD;
    } elseif ($vars['action'] == 'update') {
        links_init();
        $foot_explain = array();
        // Exhaust footnotes
        $msg =& $_links_messages['title_update'];
        $body =& $_links_messages['msg_done'];
    } else {
        $msg =& $_links_messages['title_update'];
        $body =& $_links_messages['err_invalid'];
    }
    return array('msg' => $msg, 'body' => $body);
}
开发者ID:nsmr0604,项目名称:pukiwiki,代码行数:34,代码来源:links.inc.php

示例12: plugin_scrollbox_convert

/**
 *   QHM Scroll Box Plugin
 *   -------------------------------------------
 *   plugin/scrollbox.inc.php
 *   
 *   Copyright (c) 2010 hokuken
 *   http://hokuken.com/
 *   
 *   Usage :
 *   
 */
function plugin_scrollbox_convert()
{
    $args = func_get_args();
    $last = func_num_args() - 1;
    if (strpos($args[$last], 'style=') === 0) {
    } elseif (strpos($args[$last], 'class=') === 0) {
    } else {
        $body = array_pop($args);
    }
    list($w, $h, $option) = array_pad($args, 3, '');
    $w = $w == '' ? '100%' : $w;
    $h = $h == '' ? '200px' : $h;
    $option = $option == '' ? 'overflow:auto;border:1px solid #dcdcdc;padding:5px 10px;margin-left:auto;margin-right:auto;text-align:justify;' : $option;
    $option = h($option);
    if (isset($body)) {
        $body = str_replace("\r", "\n", str_replace("\r\n", "\n", $body));
        $lines = explode("\n", $body);
        $body = convert_html($lines);
    } else {
        $body = '';
    }
    $ret = '<div style= "';
    $ret .= 'width:' . $w . ';';
    $ret .= 'height:' . $h . ';';
    $ret .= $option . ';"';
    $ret .= '>';
    $ret .= $body;
    $ret .= '</div>';
    return $ret;
}
开发者ID:big2men,项目名称:qhm,代码行数:41,代码来源:scrollbox.inc.php

示例13: plugin_enull_inline

function plugin_enull_inline()
{
    $args = func_get_args();
    array_pop($args);
    $lines = implode(',', $args);
    convert_html($lines);
    return '';
}
开发者ID:orangeal2o3,项目名称:pukiwiki-plugin,代码行数:8,代码来源:enull.inc.php

示例14: plugin_ogp_convert

/**
 *   OpenGraphProtocol Plugin
 *   -------------------------------------------
 *   ogp.inc.php
 *
 *   Copyright (c) 2011 hokuken
 *   http://hokuken.com/
 *
 *   created  : 2011-10-28
 *   modified :
 *
 *   Description
 *
 *   Usage :
 *
 */
function plugin_ogp_convert()
{
    global $script, $vars, $ogp_tag;
    //$ogp_tag を有効にする
    $ogp_tag = 1;
    $qt = get_qt();
    $data = $qt->getv('plugin_ogp_tags');
    if (!$data) {
        $data = array();
    }
    //管理者かどうか
    $editable = edit_auth($page, FALSE, FALSE);
    //引数を解析する
    $args = func_get_args();
    $params = explode("\r", array_pop($args));
    $desc = '';
    $aliases = plugin_ogp_get_aliases();
    foreach ($params as $i => $param) {
        if (preg_match('/^([\\w:]+)=(.*)$/', $param, $mts)) {
            $key = $mts[1];
            $val = $mts[2];
            if (isset($aliases[$key])) {
                $key = $aliases[$key];
            }
            $data[$key] = $val;
        } else {
            $desc .= $param . "\n";
        }
    }
    if (trim($desc) != '') {
        $data['og:description'] = $desc;
    }
    if (!$qt->getv('plugin_ogp_tags')) {
        $qt->setv('plugin_ogp_tags', $data);
    }
    $html = '';
    if ($editable) {
        $editlink = $script . '?cmd=edit&page=' . rawurlencode($vars['page']);
        $conflink = $script . '?cmd=qhmsetting&phase=sns&mode=form';
        $fb_debugger_link = 'http://developers.facebook.com/tools/debug/og/object?q=' . rawurlencode($script . '?' . rawurlencode($vars['page']));
        $wiki = '
----
\'\'【お知らせ】Open Graph Protocol タグが変更されています。\'\'
変更するには[[このページを編集してください>' . $editlink . ']]

例えばFacebook での表示は以下のようになります。
#style(class=box_gray_ssm){{
#{ogp_preview}
}}
※Facebook のチェックツールは[[こちら>' . $fb_debugger_link . ']]
※画像がない場合、OGP設定のサイト画像が表示されます。
サイト画像の変更は[[こちら>' . $conflink . ']]
----
';
        $html .= str_replace('#{ogp_preview}', plugin_ogp_get_preview(), convert_html($wiki));
    }
    return $html;
}
开发者ID:big2men,项目名称:qhm,代码行数:74,代码来源:ogp.inc.php

示例15: plugin_nav_convert

/**
 *   QHM Nav plugin
 *   -------------------------------------------
 *
 *   Copyright (c) 2014 hokuken
 *   http://hokuken.com/
 *
 *   created  : 2014/06/11
 *   modified :
 *
 *   Switch Nav content and convert
 *
 *   Usage :
 *     #nav(OtherSiteNavigator)
 *
 */
function plugin_nav_convert()
{
    global $vars, $navbar;
    static $nav = NULL;
    $qm = get_qm();
    $qt = get_qt();
    $num = func_num_args();
    if ($num > 0) {
        // Try to change default 'SiteNavigator' page name (only)
        if ($num > 1) {
            return '#nav: 引数が多すぎます。' . "<br />\n";
        }
        if ($nav !== NULL) {
            return '#nav: 既に変更されています:' . h($nav) . "<br />\n";
        }
        if ($qt->getv('plugin_nav_source')) {
            return '#nav: 既にナビの内容を変更しています。' . "<br />\n";
        }
        $args = func_get_args();
        //ナビの内容を受け取る
        if (strpos($args[0], "\r") !== FALSE) {
            if (isset($vars['page_alt'])) {
                return '#nav: 利用できません。';
            }
            $source = str_replace("\r", "\n", $args[0]);
            $qt->setv_once('plugin_nav_source', $source);
            return '';
        }
        if (!is_page($args[0])) {
            return 'ページがみつかりません:' . h($args[0]) . "<br />\n";
        } else {
            $nav = $args[0];
            // Set
            return '';
        }
    } else {
        // Output navbar page data
        $page = $nav === NULL ? $navbar : $nav;
        if ($source = $qt->getv('plugin_nav_source')) {
            // Cut fixed anchors
            $source = preg_replace('/^(\\*{1,3}.*)\\[#[A-Za-z][\\w-]+\\](.*)$/m', '$1$2', $source);
            return convert_html($source);
        }
        if (!is_page($page)) {
            return '';
        } else {
            if (isset($vars['preview']) && $vars['page'] == $page) {
                // Cut fixed anchors
                $navtext = preg_replace('/^(\\*{1,3}.*)\\[#[A-Za-z][\\w-]+\\](.*)$/m', '$1$2', $vars['msg']);
                return convert_html($navtext);
            } else {
                // Cut fixed anchors
                $navtext = preg_replace('/^(\\*{1,3}.*)\\[#[A-Za-z][\\w-]+\\](.*)$/m', '$1$2', get_source($page));
                return convert_html($navtext);
            }
        }
    }
}
开发者ID:big2men,项目名称:qhm,代码行数:74,代码来源:nav.inc.php


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