本文整理汇总了PHP中display_bbcodes函数的典型用法代码示例。如果您正苦于以下问题:PHP display_bbcodes函数的具体用法?PHP display_bbcodes怎么用?PHP display_bbcodes使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了display_bbcodes函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pdp_get_bb_smileys
function pdp_get_bb_smileys($input, $val, $is_enabled, $show_smileys = true)
{
global $locale;
if (FUSION_VERSION == 7) {
include_once INCLUDES . 'bbcode_include.php';
return display_bbcodes('98%', $input) . ($is_enabled ? '<div><label><input type="checkbox" name="disable_smileys" value="' . $val . '"' . ($val == '0' ? ' checked="checked"' : '') . ' /> ' . $locale['PDP041'] . '</label></div>' : '');
} else {
return '
<input type="button" value="b" class="button" style="font-weight:bold;"
onclick="addText(\'' . $input . '\', \'[b]\', \'[/b]\');" />
<input type="button" value="i" class="button" style="font-style:italic;"
onclick="addText(\'' . $input . '\', \'[i]\', \'[/i]\');" />
<input type="button" value="u" class="button" style="text-decoration:underline;"
onclick="addText(\'' . $input . '\', \'[u]\', \'[/u]\');" />
<input type="button" value="url" class="button"
onclick="addText(\'' . $input . '\', \'[url]\', \'[/url]\');" />
<input type="button" value="mail" class="button"
onclick="addText(\'' . $input . '\', \'[mail]\', \'[/mail]\');" />
<input type="button" value="img" class="button"
onclick="addText(\'' . $input . '\', \'[img]\', \'[/img]\');" />
<input type="button" value="center" class="button"
onclick="addText(\'' . $input . '\', \'[center]\', \'[/center]\');" />
<input type="button" value="small" class="button"
onclick="addText(\'' . $input . '\', \'[small]\', \'[/small]\');" />
<input type="button" value="code" class="button"
onclick="addText(\'' . $input . '\', \'[code]\', \'[/code]\');" />
<input type="button" value="quote" class="button"
onclick="addText(\'' . $input . '\', \'[quote]\', \'[/quote]\');" />' . ($show_smileys ? '<div>' . displaysmileys($input) . '</div>' : '') . ($is_enabled ? '<div><label><input type="checkbox" name="disable_smileys" value="' . $val . '"' . ($val == '0' ? ' checked="checked"' : '') . ' /> ' . $locale['PDP041'] . '</label></div>' : '');
}
}
示例2: showcomments
function showcomments($ctype, $cdb, $ccol, $cid, $clink = "")
{
global $settings, $userdata, $locale;
include LOCALE . LOCALESET . "comments.php";
require_once INCLUDES . "bbcode_include.php";
add_to_head("<script type='text/javascript' src='" . INCLUDES . "comments_include/comments.js'></script>");
add_to_head("<script type='text/javascript'>\n var ctype = '" . $ctype . "';\n if (ctype == 'MG') {\n var cid = window.cidas;\n } else {\n var cid = '" . $cid . "';\n }\n var basedir = '" . BASEDIR . "';\n\t\t\tvar locale_noc = '" . $locale['c101'] . "';\n\t\t\tvar locale_edit = '" . $locale['c108'] . "';\n\t\t\tvar locale_del = '" . $locale['c109'] . "';\n </script>");
echo "<br /><br />";
opentable($locale['c100']);
echo "<div id='comments_load' style='display:none;text-align:center;'><img src='" . INCLUDES . "comments_include/load.gif' alt='' style='border:0;' /></div><div id='comments'></div>";
closetable();
echo "<br /><br />";
opentable($locale['c102']);
if (iMEMBER) {
echo "<div align='center'>";
echo "<a id='edit_comment' name='edit_comment'></a>";
echo "<form name='comment_form' method='post' action='#'>";
echo "<input type='hidden' name='comment_name' value='" . $userdata['user_id'] . "' />";
echo "<input type='hidden' name='cid' value='" . $cid . "' />";
echo "<input type='hidden' name='ctype' value='" . $ctype . "' />";
echo "<input type='hidden' name='edited_id' value='' />";
echo "<input type='hidden' name='edited_id' value='' />";
echo "<textarea name='comment_message' cols='70' rows='6' class='textbox' style='width:360px'></textarea><br />";
echo "<div align='center'>" . display_bbcodes("360px", "comment_message", "comment_form") . "</div>";
echo "<input type='submit' name='post_comment' value='" . $locale['c102'] . "' class='button' /> ";
echo "<input type='submit' name='edit_comment' value='" . $locale['c103'] . "' class='button' /> ";
echo "</form>";
echo "<div id='comment_load' style='display:none;text-align:center;height:140px;'><img src='" . INCLUDES . "comments_include/load.gif' alt='' style='border:0;margin-top:50px;' /></div>";
echo "<br />";
echo "</div>";
} else {
echo "<div style='text-align:center'>" . $locale['c105'] . "</div><br />";
}
closetable();
echo "<div style='text-align:center;width:100%;'>AL jQ comments <a href='http://fusion.annetlab.tk'>Fusion @ AnnetLab</a> © 2011-2012</div>";
}
示例3: showcomments
//.........这里部分代码省略.........
$comment_updated = true;
}
}
if ($comment_updated) {
$c_start = (ceil(dbcount("(comment_id)", DB_COMMENTS, "comment_id<='" . $_GET['comment_id'] . "' AND comment_item_id='" . $cid . "' AND comment_type='" . $ctype . "'") / 10) - 1) * 10;
}
redirect($clink . "&rstart=" . (isset($c_start) && isnum($c_start) ? $c_start : ""));
} else {
if (!dbcount("(" . $ccol . ")", $cdb, $ccol . "='" . $cid . "'")) {
redirect(BASEDIR . "index.php");
}
if ($comment_name && $comment_message) {
require_once INCLUDES . "flood_include.php";
if (!flood_control("comment_datestamp", DB_COMMENTS, "comment_ip='" . USER_IP . "'")) {
$result = dbquery("INSERT INTO " . DB_COMMENTS . " (comment_item_id, comment_type, comment_name, comment_message, comment_datestamp, comment_ip) VALUES ('{$cid}', '{$ctype}', '{$comment_name}', '{$comment_message}', '" . time() . "', '" . USER_IP . "')");
}
}
$c_start = (ceil(dbcount("(comment_id)", DB_COMMENTS, "comment_item_id='" . $cid . "' AND comment_type='" . $ctype . "'") / 10) - 1) * 10;
redirect($clink . "&rstart=" . $c_start);
}
}
opentable($locale['c100']);
echo "<a id='comments' name='comments'></a>";
$c_rows = dbcount("(comment_id)", DB_COMMENTS, "comment_item_id='{$cid}' AND comment_type='{$ctype}'");
if (!isset($_GET['c_start']) || !isnum($_GET['c_start'])) {
$_GET['c_start'] = 0;
}
$result = dbquery("SELECT tcm.*,user_name FROM " . DB_COMMENTS . " tcm\n\t\tLEFT JOIN " . DB_USERS . " tcu ON tcm.comment_name=tcu.user_id\n\t\tWHERE comment_item_id='{$cid}' AND comment_type='{$ctype}'\n\t\tORDER BY comment_datestamp ASC LIMIT " . $_GET['c_start'] . ",10");
if (dbrows($result)) {
$i = $_GET['c_start'] + 1;
if ($c_rows > 10) {
echo "<div style='text-align:center;margin-bottom:5px;'>" . makecommentnav($_GET['c_start'], 10, $c_rows, 3, $clink . "&") . "</div>\n";
}
while ($data = dbarray($result)) {
echo "<div class='tbl2'>\n";
if (iADMIN && checkrights("C") || iMEMBER && $data['comment_name'] == $userdata['user_id'] && isset($data['user_name'])) {
echo "<div style='float:right' class='comment_actions'><!--comment_actions-->\n<a href='" . FUSION_REQUEST . "&c_action=edit&comment_id=" . $data['comment_id'] . "#edit_comment'>" . $locale['c108'] . "</a> |\n";
echo "<a href='" . FUSION_REQUEST . "&c_action=delete&comment_id=" . $data['comment_id'] . "'>" . $locale['c109'] . "</a>\n</div>\n";
}
echo "<a href='" . FUSION_REQUEST . "#c" . $data['comment_id'] . "' id='c" . $data['comment_id'] . "' name='c" . $data['comment_id'] . "'>#" . $i . "</a> | ";
if ($data['user_name']) {
echo "<span class='comment-name'><a href='" . BASEDIR . "profile.php?lookup=" . $data['comment_name'] . "'>" . $data['user_name'] . "</a></span>\n";
} else {
echo "<span class='comment-name'>" . $data['comment_name'] . "</span>\n";
}
echo "<span class='small'>" . $locale['global_071'] . showdate("longdate", $data['comment_datestamp']) . "</span>\n";
echo "</div>\n<div class='tbl1 comment_message'><!--comment_message-->" . nl2br(parseubb(parsesmileys($data['comment_message']))) . "</div>\n";
$i++;
}
if (iADMIN && checkrights("C")) {
echo "<div align='right' class='tbl2'><a href='" . ADMIN . "comments.php" . $aidlink . "&ctype={$ctype}&cid={$cid}'>" . $locale['c106'] . "</a></div>\n";
}
if ($c_rows > 10) {
echo "<div style='text-align:center;margin-top:5px;'>" . makecommentnav($_GET['c_start'], 10, $c_rows, 3, $clink . "&") . "</div>\n";
}
} else {
echo $locale['c101'] . "\n";
}
closetable();
opentable($locale['c102']);
if (iMEMBER && (isset($_GET['c_action']) && $_GET['c_action'] == "edit") && (isset($_GET['comment_id']) && isnum($_GET['comment_id']))) {
$eresult = dbquery("SELECT tcm.*,user_name FROM " . DB_COMMENTS . " tcm\n\t\t\tLEFT JOIN " . DB_USERS . " tcu ON tcm.comment_name=tcu.user_id\n\t\t\tWHERE comment_id='" . $_GET['comment_id'] . "' AND comment_item_id='" . $cid . "' AND comment_type='" . $ctype . "'");
if (dbrows($eresult)) {
$edata = dbarray($eresult);
if (iADMIN && checkrights("C") || iMEMBER && $edata['comment_name'] == $userdata['user_id'] && isset($edata['user_name'])) {
$clink .= "&c_action=edit&comment_id=" . $edata['comment_id'];
$comment_message = $edata['comment_message'];
}
} else {
$comment_message = "";
}
} else {
$comment_message = "";
}
if (iMEMBER || $settings['guestposts'] == "1") {
require_once INCLUDES . "bbcode_include.php";
echo "<a id='edit_comment' name='edit_comment'></a>\n";
echo "<form name='inputform' method='post' action='" . $clink . "'>\n";
if (iGUEST) {
echo "<div align='center' class='tbl'>\n" . $locale['c104'] . "<br />\n";
echo "<input type='text' name='comment_name' maxlength='30' class='textbox' style='width:360px' />\n";
echo "</div>\n";
}
echo "<div align='center' class='tbl'>\n";
echo "<textarea name='comment_message' cols='70' rows='6' class='textbox' style='width:360px'>" . $comment_message . "</textarea><br />\n";
echo display_bbcodes("360px", "comment_message");
if (iGUEST) {
echo $locale['global_158'] . "<br />\n";
echo "<img id='com_captcha' src='" . INCLUDES . "securimage/securimage_show.php' alt='' /><br />\n";
echo "<a href='" . INCLUDES . "securimage/securimage_play.php'><img src='" . INCLUDES . "securimage/images/audio_icon.gif' alt='' class='tbl-border' style='margin-bottom:1px' /></a>\n";
echo "<a href='#' onclick=\"document.getElementById('com_captcha').src = '" . INCLUDES . "securimage/securimage_show.php?sid=' + Math.random(); return false\"><img src='" . INCLUDES . "securimage/images/refresh.gif' alt='' class='tbl-border' /></a><br />\n";
echo $locale['global_159'] . "<br />\n<input type='text' name='com_captcha_code' class='textbox' style='width:100px' />\n";
}
echo "<br />\n<input type='submit' name='post_comment' value='" . ($comment_message ? $locale['c103'] : $locale['c102']) . "' class='button' />\n";
echo "</div>\n</form>\n";
} else {
echo $locale['c105'] . "\n";
}
closetable();
}
示例4: form_textarea
function form_textarea($title = FALSE, $input_name, $input_id, $input_value = FALSE, $array = FALSE)
{
global $userdata;
// for editor
$title2 = isset($title) && !empty($title) ? stripinput($title) : ucfirst(strtolower(str_replace("_", " ", $input_name)));
$input_name = isset($input_name) && !empty($input_name) ? stripinput($input_name) : "";
$input_id = isset($input_id) && !empty($input_id) ? stripinput($input_id) : "";
if (!is_array($array)) {
$required = 0;
$safemode = 0;
$deactivate = "";
$width = "100%";
$height = "80px";
$editor = 0;
$placeholder = "";
$inline = '';
$form_name = 'input_form';
$bbcode = 0;
$error_text = '';
$class = '';
} else {
$required = array_key_exists('required', $array) && $array['required'] == 1 ? 1 : 0;
$safemode = array_key_exists('safemode', $array) && $array['safemode'] == 1 ? 1 : 0;
$placeholder = array_key_exists('placeholder', $array) ? $array['placeholder'] : "";
$deactivate = array_key_exists('deactivate', $array) ? $array['deactivate'] : "";
$bbcode = array_key_exists('bbcode', $array) && $array['bbcode'] == 1 ? 1 : 0;
$editor = array_key_exists('editor', $array) ? $array['editor'] : "";
$width = array_key_exists('width', $array) ? $array['width'] : "100%";
$height = array_key_exists('height', $array) ? $array['height'] : "80";
$inline = array_key_exists("inline", $array) ? 1 : 0;
$form_name = array_key_exists('form_name', $array) ? $array['form_name'] : 'input_form';
$error_text = array_key_exists("error_text", $array) ? $array['error_text'] : "";
$class = array_key_exists("class", $array) && $array['class'] ? $array['class'] : '';
}
$input_value = phpentities(stripslashes($input_value));
$input_value = str_replace("<br />", "", $input_value);
if ($bbcode) {
require_once INCLUDES . "bbcode_include.php";
}
$html = "";
$html .= "<div id='{$input_id}-field' class='form-group m-b-0 " . $class . "'>\n";
$html .= $title ? "<label class='control-label " . ($inline ? "col-xs-12 col-sm-3 col-md-3 col-lg-3" : '') . "' for='{$input_id}'>{$title} " . ($required == 1 ? "<span class='required'>*</span>" : '') . "</label>\n" : '';
$html .= $inline ? "<div class='col-xs-12 col-sm-9 col-md-9 col-lg-9'>\n" : "";
$html .= $bbcode ? "" . display_bbcodes('90%', $input_name, $form_name) . "" : '';
$html .= "<textarea name='{$input_name}' style='width:100%; min-height:100px;' class='form-control textbox' placeholder='{$placeholder}' id='{$input_id}' " . ($deactivate == "1" && isnum($deactivate) ? "readonly" : "") . ">{$input_value}</textarea>\n";
$html .= "<div id='{$input_id}-help' class='display-inline-block'></div>";
$html .= $inline ? "</div>\n" : "";
$html .= "</div>\n";
$html .= "<input type='hidden' name='def[{$input_name}]' value='[type=textarea],[title={$title2}],[id={$input_id}],[required={$required}],[safemode={$safemode}]" . ($error_text ? ",[error_text={$error_text}]" : '') . "' readonly />";
// Editor Parse Configurations.
if ($editor) {
$result = dbquery("SELECT * FROM " . DB_EDITOR . " WHERE " . groupaccess('editor_access') . " AND editor_enable='1' ORDER BY editor_access DESC LIMIT 1");
if (dbrows($result) > 0) {
$data = dbarray($result);
if (!defined('text_editor_on')) {
define('text_editor_on', TRUE);
// load editor js
add_to_head("<script src='" . DYNAMICS . "assets/editor/development/jquery.sceditor.bbcode.js'></script>\n");
// load editor theme
$editor_theme = DYNAMICS . "assets/editor/development/themes/css/monocons.css";
if (file_exists(DYNAMICS . "assets/editor/development/themes/css/" . $data['editor_theme'] . "")) {
$editor_theme = DYNAMICS . "assets/editor/development/themes/css/" . $data['editor_theme'];
}
add_to_head("<link rel='stylesheet' href='{$editor_theme}' type='text/css' media='all' />\n");
// load smileys;
$editor_smiley = cache_editor_smiley();
// load editor bbcode settings;
$editor_config = get_editor_buttons($data['editor_name']);
// initialize the editor
add_to_jquery("\n \$('#{$input_id}').sceditor({\n plugins: 'bbcode',\n id: '{$input_id}-editor',\n height : '300',\n width : '{$width}',\n //toolbar: '{$editor_config}',\n autoUpdate: true,\n style: '{$editor_theme}',\n {$editor_smiley}\n });\n ");
}
/*
* width: '720',
* height: '300'
* resizeEnabled: false,
*/
}
}
// endif editor config
// Api for Adding Custom BBCodes - Example
/*
add_to_jquery("
$.sceditor.plugins.bbcode.bbcode.set('spoiler', {
tags: {
'div': {
'class': ['spoiler']
}
},
format: '[spoiler]{0}[/spoiler]',
html: '<div class=\"spoiler\">{0}</div>'
});
");
*/
return $html;
}
示例5: form_textarea
//.........这里部分代码省略.........
}
$tinymce_list = json_encode($tinymce_list);
$tinymce_smiley_vars = "";
if (!defined('tinymce')) {
add_to_head("<style type='text/css'>.mceIframeContainer iframe{width:100%!important; height:30px;}</style>");
add_to_footer("<script type='text/javascript' src='" . INCLUDES . "jscripts/tinymce/tinymce.min.js'></script>");
define('tinymce', TRUE);
// PHP-Fusion Parse Cache Smileys
$smileys = cache_smileys();
$tinymce_smiley_vars = "";
if (!empty($smileys)) {
$tinymce_smiley_vars = "var shortcuts = {\n";
foreach ($smileys as $params) {
$tinymce_smiley_vars .= "'" . strtolower($params['smiley_code']) . "' : '<img alt=\"" . $params['smiley_text'] . "\" src=\"" . IMAGES . "smiley/" . $params['smiley_image'] . "\"/>',\n";
}
$tinymce_smiley_vars .= "};\n";
$tinymce_smiley_vars .= "\n\t\t\t\ted.on('keyup load', function(e){\n\t\t\t\t\tvar marker = tinymce.activeEditor.selection.getBookmark();\n\t\t\t\t\t// Store editor contents\n\t\t\t\t\tvar content = tinymce.activeEditor.getContent({'format':'raw'});\n\t\t\t\t\t// Loop through all shortcuts\n\t\t\t\t\tfor(var key in shortcuts){\n\t\t\t\t\t\t// Check if the editor html contains the looped shortcut\n\t\t\t\t\t\tif(content.toLowerCase().indexOf(key) != -1) {\n\t\t\t\t\t\t\t// Escaping special characters to be able to use the shortcuts in regular expression\n\t\t\t\t\t\t\tvar k = key.replace(/[<>*()?']/ig, \"\\\$&\");\n\t\t\t\t\t\t\ttinymce.activeEditor.setContent(content.replace(k, shortcuts[key]));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Now put cursor back where it was\n\t\t\t\t\ttinymce.activeEditor.selection.moveToBookmark(marker);\n\t\t\t\t});\n\t\t\t\t";
}
}
// Mode switching for TinyMCE
switch ($options['tinymce']) {
case 'advanced':
add_to_jquery("\n tinymce.init({\n selector: '#" . $options['input_id'] . "',\n theme: 'modern',\n entity_encoding : 'raw',\n width: '100%',\n height: 300,\n plugins: [\n 'advlist autolink autoresize link image lists charmap print preview hr anchor pagebreak spellchecker',\n 'searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking',\n 'save table contextmenu directionality template paste textcolor'\n ],\n image_list: {$tinymce_list},\n content_css: '" . THEMES . "admin_templates/" . fusion_get_settings("admin_theme") . "/acp_styles.css',\n toolbar1: 'insertfile undo redo | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | newdocument fullscreen preview cut copy paste pastetext spellchecker searchreplace code',\n toolbar2: 'styleselect formatselect removeformat | fontselect fontsizeselect bold italic underline strikethrough subscript superscript blockquote | forecolor backcolor',\n toolbar3: 'hr pagebreak insertdatetime | link unlink anchor | image media | table charmap visualchars visualblocks emoticons',\n image_advtab: true,\n style_formats: [\n {title: 'Bold text', inline: 'b'},\n {title: 'Red text', inline: 'span', styles: {color: '#ff0000'}},\n {title: 'Red header', block: 'h1', styles: {color: '#ff0000'}},\n {title: 'Example 1', inline: 'span', classes: 'example1'},\n {title: 'Example 2', inline: 'span', classes: 'example2'},\n {title: 'Table styles'},\n {title: 'Table row 1', selector: 'tr', classes: 'tablerow1'}\n ],\n setup: function(ed) {\n \t\t\t\t\t// add tabkey listener\n \t\t\t\t\ted.on('keydown', function(event) {\n \t\t\t\t\tif (event.keyCode == 9) { // tab pressed\n \t\t\t\t\t\tif (event.shiftKey) { ed.execCommand('Outdent'); } else { ed.execCommand('Indent'); }\n \t\t\t\t\t\tevent.preventDefault();\n \t\t\t\t\t\treturn false;\n \t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\t// auto smileys parsing\n\t\t\t\t\t\t" . $tinymce_smiley_vars . "\n\t\t\t\t}\n });\n ");
break;
case 'simple':
add_to_jquery("\n tinymce.init({\n selector: '#" . $options['input_id'] . "',\n theme: 'modern',\n menubar: false,\n statusbar: false,\n content_css: '" . THEMES . "/templates/tinymce.css',\n image_list: {$tinymce_list},\n plugins: [\n 'advlist autolink autoresize link lists charmap print preview hr anchor pagebreak spellchecker',\n 'searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking',\n 'contextmenu directionality template paste bbcode autoresize'\n ],\n height: 30,\n image_advtab: true,\n toolbar1: 'undo redo | bold italic underline | bullist numlist blockquote | hr media | fullscreen',\n entity_encoding : 'raw',\n language: '" . $locale['tinymce'] . "',\n object_resizing: false,\n resize: false,\n relative_urls: false,\n setup: function(ed) {\n \t\t\t\t\t// add tabkey listener\n \t\t\t\t\ted.on('keydown', function(event) {\n \t\t\t\t\tif (event.keyCode == 9) { // tab pressed\n \t\t\t\t\t\tif (event.shiftKey) { ed.execCommand('Outdent'); } else { ed.execCommand('Indent'); }\n \t\t\t\t\t\tevent.preventDefault();\n \t\t\t\t\t\treturn false;\n \t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\t// auto smileys parsing\n\t\t\t\t\t\t" . $tinymce_smiley_vars . "\n\t\t\t\t}\n });\n ");
add_to_jquery("\n\t\t\t\t\$('#inject').bind('click', function() {\n\t\t\t\t\ttinyMCE.activeEditor.execCommand(\"mceInsertContent\", true, '[b]I am injecting in stuff..[/b]');\n\t\t\t\t\t});\n\t\t\t\t");
break;
case 'default':
add_to_jquery("\n tinymce.init({\n selector: '#" . $options['input_id'] . "',\n theme: 'modern',\n entity_encoding : 'raw',\n language:'" . $locale['tinymce'] . "',\n setup: function(ed) {\n \t\t\t\t\t// add tabkey listener\n \t\t\t\t\ted.on('keydown', function(event) {\n \t\t\t\t\tif (event.keyCode == 9) { // tab pressed\n \t\t\t\t\t\tif (event.shiftKey) { ed.execCommand('Outdent'); } else { ed.execCommand('Indent'); }\n \t\t\t\t\t\tevent.preventDefault();\n \t\t\t\t\t\treturn false;\n \t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\t// auto smileys parsing\n\t\t\t\t\t\t" . $tinymce_smiley_vars . "\n\t\t\t\t}\n });\n ");
break;
}
} else {
if (!defined('autogrow') && $options['autosize']) {
define('autogrow', TRUE);
add_to_footer("<script src='" . DYNAMICS . "assets/autosize/jquery.autosize.min.js'></script>");
}
if ($options['autosize']) {
add_to_jquery("\n\t\t \$('#" . $options['input_id'] . "').autosize();\n\t\t ");
}
}
if ($input_value !== '') {
$input_value = html_entity_decode(stripslashes($input_value), ENT_QUOTES, $locale['charset']);
$input_value = str_replace("<br />", "", $input_value);
}
$error_class = "";
if ($defender->inputHasError($input_name)) {
$error_class = "has-error ";
if (!empty($options['error_text'])) {
$new_error_text = $defender->getErrorText($input_name);
if (!empty($new_error_text)) {
$options['error_text'] = $new_error_text;
}
addNotice("danger", "<strong>{$title}</strong> - " . $options['error_text']);
}
}
$html = "<div id='" . $options['input_id'] . "-field' class='form-group " . $error_class . $options['class'] . "' " . ($options['inline'] && $options['width'] && !$label ? "style='width: " . $options['width'] . " !important;'" : '') . ">\n";
$html .= $label ? "<label class='control-label " . ($options['inline'] ? "col-xs-12 col-sm-3 col-md-3 col-lg-3 p-l-0" : '') . "' for='" . $options['input_id'] . "'>{$label} " . ($options['required'] == 1 ? "<span class='required'>*</span>" : '') . " " . ($options['tip'] ? "<i class='pointer fa fa-question-circle' title='" . $options['tip'] . "'></i>" : '') . "</label>\n" : '';
$html .= $options['inline'] ? "<div class='col-xs-12 " . ($label ? "col-sm-9 col-md-9 col-lg-9 p-r-0" : "col-sm-12 p-l-0") . "'>\n" : "";
$tab_active = 0;
$tab_title = array();
if ($options['preview'] && ($options['type'] == "html" || $options['type'] == "bbcode")) {
$tab_title['title'][] = $locale['preview'];
$tab_title['id'][] = "prw-" . $options['input_id'];
$tab_title['icon'][] = '';
$tab_title['title'][] = $locale['texts'];
$tab_title['id'][] = "txt-" . $options['input_id'];
$tab_title['icon'][] = '';
$tab_active = tab_active($tab_title, 1);
$html .= opentab($tab_title, $tab_active, $options['input_id'] . "-link", "", "editor-wrapper");
$html .= opentabbody($tab_title['title'][1], "txt-" . $options['input_id'], $tab_active);
}
$html .= $options['type'] == "html" || $options['type'] == "bbcode" ? "<div class='panel panel-default panel-txtarea m-b-0' " . ($options['preview'] ? "style='border-top:0 !important; border-radius:0 !important;'" : '') . ">\n<div class='panel-heading clearfix' style='padding-bottom:0 !important;'>\n" : '';
if ($options['type'] == "bbcode" && $options['form_name']) {
$html .= display_bbcodes('90%', $input_name, $options['form_name']);
} elseif ($options['type'] == "html" && $options['form_name']) {
$html .= display_html($options['form_name'], $input_name, TRUE, TRUE, TRUE, $options['path']);
}
$html .= $options['type'] == "html" || $options['type'] == "bbcode" ? "</div>\n<div class='panel-body p-0'>\n" : '';
$html .= "<textarea name='{$input_name}' style='width:100%; height:" . $options['height'] . "; " . ($options['no_resize'] ? 'resize: none;' : '') . "' class='form-control p-15 m-0 " . $options['class'] . " " . ($options['autosize'] ? 'animated-height' : '') . " " . ($options['type'] == "html" || $options['type'] == "bbcode" ? "no-shadow no-border" : '') . " textbox ' placeholder='" . $options['placeholder'] . "' id='" . $options['input_id'] . "' " . ($options['deactivate'] ? 'readonly' : '') . ($options['maxlength'] ? "maxlength='" . $options['maxlength'] . "'" : '') . ">" . $input_value . "</textarea>\n";
if ($options['type'] == "html" || $options['type'] == "bbcode") {
$html .= "</div>\n<div class='panel-footer clearfix'>\n";
$html .= "<div class='overflow-hide'><small>" . $locale['word_count'] . ": <span id='" . $options['input_id'] . "-wordcount'></span></small></div>";
add_to_jquery("\n\t\tvar init_str = \$('#" . $options['input_id'] . "').val().replace(/<[^>]+>/ig, '').replace(/\\n/g,'').replace(/ /g, '').length;\n\t\t\$('#" . $options['input_id'] . "-wordcount').text(init_str);\n\t\t\$('#" . $options['input_id'] . "').on('input propertychange paste', function() {\n\t\tvar str = \$(this).val().replace(/<[^>]+>/ig, '').replace(/\\n/g,'').replace(/ /g, '').length;\n\t\t\$('#" . $options['input_id'] . "-wordcount').text(str);\n\t\t});\n\t\t");
$html .= "</div>\n</div>\n";
}
if ($options['preview'] && ($options['type'] == "bbcode" || $options['type'] == "html")) {
$html .= closetabbody();
$html .= opentabbody($tab_title['title'][0], "prw-" . $options['input_id'] . "", $tab_active);
$html .= "No Result";
$html .= closetabbody();
$html .= closetab();
add_to_jquery("\n\t\t// preview syntax\n\t\tvar form = \$('#" . $options['form_name'] . "');\n\t\t\$('#tab-prw-" . $options['input_id'] . "').bind('click',function(){\n\t\tvar text = \$('#" . $options['input_id'] . "').val();\n\t\tvar format = '" . ($options['type'] == "bbcode" ? 'bbcode' : 'html') . "';\n\t\tvar data = {\n\t\t\t" . (defined('ADMIN_PANEL') ? "'mode': 'admin', " : "") . "\n\t\t\t'text' : text,\n\t\t\t'editor' : format,\n\t\t\t'url' : '" . $_SERVER['REQUEST_URI'] . "',\n\t\t};\n\t\tvar sendData = form.serialize() + '&' + \$.param(data);\n\t\t\$.ajax({\n\t\t\turl: '" . INCLUDES . "dynamics/assets/preview/preview.ajax.php',\n\t\t\ttype: 'POST',\n\t\t\tdataType: 'html',\n\t\t\tdata : sendData,\n\t\t\tsuccess: function(result){\n\t\t\t//console.log(result);\n\t\t\t\$('#prw-" . $options['input_id'] . "').html(result);\n\t\t\t},\n\t\t\terror: function(result) {\n\t\t\t\tnew PNotify({\n\t\t\t\t\ttitle: '" . $locale['error_preview'] . "',\n\t\t\t\t\ttext: '" . $locale['error_preview_text'] . "',\n\t\t\t\t\ticon: 'notify_icon n-attention',\n\t\t\t\t\tanimation: 'fade',\n\t\t\t\t\twidth: 'auto',\n\t\t\t\t\tdelay: '3000'\n\t\t\t\t});\n\t\t\t}\n\t\t\t});\n\t\t});\n\t\t");
}
$html .= $options['required'] == 1 && $defender->inputHasError($input_name) || $defender->inputHasError($input_name) ? "<div id='" . $options['input_id'] . "-help' class='label label-danger p-5 display-inline-block'>" . $options['error_text'] . "</div>" : "";
$html .= $options['inline'] ? "</div>\n" : '';
$html .= "</div>\n";
$defender->add_field_session(array('input_name' => $input_name, 'type' => 'textarea', 'title' => $label, 'id' => $options['input_id'], 'required' => $options['required'], 'safemode' => $options['safemode'], 'error_text' => $options['error_text']));
return $html;
}
示例6: display_bbcodes
$archive_shout_link = FUSION_SELF;
$archive_shout_message = "";
}
} else {
$archive_shout_link = FUSION_SELF;
$archive_shout_message = "";
}
echo "<form name='archive_form' method='post' action='" . $archive_shout_link . "'>\n";
echo "<div style='text-align:center'>\n";
if (iGUEST) {
echo $locale['SB_name'] . "<br />\n";
echo "<input type='text' name='archive_shout_name' value='' class='textbox' maxlength='30' style='width:200px;' /><br />\n";
echo $locale['SB_message'] . "<br />\n";
}
echo "<textarea name='archive_shout_message' rows='4' cols='50' class='textbox'>" . $archive_shout_message . "</textarea><br />\n";
echo "<div style='text-align:center'>" . display_bbcodes("100%", "archive_shout_message", "archive_form", "smiley|b|i|u|url|color") . "</div>\n";
if (iGUEST) {
echo $locale['SB_validation_code'] . "<br />\n";
echo "<img id='captcha' src='" . INCLUDES . "captchas/securimage/securimage_show.php' alt='' /><br />\n";
echo "<a href='" . INCLUDES . "captchas/securimage/securimage_play.php'><img src='" . INCLUDES . "captchas/securimage/images/audio_icon.gif' alt='' class='tbl-border' style='margin-bottom:1px' /></a>\n";
echo "<a href='#' onclick=\"document.getElementById('captcha').src = '" . INCLUDES . "captchas/securimage/securimage_show.php?sid=' + Math.random(); return false\"><img src='" . INCLUDES . "captchas/securimage/images/refresh.gif' alt='' class='tbl-border' /></a><br />\n";
echo $locale['SB_enter_validation_code'] . "<br />\n<input type='text' name='captcha_code' class='textbox' style='width:100px' /><br />\n";
}
echo "<br /><input type='submit' name='post_archive_shout' value='" . $locale['SB_shout'] . "' class='button' />\n";
echo "</div>\n</form>\n<br />\n";
} else {
echo "<div style='text-align:center'>" . $locale['SB_login_req'] . "</div>\n";
}
$rows = dbcount("(shout_id)", DB_SHOUTBOX, "shout_hidden='0'");
if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) {
$_GET['rowstart'] = 0;
示例7: add_to_title
add_to_title($locale['global_201'] . $locale['401']);
echo "<!--pre_postnewthread-->";
opentable($locale['401']);
if (!isset($_POST['previewpost'])) {
echo "<div class='tbl2' style='margin-bottom:5px'><span class='small'><a href='index.php'>" . $settings['sitename'] . "</a> :: " . $caption . "</span></div>\n";
}
echo "<form id='inputform' method='post' action='" . FUSION_SELF . "?action=newthread&forum_id=" . $_GET['forum_id'] . "' enctype='multipart/form-data'>\n";
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n<tr>\n";
echo "<td width='145' class='tbl2'>" . $locale['460'] . "</td>\n";
echo "<td class='tbl1'><input type='text' name='subject' value='" . $subject . "' class='textbox' maxlength='255' style='width: 250px' /></td>\n";
echo "</tr>\n<tr>\n";
echo "<td valign='top' width='145' class='tbl2'>" . $locale['461'] . "</td>\n";
echo "<td class='tbl1'><textarea name='message' cols='60' rows='15' class='textbox' style='width:98%'>" . $message . "</textarea></td>\n";
echo "</tr>\n<tr>\n";
echo "<td width='145' class='tbl2'> </td>\n";
echo "<td class='tbl1'>" . display_bbcodes("99%", "message") . "</td>\n";
echo "</tr>\n<tr>\n";
echo "<td valign='top' width='145' class='tbl2'>" . $locale['463'] . "</td>\n";
echo "<td class='tbl1'>\n";
if (iMOD || iSUPERADMIN) {
echo "<label><input type='checkbox' name='sticky_thread' value='1'" . $sticky_thread_check . " /> " . $locale['480'] . "</label><br />\n";
echo "<label><input type='checkbox' name='lock_thread' value='1'" . $lock_thread_check . " /> " . $locale['481'] . "</label><br />\n";
}
echo "<label><input type='checkbox' name='disable_smileys' value='1'" . $disable_smileys_check . " /> " . $locale['482'] . "</label>";
if (array_key_exists("user_sig", $userdata) && $userdata['user_sig']) {
echo "<br />\n<label><input type='checkbox' name='show_sig' value='1'" . $sig_checked . " /> " . $locale['483'] . "</label>";
}
if ($settings['thread_notify']) {
echo "<br />\n<label><input type='checkbox' name='notify_me' value='1'" . $notify_checked . " /> " . $locale['486'] . "</label>";
}
echo "</td>\n</tr>\n";
示例8: display_bbcodes
if (isset($_GET['action']) && $_GET['action'] == "edit") {
$sel = $data['album_parent'] == $data2['album_id'] ? " selected='selected'" : "";
}
$editlist .= "<option value='" . $data2['album_id'] . "'{$sel}>" . $data2['album_title'] . "</option>\n";
//pimped
}
}
//Pimped: Subcategory end
echo "<form name='inputform' method='post' action='{$formaction}' enctype='multipart/form-data'>\n";
echo "<table cellspacing='0' cellpadding='0' class='center'>\n<tr>\n";
echo "<td class='tbl'>" . $locale['440'] . "</td>\n";
echo "<td class='tbl'><input type='text' name='album_title' value='" . $album_title . "' maxlength='100' class='textbox' style='width:330px;' /></td>\n";
echo "</tr>\n<tr>\n";
echo "<td valign='top' class='tbl'>" . $locale['441'] . "</td>\n";
echo "<td class='tbl'><textarea name='album_description' cols='60' rows='5' class='textbox' style='width:330px;'>" . $album_description . "</textarea><br />\n";
echo display_bbcodes("300px", "album_description", "inputform", "b|i|u|center|small|url|mail|img|quote") . "</td>\n";
echo "</tr>\n<tr>\n";
echo "<td class='tbl'>" . $locale['446'] . "</td>\n";
// Pimped
echo "<td class='tbl'><select name='album_parent' class='textbox' style='width:150px;'>\n" . $editlist . "</select>\n";
echo "</td>\n</tr>\n<tr>\n";
echo "<td class='tbl'>" . $locale['442'] . "</td>\n";
echo "<td class='tbl'><select name='album_access' class='textbox' style='width:150px;'>\n" . $access_opts . "</select>\n";
echo $locale['443'] . "<input type='text' name='album_order' value='" . $album_order . "' maxlength='4' class='textbox' style='width:40px;' />\n";
echo "</td>\n</tr>\n<tr>\n";
echo "<td valign='top' class='tbl'>" . $locale['444'];
if (isset($_GET['action']) && $_GET['action'] == "edit" && ($album_thumb && file_exists(PHOTOS . $album_thumb))) {
echo "<br /><br />\n<a class='small' href='" . FUSION_SELF . $aidlink . "&action=deletethumb&album_id=" . $_GET['album_id'] . "'>" . $locale['469'] . "</a></td>\n";
echo "<td class='tbl'><img src='" . PHOTOS . $album_thumb . "' alt='album_thumb' />";
} else {
echo "</td>\n<td class='tbl'><input type='file' name='album_pic_file' class='textbox' style='width:250px;' />";
示例9: opentable
if (!in_array($option['0'], $hide)) {
$sel = $selected == $option['0'] ? " selected='selected'" : "";
$option_list .= "<option value='" . $option['0'] . "'{$sel}>" . $option['1'] . "</option>\n";
}
}
return $option_list;
}
opentable($forum_title);
echo "<form name='addforum' method='post' action='{$forum_action}'>\n";
echo "<table align='center' cellpadding='0' cellspacing='0' width='300'>\n<tr>\n";
echo "<td colspan='2' class='tbl'>" . $locale['520'] . "<br />\n";
echo "<input type='text' name='forum_name' value='" . $forum_name . "' class='textbox' style='width:285px;' /></td>\n";
echo "</tr>\n<tr>\n";
echo "<td colspan='2' class='tbl'>" . $locale['521'] . "<br />\n";
echo "<textarea type='text' name='forum_description' cols='70' rows='4' class='textbox' style='width:98%'>" . $forum_description . "</textarea><br />\n";
echo display_bbcodes("280px;", "forum_description", "addforum", "b|i|u|color|url|center|size|big|small") . "</td>\n";
echo "</tr>\n<tr>\n";
echo "<td class='tbl'>" . $locale['522'] . "<br />\n";
echo "<select name='forum_cat' class='textbox' style='width:225px;'>\n" . $cat_opts . "</select></td>\n";
echo "</tr>\n<tr>\n";
//subforums
echo "<td class='tbl'>" . $locale['519'] . "<br />\n";
//subforums
echo "<select name='forum_parent' class='textbox' style='width:225px;'>\n" . (isset($_GET['forum_id']) ? forum_admin_editopts($_GET['forum_id']) : forum_admin_editopts(null)) . "</select></td>\n";
//subforums
echo "<td width='55' class='tbl'>";
if (!isset($_GET['action']) || $_GET['action'] != "edit") {
echo $locale['523'] . "<br />\n<input type='text' name='forum_order' value='" . $forum_order . "' class='textbox' style='width:45px;' />";
echo "</td>\n</tr>\n<tr>\n";
echo "<td align='center' colspan='2' class='tbl'>\n";
echo "<input type='submit' name='save_forum' value='" . $locale['532'] . "' class='button' />";
示例10: redirect
} else {
redirect(FUSION_SELF . $aidlink);
}
}
if (isset($_GET['action']) && $_GET['action'] == "edit" && (isset($_GET['shout_id']) && isnum($_GET['shout_id']))) {
$result = dbquery("SELECT shout_id, shout_message FROM " . DB_SHOUTBOX . " WHERE shout_id='" . $_GET['shout_id'] . "'");
if (dbrows($result)) {
$data = dbarray($result);
opentable($locale['SB_edit_shout']);
echo "<form name='editform' method='post' action='" . FUSION_SELF . $aidlink . "&shout_id=" . $data['shout_id'] . "'>\n";
echo "<table cellpadding='0' cellspacing='0' class='center'>\n<tr>\n";
echo "<td class='tbl'>" . $locale['SB_message'] . "</td>\n";
echo "</tr>\n<tr>\n";
echo "<td class='tbl'><textarea name='shout_message' cols='60' rows='3' class='textbox' style='width:250px;'>" . str_replace("<br />", "", $data['shout_message']) . "</textarea></td>\n";
echo "</tr>\n<tr>\n";
echo "<td class='tbl' align='center'>" . display_bbcodes("150px;", "shout_message", "editform", "smiley|b|u|url|color") . "</td>\n";
echo "</tr>\n<tr>\n";
echo "<td align='center' class='tbl'><input type='submit' name='saveshout' value='" . $locale['SB_save_shout'] . "' class='button' /></td>\n";
echo "</tr>\n</table>\n\n</form>";
closetable();
} else {
redirect(FUSION_SELF . $aidlink);
}
}
opentable($locale['SB_edit_shout']);
echo $nav;
$result = dbquery("SELECT * FROM " . DB_SHOUTBOX);
$rows = dbrows($result);
if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) {
$_GET['rowstart'] = 0;
}
示例11: display_bbcodes
echo "<select name='date[day]'>";
for ($i = 1; $i <= 31; $i++) {
echo "<option value='" . $i . "'" . ($i == $date['day'] ? " selected='selected'" : "") . ">" . $i . "</option>";
}
echo "</select>-<select name='date[month]'>";
for ($i = 1; $i <= 12; $i++) {
echo "<option value='" . $i . "'" . ($i == $date['month'] ? " selected='selected'" : "") . ">" . $locale['alcr_mon_' . $i] . "</option>";
}
echo "</select>-<select name='date[year]'>";
for ($i = date('Y') - 5; $i <= date('Y') + 5; $i++) {
echo "<option value='" . $i . "'" . ($i == $date['year'] ? " selected='selected'" : "") . ">" . $i . "</option>";
}
echo "</select> <select name='date[hour]'>";
for ($i = 0; $i <= 23; $i++) {
echo "<option value='" . ($i < 10 ? "0" : "") . $i . "'" . ($i == $date['hour'] ? " selected='selected'" : "") . ">" . ($i < 10 ? "0" : "") . $i . "</option>";
}
echo "</select>:<select name='date[minute]'>";
for ($i = 0; $i <= 59; $i++) {
echo "<option value='" . ($i < 10 ? "0" : "") . $i . "'" . ($i == $date['minute'] ? " selected='selected'" : "") . ">" . ($i < 10 ? "0" : "") . $i . "</option>";
}
echo "</select>";
echo "</td>";
echo "</tr>";
echo "<tr valign='top'>";
echo "<td class='tbl'>" . $locale['alcr24'] . "</td>";
echo "<td class='tbl'><textarea class='textbox' name='desc' style='width: 100%' rows='10' id='desc'>" . $desc . "</textarea><br />" . display_bbcodes("99%", "desc") . "</td>";
echo "</tr>";
echo "<tr><td class='tbl' colspan='2'>" . ($is_edit ? "<input type='hidden' name='event_id' value='" . $event_id . "' />" : "") . "<input type='submit' class='button' name='save' value='" . $locale['alcr15'] . "' /> <a href='" . ($is_edit ? FUSION_SELF . "?p=day&date=" . $date['year'] . "-" . $date['month'] . "-" . $date['day'] : FUSION_SELF) . "'>" . $locale['alcr27'] . "</a></td></tr>";
echo "</table>";
echo "</form>";
closetable();
示例12: display_bbcodes
echo "<tr>\n";
echo "<td width='50%' class='tbl'><label for='welcome_pm'>" . $locale['welpm102'] . ":</label></td>\n";
echo "<td width='50%' class='tbl'>\r\n<select name='welcome_pm' class='textbox' id='welcome_pm'>\n\r\n<option value='0'" . ($settings['welcome_pm'] == 0 ? " selected='selected'" : "") . ">" . $locale['welpm104'] . "</option>\n\r\n<option value='1'" . ($settings['welcome_pm'] == 1 ? " selected='selected'" : "") . ">" . $locale['welpm103'] . "</option>\n\r\n</select>\n\r\n</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td width='50%' class='tbl'><label for='welcome_pm_from'>" . $locale['welpm105'] . ":</label></td>\n";
echo "<td width='50%' class='tbl'>" . $opt . "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td width='50%' class='tbl'><label for='welcome_pm_subject'>" . $locale['welpm110'] . ":</label></td>\n";
echo "<td width='50%' class='tbl'><input type='text' name='welcome_pm_subject' id='welcome_pm_subject' value='" . $settings['welcome_pm_subject'] . "' class='textbox' style='width: 250px;' /></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td width='50%' class='tbl' valign='top'><label for='welcome_pm_message'>" . $locale['welpm111'] . ":</label></td>\n";
echo "<td width='50%' class='tbl'>\n";
echo "<textarea name='welcome_pm_message' id='welcome_pm_message' class='textbox' rows='8' cols='55'>" . $settings['welcome_pm_message'] . "</textarea><br />\n";
echo display_bbcodes("98%", "welcome_pm_message", "settingsform");
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td align='center' colspan='2' class='tbl'><label>\r\n<input type='checkbox' name='welcome_pm_smiley' value='n'" . ($settings['welcome_pm_smiley'] == "n" ? " checked='checked'" : "") . " />" . $locale['welpm112'] . "</label></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td width='50%' class='tbl'>" . info_helper("welcome_message") . "</td>";
echo "<td width='50%' class='tbl'><input type='submit' name='savesettings' value='" . $locale['750'] . "' class='button' /></td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "</form>\n";
closetable();
}
require_once TEMPLATES . "footer.php";
示例13: showcomments
function showcomments($ctype, $cdb, $ccol, $cid, $clink, $ingroup)
{
global $settings, $locale, $userdata, $aidlink;
if (iMEMBER && (isset($_GET['c_action']) && $_GET['c_action'] == "edit") && (isset($_GET['comment_id']) && isnum($_GET['comment_id']))) {
$eresult = dbquery("SELECT tcm.*,user_name FROM " . DB_COMMENTS . " tcm\n\t\t\tLEFT JOIN " . DB_USERS . " tcu ON tcm.comment_name=tcu.user_id\n\t\t\tWHERE comment_id='" . $_GET['comment_id'] . "' AND comment_item_id='" . $cid . "' AND comment_type='" . $ctype . "'");
if (dbrows($eresult)) {
$edata = dbarray($eresult);
if (iADMIN && checkrights("C") || iMEMBER && $edata['comment_name'] == $userdata['user_id'] && isset($edata['user_name'])) {
$clink .= "&c_action=edit&comment_id=" . $edata['comment_id'];
$comment_message = $edata['comment_message'];
}
} else {
$comment_message = "";
}
} else {
$comment_message = "";
}
if (iMEMBER && $ingroup) {
add_to_head("<script type='text/javascript'>window.onload=setTimeout(\"hideall()\", 250);\n\t\tfunction hideall(){\n\t\t\tdocument.getElementById('bbcode').style.display='none';\n\t\t}\n\t\tfunction showhide(msg_id) {\n\t\t document.getElementById(msg_id).style.display = document.getElementById(msg_id).style.display == 'none' ? 'block' : 'none';\n\t\t}</script>\n");
require_once INCLUDES . "bbcode_include.php";
echo "<a id='edit_comment' name='edit_comment'></a>\n";
echo "<form name='inputform' method='post' action='" . $clink . "'>\n";
echo "<div align='center'>\n";
echo "<textarea name='comment_message' rows='2' class='textbox' style='width:90%'>" . $comment_message . "</textarea><br />\n";
echo "<input type='submit' name='post_comment' value='" . $locale['uc283'] . "' class='button' /> :: <a onClick='showhide(\"bbcode\")'>" . $locale['uc285'] . "</a>\n";
echo "<div id='bbcode'><br />" . display_bbcodes("360px", "comment_message") . "</div>\n";
echo "</div>\n</form>\n";
} else {
echo "<div align='center'>" . $locale['uc289'] . "</div>\n";
}
echo "</td>\n</tr>\n";
echo "<tr>\n<td class='tbl1' style='padding:6px;'>\n";
if (iMEMBER && (isset($_GET['c_action']) && $_GET['c_action'] == "delete") && (isset($_GET['comment_id']) && isnum($_GET['comment_id']))) {
if (iADMIN && checkrights("C") || iMEMBER && dbcount("(comment_id)", DB_COMMENTS, "comment_id='" . $_GET['comment_id'] . "' AND comment_name='" . $userdata['user_id'] . "'")) {
$result = dbquery("DELETE FROM " . DB_COMMENTS . " WHERE comment_id='" . $_GET['comment_id'] . "'" . (iADMIN ? "" : " AND comment_name='" . $userdata['user_id'] . "'"));
}
redirect($clink);
}
if ((iMEMBER || $settings['guestposts'] == "1") && isset($_POST['post_comment'])) {
if (iMEMBER) {
$comment_name = $userdata['user_id'];
} elseif ($settings['guestposts'] == "1") {
$comment_name = trim(stripinput($_POST['comment_name']));
$comment_name = preg_replace("(^[0-9]*)", "", $comment_name);
if (isnum($comment_name)) {
$comment_name = "";
}
}
$comment_message = trim(stripinput(censorwords($_POST['comment_message'])));
if (iMEMBER && (isset($_GET['c_action']) && $_GET['c_action'] == "edit") && (isset($_GET['comment_id']) && isnum($_GET['comment_id']))) {
$comment_updated = false;
if (iADMIN && checkrights("C") || iMEMBER && dbcount("(comment_id)", DB_COMMENTS, "comment_id='" . $_GET['comment_id'] . "' AND comment_name='" . $userdata['user_id'] . "'")) {
if ($comment_message) {
$result = dbquery("UPDATE " . DB_COMMENTS . " SET comment_message='{$comment_message}' WHERE comment_id='" . $_GET['comment_id'] . "'" . (iADMIN ? "" : " AND comment_name='" . $userdata['user_id'] . "'"));
$comment_updated = true;
}
}
if ($comment_updated) {
$c_start = (ceil(dbcount("(comment_id)", DB_COMMENTS, "comment_id<='" . $_GET['comment_id'] . "' AND comment_item_id='" . $cid . "' AND comment_type='" . $ctype . "'") / 10) - 1) * 10;
}
redirect($clink . "&rstart=" . (isset($c_start) && isnum($c_start) ? $c_start : ""));
} else {
if (!dbcount("(" . $ccol . ")", $cdb, $ccol . "='" . $cid . "'")) {
redirect(BASEDIR . "index.php");
}
if ($comment_name && $comment_message) {
require_once INCLUDES . "flood_include.php";
if (!flood_control("comment_datestamp", DB_COMMENTS, "comment_ip='" . USER_IP . "'")) {
$result = dbquery("INSERT INTO " . DB_COMMENTS . " (comment_item_id, comment_type, comment_name, comment_message, comment_datestamp, comment_ip) VALUES ('{$cid}', '{$ctype}', '{$comment_name}', '{$comment_message}', '" . time() . "', '" . USER_IP . "')");
}
}
$c_start = (ceil(dbcount("(comment_id)", DB_COMMENTS, "comment_item_id='" . $cid . "' AND comment_type='" . $ctype . "'") / 10) - 1) * 10;
redirect($clink . "&rstart=" . $c_start);
}
}
echo "<a id='comments' name='comments'></a>";
$c_rows = dbcount("(comment_id)", DB_COMMENTS, "comment_item_id='{$cid}' AND comment_type='{$ctype}'");
if (!isset($_GET['c_start']) || !isnum($_GET['c_start'])) {
$_GET['c_start'] = 0;
}
$result = dbquery("SELECT tcm.*,tcu.* FROM " . DB_COMMENTS . " tcm\n\t\tLEFT JOIN " . DB_USERS . " tcu ON tcm.comment_name=tcu.user_id\n\t\tWHERE comment_item_id='{$cid}' AND comment_type='{$ctype}'\n\t\tORDER BY comment_datestamp DESC LIMIT " . $_GET['c_start'] . ",10");
if (dbrows($result)) {
$i = $_GET['c_start'] + 1;
if ($c_rows > 10) {
echo "<div style='text-align:center;margin-bottom:5px;'>" . makecommentnav($_GET['c_start'], 10, $c_rows, 3, $clink . "&") . "</div>\n";
}
echo "<table width='100%' cellspacing='1' cellpadding='0'>\n";
while ($data = dbarray($result)) {
echo "<tr><td class='tbl2' rowspan='2' width='1'>\n";
if ($data['user_avatar']) {
list($width, $height) = getimagesize(IMAGES . "avatars/" . $data['user_avatar']);
$new_width = 70;
$new_height = $height * ($new_width / $height);
echo "<img src='" . IMAGES . "avatars/" . $data['user_avatar'] . "' alt='' style='width:" . $new_width . "px;height:" . $new_height . "px'>\n";
} else {
echo "<img src='" . IMAGES . "noav.gif' alt='' style='width:70px;height:70px'>\n";
}
echo "</td>\n<td class='tbl2' style='height:30px;'>";
if (iADMIN && checkrights("C") || iMEMBER && $data['comment_name'] == $userdata['user_id'] && isset($data['user_name'])) {
echo "<div style='float:right'>\n<a href='" . FUSION_REQUEST . "&c_action=edit&comment_id=" . $data['comment_id'] . "#edit_comment'>" . $locale['c108'] . "</a> |\n";
//.........这里部分代码省略.........
示例14: dbquery
if (isset($_POST['update_profile'])) {
$result = dbquery("update " . DB_USERS . " set user_sig='" . (isset($_POST['user_sig']) ? stripinput(trim($_POST['user_sig'])) : "") . "' where user_id='" . $userdata['user_id'] . "'");
redirect(FUSION_SELF . "?section=signature&status=updated");
}
if (isset($_GET['status']) && $_GET['status'] == "updated") {
echo "<tr>\n<td class='tbl1' style='padding:20px; text-align:center; font-weight:bold;'>" . $locale['uc334'] . "</td>\n</tr>\n";
}
add_to_title(" :: " . $locale['uc108']);
require_once INCLUDES . "bbcode_include.php";
echo "<tr>\n<td class='tbl2 navtitle'>" . $locale['uc108'] . "</td>\n</tr>\n";
echo "<tr>\n<td class='tbl2 navsection'>" . $locale['uc331'] . "</td>\n</tr>\n";
echo "<tr>\n<td class='tbl1' style='padding:7px;'><form action='" . FUSION_SELF . "?section=signature' method='post' name='sigform'>\n";
echo nl2br(parseubb(parsesmileys($userdata['user_sig']), "b|i|u||center|small|url|mail|img|color")) . "</td>\n</tr>\n";
echo "<tr>\n<td class='tbl2 navsection'>" . $locale['uc332'] . "</td>\n</tr>\n";
echo "<tr>\n<td class='tbl1' align='center'><textarea name='user_sig' cols='60' rows='5' class='textbox' style='width:295px'>" . (isset($userdata['user_sig']) ? $userdata['user_sig'] : "") . "</textarea><br />\n";
echo display_bbcodes("300px", "user_sig", "sigform", "smiley|b|i|u||center|small|url|mail|img|color") . "<br />";
echo "<input type='submit' name='update_profile' value='" . $locale['uc333'] . "' class='button'>\n</form>\n</td>\n</tr>\n";
/* User CP -> Settings -> Email & Password */
} elseif ($_GET['section'] == "email") {
add_to_title(" :: " . $locale['uc109']);
if (isset($_POST['update_profile'])) {
include INFUSIONS . "fusionboard4/includes/update_pass.php";
}
if (isset($_GET['status']) && $_GET['status'] == "updated") {
echo "<tr>\n<td class='tbl1' style='padding:20px; text-align:center; font-weight:bold;'>" . $locale['uc343'] . "</td>\n</tr>\n";
}
if (isset($error) && $error) {
echo "<tr>\n<td class='tbl1' style='padding:20px; text-align:center; font-weight:bold;'>" . $error . "</td>\n</tr>\n";
}
echo "<tr>\n<td class='tbl2 navtitle'>" . $locale['uc109'] . "</td>\n</tr>\n";
echo "<tr>\n<td class='tbl1' style='padding:10px;'>\n";
示例15: dbcount
}
echo "</td>\n<td valign='top' width='25%' class='small'>\r\n" . (checkrights("SU") ? "<a href='" . ADMIN . "submissions.php" . $aidlink . "#news_submissions'>" . $locale['254'] . "</a>" : $locale['254']) . " " . dbcount("(submit_id)", DB_SUBMISSIONS, "submit_type='n'") . "<br />\r\n" . (checkrights("SU") ? "<a href='" . ADMIN . "submissions.php" . $aidlink . "#article_submissions'>" . $locale['255'] . "</a>" : $locale['255']) . " " . dbcount("(submit_id)", DB_SUBMISSIONS, "submit_type='a'") . "<br />\r\n" . (checkrights("SU") ? "<a href='" . ADMIN . "submissions.php" . $aidlink . "#link_submissions'>" . $locale['256'] . "</a>" : $locale['256']) . " " . dbcount("(submit_id)", DB_SUBMISSIONS, "submit_type='l'") . "<br />\r\n" . (checkrights("SU") ? "<a href='" . ADMIN . "submissions.php" . $aidlink . "#photo_submissions'>" . $locale['260'] . "</a>" : $locale['260']) . " " . dbcount("(submit_id)", DB_SUBMISSIONS, "submit_type='p'") . "\r\n</td>\n<td valign='top' width='25%' class='small'>\r\n" . $locale['257'] . " " . dbcount("(comment_id)", DB_COMMENTS) . "<br />\r\n" . $locale['258'] . " " . dbcount("(shout_id)", DB_SHOUTBOX) . "<br />\r\n" . $locale['259'] . " " . dbcount("(post_id)", DB_POSTS) . "<br />\r\n" . $locale['261'] . " " . dbcount("(photo_id)", DB_PHOTOS) . "\r\n</td>\n</tr>\n</table>\n";
closetable();
// Admin Notes Panel
// Author: Johan Wilson (Barspin)
// Contact: barspin@blendtek.net
// modified by slaughter for PiF
if ($settings['adminmenue_notes']) {
include_once INCLUDES . "bbcode_include.php";
add_to_head("<script type='text/javascript'>\r\n\$(function(){\r\n\$('.loding').hide();\r\n\t\$('#notes_q div').hover(function() {\r\n\t\t\$(this).find('.loding').show();\r\n\t}, function() {\r\n\t\t\$(this).find('.loding').hide();\r\n\t});\r\n\$('#notes_q a').click(function(){\r\nvar element = \$(this);\r\nvar noteid = element.attr('id');\r\nvar info = 'id=' + noteid;\r\n\$(element).find('.loding').hide();\r\n\$(element).parent('li').animate({'opacity': .5 });\r\n\$(element).append(\"<img src='" . IMAGES . "ajax-loader.gif' alt='Loading' style='vertical-align:middle;border:0;' />\");\r\n\$.ajax({\r\n type: 'GET',\r\n url: '" . FUSION_SELF . $aidlink . "',\r\n data: info,\r\n success: function(){\r\n element.parent().eq(0).fadeOut('fast');\r\n }\r\n});\r\nreturn false;\r\n}); \r\n\$('#notes_submit').click(function(){\r\nvar loading = \$('div#note_loading').html(\"<img src='" . IMAGES . "ajax-loader.gif' alt='Loading' style='vertical-align:middle;border:0;' />\"); \r\nvar content = \$('#notes_content').val();\r\nvar name = \$('#note_name').val();\r\nvar url = 'submit=1&content=' + content + '&submit=1&name=' + name;\r\nvar type = \$('#notes_content').val();\r\nif (type == '') {\r\n \$(loading).hide();\r\n} else {\r\n \$(loading).show();\r\n \$.ajax({\r\n type: 'POST',\r\n url: '" . FUSION_SELF . $aidlink . "',\r\n data: url,\r\n success: function(){\r\n \$('div#note_loading').after(\"<div style='float:left' class='admin_note'><strong>\" + name + \"</strong> <img src='' alt='' style='height:16px;width:0px;' /><br /><div class='shoutboxdate'>" . showdate("%d %b %H:%M", time()) . "</div><div class='notify'>\" + content + \"</div></div>\");\r\n \$(loading).hide();\r\n \$('#notes_content').val('');\r\n }\r\n });\r\n}\r\n\r\nreturn false;\r\n});\r\n});\r\n</script>\r\n\r\n<style type='text/css'>\r\n.notify{background:#FFD6D6 none repeat scroll 0 0;border-bottom:2px solid #EF706F;border-top:2px solid #EF706F;color:#CC0000;padding:2px;margin-bottom:5px;margin-top: 2px;}\r\n.admin_note{min-width:100px;margin:3px;padding:3px 0;list-style-type:none;overflow:auto;}\r\n</style>");
openside($locale['note_01'], true);
echo "<div id='notes' style='float:left'>\n";
echo "<form id='notes_form' action='" . FUSION_SELF . $aidlink . "' method='post'>\n";
echo "<input type='hidden' name='note_name' id='note_name' value='" . $userdata['user_name'] . "' maxlength='30' />\n";
echo "<br/>\n<textarea name='notes_content' id='notes_content' class='textbox' cols='20' rows='4' style='width:140px'></textarea><br />\n";
echo "" . display_bbcodes("150px;", "notes_content", "notes_form", "smiley|b|u|url") . "";
echo "<input type='submit' id='notes_submit' name='notes_submit' class='button' value='" . $locale['note_02'] . "' />\n";
echo "</form>\n";
echo "</div><br />\n";
$result = dbquery("SELECT note_id, note_name, note_text, note_datestamp FROM " . DB_ADMIN_NOTES . " ORDER BY note_id DESC");
echo "<div class='admin_notes' id='notes_q'>";
echo "<div id='note_loading'></div>\n";
while ($data = dbarray($result)) {
echo "<div style='float:left' class='admin_note'>";
echo "<strong>" . $data['note_name'] . "</strong> ";
echo "<a id='" . $data['note_id'] . "' href='" . FUSION_SELF . "?id=" . $data['note_id'] . "'>";
echo "<img class='loding' src='" . get_image("cancel") . "' title='" . $locale['note_03'] . "?' alt='" . $locale['note_03'] . "?' style='border:0;margin:0;vertical-align:bottom;' />";
echo "</a><img src='' alt='' style='height:16px;width:0px;' /><br />";
echo "<div class='shoutboxdate'>" . showdate("%d %b %H:%M", $data['note_datestamp']) . "</div>";
echo "<div class='notify'>" . parseubb(parsesmileys($data['note_text']), "b|i|u|url") . "</div>";
echo "</div>";