1
0

Proper placing

This commit is contained in:
Garvin Hicking
2006-11-14 09:23:16 +00:00
parent 4ab2a93be8
commit 233195680f
8 changed files with 72 additions and 17 deletions

View File

@ -3,6 +3,10 @@
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
* Added functionality to reply to comments in the admin interface

View File

@ -610,7 +610,7 @@ function serendipity_makeThumbnail($file, $directory = '', $size = false, $thumb
$infile = $serendipity['serendipityPath'] . $serendipity['uploadPath'] . $directory . $file;
# echo 'From: ' . $infile . '<br />';
echo 'From: ' . $infile . '<br />';
if ($is_temporary) {
$temppath = dirname($thumbname);
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;
}
$serendipity['last_outfile'] = $outfile;
# echo 'To: ' . $outfile . '<br />';
echo 'To: ' . $outfile . '<br />';
$fdim = @serendipity_getimagesize($infile, '', $suf);
if (isset($fdim['noimage'])) {

View File

@ -18,14 +18,15 @@ if ($global_debug) {
// rules to handle archives.
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
ob_start();
include('serendipity_config.inc.php');
header('Content-Type: text/html; charset='. LANG_CHARSET);
if ($serendipity['expose_s9y']) {
header('X-Blog: Serendipity'); // Used for installer detection
}
if ($serendipity['CacheControl']) {
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');

View File

@ -1,4 +1,6 @@
<?php # $Id$
@define('PLUGIN_EVENT_NL2BR_NAME', 'Textformatierung: NL2BR');
@define('PLUGIN_EVENT_NL2BR_DESC', 'Konvertiert Zeilenumbrüche zu HTML');
@define('PLUGIN_EVENT_NL2BR_NAME', 'Textformatierung: NL2BR');
@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!');

View File

@ -1,4 +1,6 @@
<?php # $Id$
@define('PLUGIN_EVENT_NL2BR_NAME', 'Textformatierung: NL2BR');
@define('PLUGIN_EVENT_NL2BR_DESC', 'Konvertiert Zeilenumbr<62>che zu HTML');
@define('PLUGIN_EVENT_NL2BR_NAME', 'Textformatierung: NL2BR');
@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!');

View File

@ -8,5 +8,6 @@
@define('PLUGIN_EVENT_NL2BR_NAME', 'Markup: NL2BR');
@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.');
?>

View File

@ -20,7 +20,7 @@ class serendipity_event_nl2br extends serendipity_event
$propbag->add('description', PLUGIN_EVENT_NL2BR_DESC);
$propbag->add('stackable', false);
$propbag->add('author', 'Serendipity Team');
$propbag->add('version', '1.4');
$propbag->add('version', '1.5');
$propbag->add('requirements', array(
'serendipity' => '0.8',
'smarty' => '2.6.7',
@ -50,6 +50,7 @@ class serendipity_event_nl2br extends serendipity_event
);
$conf_array = array();
$conf_array[] = 'isolate';
foreach($this->markup_elements as $element) {
$conf_array[] = $element['name'];
}
@ -71,21 +72,59 @@ class serendipity_event_nl2br extends serendipity_event
function introspect_config_item($name, &$propbag)
{
switch($name) {
case 'isolate':
$propbag->add('type', 'string');
$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;
}
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) {
global $serendipity;
static $isolate = null;
global $_buf;
$hooks = &$bag->get('event_hooks');
if (isset($hooks[$event])) {
switch($event) {
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) {
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'])) {
$element = $temp['element'];
if ($isolate) {
$eventData[$element] = $this->isolate($eventData[$element], '~[<\\[](' . implode('|', $isolate) . ').*?[>\\]].*?[<\\[]/\\1[>\\]]~si');
}
$eventData[$element] = nl2br($eventData[$element]);
if ($isolate) {
$eventData[$element] = $this->restore($eventData[$element]);
}
}
}
return true;

View File

@ -170,7 +170,7 @@ function fillInput(source, target) {ldelim}
{rdelim}
</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>
{if $media.max_file_size}
<input type="hidden" name="MAX_FILE_SIZE" value="{$max_file_size}" />