本文整理汇总了PHP中bbcode::display方法的典型用法代码示例。如果您正苦于以下问题:PHP bbcode::display方法的具体用法?PHP bbcode::display怎么用?PHP bbcode::display使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bbcode
的用法示例。
在下文中一共展示了bbcode::display方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
$site = api::send('site/list', array('id' => $_GET['id'], 'directory' => 1), $GLOBALS['CONFIG']['API_USERNAME'] . ':' . $GLOBALS['CONFIG']['API_PASSWORD']);
$site = $site[0];
$lang['TITLE'] = $lang['olympe'] . $site['title'];
if ($security->hasAccess('/panel')) {
$rating = api::send('self/site/getrate', array('id' => $_GET['id']));
}
if ($site['rating']['count'] == 0) {
$site['rating']['count'] = 1;
}
$content .= "\n\t\t<div id=\"directorycontainer\">\n\t\t\t<div class=\"directory\">\n\t\t\t\t<div class=\"container\">\n\t\t\t\t\t<div class=\"logo\">\n\t\t\t\t\t\t<img src=\"/{$GLOBALS['CONFIG']['SITE']}/images/sites/?url={$site['url']}\" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style=\"float: left; width: 600px;\">\n\t\t\t\t\t\t<h1 class=\"dark\">{$site['title']}</h1>\n\t\t\t\t\t\t<span class=\"category\">" . $lang['CAT_' . $site['category']] . "</span>\n\t\t\t\t\t\t<div class=\"clear\"></div>\n\t\t\t\t\t\t<br />\n\t\t\t\t\t\t<a class=\"callout\" href=\"http://{$site['url']}\">{$lang['visit']}</a>\n\t\t\t\t\t\t<br /><br /><br />\n\t\t\t\t\t\t<div class=\"seperator-mini\" style=\"width: 620px;\"></div>\n\t\t\t\t\t\t<div class=\"star\" data-score=\"{$rating['rating_value']}\" data-id=\"{$site['id']}\"></div>\n\t\t\t\t\t\t<span class=\"label\">{$lang['edited']} {$site['user']}</span>\n\t\t\t\t\t\t<div class=\"social\">\n\t\t\t\t\t\t\t<div class=\"fb-like\" data-href=\"https://www.olympe.in/directory/site?id={$site['id']}\" data-width=\"\" data-height=\"\" data-colorscheme=\"light\" data-layout=\"button_count\" data-action=\"like\" data-show-faces=\"true\" data-send=\"false\"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"social\">\n\t\t\t\t\t\t\t<div class=\"g-plusone\" data-size=\"medium\"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style=\"float: right; width: 100px;\">\n\t\t\t\t\t\t<a class=\"action report\" href=\"#\" onclick=\"\$('#report').dialog('open'); \$('input[name=site]').val('{$site['id']}'); return false;\">\n\t\t\t\t\t\t\t{$lang['report']}\n\t\t\t\t\t\t</a>\t\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"clear\"></div>\n\t\t\t</div>\n\t\t\t<div class=\"directorylight\">\n\t\t\t\t<div style=\"float: right;\">\n\t\t\t\t\t<h1 class=\"dark thin\">{$lang['rating']}</h1>\n\t\t\t\t\t<br />\n\t\t\t\t\t<div style=\"background-color: #f2f2f2; width: 360px; height: 120px; padding: 8px 10px 10px 10px;\">\n\t\t\t\t\t\t<div style=\"float: left; width: 150px; text-align: center;\">\n\t\t\t\t\t\t\t<span style=\"font-size: 4em; text-align: center;\">" . round($site['rating']['rating'], 2) . "</span>\n\t\t\t\t\t\t\t<div class=\"bigstar\" data-score=\"{$site['rating']['rating']}\"></div>\n\t\t\t\t\t\t\t<img style=\"display: inline-block;\" src=\"/{$GLOBALS['CONFIG']['SITE']}/images/icons/mini-user.png\" />\n\t\t\t\t\t\t\t<span style=\"color: #a6a6a6; font-size: 12px;\">{$site['rating']['count']} {$lang['total']}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div style=\"float: left; width: 180px; text-align: left; margin-left: 15px;\">\n\t\t\t\t\t\t\t<div style=\"clear: left; height: 25px;\">\n\t\t\t\t\t\t\t\t<img src=\"/{$GLOBALS['CONFIG']['SITE']}/images/icons/star-on.png\" style=\"float: left; display: block; padding-top: 4px;\" />\n\t\t\t\t\t\t\t\t<span style=\"float: left; font-size: 12px; margin-left: 10px; display: block; padding-top: 4px; width: 5px;\">5</span>\n\t\t\t\t\t\t\t\t<span style=\"margin-left: 10px; width: " . ($site['rating']['count5'] * 70 / $site['rating']['count'] == 0 ? "10" : "" . $site['rating']['count5'] * 70 / $site['rating']['count'] . "") . "%; background-color: #9fc05a; display: block; height: 25px; float: left; text-align: center;\"><span style=\"padding: 4px; display: block; margin: 0 auto; text-align: center;\">{$site['rating']['count5']}</span></span></span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div style=\"clear: left; height: 25px;\">\n\t\t\t\t\t\t\t\t<img src=\"/{$GLOBALS['CONFIG']['SITE']}/images/icons/star-on.png\" style=\"float: left; display: block; padding-top: 4px;\" />\n\t\t\t\t\t\t\t\t<span style=\"float: left; font-size: 12px; margin-left: 10px; display: block; padding-top: 4px; width: 5px;\">4</span>\n\t\t\t\t\t\t\t\t<span style=\"margin-left: 10px; width: " . ($site['rating']['count4'] * 70 / $site['rating']['count'] == 0 ? "10" : "" . $site['rating']['count4'] * 70 / $site['rating']['count'] . "") . "%; background-color: #add633; display: block; height: 25px; float: left; text-align: center;\"><span style=\"padding: 4px; display: block; margin: 0 auto; text-align: center;\">{$site['rating']['count4']}</span></span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div style=\"clear: left; height: 25px;\">\n\t\t\t\t\t\t\t\t<img src=\"/{$GLOBALS['CONFIG']['SITE']}/images/icons/star-on.png\" style=\"float: left; display: block; padding-top: 4px;\" />\n\t\t\t\t\t\t\t\t<span style=\"float: left; font-size: 12px; margin-left: 10px; display: block; padding-top: 4px; width: 5px;\">3</span>\n\t\t\t\t\t\t\t\t<span style=\"margin-left: 10px; width: " . ($site['rating']['count3'] * 70 / $site['rating']['count'] == 0 ? "10" : "" . $site['rating']['count3'] * 70 / $site['rating']['count'] . "") . "%; background-color: #ffd834; display: block; height: 25px; float: left; text-align: center;\"><span style=\"padding: 4px; display: block; margin: 0 auto; text-align: center;\">{$site['rating']['count3']}</span></span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div style=\"clear: left; height: 25px;\">\n\t\t\t\t\t\t\t\t<img src=\"/{$GLOBALS['CONFIG']['SITE']}/images/icons/star-on.png\" style=\"float: left; display: block; padding-top: 4px;\" />\n\t\t\t\t\t\t\t\t<span style=\"float: left; font-size: 12px; margin-left: 10px; display: block; padding-top: 4px; width: 5px;\">2</span>\n\t\t\t\t\t\t\t\t<span style=\"margin-left: 10px; width: " . ($site['rating']['count2'] * 70 / $site['rating']['count'] == 0 ? "10" : "" . $site['rating']['count2'] * 70 / $site['rating']['count'] . "") . "%; background-color: #ffb234; display: block; height: 25px; float: left; text-align: center;\"><span style=\"padding: 4px; display: block; margin: 0 auto; text-align: center;\">{$site['rating']['count2']}</span></span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div style=\"clear: left; height: 25px;\">\n\t\t\t\t\t\t\t\t<img src=\"/{$GLOBALS['CONFIG']['SITE']}/images/icons/star-on.png\" style=\"float: left; display: block; padding-top: 4px;\" />\n\t\t\t\t\t\t\t\t<span style=\"float: left; font-size: 12px; margin-left: 10px; display: block; padding-top: 4px; width: 5px;\">1</span>\n\t\t\t\t\t\t\t\t<span style=\"margin-left: 10px;width: " . ($site['rating']['count1'] * 70 / $site['rating']['count'] == 0 ? "10" : "" . $site['rating']['count1'] * 70 / $site['rating']['count'] . "") . "%; background-color: #ff8b5a; display: block; height: 25px; float: left; text-align: center;\"><span style=\"padding: 4px; display: block; margin: 0 auto; text-align: center;\">{$site['rating']['count1']}</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\t\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"clear\"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<h1 class=\"dark thin\">{$lang['description']}</h1>\n\t\t\t\t<p style=\"margin-top: 15px; font-size: 18px; width: 600px;\">" . bbcode::display($site['description']) . "</p>\n\t\t\t\t<div class=\"clear\"><br /><br /></div>\n\t\t\t\t<br />\n\t\t\t\t<div class=\"seperator-light\"></div>\n\t\t\t\t<div class=\"comments\">\n\t\t\t\t\t<h1 class=\"dark thin\">{$lang['comments']}</h1>\n\t\t\t\t\t<br />\n\t\t\t\t\t<div id=\"disqus_thread\"></div>\n\t\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\t\t/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */\n\t\t\t\t\t\tvar disqus_developer = 0; // developer mode\n\t\t\t\t\t\tvar disqus_shortname = 'olympe'; // required: replace example with your forum shortname\n\t\t\t\t\t\tvar disqus_identifier = 'Site - {$site['title']}';\n\t\t\t\t\t\tvar disqus_url = 'https://www.olympe.in/directory/site?id={$site['id']}';\n\t\t\t\t\t\t/* * * DON'T EDIT BELOW THIS LINE * * */\n\t\t\t\t\t\t(function() {\n\t\t\t\t\t\t\tvar dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;\n\t\t\t\t\t\t\tdsq.src = 'https://' + disqus_shortname + '.disqus.com/embed.js';\n\t\t\t\t\t\t\t(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);\n\t\t\t\t\t\t})();\n\t\t\t\t\t</script>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"clear\"><br /></div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div id=\"report\" class=\"floatingdialog\">\n\t\t\t<br />\n\t\t\t<h3 class=\"center\">{$lang['newreport']}</h3>\n\t\t\t<p style=\"text-align: center;\">{$lang['newreport_text']}</p>\n\t\t\t<div class=\"form-small\">\n\t\t\t\t<form action=\"/directory/report_action\" method=\"post\" class=\"center\">\n\t\t\t\t\t<input type=\"hidden\" name=\"site\" value=\"\" />\n\t\t\t\t\t<fieldset>\n\t\t\t\t\t\t<input class=\"auto\" type=\"text\" style=\"width: 400px;\" value=\"{$lang['title']}\" name=\"title\" onfocus=\"this.value = this.value=='{$lang['title']}' ? '' : this.value; this.style.color='#4c4c4c';\" onfocusout=\"this.value = this.value == '' ? this.value = '{$lang['title']}' : this.value; this.value=='{$lang['title']}' ? this.style.color='#cccccc' : this.style.color='#4c4c4c'\" />\n\t\t\t\t\t\t<span class=\"help-block\">{$lang['title_help']}</span>\n\t\t\t\t\t</fieldset>\n\t\t\t\t\t<fieldset>\n\t\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\t<span class=\"help-block\">{$lang['content_help']}</span>\n\t\t\t\t\t</fieldset>\n\t\t\t\t\t<fieldset>\t\n\t\t\t\t\t\t<input autofocus type=\"submit\" value=\"{$lang['submit']}\" />\n\t\t\t\t\t</fieldset>\n\t\t\t\t</form>\t\t\t\t\t\t\t\n\t\t\t</div>\n\t\t</div>\t\n\t\t<script type=\"text/javascript\">\n\t\t\twindow.___gcfg = {lang: 'fr'};\n\t\t\n\t\t\t(function() {\n\t\t\t\tvar po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;\n\t\t\t\tpo.src = 'https://apis.google.com/js/plusone.js';\n\t\t\t\tvar s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);\n\t\t\t})();\n\t\t\t\n\t\t\tnewFlexibleDialog('report', 550);\n\t\t</script>\n";
/* ========================== OUTPUT PAGE ========================== */
$template->output($content);
示例3: 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);