Proper placing
This commit is contained in:
@ -3,6 +3,10 @@
|
|||||||
Version 1.1 ()
|
Version 1.1 ()
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
|
|
||||||
|
* Enhanced nl2br plugin so that it will NOT put breaks into pre-
|
||||||
|
defined tags like <pre>, <code> etc. Not enabled by default.
|
||||||
|
Thanks to Brendon K from the forums!
|
||||||
|
|
||||||
* Portuguese translation update by Angel
|
* Portuguese translation update by Angel
|
||||||
|
|
||||||
* Added functionality to reply to comments in the admin interface
|
* Added functionality to reply to comments in the admin interface
|
||||||
|
@ -610,7 +610,7 @@ function serendipity_makeThumbnail($file, $directory = '', $size = false, $thumb
|
|||||||
|
|
||||||
|
|
||||||
$infile = $serendipity['serendipityPath'] . $serendipity['uploadPath'] . $directory . $file;
|
$infile = $serendipity['serendipityPath'] . $serendipity['uploadPath'] . $directory . $file;
|
||||||
# echo 'From: ' . $infile . '<br />';
|
echo 'From: ' . $infile . '<br />';
|
||||||
if ($is_temporary) {
|
if ($is_temporary) {
|
||||||
$temppath = dirname($thumbname);
|
$temppath = dirname($thumbname);
|
||||||
if (!is_dir($temppath)) {
|
if (!is_dir($temppath)) {
|
||||||
@ -621,7 +621,7 @@ function serendipity_makeThumbnail($file, $directory = '', $size = false, $thumb
|
|||||||
$outfile = $serendipity['serendipityPath'] . $serendipity['uploadPath'] . $directory . $f . '.' . $thumbname . '.' . $suf;
|
$outfile = $serendipity['serendipityPath'] . $serendipity['uploadPath'] . $directory . $f . '.' . $thumbname . '.' . $suf;
|
||||||
}
|
}
|
||||||
$serendipity['last_outfile'] = $outfile;
|
$serendipity['last_outfile'] = $outfile;
|
||||||
# echo 'To: ' . $outfile . '<br />';
|
echo 'To: ' . $outfile . '<br />';
|
||||||
|
|
||||||
$fdim = @serendipity_getimagesize($infile, '', $suf);
|
$fdim = @serendipity_getimagesize($infile, '', $suf);
|
||||||
if (isset($fdim['noimage'])) {
|
if (isset($fdim['noimage'])) {
|
||||||
|
@ -18,14 +18,15 @@ if ($global_debug) {
|
|||||||
// rules to handle archives.
|
// rules to handle archives.
|
||||||
header('HTTP/1.0 200');
|
header('HTTP/1.0 200');
|
||||||
|
|
||||||
if ($serendipity['expose_s9y']) {
|
|
||||||
header('X-Blog: Serendipity'); // Used for installer detection
|
|
||||||
}
|
|
||||||
|
|
||||||
// Session are needed to also remember an autologin user on the frontend
|
// Session are needed to also remember an autologin user on the frontend
|
||||||
ob_start();
|
ob_start();
|
||||||
include('serendipity_config.inc.php');
|
include('serendipity_config.inc.php');
|
||||||
header('Content-Type: text/html; charset='. LANG_CHARSET);
|
header('Content-Type: text/html; charset='. LANG_CHARSET);
|
||||||
|
|
||||||
|
if ($serendipity['expose_s9y']) {
|
||||||
|
header('X-Blog: Serendipity'); // Used for installer detection
|
||||||
|
}
|
||||||
|
|
||||||
if ($serendipity['CacheControl']) {
|
if ($serendipity['CacheControl']) {
|
||||||
if (!empty($HTTP_SERVER_VARS['SERVER_SOFTWARE']) && strstr($HTTP_SERVER_VARS['SERVER_SOFTWARE'], 'Apache/2')) {
|
if (!empty($HTTP_SERVER_VARS['SERVER_SOFTWARE']) && strstr($HTTP_SERVER_VARS['SERVER_SOFTWARE'], 'Apache/2')) {
|
||||||
header('Cache-Control: no-cache, pre-check=0, post-check=0');
|
header('Cache-Control: no-cache, pre-check=0, post-check=0');
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
<?php # $Id$
|
<?php # $Id$
|
||||||
|
|
||||||
@define('PLUGIN_EVENT_NL2BR_NAME', 'Textformatierung: NL2BR');
|
@define('PLUGIN_EVENT_NL2BR_NAME', 'Textformatierung: NL2BR');
|
||||||
@define('PLUGIN_EVENT_NL2BR_DESC', 'Konvertiert Zeilenumbrüche zu HTML');
|
@define('PLUGIN_EVENT_NL2BR_DESC', 'Konvertiert Zeilenumbrüche zu HTML');
|
||||||
|
@define('PLUGIN_EVENT_NL2BR_ISOLATE_TAGS', 'Eine Liste von HTML-Tags, innerhalb derer keine Umbrüche konvertiert werden');
|
||||||
|
@define('PLUGIN_EVENT_NL2BR_ISOLATE_TAGS_DESC', 'Konfigurationsvorschlag: "code,pre,geshi,textarea". Trennen Sie mehrere HTML-Tags mit Komma. Hinweis: Die eingegebenen Tags sind reguläre Ausdrücke!');
|
@ -1,4 +1,6 @@
|
|||||||
<?php # $Id$
|
<?php # $Id$
|
||||||
|
|
||||||
@define('PLUGIN_EVENT_NL2BR_NAME', 'Textformatierung: NL2BR');
|
@define('PLUGIN_EVENT_NL2BR_NAME', 'Textformatierung: NL2BR');
|
||||||
@define('PLUGIN_EVENT_NL2BR_DESC', 'Konvertiert Zeilenumbr<62>che zu HTML');
|
@define('PLUGIN_EVENT_NL2BR_DESC', 'Konvertiert Zeilenumbr<62>che zu HTML');
|
||||||
|
@define('PLUGIN_EVENT_NL2BR_ISOLATE_TAGS', 'Eine Liste von HTML-Tags, innerhalb derer keine Umbr<62>che konvertiert werden');
|
||||||
|
@define('PLUGIN_EVENT_NL2BR_ISOLATE_TAGS_DESC', 'Konfigurationsvorschlag: "code,pre,geshi,textarea". Trennen Sie mehrere HTML-Tags mit Komma. Hinweis: Die eingegebenen Tags sind regul<75>re Ausdr<64>cke!');
|
@ -8,5 +8,6 @@
|
|||||||
|
|
||||||
@define('PLUGIN_EVENT_NL2BR_NAME', 'Markup: NL2BR');
|
@define('PLUGIN_EVENT_NL2BR_NAME', 'Markup: NL2BR');
|
||||||
@define('PLUGIN_EVENT_NL2BR_DESC', 'Convert newlines to BR tags');
|
@define('PLUGIN_EVENT_NL2BR_DESC', 'Convert newlines to BR tags');
|
||||||
|
@define('PLUGIN_EVENT_NL2BR_ISOLATE_TAGS', 'A list of HTML-tags where no breaks shall be converted');
|
||||||
|
@define('PLUGIN_EVENT_NL2BR_ISOLATE_TAGS_DESC', 'Suggestion: "code,pre,geshi,textarea". Seperate multiple tags with a comma. Hint: The entered tags are evaluated as regular expressions.');
|
||||||
?>
|
?>
|
||||||
|
@ -20,7 +20,7 @@ class serendipity_event_nl2br extends serendipity_event
|
|||||||
$propbag->add('description', PLUGIN_EVENT_NL2BR_DESC);
|
$propbag->add('description', PLUGIN_EVENT_NL2BR_DESC);
|
||||||
$propbag->add('stackable', false);
|
$propbag->add('stackable', false);
|
||||||
$propbag->add('author', 'Serendipity Team');
|
$propbag->add('author', 'Serendipity Team');
|
||||||
$propbag->add('version', '1.4');
|
$propbag->add('version', '1.5');
|
||||||
$propbag->add('requirements', array(
|
$propbag->add('requirements', array(
|
||||||
'serendipity' => '0.8',
|
'serendipity' => '0.8',
|
||||||
'smarty' => '2.6.7',
|
'smarty' => '2.6.7',
|
||||||
@ -50,6 +50,7 @@ class serendipity_event_nl2br extends serendipity_event
|
|||||||
);
|
);
|
||||||
|
|
||||||
$conf_array = array();
|
$conf_array = array();
|
||||||
|
$conf_array[] = 'isolate';
|
||||||
foreach($this->markup_elements as $element) {
|
foreach($this->markup_elements as $element) {
|
||||||
$conf_array[] = $element['name'];
|
$conf_array[] = $element['name'];
|
||||||
}
|
}
|
||||||
@ -71,21 +72,59 @@ class serendipity_event_nl2br extends serendipity_event
|
|||||||
|
|
||||||
function introspect_config_item($name, &$propbag)
|
function introspect_config_item($name, &$propbag)
|
||||||
{
|
{
|
||||||
$propbag->add('type', 'boolean');
|
switch($name) {
|
||||||
$propbag->add('name', constant($name));
|
case 'isolate':
|
||||||
$propbag->add('description', sprintf(APPLY_MARKUP_TO, constant($name)));
|
$propbag->add('type', 'string');
|
||||||
$propbag->add('default', 'true');
|
$propbag->add('name', PLUGIN_EVENT_NL2BR_ISOLATE_TAGS);
|
||||||
|
$propbag->add('description', PLUGIN_EVENT_NL2BR_ISOLATE_TAGS_DESC);
|
||||||
|
$propbag->add('default', '');
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
$propbag->add('type', 'boolean');
|
||||||
|
$propbag->add('name', constant($name));
|
||||||
|
$propbag->add('description', sprintf(APPLY_MARKUP_TO, constant($name)));
|
||||||
|
$propbag->add('default', 'true');
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isolate($src, $regexp = NULL) {
|
||||||
|
if($regexp) return preg_replace_callback($regexp, array($this, 'isolate'), $src);
|
||||||
|
global $_buf;
|
||||||
|
$_buf[] = $src[0];
|
||||||
|
return "\\001" . (count($_buf) - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
function restore($text) {
|
||||||
|
global $_buf;
|
||||||
|
return preg_replace('~\\001(\\d+)~e', '$_buf[$1]', $text);
|
||||||
|
}
|
||||||
|
|
||||||
function event_hook($event, &$bag, &$eventData) {
|
function event_hook($event, &$bag, &$eventData) {
|
||||||
global $serendipity;
|
global $serendipity;
|
||||||
|
static $isolate = null;
|
||||||
|
global $_buf;
|
||||||
|
|
||||||
$hooks = &$bag->get('event_hooks');
|
$hooks = &$bag->get('event_hooks');
|
||||||
|
|
||||||
if (isset($hooks[$event])) {
|
if (isset($hooks[$event])) {
|
||||||
switch($event) {
|
switch($event) {
|
||||||
case 'frontend_display':
|
case 'frontend_display':
|
||||||
|
if ($isolate === null) {
|
||||||
|
$isolate = $this->get_config('isolate');
|
||||||
|
$tags = (array)explode(',', $isolate);
|
||||||
|
$isolate = array();
|
||||||
|
foreach($tags AS $tag) {
|
||||||
|
$tag = trim($tag);
|
||||||
|
if (!empty($tag)) {
|
||||||
|
$isolate[] = $tag;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (count($isolate) < 1) {
|
||||||
|
$isolate = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($this->markup_elements as $temp) {
|
foreach ($this->markup_elements as $temp) {
|
||||||
if (serendipity_db_bool($this->get_config($temp['name'], true)) && isset($eventData[$temp['element']]) &&
|
if (serendipity_db_bool($this->get_config($temp['name'], true)) && isset($eventData[$temp['element']]) &&
|
||||||
@ -95,7 +134,13 @@ class serendipity_event_nl2br extends serendipity_event
|
|||||||
!isset($serendipity['POST']['properties']['ep_no_nl2br'])) {
|
!isset($serendipity['POST']['properties']['ep_no_nl2br'])) {
|
||||||
|
|
||||||
$element = $temp['element'];
|
$element = $temp['element'];
|
||||||
|
if ($isolate) {
|
||||||
|
$eventData[$element] = $this->isolate($eventData[$element], '~[<\\[](' . implode('|', $isolate) . ').*?[>\\]].*?[<\\[]/\\1[>\\]]~si');
|
||||||
|
}
|
||||||
$eventData[$element] = nl2br($eventData[$element]);
|
$eventData[$element] = nl2br($eventData[$element]);
|
||||||
|
if ($isolate) {
|
||||||
|
$eventData[$element] = $this->restore($eventData[$element]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -170,7 +170,7 @@ function fillInput(source, target) {ldelim}
|
|||||||
{rdelim}
|
{rdelim}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<form action="?" method="POST" id="uploadform" enctype="multipart/form-data" onsubmit="rememberOptions()">
|
<form target="_blank" action="?" method="POST" id="uploadform" enctype="multipart/form-data" onsubmit="rememberOptions()">
|
||||||
<div>
|
<div>
|
||||||
{if $media.max_file_size}
|
{if $media.max_file_size}
|
||||||
<input type="hidden" name="MAX_FILE_SIZE" value="{$max_file_size}" />
|
<input type="hidden" name="MAX_FILE_SIZE" value="{$max_file_size}" />
|
||||||
|
Reference in New Issue
Block a user