本文整理汇总了PHP中format_html函数的典型用法代码示例。如果您正苦于以下问题:PHP format_html函数的具体用法?PHP format_html怎么用?PHP format_html使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了format_html函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _create_key_tree
/**
*
* 建树
* @param unknown_type $item
* @param unknown_type $name
* @param unknown_type $full_key
* @param unknown_type $is_last
* @param unknown_type $return_html
*/
private function _create_key_tree($item, $name, $full_key, $is_last, &$return_html)
{
$this->_nowLevel = $full_key !== '' ? count(explode(SEPERATOR, $full_key)) : 0;
$this->_create_key_tree_head($item, $name, $full_key, $is_last, $return_html);
if (count($item) > 0) {
$tree_sub2 = array();
if ($full_key != $this->_sub_key) {
//因为dom的ID不能包含冒号: 所以将:替换为___
$tree_sub2[] = '<li class="folder' . (empty($full_key) ? '' : ' collapsed') . ($is_last ? ' last' : '') . '" title="' . urlencode($full_key) . '" id="keyid_' . str_replace(SEPERATOR, '___', $full_key) . '">';
$tree_sub2[] = '<div class="icon">' . format_html($name) . ' <span class="info">(' . count($item) . ')</span>';
$tree_sub2[] = !empty($full_key) ? '<a href="#" class="refresh" onclick="return refreshTree(this)"><img src="' . base_url('static/images/refresh.png') . '" width="10" height="10" title="刷新当前节点" alt="[X]"></a>' : '';
$tree_sub2[] = !empty($full_key) ? '<a href="' . manager_site_url('export', 'index', 'key=' . urlencode($full_key) . ':*') . '" class="export"><img src="' . base_url('static/images/export.png') . '" width="10" height="10" title="导出当前节点" alt="[X]"></a>' : '';
$tree_sub2[] = !empty($full_key) ? '<a href="' . manager_site_url('delete', 'index', 'tree=' . urlencode($full_key) . ':') . '" class="deltree"><img src="' . base_url('static/images/delete.png') . '" width="10" height="10" title="删除整个树" alt="[X]"></a>' : '';
$tree_sub2[] = '</div>';
}
$tree_sub2[] = '<ul>';
$return_html[] = implode(PHP_EOL, $tree_sub2);
if ($this->_nowLevel < $this->_auto_build_tree_level && is_array($item)) {
$l = count($item);
foreach ($item as $childname => $childitem) {
if (empty($full_key)) {
$childfullkey = $childname;
} else {
$childfullkey = $full_key . SEPERATOR . $childname;
}
$this->_create_key_tree($childitem, $childname, $childfullkey, --$l == 0, $return_html);
}
}
$return_html[] = '</ul>';
if ($full_key != $this->_sub_key) {
$return_html[] = '</li>';
}
}
}
示例2: stripslashes
<td colspan=2>
<b><?php
echo stripslashes($row["vKBTitle"]);
?>
</b>
</td>
</tr>
<tr align="left" class="listingmaintext">
<td colspan=2>
<?php
?>
<?PHP// echo format_html(nl2br(htmlentities($row["tKBDesc"]))); ?>
<?php
echo format_html(nl2br(stripslashes($row["tKBDesc"])));
?>
</td>
</tr>
<tr align="left" class="listingmaintext">
<td colspan="5" class="dotedhoriznline" height="1"><img src="./images/spacerr.gif" width="1" height="1"></td>
</tr>
<?php
$cnt++;
}
mysql_free_result($rs);
?>
<tr class="listingmaintext">
<td align="left" width="30%"><?php
echo $navigate[1] . " " . TEXT_OF . " " . $totalrows . " " . TEXT_RESULTS;
?>
示例3: format_html
?>
<?php
/* Disable phone number detection on apple devices. */
?>
<meta name=format-detection content="telephone=no">
<?php
/* I don't think we ever want this to be indexed*/
?>
<meta name=robots content="noindex,nofollow,noarchive">
<meta name=author content="https://github.com/ErikDubbelboer/">
<title><?php
echo format_html($server['host']);
?>
- phpRedisAdmin</title>
<?php
foreach ($page['css'] as $css) {
?>
<link rel=stylesheet href="css/<?php
echo $css;
?>
.css?v1" media=all>
<?php
}
?>
<link rel="shortcut icon" href="images/favicon.png">
示例4: db_query
<?php
include "../../include.php";
if ($posting) {
$theuser_id = $page['is_admin'] ? $_POST["created_user"] : $_SESSION["user_id"];
db_query("UPDATE press_releases SET\n\t\t\theadline = '{$_POST["headline"]}',\t\n\t\t\tdetail = '{$_POST["detail"]}',\t\n\t\t\tlocation = '{$_POST["location"]}',\t\n\t\t\ttext = '" . format_html($_POST["text"]) . "',\t\n\t\t\tcorporationID = {$_POST["corporationID"]},\n\t\t\tupdated_date = GETDATE(),\n\t\t\tupdated_user = {$theuser_id}\n\t\t\tWHERE id = " . $_GET["id"]);
url_change("../?id=" . $_GET["id"]);
}
echo drawTop();
$r = db_grab("SELECT id, headline, detail, location, releaseDate, corporationID, text FROM press_releases WHERE id = " . $_GET["id"]);
$form = new intranet_form();
if ($page['is_admin']) {
$form->addUser("created_user", "Posted By", $_SESSION["user_id"], false, "EEDDCC");
}
$form->addRow("itext", "Headline", "headline", $r["headline"], "", true, 255);
$form->addRow("itext", "Detail", "detail", $r["detail"], "", false, 255);
$form->addRow("itext", "Location", "location", $r["location"], "", true, 255);
$form->addRow("select", "Organization", "corporationID", "SELECT id, title from organizations ORDER BY title", $r["corporationID"]);
$form->addRow("date", "Date", "releaseDate", $r["releaseDate"]);
$form->addRow("textarea", "Text", "text", $r["text"], "", true);
$form->addRow("submit", "update press release");
$form->draw("Update Release");
echo drawBottom();
示例5: isset
<p id="scorep">
<label for="score">Score:</label>
<input type="text" name="score" id="score" size="30" <?php
echo isset($_GET['score']) ? 'value="' . format_html($_GET['score']) . '"' : '';
?>
>
</p>
<p>
<label for="value">Value:</label>
<textarea name="value" id="value" cols="80" rows="20"><?php
echo nl2br(format_html($value));
?>
</textarea>
</p>
<input type="hidden" name="oldvalue" value="<?php
echo format_html($value);
?>
">
<p>
<input type="submit" class="button" value="<?php
echo $edit ? 'Edit' : 'Add';
?>
">
</p>
</form>
<?php
require 'footer.inc.php';
示例6: isset
<?php
PagerWidget::header();
?>
<h2>
导出数据
<?php
echo isset($key) ? format_html($key) : '';
?>
</h2>
<form action="" method="post">
<p>
<label for="type">数据格式:</label>
<select name="type" id="type">
<option value="redis" <?php
echo isset($type) && $type == 'redis' ? 'selected="selected"' : '';
?>
>Redis</option>
<option value="json" <?php
echo isset($type) && $type == 'json' ? 'selected="selected"' : '';
?>
>JSON</option>
</select>
</p>
<p>
<input type="submit" class="button" value="导出">
</p>
</form>
<?php
PagerWidget::footer();
示例7: print_namespace
function print_namespace($item, $name, $fullkey, $islast) {
global $config, $redistypes, $server, $redis;
// Is this also a key and not just a namespace?
if (isset($item['__phpredisadmin__'])) {
// Unset it so we won't loop over it when printing this namespace.
unset($item['__phpredisadmin__']);
$type = $redis->type($fullkey);
if (!isset($redistypes[$type])) {
return;
}
$type = $redistypes[$type];
$class = array();
$len = false;
if (isset($_GET['key']) && ($fullkey == $_GET['key'])) {
$class[] = 'current';
}
if ($islast) {
$class[] = 'last';
}
// Get the number of items in the key.
if (!isset($config['faster']) || !$config['faster']) {
switch ($type) {
case 'hash':
$len = $redis->hLen($fullkey);
break;
case 'list':
$len = $redis->lSize($fullkey);
break;
case 'set':
// This is currently the only way to do this, this can be slow since we need to retrieve all keys
$len = count($redis->sMembers($fullkey));
break;
case 'zset':
// This is currently the only way to do this, this can be slow since we need to retrieve all keys
$len = count($redis->zRange($fullkey, 0, -1));
break;
}
}
?>
<li<?php echo empty($class) ? '' : ' class="'.implode(' ', $class).'"'?>>
<a href="?view&s=<?php echo $server['id']?>&key=<?php echo urlencode($fullkey)?>"><?php echo format_html($name)?><?php if ($len !== false) { ?><span class="info">(<?php echo $len?>)</span><?php } ?></a>
</li>
<?php
}
// Does this namespace also contain subkeys?
if (count($item) > 0) {
?>
<li class="folder<?php echo empty($fullkey) ? '' : ' collapsed'?><?php echo $islast ? ' last' : ''?>"><div class="icon"><?php echo format_html($name)?> <span class="info">(<?php echo count($item)?>)</span></div>
<ul>
<?php
$l = count($item);
foreach ($item as $childname => $childitem) {
// $fullkey will be empty on the first call.
if (empty($fullkey)) {
$childfullkey = $childname;
} else {
$childfullkey = $fullkey.$config['seperator'].$childname;
}
print_namespace($childitem, $childname, $childfullkey, (--$l == 0));
}
?>
</ul>
</li>
<?php
}
}
示例8: _public_add_info
function _public_add_info($type = 'bbs')
{
$info = $this->_article_info();
if (!$info) {
return;
}
if ($type == 'bbs') {
require_once libfile('function/editor');
$info['content'] = dstripslashes($info['content']);
$info['content'] = img_htmlbbcode($info['content'], $info['page_url']);
$info['content'] = media_htmlbbcode($info['content'], $info['page_url']);
$info['content'] = audio_htmlbbcode($info['content'], $info['page_url']);
$info['content'] = htmlspecialchars_decode(html2bbcode($info['content']));
$info['content'] = dstripslashes(format_html($info['content']));
$script .= '<div id="show_title" style="display:none">' . $info['title'] . '</div><div id="show_content" style="display:none">' . $info['content'] . '</div><script language="javascript" type="text/javascript" >';
$script .= '
var subject = $("show_title").innerHTML;
var message = $("show_content").innerHTML;
$("subject").value= subject;
message = message.replace(/<p>([\\s\\S]*?)<\\/p>/ig, "$1<br />");
message = message.replace(/<center>([\\s\\S]*?)<\\/center>/ig, "[align=center]$1[/align]");
$(\'e_textarea\').value = message;
$("subject").focus();';
$script .= '</script>';
} else {
if ($type == 'portal') {
$script .= '<div id="show_title" style="display:none">' . $info['title'] . '</div><div id="show_content" style="display:none">' . $info['content'] . '</div><script language="javascript" type="text/javascript" >';
$script .= '
var subject = $("show_title").innerHTML;
var message = $("show_content").innerHTML;
$("title").value= subject;
$("from").value= \'' . $this->_public_data($info['from']) . '\';
document.getElementsByName(\'fromurl\')[0].value = \'' . $this->_public_data($info['url']) . '\';
document.getElementsByName(\'author\')[0].value = \'' . $this->_public_data($info['author']) . '\';
$(\'uchome-ttHtmlEditor\').value = message;
var p = window.frames[\'uchome-ifrHtmlEditor\'];
var obj = p.window.frames[\'HtmlEditor\'];
obj.document.body.innerHTML = message;
edit_save();
$("title").focus()';
$script .= '</script>';
} else {
if ($type == 'blog') {
$script .= '<div id="show_title" style="display:none">' . $info['title'] . '</div><div id="show_content" style="display:none">' . $info['content'] . '</div><script language="javascript" type="text/javascript" >';
$script .= '
var subject = $("show_title").innerHTML;
var message = $("show_content").innerHTML;
$("subject").value= subject;
document.getElementsByName(\'tag\')[0].value = \'' . $this->_public_data($info['article_tag']) . '\';
$(\'uchome-ttHtmlEditor\').value = message;
var p = window.frames[\'uchome-ifrHtmlEditor\'];
var obj = p.window.frames[\'HtmlEditor\'];
obj.document.body.innerHTML = message;
edit_save();
$("subject").focus()';
$script .= '</script>';
}
}
}
return $script;
}
示例9: output_update_html
function output_update_html($token, $status, $done, $cancelled, $failed, $err, $errs, $errs_admin = false, $ajax = false)
{
global $fups_url_cancel, $fups_url_notify_email_address, $fups_url_run;
if ($err) {
?>
<div class="fups_error"><?php
echo format_html($err);
?>
</div>
<?php
return;
}
?>
<h3>Status</h3>
<div id="fups_div_status">
<?php
echo htmlspecialchars($status);
?>
</div>
<?php
if ($done) {
$output_info = json_decode(file_get_contents(make_output_info_filename($token)), true);
if ($output_info == null) {
?>
<p>We are sorry, but an unexpected error occurred. The scraping process completed, and the output was created, however we were unable to decode the list of output files. Please feel free to <a href="<?php
echo FUPS_CONTACT_URL;
?>
">contact me</a> for help with accessing your output files, quoting token "<?php
echo $token;
?>
".</p>
<?php
} else {
?>
<p>Success! Your posts were retrieved and the output is ready. The following output files are available:</p>
<table style="border-collapse: collapse;">
<tr><th style="border: 1px solid black;">Description</th><th style="border: 1px solid black;">View/download file (opens in a new window)</th><th style="border: 1px solid black;">File size</th></tr>
<?php
foreach ($output_info as $opv) {
?>
<tr><td style="border: 1px solid black;"><?php
echo $opv['description'];
?>
</td><td style="border: 1px solid black;"><a target="_blank" href="<?php
echo $opv['url'];
?>
">View/download file</a></td><td style="border: 1px solid black;"><?php
echo number_format($opv['size']) . ' bytes';
?>
</td></tr>
<?php
}
?>
</table>
<p>If you're wondering what to do next, here are some possible steps:</p>
<ol>
<li>Click on the "View/download file" link beside the HTML file which is sorted according to your preference. This will open up a new window/tab for that file. Switch to this window/tab if necessary, and then save the page, e.g. in Firefox click the "File" menu option and under that click "Save Page As". Select the directory/folder and filename you wish to save this output as (remember this location for the next step).</li>
<li>Start up a word processor such as LibreOffice/OpenOffice or Microsoft Word. Open up in that word processor the HTML file that you saved in the previous step, e.g. click the "File" menu option and under that click "Open", then select the file you saved in the previous step. You are now free to edit the file as you like. You can now (if you so desire) save the file in a friendlier format than HTML, a format such as your editor's default format, e.g. in LibreOffice, click the "File" menu option and then click "Save As" or "Export", and choose the format you desire.</li>
</ol>
<?php
show_delete($token, true);
}
} else {
if ($cancelled) {
?>
<p>Cancelled by your request.</p>
<?php
show_delete($token, false);
} else {
if ($failed) {
?>
<p>The script appears to have exited due to an error; the error message is shown below. I have been notified of this error by email; if you would like me to get back to you if/when I have fixed the error, then please enter your email address into the following box and press the button to notify me of it.</p>
<div>
<form method="post" action="<?php
echo $fups_url_notify_email_address;
?>
">
<input type="hidden" name="token" value="<?php
echo $token;
?>
" />
<label for="email_address.id">Your contact email address:</label><br />
<input type="text" name="email_address" id="email_address.id" /><br />
<label for="message.id">Any message you'd like to include (leaving this blank is fine):</label><br />
<textarea rows="5" cols="80" name="message" id="message.id"></textarea><br />
<input type="submit" value="Notify the FUPS maintainer" />
</form>
</div>
<p>Alternatively, feel free to retry or to <a href="<?php
echo FUPS_CONTACT_URL;
?>
">contact me</a> manually about this error, quoting your run token of "<?php
echo $token;
?>
//.........这里部分代码省略.........
示例10: format_post_bits
<?php
include "../include.php";
if ($posting) {
format_post_bits("isAdmin,temporary");
$_POST["description"] = format_html($_POST["description"]);
db_enter("bulletin_board_topics", "title description isAdmin temporary");
//db_query("UPDATE bulletin_board_topics SET threadDate = GETDATE() WHERE id = " . $_GET["id"]); don't do this
syndicateBulletinBoard();
url_change("topic.php?id=" . $_GET["id"]);
}
drawTop();
$t = db_grab("SELECT title, description, isAdmin, temporary, createdBy FROM bulletin_board_topics WHERE id = " . $_GET["id"]);
$form = new intranet_form();
if ($isAdmin) {
$form->addUser("createdBy", "Posted By", $t["createdBy"], false, true);
$form->addCheckbox("isAdmin", "Admin Post?", $t["isAdmin"], "(check if yes)", true);
}
$form->addCheckbox("temporary", "Lifespan", $t['temporary'], "Check Box to Delete Post After 30 Days");
$form->addRow("itext", "Subject", "title", $t["title"], "", true);
$form->addRow("textarea", "Message", "description", $t["description"], "", true);
$form->addRow("submit", "edit topic");
$form->draw("Edit Bulletin Board Topic");
drawBottom();
示例11: format_html
<?php
PagerWidget::header();
?>
<h2>重命名
<?php
echo format_html($key);
?>
</h2>
<form action="" method="post">
<input type="hidden" name="old" value="<?php
echo format_html($key);
?>
">
<p>
<label for="key">Key:</label>
<input type="text" name="key" id="key" size="30"value="<?php
echo format_html($key);
?>
">
</p>
<p>
<input type="submit" class="button" value="重命名">
</p>
</form>
<?php
PagerWidget::footer();
示例12: if
?><!DOCTYPE html>
<html lang=en>
<head>
<meta charset=utf-8>
<?php if (is_ie()) {
// Always force latest IE rendering engine and chrome frame (also hides compatibility mode button)
?><meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1"><?php
} ?>
<meta name=author content="https://github.com/ErikDubbelboer/">
<?php /* I don't think we ever want this to be indexed*/ ?>
<meta name=robots content="noindex,nofollow,noarchive">
<title><?php echo format_html($server['host'])?> - phpRedisAdmin</title>
<?php foreach ($page['css'] as $css) { ?>
<link rel=stylesheet href="css/<?php echo $css; ?>.css?v1" media=all>
<?php } ?>
<link rel="shortcut icon" href="images/favicon.png">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.js"></script>
<?php foreach ($page['js'] as $js) { ?>
<script src="js/<?php echo $js; ?>.js?v1"></script>
<?php } ?>
</head>
<body>
示例13: format_post_html
function format_post_html($fieldnames)
{
//takes a comma-separated list of POST keys and formats the html in them
global $_POST;
$fields = array_post_fields($fieldnames);
foreach ($fields as $field) {
$return = format_html($_POST[$field]);
$_POST[$field] = empty($return) ? "NULL" : "'" . $_POST[$field] . "'";
}
}
示例14: main
/**
* Main Function
*
* @access public
* @param int $argc The number of command line arguments
* @param array &$argv The command line arguments
* @uses $GLOBALS['SOURCEKIND']
* @uses downwiki()
* @uses downhtml()
* @uses downattach()
*/
function main($argc, &$argv)
{
if ($argc < 2) {
$help = '';
$help .= '$ php pkwkdownloader.php [option...] pkwkurl' . "\n";
$help .= '$ php pkwkdownloader.php --format [option...] pkwkurl' . "\n";
$help .= 'Examples)' . "\n";
$help .= '$ php pkwkdownloader.php -p [adminpass] -un [read username] -up [read userpass] -k html -d html/ http://example.com/pukiwiki/index.php' . "\n";
$help .= '$ php pkwkdownloader.php -p [adminpass] -un [read username] -up [read userpass] -k wiki -d wiki/ http://example.com/pukiwiki/index.php' . "\n";
$help .= '$ php pkwkdownloader.php -p [adminpass] -un [read username] -up [read userpass] -k attach -d attach/ http://example.com/pukiwiki/index.php' . "\n";
$help .= '$ php pkwkdownloader.php --format -d html/ -s relative http://example.com/pukiwiki/index.php' . "\n";
$help .= 'Please see http://lsx.sourceforge.jp/?pkwkdownloader.php for further details' . "\n";
$help .= 'NOTE: PukiWiki Plus! requires adminpss always. This must be fixed in the future.' . "\n";
print $help;
exit;
}
while (($arg = next($argv)) !== FALSE) {
// skip $argv[0]
switch ($arg) {
case '-d':
case '--directory-prefix':
$GLOBALS['DOWNDIR'] = next($argv);
if (strrpos($GLOBALS['DOWNDIR'], '/') !== strlen($GLOBALS['DOWNDIR']) - 1) {
$GLOBALS['DOWNDIR'] .= '/';
}
break;
case '-k':
case '--kind':
$GLOBALS['SOURCEKIND'] = next($argv);
break;
case '-c':
case '--continue':
$GLOBALS['CONTINUE'] = TRUE;
break;
case '-w':
case '--waittime':
$GLOBALS['WAITTIME'] = next($argv);
break;
case '-p':
case '--password':
$GLOBALS['ADMINPASS'] = next($argv);
break;
case '-un':
case '--username':
$GLOBALS['USERNAME'] = next($argv);
break;
case '-up':
case '--userpass':
$GLOBALS['USERPASS'] = next($argv);
break;
case '-g':
case '--filter':
$GLOBALS['FILTER'] = next($argv);
break;
case '-v':
case '--except':
$GLOBALS['EXCEPT'] = next($argv);
break;
case '-m':
case '--format':
$GLOBALS['FORMAT'] = TRUE;
break;
case '-s':
case '-=urlstyle':
$GLOBALS['URLSTYLE'] = next($argv);
break;
case '-e':
case '--encode':
$GLOBALS['ENCODE'] = next($argv);
break;
case '-p':
case '-publichome':
$GLOBALS['PUBLICHOME'] = next($argv);
break;
default:
$GLOBALS['PKWKURL'] = $arg;
$GLOBALS['PKWKBASEURL'] = substr($GLOBALS['PKWKURL'], 0, strrpos($GLOBALS['PKWKURL'], '/')) . '/';
break;
}
}
if ($GLOBALS['PKWKURL'] === '') {
print 'No PukiWiki Top URL was specified. exit. ';
exit;
}
if ($GLOBALS['FORMAT']) {
format_html();
exit;
}
switch ($GLOBALS['SOURCEKIND']) {
//.........这里部分代码省略.........
示例15: db_query
<?php
include "../../include.php";
if (url_action("delete")) {
db_query("UPDATE press_releases SET \n\t\t\t\tdeleted_date = GETDATE(),\n\t\t\t\tdeleted_user = {$_SESSION["user_id"]},\n\t\t\t\tis_active = 0\n\t\t\tWHERE id = " . $_GET["id"]);
url_drop();
} elseif ($posting) {
$theuser_id = $page['is_admin'] ? $_POST["created_user"] : $_SESSION["user_id"];
db_query("INSERT INTO press_releases (\n\t\theadline,\n\t\tdetail,\n\t\tlocation,\n\t\treleaseDate,\n\t\ttext,\n\t\tcorporationID,\n\t\tcreated_date,\n\t\tcreated_user,\n\t\tis_active\n\t) VALUES (\n\t\t'" . $_POST["headline"] . "',\n\t\t'" . $_POST["detail"] . "',\n\t\t'" . $_POST["location"] . "',\n\t\t" . format_post_date("releaseDate") . ",\n\t\t'" . format_html($_POST["text"]) . "',\n\t\t" . $_POST["corporationID"] . ",\n\t\tGETDATE(),\n\t\t" . $theuser_id . ",\n\t\t1\n\t)");
url_change();
}
echo drawTop();
if (url_id()) {
$r = db_grab("SELECT\n\t\t\theadline,\n\t\t\tdetail,\n\t\t\tlocation,\n\t\t\ttext,\n\t\t\treleaseDate\n\t\tFROM press_releases\n\t\tWHERE id = " . $_GET["id"]);
?>
<table class="left" cellspacing="1">
<?php
if ($page['is_admin']) {
echo drawHeaderRow("Press Release", 1, "edit", "edit/?id=" . $_GET["id"]);
} else {
echo drawHeaderRow("Press Release", 1);
}
?>
<tr>
<td style="padding:20px;" class="text">
<h1><?php
echo $r["headline"];
?>
</h1>
<b><?php
echo $r["detail"];