本文整理汇总了PHP中strip_htmltag函数的典型用法代码示例。如果您正苦于以下问题:PHP strip_htmltag函数的具体用法?PHP strip_htmltag怎么用?PHP strip_htmltag使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了strip_htmltag函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: plugin_uname_inline
function plugin_uname_inline()
{
$qt = get_qt();
//---- キャッシュのための処理を登録 -----
if ($qt->create_cache) {
$args = func_get_args();
return $qt->get_dynamic_plugin_mark(__FUNCTION__, $args);
}
//------------------------------------
global $vars;
$name = isset($vars['uname']) ? $vars['uname'] : '';
//unameパラメータがセットされていない場合
if ($name == '') {
return 'あなた';
} else {
$name = htmlspecialchars(mb_convert_encoding($name, SOURCE_ENCODING, 'UTF8,EUC-JP,Shift_JIS'));
}
$args = func_get_args();
$num = count($args);
$ntitle = "さん";
if ($num > 1) {
strip_htmltag(array_pop($args), FALSE);
$tmpstr = strip_htmltag(array_pop($args), FALSE);
if ($tmpstr == "none") {
$ntitle = '';
} else {
$ntitle = $tmpstr;
}
}
return $name . $ntitle;
}
开发者ID:big2men,项目名称:qhm,代码行数:31,代码来源:uname.inc.php
示例2: plugin__set_inline
/**
* I18N - 各言語毎のメッセージを一時的に設定するプラグイン
*
* @copyright Copyright © 2005, Katsumi Saito <[email protected]>
* @version $Id: _set.inc.php,v 0.1 2005/05/07 23:38:00 upk Exp $
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
function plugin__set_inline()
{
global $i18n_temp_msg;
$argc = func_num_args();
$argv = func_get_args();
list($key, $lang, $msg) = i18n_set_param($argc, $argv);
$i18n_temp_msg[$key][$lang] = strip_htmltag($msg);
return '';
}
开发者ID:logue,项目名称:pukiwiki_adv,代码行数:17,代码来源:_set.inc.php
示例3: plugin_img3_inline
function plugin_img3_inline()
{
global $script;
global $_img3_msg;
static $img_no = 0;
// パラメータ
@(list($src, $title, $ratio, $align) = func_get_args());
if (is_null($src) || empty($src)) {
return '';
}
if (is_null($title) || empty($title)) {
$title = 'image';
}
if (is_null($ratio) || empty($ratio)) {
$ratio = 1;
}
if (is_null($align) || empty($align)) {
$align = '';
}
// ファイルの存在チェック
// $url = rawurldecode($src);
$url_arry = parse_url($src);
if (empty($url_arry['scheme'])) {
if (!file_exists($src)) {
return $_img3_msg['not_found'];
}
} else {
if (!USE_IMAGE_URI) {
return $_img3_msg['not_permitted'];
}
}
$src = htmlspecialchars($src);
$title = strip_htmltag($title);
$title = htmlspecialchars($title);
$ratio = htmlspecialchars($ratio);
$align = htmlspecialchars($align);
$size = img3_set_image_size($src, $ratio);
// width, height の取得
if ($size[4] == 0) {
return $_img3_msg['not_support'];
}
if (!empty($align)) {
$img_no++;
return <<<EOD
<style type="text/css">
img.img3{$img_no} { vertical-align: {$align}; }
</style>
<img src="{$src}" alt="{$title}" title="{$title}" {$size[6]} class="img3{$img_no}" />
EOD;
}
return <<<EOD
<img src="{$src}" alt="{$title}" title="{$title}" {$size[6]} />
EOD;
}
开发者ID:aterai,项目名称:pukiwiki-plus-i18n,代码行数:54,代码来源:img3.inc.php
示例4: plugin_ruby_inline
function plugin_ruby_inline()
{
if (func_num_args() != 2) {
return PLUGIN_RUBY_USAGE;
}
list($ruby, $body) = func_get_args();
// strip_htmltag() is just for avoiding AutoLink insertion
$body = strip_htmltag($body);
if ($ruby == '' || $body == '') {
return PLUGIN_RUBY_USAGE;
}
return '<ruby><rb>' . $body . '</rb>' . '<rp>(</rp>' . '<rt>' . htmlsc($ruby) . '</rt>' . '<rp>)</rp>' . '</ruby>';
}
开发者ID:geoemon2k,项目名称:source_wiki,代码行数:13,代码来源:ruby.inc.php
示例5: plugin_aname_inline
function plugin_aname_inline()
{
$convert = FALSE;
if (func_num_args() < 2) {
return plugin_aname_usage($convert);
}
$args = func_get_args();
// ONE or more
$body = strip_htmltag(array_pop($args), FALSE);
// Strip anchor tags only
array_push($args, $body);
return plugin_aname_tag($args, $convert);
}
开发者ID:KimuraYoichi,项目名称:PukiWiki,代码行数:13,代码来源:aname.inc.php
示例6: plugin_ruby_inline
function plugin_ruby_inline()
{
$qm = get_qm();
if (func_num_args() != 2) {
return $qm->m['plg_ruby']['err_usage'];
}
list($ruby, $body) = func_get_args();
// strip_htmltag() is just for avoiding AutoLink insertion
$body = strip_htmltag($body);
if ($ruby == '' || $body == '') {
return $qm->m['plg_ruby']['err_usage'];
}
return '<ruby><rb>' . $body . '</rb>' . '<rp>(</rp>' . '<rt>' . h($ruby) . '</rt>' . '<rp>)</rp>' . '</ruby>';
}
开发者ID:big2men,项目名称:qhm,代码行数:14,代码来源:ruby.inc.php
示例7: plugin__get_inline
/**
* @copyright Copyright © 2006, Katsumi Saito <[email protected]>
* @version $Id: _get.inc.php,v 0.2 2006/04/30 16:56:00 upk Exp $
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*/
function plugin__get_inline()
{
switch (func_num_args()) {
case 2:
list($msg) = func_get_args();
return strip_htmltag($msg);
case 3:
list($name, $msg) = func_get_args();
return i18n_gettext($name, $msg);
case 4:
list($name, $lang, $msg) = func_get_args();
return i18n_setlocale($name, $lang, $msg);
}
return '';
}
开发者ID:aterai,项目名称:pukiwiki-plus-i18n,代码行数:20,代码来源:_get.inc.php
示例8: plugin_get_title_inline
/**
* Get TITLE: line or the first headline of a page
*
* Usage:
* - &get_title(page,[option])
* Option
* - firsthead Get the first headline instead of title
*
* @package plugin
* @license http://www.gnu.org/licenses/gpl.html GPL v2
* @author sonots
* @link http://lsx.sourceforge.jp/?Plugin%2Fget_title.inc.php
* @version $Id: get_title.inc.php,v 2.0 2008-07-30 16:28:39Z sonots $
*/
function plugin_get_title_inline()
{
$args = func_get_args();
array_pop($args);
$page = array_shift($args);
$conf_options = array('firsthead' => false);
$options = sonots::parse_options($args, $conf_options);
if ($options['firsthead']) {
$str = PluginSonotsMetapage::firsthead($page);
} else {
$str = PluginSonotsMetapage::title($page);
}
if (is_null($str)) {
$str = $page;
}
$str = strip_htmltag(make_link($str));
return $str;
}
开发者ID:orangeal2o3,项目名称:pukiwiki-plugin,代码行数:32,代码来源:get_title.inc.php
示例9: plugin___inline
/**
* Plug-in that achieves gettext in PukiWiki page
* PukiWiki ページ内で gettext を実現するプラグイン
*
* @copyright Copyright © 2005-2006, Katsumi Saito <[email protected]>
* @version $Id: _.inc.php,v 0.10 2006/02/04 23:42:00 upk Exp $
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
* o :config/i18n/text/ja/text or :config/i18n/text/ja_JP is acceptable.
* o There are zh_TW etc. ,
* too and the form of language_country can be selected though the language name is appropriate in principle.
* o 原則的には、言語名が適切であるものの、zh_TW などもあり 言語_国 の形式も選択可能。
*
* o &_(ja){掲示板};
* 一度、英語の文字列を得て、表示言語に変換する。
* o &_{BBS};
* 英語表記であることを信じ、表示言語に変換する。
*
* 全てにおいて、未定義語の場合は、指定文字列をそのまま戻す。
* All, a specified character string is returned as it is for an undefined word.
*
*/
function plugin___inline()
{
global $language_considering_setting_level;
global $language;
global $i18n_temp_msg;
switch (func_num_args()) {
case 1:
list($msg) = func_get_args();
// $parm_lang = DEFAULT_LANG;
$parm_lang = 'en_US';
break;
default:
list($parm_lang, $msg) = func_get_args();
}
$msg = strip_htmltag($msg);
// FIXME: level 5
$view_lang = $language_considering_setting_level == 0 ? get_language(5) : $language;
$view_lang_split = accept_language::split_locale_str($view_lang);
// ja_JP なら ja に分割
if ($parm_lang == $view_lang || $parm_lang == $view_lang_split[1]) {
return $msg;
}
// 指定言語と同じ
// 指定文字列が en 以外の場合は、ベース言語に変換後、他言語に変換する
$parm_lang_split = accept_language::split_locale_str($parm_lang);
if (isset($i18n_temp_msg)) {
$temp_msg = i18n_TempMsg($parm_lang_split, $view_lang_split, $msg);
if (!empty($temp_msg)) {
return $temp_msg;
}
}
if ($parm_lang_split[1] !== 'en') {
$msg = i18n_ConfMsgGet($parm_lang_split, $msg, 1);
}
// :config から、単語を検索
return i18n_ConfMsgGet($view_lang_split, $msg);
}
开发者ID:aterai,项目名称:pukiwiki-plus-i18n,代码行数:59,代码来源:_.inc.php
示例10: make_heading
function make_heading(&$str, $strip = TRUE)
{
global $NotePattern;
// Cut fixed-heading anchors
$id = '';
$matches = array();
if (preg_match('/^(\\*{0,3})(.*?)\\[#([A-Za-z][\\w-]+)\\](.*?)$/m', $str, $matches)) {
$str = $matches[2] . $matches[4];
$id =& $matches[3];
} else {
$str = preg_replace('/^\\*{0,3}/', '', $str);
}
// Cut footnotes and tags
if ($strip === TRUE) {
$str = strip_htmltag(make_link(preg_replace($NotePattern, '', $str)));
}
return $id;
}
开发者ID:geoemon2k,项目名称:source_wiki,代码行数:18,代码来源:html.php
示例11: plugin_edit_inline
function plugin_edit_inline()
{
static $usage = '&edit(pagename#anchor[[,noicon],nolabel])[{label}];';
global $script, $vars, $fixed_heading_anchor_edit;
if (PKWK_READONLY) {
return '';
}
// Show nothing
// Arguments
$args = func_get_args();
// {label}. Strip anchor tags only
$s_label = strip_htmltag(array_pop($args), FALSE);
$page = array_shift($args);
if ($page == NULL) {
$page = '';
}
$_noicon = $_nolabel = FALSE;
foreach ($args as $arg) {
switch (strtolower($arg)) {
case '':
break;
case 'nolabel':
$_nolabel = TRUE;
break;
case 'noicon':
$_noicon = TRUE;
break;
default:
return $usage;
}
}
// Separate a page-name and a fixed anchor
list($s_page, $id, $editable) = anchor_explode($page, TRUE);
// Default: This one
if ($s_page == '') {
$s_page = isset($vars['page']) ? $vars['page'] : '';
}
// $s_page fixed
$isfreeze = is_freeze($s_page);
$ispage = is_page($s_page);
// Paragraph edit enabled or not
$short = htmlspecialchars('Edit');
if ($fixed_heading_anchor_edit && $editable && $ispage && !$isfreeze) {
// Paragraph editing
$id = rawurlencode($id);
$title = htmlspecialchars(sprintf('Edit %s', $page));
$icon = '<img src="' . IMAGE_DIR . 'paraedit.png' . '" width="9" height="9" alt="' . $short . '" title="' . $title . '" /> ';
$class = ' class="anchor_super"';
} else {
// Normal editing / unfreeze
$id = '';
if ($isfreeze) {
$title = 'Unfreeze %s';
$icon = 'unfreeze.png';
} else {
$title = 'Edit %s';
$icon = 'edit.png';
}
$title = htmlspecialchars(sprintf($title, $s_page));
$icon = '<img src="' . IMAGE_DIR . $icon . '" width="20" height="20" alt="' . $short . '" title="' . $title . '" />';
$class = '';
}
if ($_noicon) {
$icon = '';
}
// No more icon
if ($_nolabel) {
if (!$_noicon) {
$s_label = '';
// No label with an icon
} else {
$s_label = $short;
// Short label without an icon
}
} else {
if ($s_label == '') {
$s_label = $title;
}
// Rich label with an icon
}
// URL
if ($isfreeze) {
$url = $script . '?cmd=unfreeze&page=' . rawurlencode($s_page);
} else {
$s_id = $id == '' ? '' : '&id=' . $id;
$url = $script . '?cmd=edit&page=' . rawurlencode($s_page) . $s_id;
}
$atag = '<a' . $class . ' href="' . $url . '" title="' . $title . '">';
static $atags = '</a>';
if ($ispage) {
// Normal edit link
return $atag . $icon . $s_label . $atags;
} else {
// Dangling edit link
return '<span class="noexists">' . $atag . $icon . $atags . $s_label . $atag . '?' . $atags . '</span>';
}
}
开发者ID:KimuraYoichi,项目名称:PukiWiki,代码行数:97,代码来源:edit.inc.php
示例12: plugin_tb_output_rsslist
function plugin_tb_output_rsslist($tb_id)
{
global $script, $vars, $entity_pattern;
$page = tb_id2page($tb_id);
if ($page === false) {
return false;
}
$items = '';
foreach (tb_get(tb_get_filename($page)) as $arr) {
// _utime_, title, excerpt, _blog_name_
array_shift($arr);
// Cut utime
list($url, $title, $excerpt) = array_map(create_function('$a', 'return htmlspecialchars($a);'), $arr);
$items .= <<<EOD
<item>
<title>{$title}</title>
<link>{$url}</link>
<description>{$excerpt}</description>
</item>
EOD;
}
$title = htmlspecialchars($page);
$link = $script . '?' . rawurlencode($page);
$vars['page'] = $page;
$excerpt = strip_htmltag(convert_html(get_source($page)));
$excerpt = preg_replace("/&{$entity_pattern};/", '', $excerpt);
$excerpt = mb_strimwidth(preg_replace("/[\r\n]/", ' ', $excerpt), 0, 255, '...');
$lang = PLUGIN_TB_LANGUAGE;
$rc = <<<EOD
<?xml version="1.0" encoding="utf-8" ?>
<response>
<error>0</error>
<rss version="0.91">
<channel>
<title>{$title}</title>
<link>{$link}</link>
<description>{$excerpt}</description>
<language>{$lang}</language>{$items}
</channel>
</rss>
</response>
EOD;
pkwk_common_headers();
header('Content-Type: text/xml');
echo mb_convert_encoding($rc, 'UTF-8', SOURCE_ENCODING);
exit;
}
开发者ID:nsmr0604,项目名称:pukiwiki,代码行数:48,代码来源:tb.inc.php
示例13: tb_send
function tb_send($page, $plus, $minus = '')
{
global $page_title;
$script = get_script_uri();
// Disable 'max execution time' (php.ini: max_execution_time)
if (ini_get('safe_mode') == '0') {
set_time_limit(0);
}
// Get URLs from <a>(anchor) tag from convert_html()
$links = array();
$plus = convert_html($plus);
// WARNING: heavy and may cause side-effect
preg_match_all('#href="(https?://[^"]+)"#', $plus, $links, PREG_PATTERN_ORDER);
$links = array_unique($links[1]);
// Reject from minus list
if ($minus != '') {
$links_m = array();
$minus = convert_html($minus);
// WARNING: heavy and may cause side-effect
preg_match_all('#href="(https?://[^"]+)"#', $minus, $links_m, PREG_PATTERN_ORDER);
$links_m = array_unique($links_m[1]);
$links = array_diff($links, $links_m);
}
// Reject own URL (Pattern _NOT_ started with '$script' and '?')
$links = preg_grep('/^(?!' . preg_quote($script, '/') . '\\?)./', $links);
// No link, END
if (!is_array($links) || empty($links)) {
return;
}
$r_page = rawurlencode($page);
$excerpt = strip_htmltag(convert_html(get_source($page)));
// Sender's information
$putdata = array('title' => $page, 'url' => $script . '?' . $r_page, 'excerpt' => mb_strimwidth(preg_replace("/[\r\n]/", ' ', $excerpt), 0, 255, '...'), 'blog_name' => $page_title . ' (' . PLUGIN_TRACKBACK_VERSION . ')', 'charset' => SOURCE_ENCODING);
foreach ($links as $link) {
$tb_id = tb_get_url($link);
// Get Trackback ID from the URL
if (empty($tb_id)) {
continue;
}
// Trackback is not supported
$result = http_request($tb_id, 'POST', '', $putdata, 2, CONTENT_CHARSET);
// FIXME: Create warning notification space at pukiwiki.skin!
}
}
开发者ID:nsmr0604,项目名称:pukiwiki,代码行数:44,代码来源:trackback.php
示例14: plugin_rss_action
//.........这里部分代码省略.........
if ($qblog_mode) {
$page = trim($line);
$time = strtotime(get_qblog_date('Y-m-d 00:00:00', $page));
} else {
list($time, $page) = explode("\t", rtrim($line));
}
//blogモードで、$blog_name/Hogehogeでないなら(つまり、ブログページでないなら、何もしない
if ($blog_mode && !preg_match('/^' . $blog_mode . '\\/.*/', $page)) {
continue;
}
$r_page = rawurlencode($page);
$title = get_page_title($page);
$source = get_source($page);
foreach ($source as $k => $l) {
if (preg_match($ignore_plugin, $l)) {
// リストから省く
$skip_list = TRUE;
break;
}
if (preg_match($strip_plugin, $l)) {
// 説明から省く
unset($source[$k]);
}
}
if ($skip_list) {
continue;
}
//html(noskinを避ける)
if (count($source) > 0) {
$source = str_replace('#html(noskin)', '#html()', $source);
$source = preg_replace($strip_plugin_inline, '', $source);
// 行内のプラグインを説明から省く
}
$contents = mb_strimwidth(strip_htmltag(convert_html($source)), 0, RSS_DESP_LENGTH, '...');
$contents = preg_replace_callback('/(&[^;]+;)/', 'plugin_rss_html_entity_decode', $contents);
$contents = plugin_rss_utf8_for_xml($contents);
switch ($version) {
case '0.91':
/* FALLTHROUGH */
/* FALLTHROUGH */
case '2.0':
$date = get_date('D, d M Y H:i:s T', $time);
$date = $version == '0.91' ? ' <description>' . $date . ' -- ' . $contents . '</description>' : ' <pubDate>' . $date . '</pubDate>' . ' <description>' . $contents . '</description>';
$items .= <<<EOD
<item>
<title>{$title}</title>
<link>{$self}?{$r_page}</link>
{$date}
</item>
EOD;
break;
case '1.0':
// Add <item> into <items>
$rdf_li .= ' <rdf:li rdf:resource="' . $self . '?' . $r_page . '" />' . "\n";
$date = substr_replace(get_date('Y-m-d\\TH:i:sO', $time), ':', -2, 0);
$trackback_ping = '';
if ($trackback) {
$tb_id = md5($r_page);
$trackback_ping = ' <trackback:ping>' . $self . '?tb_id=' . $tb_id . '</trackback:ping>';
}
$items .= <<<EOD
<item rdf:about="{$self}?{$r_page}">
<title>{$title}</title>
<link>{$self}?{$r_page}</link>
<description><![CDATA[{$contents}]]></description>
开发者ID:big2men,项目名称:qhm,代码行数:67,代码来源:rss.inc.php
示例15: plugin_weblog_rss_action
function plugin_weblog_rss_action()
{
global $rss_max, $page_title, $WikiName, $BracketName, $script, $whatsnew, $trackback, $use_static_url, $anon_writable;
global $vars;
global $options, $_weblog_msgs;
//コンフィグの読み込み(指定weblog固有)
$conf_name = $vars['config'];
$options = weblog_get_options($conf_name, $options);
$page = strip_bracket($options['PREFIX']);
$with_content = $vars['content'];
$list_count = $vars['count'];
if ($list_count == 0) {
$list_count = $rss_max;
}
$lines = get_existpages(false, $page, $list_count, " ORDER BY editedtime DESC", true);
header("Content-type: application/xml");
if (is_page($page)) {
$linkpage = $page;
} else {
if (strrchr($page, "/")) {
$_p = substr($page, 0, -strlen(strrchr($page, "/")));
if (is_page($_p)) {
$linkpage = $_p;
}
} else {
$linkpage = $whatsnew;
}
}
if ($use_static_url) {
$linkpage_url = XOOPS_WIKI_URL . "/" . get_pgid_by_name($linkpage) . ".html";
} else {
$linkpage_url = $script . "?" . rawurlencode($linkpage);
}
$page_title_utf8 = $page_title;
if (function_exists("mb_convert_encoding")) {
$page_title_utf8 = mb_convert_encoding($page_title_utf8, "UTF-8", "auto");
// $page_utf8 = mb_convert_encoding($linkpage,"UTF-8","auto");
$page_utf8 = mb_convert_encoding($options['NAME'], "UTF-8", "auto");
$page_add_utf8 = $linkpage ? "-" . $page_utf8 : "";
}
$item = "";
$rdf_li = "";
foreach ($lines as $line) {
$vars['page'] = $line;
$page_name = strip_bracket($line);
if (!preg_match("/^(.*\\/)?[0-9\\-]+\$/", $page_name)) {
continue;
}
$src = @join("", get_source($page_name));
$sources = $src;
if (preg_match("/\\&weblog_field\\(__SUBJECT\\)\\{([^}]+)\\}\\;/m", $sources, $match)) {
$subject = $match[1];
}
if (preg_match("/\\&weblog_field\\(__AUTHOR\\)\\{([^}]+)\\}\\;/m", $sources, $match)) {
$author = $match[1];
}
if (preg_match("/\\&weblog_field\\(__CATEGORY,:([^\\)]+)\\)\\{([^}]+)\\}\\;((\\[ )?\\[\\[.*\\]\\]( \\])?)+/m", $sources, $match)) {
$catpath = $match[1];
$category = $match[2];
}
if (preg_match("/#weblog_field\\(__BODY\\,Start\\)\\s*\n(.*\n)#weblog_field\\(__BODY\\,End\\)\n/ms", $sources, $match)) {
$body = $match[1];
$body = preg_replace("/\\s*((\r\n)|(\r)|(\n))/", "\n", $body);
}
$title = mb_convert_encoding($subject, "UTF-8", "auto");
$url = strip_bracket($line);
// if ($page) $title = preg_replace("/^".preg_quote($page_utf8,"/")."\//","",$title);
$title = htmlspecialchars($title);
$desc = date("D, d M Y H:i:s T", filemtime(get_filename(encode($line))));
$dcdate = substr_replace(date("Y-m-d\\TH:i:sO", filemtime(get_filename(encode($line)))), ':', -2, 0);
if ($use_static_url) {
$link_url = XOOPS_WIKI_URL . "/" . get_pgid_by_name($line) . ".html";
} else {
$link_url = $script . "?" . rawurlencode($url);
}
$items .= "<item rdf:about=\"" . $link_url . "\">\n";
$items .= " <title>{$title}</title>\n";
$items .= " <link>" . $link_url . "</link>\n";
$items .= " <dc:date>{$dcdate}</dc:date>\n";
$_anon_writable = $anon_writable;
$anon_writable = 0;
$desc = convert_html($body, false, false);
$desc = mb_convert_encoding(mb_substr(strip_htmltag($desc), 0, 250, "EUC-JP"), "UTF-8", "auto");
$desc = htmlspecialchars($desc);
$desc = mb_ereg_replace("\n", "", $desc);
$items .= " <description>{$desc}</description>\n";
if ($with_content == "true") {
$src = preg_replace("/\\&weblog_field\\(__EDIT\\,[^\\)]+\\);/m", "", $src);
$content = convert_html($src, false, false);
$content = mb_convert_encoding($content, "UTF-8", "auto");
$content = preg_replace("/\\<input [^\\>]+\\/>(\n)?/ms", "", $content);
$content = preg_replace("/^(\\s*\n)+/mS", "\n", $content);
$content = preg_replace("/\\s*\\<br \\/\\>\\s*/mS", "<br />", $content);
$content = preg_replace("/class\\=\"p\\_right\"/", 'style="text-align:right;"', $content);
$items .= "<content:encoded>\n<![CDATA[\n";
$items .= "{$content}\n";
$items .= "]]>\n</content:encoded>\n";
}
$anon_writable = $anon_writable = 0;
//trackback
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:101,代码来源:weblog_rss.inc.php
示例16: plugin_mixirss_action
function plugin_mixirss_action()
{
global $vars, $get, $post, $rss_max, $rss_description, $page_title, $whatsnew;
global $modifier;
global $exclude_plugin;
global $memcache;
$version = isset($vars['ver']) ? $vars['ver'] : '';
switch ($version) {
case '':
$version = '1.0';
break;
// mixi Default
// mixi Default
case '1':
$version = '1.0';
break;
case '2':
$version = '2.0';
break;
case '0.91':
/* FALLTHROUGH */
/* FALLTHROUGH */
case '1.0':
/* FALLTHROUGH */
/* FALLTHROUGH */
case '2.0':
break;
default:
die('Invalid RSS version!!');
}
// Official Main routine ...
$page_title_utf8 = mb_convert_encoding($page_title, 'UTF-8', SOURCE_ENCODING);
$rss_description_utf8 = mb_convert_encoding(htmlspecialchars($rss_description), 'UTF-8', SOURCE_ENCODING);
// Disable plugin
$exclude_plugin[] = 'include';
$self = get_script_absuri();
change_uri('', 1);
// Force absoluteURI.
// Creating <item>
$items = $rdf_li = '';
foreach (Recent::get() as $page => $time) {
$wiki = Factory::Wiki($page);
$r_page = rawurlencode($page);
$url = $wiki->uri();
$title = mb_convert_encoding($page, 'UTF-8', SOURCE_ENCODING);
switch ($version) {
case '0.91':
/* FALLTHROUGH */
/* FALLTHROUGH */
case '2.0':
$date = get_date('D, d M Y H:i:s T', $time);
$date = $version == '0.91' ? ' <description>' . $date . '</description>' : ' <pubDate>' . $date . '</pubDate>';
$items .= <<<EOD
<item>
<title>{$title}</title>
<link>{$url}</link>
{$date}
</item>
EOD;
break;
case '1.0':
// Add <item> into <items>
// $rdf_li .= ' <rdf:li rdf:resource="' . $url . '" />' . "\n";
$date = substr_replace(get_date('Y-m-d\\TH:i:sO', $time), ':', -2, 0);
if (plugin_mixirss_isValidDate(substr($page, -10)) && check_readable($page, false, false)) {
// for Calendar/MiniCalendar
$get['page'] = $post['page'] = $vars['page'] = $page;
$source = get_source($page);
$rdf_hx = '';
$rdf_lx = '';
$itemhx = '';
$itemlx = '';
while (!empty($source)) {
$line = array_shift($source);
if (preg_match('/^(\\*{1,3})(.*)\\[#([A-Za-z][\\w-]+)\\](.*)$/m', $line, $matches)) {
$anchortitle = strip_htmltag(RendererFactory::factory($matches[2]));
$anchortitle = preg_replace("/[\r\n]/", ' ', $anchortitle);
$anchortitle = '<![CDATA[' . mb_convert_encoding($anchortitle, 'UTF-8', SOURCE_ENCODING) . '(' . $title . ')' . ']]>';
$sharp = '#';
$rdf_hx .= ' <rdf:li rdf:resource="' . $url . $sharp . $matches[3] . '" />' . "\n";
$itemhx .= <<<EOD
<item rdf:about="{$url}{$sharp}{$matches[3]}">
<title>{$anchortitle}</title>
<link>{$url}{$sharp}{$matches[3]}</link>
<dc:date>{$date}</dc:date>
<dc:identifier>{$url}{$sharp}{$matches[3]}</dc:identifier>
</item>
EOD;
} else {
if (preg_match('/^(\\-{1,3})(.*)$/m', $line, $matches)) {
$anchortitle = strip_htmltag(RendererFactory::factory($matches[2]));
$anchortitle = preg_replace("/[\r\n]/", ' ', $anchortitle);
$anchortitle = '<![CDATA[' . mb_convert_encoding($anchortitle, 'UTF-8', SOURCE_ENCODING) . '(' . $title . ')' . ']]>';
$sharp = '#';
$rdf_lx .= ' <rdf:li rdf:resource="' . $url . '" />' . "\n";
$itemlx .= <<<EOD
<item rdf:about="{$url}">
<title>{$anchortitle}</title>
<link>{$url}</link>
<dc:date>{$date}</dc:date>
//.........这里部分代码省略.........
开发者ID:logue,项目名称:pukiwiki_adv,代码行数:101,代码来源:mixirss.inc.php
示例17: plugin_mceedit_inline
function plugin_mceedit_inline()
{
static $usage = '&edit(pagename#anchor[[,noicon],nolabel])[{label}];';
global $script, $vars, $fixed_heading_edited;
global $_symbol_paraedit;
if (!$fixed_heading_edited || is_freeze($vars['page'])) {
return '';
}
$args = func_get_args();
$s_label = strip_htmltag(array_pop($args), FALSE);
// {label}. Strip anchor tags only
if ($s_label == '') {
$s_label = $_symbol_paraedit;
}
list($page, $id) = array_pad($args, 2, '');
if (!is_page($page)) {
$page = $vars['page'];
}
if ($id != '') {
$id = '&id=' . rawurlencode($id);
}
$r_page = rawurlencode($page);
return "<a class=\"anchor_super\" href=\"{$script}?cmd=edit&page={$r_page}{$id}\">{$s_label}</a>";
}
开发者ID:orangeal2o3,项目名称:pukiwiki-plugin,代码行数:24,代码来源:mceedit.inc.php
示例18: plugin_tabbox_convert
function plugin_tabbox_convert()
{
static $s_tab_cnt = 0;
static $s_tab_confnum = 0;
//jquery ライブラリの読み込み
$qt = get_qt();
$qt->setv('jquery_include', true);
$args = func_get_args();
$last = func_num_args() - 1;
$body = '';
$ret = $head = '';
$options = array('tab' => PLUGIN_TABBOX_DEF_TAB, 'selected' => PLUGIN_TABBOX_DEF_SELECTED, 'hover' => PLUGIN_TABBOX_DEF_HOVER, 'box' => PLUGIN_TABBOX_DEF_BOX, 'default' => PLUGIN_TABBOX_DEF_DEFAULT, 'height' => PLUGIN_TABBOX_DEF_HEIGHT);
$config = false;
foreach ($args as $arg) {
if (trim($arg) == 'conf') {
$config = true;
}
}
if ($config) {
if ($last > 0) {
$body = array_pop($args);
}
$options['conf'] = 'conf';
$s_tab_confnum++;
} else {
if ($s_tab_cnt == 0) {
$s_tab_confnum++;
}
$body = array_pop($args);
foreach ($args as $arg) {
list($key, $val) = explode('=', $arg, 2);
$options[$key] = htmlspecialchars($val);
}
$options['tab'] = isset($options['tab']) ? $options['tab'] : PLUGIN_TABBOX_DEF_TAB;
$options['selected'] = isset($options['selected']) ? $options['selected'] : PLUGIN_TABBOX_DEF_SELECTED;
$options['hover'] = isset($options['hover']) ? $options['hover'] : PLUGIN_TABBOX_DEF_HOVER;
$options['box'] = isset($options['box']) ? $options['box'] : PLUGIN_TABBOX_DEF_BOX;
$options['default'] = isset($options['default']) ? $options['default'] : PLUGIN_TABBOX_DEF_DEFAULT;
$options['height'] = isset($options['height']) ? $options['height'] : PLUGIN_TABBOX_DEF_HEIGHT;
}
$body = str_replace("\r", "\n", str_replace("\r\n", "\n", $body));
// confが指定された場合
if (isset($options['conf'])) {
$tmp = explode("\n", $body);
foreach ($tmp as $buff) {
list($key, $val) = explode('=', $buff, 2);
$options[$key] = htmlspecialchars($val);
}
// confに指定がない場合、デフォルトを設定
$options['tab'] = isset($options['tab']) ? $options['tab'] : PLUGIN_TABBOX_DEF_TAB;
$options['selected'] = isset($options['selected']) ? $options['selected'] : PLUGIN_TABBOX_DEF_TAB;
$options['hover'] = isset($options['hover']) ? $options['hover'] : PLUGIN_TABBOX_DEF_HOVER;
$options['box'] = isset($options['box']) ? $options['box'] : PLUGIN_TABBOX_DEF_BOX;
$options['default'] = isset($options['default']) ? $options['default'] : PLUGIN_TABBOX_DEF_DEFAULT;
$options['height'] = isset($options['default']) ? $options['default'] : PLUGIN_TABBOX_DEF_HEIGHT;
} else {
$lines = explode("\n", $body);
$buff = "";
$box = array();
$title = array();
$link = array();
foreach ($lines as $l) {
if (preg_match("/^\\*\\s?(.*)\$/", $l, $matches)) {
if (count($title) > 0) {
$box[] = $buff;
}
$tmp = strip_htmltag(substr(convert_html($matches[1]), 3, -5), FALSE);
$title[] = $tmp;
$buff = '';
} else {
$buff .= "{$l}\n";
}
}
if (count($title) > 0) {
$box[] = $buff;
}
}
// はじめての定義の場合、javascriptを出力
if ($s_tab_cnt == 0) {
$head = '
<script type="text/javascript">
<!--
$(document).ready(function(){
$("div.max").each(function(){
var maxh = 0;
$(this).find("div").each(function(){
if ($(this).height() > maxh) {
maxh = $(this).height();
}
});
$(this).find("div").each(function(){
$(this).height(maxh);
});
});
$("div.tabpanel > div.tabbox").hide();
if (window.location.hash.length == 0) {
// default指定があるため
}
//.........这里部分代码省略.........
开发者ID:big2men,项目名称:qhm,代码行数:101,代码来源:tabbox.inc.php
示例19: toc_convert_index
function toc_convert_index($idx, $lvl)
{
global $plugin_num_proc;
global $fixed_heading_edited;
global $fixed_heading_anchor;
static $num = 0;
// 不要な行のカウント
$off = 0;
foreach ($idx as $id => $data) {
if ($data['sw']) {
break;
}
$off++;
}
// 全行を変換
$lines = array();
foreach ($idx as $id => $data) {
$lines[] = $data['dat'];
}
$plugin_num_proc = 'toc' . $num++;
$bkup_fixed_heading_edited = $fixed_heading_edited;
$fixed_heading_edited = 0;
$html = convert_html($lines);
$html = ereg_replace("\r|\n", '', $html);
// \r \n の除去
$fixed_heading_edited = $bkup_fixed_heading_edited;
$rc = $matches = array();
$i = 0;
while (preg_match("'<h(.?)(.*?)>(.*?)</h.?>'si", $html, $matches)) {
if (!empty($matches[2])) {
preg_match("'^id=\"(.*?)\"'si", trim($matches[2]), $mat);
$matches[2] = $mat[1];
}
if ($off > $i) {
$i++;
$html = str_replace($matches[0], '', $html);
// 該当行の削除
$matches = array();
continue;
}
$dat_lvl = $matches[1] - 1;
if (!toc_from_to_check($lvl, $dat_lvl)) {
continue;
}
if (empty($matches[2])) {
$rc[$i]['tag'] = '';
} else {
$rc[$i]['tag'] = '#';
// convert_html すると、h2_content_X_1 の X の部分がカウントアップされてしまうので対処する
if ($fixed_heading_anchor) {
$rc[$i]['tag'] .= $matches[2];
} else {
$matches2 = array();
// h2_content_1_1
if (preg_match("'h(.+)_content_(.+)_(.+)'si", $matches[2], $matches2)) {
$rc[$i]['tag'] .= 'h' . $matches2[1] . '_content_' . --$matches2[2] . '_' . $matches2[3];
} else {
$rc[$i]['tag'] .= $matches[2];
}
}
}
$rc[$i]['dat'] = strip_htmltag($matches[3]);
$rc[$i]['lvl'] = $dat_lvl;
$i++;
$html = str_replace($matches[0], '', $html);
// 該当行の削除
$matches = array();
}
return $rc;
}
开发者ID:logue,项目名称:pukiwiki_adv,代码行数:70,代码来源:toc.inc.php
示例20: makelink_metalines
function makelink_metalines()
{
$metalines = array();
foreach ($this->metalines as $metaline) {
$anchor = $metaline['anchor'];
$headline = $metaline['headline'];
$headline = strip_htmltag(make_link($headline));
// convert inline
|
请发表评论