本文整理汇总了PHP中bbcode::edit方法的典型用法代码示例。如果您正苦于以下问题:PHP bbcode::edit方法的具体用法?PHP bbcode::edit怎么用?PHP bbcode::edit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bbcode
的用法示例。
在下文中一共展示了bbcode::edit方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
<?php
if (!defined('PROPER_START')) {
header("HTTP/1.0 403 Forbidden");
exit;
}
try {
$message = api::send('message/list', array('id' => $_GET['id']));
$message = $message[0];
$messages = api::send('message/list', array('parent' => $_GET['id']));
} catch (Exception $e) {
template::redirect('/admin/messages');
}
if (!$message['id'] || !$_GET['id']) {
template::redirect('/admin/messages');
}
$content .= "\n\t<div class=\"panel\">\n\t\t<div class=\"top\">\n\t\t\t<div class=\"left\" style=\"width: 600px;\">\n\t\t\t\t<h3>{$message['title']}</h3>\n\t\t\t</div>\n\t\t\t<div class=\"right\" style=\"width: 400px; float: right; text-align: right;\">\n\t\t\t\t<a class=\"button classic\" href=\"#\" onclick=\"\$('#reply').dialog('open'); return false;\" style=\"width: 180px; height: 22px; float: right;\">\n\t\t\t\t\t<span style=\"display: block; padding-top: 3px;\">{$lang['reply']}</span>\n\t\t\t\t</a>\n\t\t\t</div>\n\t\t\t<div class=\"clear\"></div><br /><br />\n\t\t</div>\n\t\t<div class=\"container\">\n\t\t\t<div class=\"topic\">\n";
foreach ($messages as $m) {
$content .= "\n\t\t\t\t<div class=\"message\">\n\t\t\t\t\t<div class=\"toppart\">\n\t\t\t\t\t\t<div class=\"messageid\">\n\t\t\t\t\t\t\t#{$m['id']}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"date\">\n\t\t\t\t\t\t\t" . date($lang['dateformat'], $m['date']) . "\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"icons\">\n\t\t\t\t\t\t\t<a href=\"#\" onclick=\"showEdit('{$m['id']}'); return false;\"><img class=\"link\" src=\"/{$GLOBALS['CONFIG']['SITE']}/images/icons/small/pencil.png\" alt=\"\" /></a>\n\t\t\t\t\t\t\t<a href=\"#\" onclick=\"\$('#id').val('{$m['id']}'); \$('#delete').dialog('open'); return false;\"><img class=\"link\" src=\"/{$GLOBALS['CONFIG']['SITE']}/images/icons/small/close.png\" alt=\"\" /></a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"clear\"></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"meta\">\n\t\t\t\t\t\t<a href=\"/admin/users/detail?id={$m['user']['id']}\"><img style=\"width: 80px; display: block;\" src=\"" . (file_exists("{$GLOBALS['CONFIG']['SITE']}/images/users/{$m['user']['id']}.png") ? "/{$GLOBALS['CONFIG']['SITE']}/images/users/{$m['user']['id']}.png" : "/{$GLOBALS['CONFIG']['SITE']}/images/users/user.png") . "\" /></a>\n\t\t\t\t\t\t<br />\n\t\t\t\t\t\t{$m['user']['name']}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"text\">\n\t\t\t\t\t\t<form action=\"/admin/messages/update_action\" method=\"post\">\n\t\t\t\t\t\t\t<input type=\"hidden\" name=\"id\" value=\"{$m['id']}\" />\n\t\t\t\t\t\t\t<input type=\"hidden\" name=\"parent\" value=\"{$message['id']}\" />\n\t\t\t\t\t\t\t<p id=\"text{$m['id']}\">" . bbcode::display($m['content']) . "</p>\n\t\t\t\t\t\t\t<textarea id=\"edit{$m['id']}\" style=\"display: none; width: 700px; height: 200px;\" name=\"content\">" . bbcode::edit($m['content']) . "</textarea>\n\t\t\t\t\t\t\t<input id=\"submit{$m['id']}\" style=\"display: none;\" type=\"submit\" value=\"{$lang['update']}\" />\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"clear\"></div>\n\t\t\t\t</div>\n\t\t";
}
$content .= "\n\t\t\t\t<div class=\"message\">\n\t\t\t\t\t<div class=\"toppart\">\n\t\t\t\t\t\t<div class=\"messageid\">\n\t\t\t\t\t\t\t#{$message['id']}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"date\">\n\t\t\t\t\t\t\t" . date($lang['dateformat'], $message['date']) . "\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"icons\">\n\t\t\t\t\t\t\t<a href=\"#\" onclick=\"showEdit('{$message['id']}'); return false;\"><img class=\"link\" src=\"/{$GLOBALS['CONFIG']['SITE']}/images/icons/small/pencil.png\" alt=\"\" /></a>\n\t\t\t\t\t\t\t<a href=\"#\" onclick=\"\$('#id').val('{$message['id']}'); \$('#delete').dialog('open'); return false;\"><img class=\"link\" src=\"/{$GLOBALS['CONFIG']['SITE']}/images/icons/small/close.png\" alt=\"\" /></a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"clear\"></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"meta\">\n\t\t\t\t\t\t<a href=\"/admin/users/detail?id={$message['user']['id']}\"><img style=\"width: 80px; display: block;\" src=\"" . (file_exists("{$GLOBALS['CONFIG']['SITE']}/images/users/{$message['user']['id']}.png") ? "/{$GLOBALS['CONFIG']['SITE']}/images/users/{$message['user']['id']}.png" : "/{$GLOBALS['CONFIG']['SITE']}/images/users/user.png") . "\" /></a>\n\t\t\t\t\t\t<br />\n\t\t\t\t\t\t{$message['user']['name']}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"text\">\n\t\t\t\t\t\t<form action=\"/admin/messages/update_action\" method=\"post\">\n\t\t\t\t\t\t\t<input type=\"hidden\" name=\"id\" value=\"{$message['id']}\" />\n\t\t\t\t\t\t\t<input type=\"hidden\" name=\"parent\" value=\"{$message['id']}\" />\n\t\t\t\t\t\t\t<p id=\"text{$message['id']}\">" . bbcode::display($message['content']) . "</p>\n\t\t\t\t\t\t\t<textarea id=\"edit{$message['id']}\" style=\"display: none; width: 700px; height: 200px;\" name=\"content\">" . bbcode::edit($message['content']) . "</textarea>\n\t\t\t\t\t\t\t<input id=\"submit{$message['id']}\" style=\"display: none;\" type=\"submit\" value=\"{$lang['update']}\" />\n\t\t\t\t\t\t</form>\t\t\t\t\t\t\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"clear\"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<br />\n\t\t\t<a class=\"button classic\" href=\"#\" onclick=\"\$('#reply').dialog('open'); return false;\" style=\"width: 180px; height: 22px; float: right;\">\n\t\t\t\t<span style=\"display: block; padding-top: 3px;\">{$lang['reply']}</span>\n\t\t\t</a>\n";
if ($message['status'] != 3) {
$content .= "\n\t\t\t<a class=\"button classic\" href=\"#\" onclick=\"\$('#close').dialog('open'); return false;\" style=\"width: 180px; height: 22px; float: right; margin-right: 20px;\">\n\t\t\t\t<span style=\"display: block; padding-top: 3px;\">{$lang['close']}</span>\n\t\t\t</a>\n\t";
} else {
$content .= "\n\t\t\t<a class=\"button classic\" href=\"/admin/messages/open_action?id={$message['id']}\" style=\"width: 180px; height: 22px; float: right; margin-right: 20px;\">\n\t\t\t\t<span style=\"display: block; padding-top: 3px;\">{$lang['open']}</span>\n\t\t\t</a>\n\t";
}
$content .= "\n\t\t</div>\n\t\t<div class=\"clear\"></div><br /><br />\n\t</div>\n\t<div id=\"reply\" class=\"floatingdialog\">\n\t\t<br />\n\t\t<h3 class=\"center\">{$lang['reply']}</h3>\n\t\t<div class=\"form-small\">\t\t\n\t\t\t<form action=\"/admin/messages/add_action\" method=\"post\" class=\"center\">\n\t\t\t\t<input type=\"hidden\" name=\"parent\" value=\"{$message['id']}\" />\n\t\t\t\t<input type=\"hidden\" name=\"type\" value=\"{$message['type']}\" />\n\t\t\t\t<fieldset>\n\t\t\t\t\t<textarea class=\"auto\" style=\"text-align: left; width: 400px; height: 150px;\" name=\"content\" onfocus=\"this.value = this.value=='{$lang['content']}' ? '' : this.value; this.style.color='#4c4c4c';\" onfocusout=\"this.value = this.value == '' ? this.value = '{$lang['content']}' : this.value; this.value=='{$lang['content']}' ? this.style.color='#cccccc' : this.style.color='#4c4c4c'\">{$lang['content']}</textarea>\n\t\t\t\t\t<span class=\"help-block\">{$lang['content_help']}</span>\n\t\t\t\t</fieldset>\n\t\t\t\t<fieldset>\n\t\t\t\t\t<input autofocus type=\"submit\" value=\"{$lang['send']}\" />\n\t\t\t\t</fieldset>\n\t\t\t</form>\n\t\t</div>\n\t</div>\n\t<div id=\"delete\" class=\"floatingdialog\">\n\t\t<h3 class=\"center\">{$lang['delete']}</h3>\n\t\t<p style=\"text-align: center;\">{$lang['delete_text']}</p>\n\t\t<div class=\"form-small\">\t\t\n\t\t\t<form action=\"/admin/messages/del_action\" method=\"get\" class=\"center\">\n\t\t\t\t<input type=\"hidden\" value=\"{$message['id']}\" name=\"parent\" />\n\t\t\t\t<input id=\"id\" type=\"hidden\" value=\"\" name=\"id\" />\n\t\t\t\t<fieldset>\t\n\t\t\t\t\t<input autofocus type=\"submit\" value=\"{$lang['delete_now']}\" />\n\t\t\t\t</fieldset>\n\t\t\t</form>\n\t\t</div>\n\t</div>\n\t<div id=\"close\" class=\"floatingdialog\">\n\t\t<br />\n\t\t<h3 class=\"center\">{$lang['close']}</h3>\n\t\t<p style=\"text-align: center;\">{$lang['close_text']}</p>\n\t\t<div class=\"form-small\">\t\t\n\t\t\t<form action=\"/admin/messages/close_action\" method=\"get\" class=\"center\">\n\t\t\t\t<input type=\"hidden\" value=\"{$message['id']}\" name=\"id\" />\n\t\t\t\t<fieldset>\t\n\t\t\t\t\t<input autofocus type=\"submit\" value=\"{$lang['close_now']}\" />\n\t\t\t\t</fieldset>\n\t\t\t</form>\n\t\t</div>\n\t</div>\n\t<script>\n\t\tnewFlexibleDialog('reply', 550);\n\t\tnewFlexibleDialog('delete', 550);\n\t\tnewFlexibleDialog('close', 550);\n\t\tvar status = 0;\n\t\tfunction showEdit(id)\n\t\t{\n\t\t\tvar options = {};\n\t\t\tif( status == 0 )\n\t\t\t{\n\t\t\t\t\$(\"#text\" + id).css(\"display\", \"none\");\n\t\t\t\t\$(\"#submit\" + id).show(\"fade\", options, 200);\n\t\t\t\t\$(\"#edit\" + id).show(\"fade\", options, 200);\n\t\t\t\tstatus = 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t\$(\"#submit\" + id).css(\"display\", \"none\");\n\t\t\t\t\$(\"#edit\" + id).css(\"display\", \"none\");\n\t\t\t\t\$(\"#text\" + id).show(\"fade\", options, 200);\n\t\t\t\tstatus = 0;\n\t\t\t}\n\t\t}\n\t</script>\n";
/* ========================== OUTPUT PAGE ========================== */
$template->output($content);
示例2: header
<?php
if (!defined('PROPER_START')) {
header("HTTP/1.0 403 Forbidden");
exit;
}
try {
$message = api::send('self/message/list', array('id' => $_GET['id']));
$message = $message[0];
$messages = api::send('self/message/list', array('parent' => $_GET['id']));
} catch (Exception $e) {
template::redirect('/admin/messages');
}
if (!$message['id'] || !$_GET['id']) {
template::redirect('/admin/messages');
}
$content .= "\n\t<div class=\"panel\">\n\t\t<div class=\"top\">\n\t\t\t<div class=\"left\" style=\"width: 600px;\">\n\t\t\t\t<h3>{$message['title']}</h3>\n\t\t\t</div>\n\t\t\t<div class=\"right\" style=\"width: 400px; float: right; text-align: right;\">\n\t\t\t\t<a class=\"button classic\" href=\"#\" onclick=\"\$('#reply').dialog('open'); return false;\" style=\"width: 180px; height: 22px; float: right;\">\n\t\t\t\t\t<span style=\"display: block; padding-top: 3px;\">{$lang['reply']}</span>\n\t\t\t\t</a>\n\t\t\t</div>\n\t\t\t<div class=\"clear\"></div><br /><br />\n\t\t</div>\n\t\t<div class=\"container\">\n\t\t\t<div class=\"topic\">\n";
foreach ($messages as $m) {
$content .= "\n\t\t\t\t<div class=\"message\">\n\t\t\t\t\t<div class=\"toppart\">\n\t\t\t\t\t\t<div class=\"messageid\">\n\t\t\t\t\t\t\t#{$m['id']}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"date\">\n\t\t\t\t\t\t\t" . date($lang['dateformat'], $m['date']) . "\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"icons\">\n\t\t";
if ($m['user']['name'] == security::get('USER')) {
$content .= "\n\t\t\t\t\t\t\t<a href=\"#\" onclick=\"showEdit('{$m['id']}'); return false;\"><img class=\"link\" src=\"/{$GLOBALS['CONFIG']['SITE']}/images/icons/small/pencil.png\" alt=\"\" /></a>\n\t\t\t\t\t\t\t<a href=\"#\" onclick=\"\$('#id').val('{$m['id']}'); \$('#delete').dialog('open'); return false;\"><img class=\"link\" src=\"/{$GLOBALS['CONFIG']['SITE']}/images/icons/small/close.png\" alt=\"\" /></a>\n\t\t\t";
}
$content .= "\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"clear\"></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"meta\">\n\t\t\t\t\t\t<img style=\"width: 80px; display: block;\" src=\"" . (file_exists("{$GLOBALS['CONFIG']['SITE']}/images/users/{$m['user']['id']}.png") ? "/{$GLOBALS['CONFIG']['SITE']}/images/users/{$m['user']['id']}.png" : "/{$GLOBALS['CONFIG']['SITE']}/images/users/user.png") . "\" />\n\t\t\t\t\t\t<br />\n\t\t\t\t\t\t{$m['user']['name']}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"text\">\n\t\t\t\t\t\t<form action=\"/panel/messages/update_action\" method=\"post\">\n\t\t\t\t\t\t\t<input type=\"hidden\" name=\"id\" value=\"{$m['id']}\" />\n\t\t\t\t\t\t\t<input type=\"hidden\" name=\"parent\" value=\"{$message['id']}\" />\n\t\t\t\t\t\t\t<p id=\"text{$m['id']}\">" . bbcode::display($m['content']) . "</p>\n\t\t\t\t\t\t\t<textarea id=\"edit{$m['id']}\" style=\"display: none; width: 700px; height: 200px;\" name=\"content\">" . bbcode::edit($m['content']) . "</textarea>\n\t\t\t\t\t\t\t<input id=\"submit{$m['id']}\" style=\"display: none;\" type=\"submit\" value=\"{$lang['update']}\" />\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"clear\"></div>\n\t\t\t\t</div>\n\t\t";
}
$content .= "\n\t\t\t\t<div class=\"message\">\n\t\t\t\t\t<div class=\"toppart\">\n\t\t\t\t\t\t<div class=\"messageid\">\n\t\t\t\t\t\t\t#{$message['id']}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"date\">\n\t\t\t\t\t\t\t" . date($lang['dateformat'], $message['date']) . "\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"icons\">\n\t\t\t\t\t\t\t<a href=\"#\" onclick=\"showEdit('{$message['id']}'); return false;\"><img class=\"link\" src=\"/{$GLOBALS['CONFIG']['SITE']}/images/icons/small/pencil.png\" alt=\"\" /></a>\n\t\t\t\t\t\t\t<a href=\"#\" onclick=\"\$('#id').val('{$message['id']}'); \$('#delete').dialog('open'); return false;\"><img class=\"link\" src=\"/{$GLOBALS['CONFIG']['SITE']}/images/icons/small/close.png\" alt=\"\" /></a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"clear\"></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"meta\">\n\t\t\t\t\t\t<img style=\"width: 80px; display: block;\" src=\"" . (file_exists("{$GLOBALS['CONFIG']['SITE']}/images/users/{$message['user']['id']}.png") ? "/{$GLOBALS['CONFIG']['SITE']}/images/users/{$message['user']['id']}.png" : "/{$GLOBALS['CONFIG']['SITE']}/images/users/user.png") . "\" />\n\t\t\t\t\t\t<br />\n\t\t\t\t\t\t{$message['user']['name']}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"text\">\n\t\t\t\t\t\t<form action=\"/panel/messages/update_action\" method=\"post\">\n\t\t\t\t\t\t\t<input type=\"hidden\" name=\"id\" value=\"{$message['id']}\" />\n\t\t\t\t\t\t\t<input type=\"hidden\" name=\"parent\" value=\"{$message['id']}\" />\n\t\t\t\t\t\t\t<p id=\"text{$message['id']}\">" . bbcode::display($message['content']) . "</p>\n\t\t\t\t\t\t\t<textarea id=\"edit{$message['id']}\" style=\"display: none; width: 700px; height: 200px;\" name=\"content\">" . bbcode::edit($message['content']) . "</textarea>\n\t\t\t\t\t\t\t<input id=\"submit{$message['id']}\" style=\"display: none;\" type=\"submit\" value=\"{$lang['update']}\" />\n\t\t\t\t\t\t</form>\t\t\t\t\t\t\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"clear\"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<br />\n\t\t\t<a class=\"button classic\" href=\"#\" onclick=\"\$('#reply').dialog('open'); return false;\" style=\"width: 180px; height: 22px; float: right;\">\n\t\t\t\t<span style=\"display: block; padding-top: 3px;\">{$lang['reply']}</span>\n\t\t\t</a>\n\t\t</div>\n\t\t<div class=\"clear\"></div><br /><br />\n\t</div>\n\t<div id=\"reply\" class=\"floatingdialog\">\n\t\t<br />\n\t\t<h3 class=\"center\">{$lang['reply']}</h3>\n\t\t<div class=\"form-small\">\t\t\n\t\t\t<form action=\"/panel/messages/add_action\" method=\"post\" class=\"center\">\n\t\t\t\t<input type=\"hidden\" name=\"parent\" value=\"{$message['id']}\" />\n\t\t\t\t<input type=\"hidden\" name=\"type\" value=\"{$message['type']}\" />\n\t\t\t\t<fieldset>\n\t\t\t\t\t<textarea class=\"auto\" style=\"text-align: left; width: 400px; height: 150px;\" name=\"content\" onfocus=\"this.value = this.value=='{$lang['content']}' ? '' : this.value; this.style.color='#4c4c4c';\" onfocusout=\"this.value = this.value == '' ? this.value = '{$lang['content']}' : this.value; this.value=='{$lang['content']}' ? this.style.color='#cccccc' : this.style.color='#4c4c4c'\">{$lang['content']}</textarea>\n\t\t\t\t\t<span class=\"help-block\">{$lang['content_help']}</span>\n\t\t\t\t</fieldset>\n\t\t\t\t<fieldset>\n\t\t\t\t\t<input autofocus type=\"submit\" value=\"{$lang['send']}\" />\n\t\t\t\t</fieldset>\n\t\t\t</form>\n\t\t</div>\n\t</div>\n\t<div id=\"delete\" class=\"floatingdialog\">\n\t\t<h3 class=\"center\">{$lang['delete']}</h3>\n\t\t<p style=\"text-align: center;\">{$lang['delete_text']}</p>\n\t\t<div class=\"form-small\">\t\t\n\t\t\t<form action=\"/panel/messages/del_action\" method=\"get\" class=\"center\">\n\t\t\t\t<input id=\"id\" type=\"hidden\" value=\"\" name=\"id\" />\n\t\t\t\t<input type=\"hidden\" value=\"{$message['id']}\" name=\"parent\" />\n\t\t\t\t<fieldset>\t\n\t\t\t\t\t<input autofocus type=\"submit\" value=\"{$lang['delete_now']}\" />\n\t\t\t\t</fieldset>\n\t\t\t</form>\n\t\t</div>\n\t</div>\n\t<script>\n\t\tnewFlexibleDialog('reply', 550);\n\t\tnewFlexibleDialog('delete', 550);\n\t\tvar status = 0;\n\t\tfunction showEdit(id)\n\t\t{\n\t\t\tvar options = {};\n\t\t\tif( status == 0 )\n\t\t\t{\n\t\t\t\t\$(\"#text\" + id).css(\"display\", \"none\");\n\t\t\t\t\$(\"#submit\" + id).show(\"fade\", options, 200);\n\t\t\t\t\$(\"#edit\" + id).show(\"fade\", options, 200);\n\t\t\t\tstatus = 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t\$(\"#submit\" + id).css(\"display\", \"none\");\n\t\t\t\t\$(\"#edit\" + id).css(\"display\", \"none\");\n\t\t\t\t\$(\"#text\" + id).show(\"fade\", options, 200);\n\t\t\t\tstatus = 0;\n\t\t\t}\n\t\t}\n\t</script>\n";
/* ========================== OUTPUT PAGE ========================== */
$template->output($content);