⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 html_editor.inc.php

📁 一款开源的sns系统源码 安装简单
💻 PHP
字号:
<?php// -----------------------------------------------------------------------// This file is part of AROUNDMe// // Copyright (C) 2003-2007 Barnraiser// http://www.barnraiser.org/// info@barnraiser.org// // This program is free software: you can redistribute it and/or modify// it under the terms of the GNU General Public License as published by// the Free Software Foundation, either version 3 of the License, or// (at your option) any later version.// // This program is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the// GNU General Public License for more details.// // You should have received a copy of the GNU General Public License// along with this program; see the file COPYING.txt.  If not, see// <http://www.gnu.org/licenses/>// -----------------------------------------------------------------------?><style>	.button {		cursor: pointer;		background-color: white;		border: 1px solid black;		padding-left: 2px;		padding-right: 2px;		color: black;		margin-top: 0px;		margin-bottom: 0px;		font-weight: bold;	}	.active {		background-color: #F0F0F1;		font-weight: bold;	}	img {		cursor: pointer;	}</style><?php	if (!isset($html_editor_name)) {		$html_editor_name = "content";	}	if (!isset($content)) {		$content = "";	}?><?phpif (isset($webspace['webspace_css'])) {?><script type="text/javascript">//<![CDATA[var webspace_css = <?php echo $webspace['webspace_css'];?>//]]></script><?php }?><script type="text/javascript" src="<?php echo $template_path_core;?>js/html_editor.js"></script><div style="float: left;" id="tools">	<a href="javascript:insertTag('<?php echo $html_editor_name; ?>', '<b>', '</b>');"><img src="<?php echo $template_path_core;?>img/am_editor_b.png" width="16" height="14" alt="b" border="0" /></a>	<a href="javascript:insertTag('<?php echo $html_editor_name; ?>', '<i>', '</i>');"><img src="<?php echo $template_path_core;?>img/am_editor_i.png" width="16" height="14" alt="i" border="0" /></a>	<a href="javascript:insertTag('<?php echo $html_editor_name; ?>', '\n<h3>', '</h3>');"><img src="<?php echo $template_path_core;?>img/am_editor_h.png" width="16" height="14" alt="h" border="0" /></a>	<a href="javascript:insertTag('<?php echo $html_editor_name; ?>', '<a href=&quot;', '&quot;>link title</a>');"><img src="<?php echo $template_path_core;?>img/am_editor_a.png" width="17" height="14" alt="a" border="0" /></a>	<a href="javascript:insertTag('<?php echo $html_editor_name; ?>', '\n<hr />\n', '');"><img src="<?php echo $template_path_core;?>img/am_editor_hr.png" width="16" height="14" alt="hr" border="0" /></a>	<a href="javascript:insertTag('<?php echo $html_editor_name; ?>', '\n<table border=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;2&quot;>\n<tr>\n<td>example entry</td>\n<td>example entry</td>\n</tr>\n</table>', '');"><img src="<?php echo $template_path_core;?>img/am_editor_table.png" width="16" height="14" alt="table" border="0" /></a>	<a href="javascript:insertTag('<?php echo $html_editor_name; ?>', '\n<ol>\n<li>list item 1</li>\n<li>list item 2</li>\n</ol>\n', '');"><img src="<?php echo $template_path_core;?>img/am_editor_ol.png" width="16" height="14" alt="ol" border="0" /></a>	<a href="javascript:insertTag('<?php echo $html_editor_name; ?>', '\n<ul>\n<li>list item 1</li>\n<li>list item 2</li>\n</ul>\n', '');"><img src="<?php echo $template_path_core;?>img/am_editor_ul.png" width="16" height="14" alt="ul" border="0" /></a>	<a href="javascript:insertTag('<?php echo $html_editor_name; ?>', '\n<pre>\n<code>\n//&nbsp;&nbsp;code example', '\n</code>\n</pre>\n');"><img src="<?php echo $template_path_core;?>img/am_editor_code.png" width="16" height="14" alt="code" border="0" /></a>	<?php if (isset($images)) {		if (substr($_SERVER["HTTP_HOST"], -1, 1) == "/") {			$server_path = 'http://' . substr($_SERVER["HTTP_HOST"], 0, -1);		}		else {			$server_path = 'http://' . $_SERVER["HTTP_HOST"];		}		if (dirname($_SERVER['PHP_SELF']) != "/") {			$server_path .=  dirname($_SERVER['PHP_SELF']);		}		?>		<select class="gui_select" style="margin:0px; border-color:#7f7f7f; padding:0px;" onChange="javascript:if(this.value!= '') {insertTag('<?php echo $html_editor_name; ?>', '<img src=&quot;<?php echo $server_path; ?>/components/core/relay/get_file.php?file='+this.value+'&quot alt=&quot', '&quot; />')};">			<option value=""><?php echo $lang['txt_images'];?></option>			<?php foreach ($images as $key => $i): ?>				<option value="<?php echo $i['file_md5_name'];?>_<?php echo $i['file_type']; ?>"><?php echo $i['file_title'];?></option>			<?php endforeach; ?>		</select>	<?php }?>	<?php if (isset($files)) {		if (substr($_SERVER["HTTP_HOST"], -1, 1) == "/") {			$server_path = 'http://' . substr($_SERVER["HTTP_HOST"], 0, -1);		}		else {			$server_path = 'http://' . $_SERVER["HTTP_HOST"];		}		if (dirname($_SERVER['PHP_SELF']) != "/") {			$server_path .=  dirname($_SERVER['PHP_SELF']);		}		?>		<select class="gui_select" style="margin:0px; border-color:#7f7f7f;padding:0px;" onChange="javascript:if(this.value!= '') {insertTag('<?php echo $html_editor_name; ?>', '<a href=&quot;<?php echo $server_path; ?>/components/core/relay/get_file.php?file='+this.value+'&quot alt=&quot&quot;>', 'file link</a>')};">			<option value=""><?php echo $lang['txt_files'];?></option>			<?php foreach ($files as $key => $i): ?>				<option value="<?php echo $i['file_md5_name'];?>_<?php echo $i['file_type']; ?>"><?php echo $i['file_title'];?></option>			<?php endforeach; ?>		</select>	<?php }?>	<?php if (isset($pages)) { ?>		<select class="gui_select" style="margin:0px; border-color:#7f7f7f; padding:0px;" onChange="javascript:if(this.value!= '') {insertTag('<?php echo $html_editor_name; ?>', '<interlink name=&quot'+this.value+'&quot>', this.value+'</interlink>')};">			<option value=""><?php echo $lang['txt_wiki_pages'];?></option>			<?php foreach ($pages as $key => $i): ?>				<option value="<?php echo $i['webpage_name'];?>"><?php echo $i['webpage_name'];?></option>			<?php endforeach; ?>		</select>	<?php }?></div><div style="float: right;">	<input type="button" id="_edit" class="button active" onclick="edit('<?php echo $html_editor_name; ?>');" value="edit" accesskey="E"/>	<input type="button" id="_preview" class="button" onclick="preview('<?php echo $html_editor_name; ?>');" value="preview" accesskey="P"/></div><div style="clear: both;"></div><iframe id="preview" style="width: 100%; height: 300px; border: 1px solid black; display: none;" src="<?php echo $template_path_core; ?>inc/html_preview.inc.php"></iframe><textarea id="<?php echo $html_editor_name; ?>" name="<?php echo $html_editor_name; ?>" style="width: 100%; height: 300px; border: 1px solid black; margin-top: 0px;"><?php echo $content;?></textarea>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -