tab2spaces, line indent cleanup, ending spaces
all without htmlarea & $smarty
This commit is contained in:
parent
3e16ad95d9
commit
9d34a5244c
bundled-libs
comment.phpinclude
admin
comments.inc.phpimages.inc.phpimport.inc.php
compat.inc.phpimporters
blogger.inc.phpgeneric.inc.phplivejournal.inc.phpnucleus.inc.phpphpbb.inc.phpserendipity.inc.phpvoodoopad.inc.phpwordpress.inc.php
installer.inc.phppersonal.inc.phpplugins.inc.phptemplates.inc.phpdb
functions.inc.phpfunctions_calendars.inc.phpfunctions_comments.inc.phpfunctions_config.inc.phpfunctions_entries.inc.phpfunctions_entries_admin.inc.phpfunctions_images.inc.phpfunctions_installer.inc.phpfunctions_permalinks.inc.phpfunctions_plugins_admin.inc.phpfunctions_rss.inc.phpfunctions_smarty.inc.phpfunctions_trackbacks.inc.phpgenpage.inc.phpplugin_api.inc.phpplugin_internal.inc.phpserendipity_smarty_class.inc.phptemplate_api.inc.phptpl
lang
UTF-8
plugin_lang.phpserendipity_lang_cn.inc.phpserendipity_lang_cs.inc.phpserendipity_lang_cz.inc.phpserendipity_lang_da.inc.phpserendipity_lang_fi.inc.phpserendipity_lang_hu.inc.phpserendipity_lang_is.inc.phpserendipity_lang_pl.inc.phpserendipity_lang_sa.inc.phpserendipity_lang_sk.inc.phpserendipity_lang_ta.inc.phpserendipity_lang_tn.inc.phpserendipity_lang_tw.inc.phpserendipity_lang_zh.inc.php
plugin_lang.phpserendipity_lang_cs.inc.phpserendipity_lang_cz.inc.phpserendipity_lang_fi.inc.phpserendipity_lang_pl.inc.phpserendipity_lang_sk.inc.phpserendipity_lang_tn.inc.phpserendipity_lang_tw.inc.phpserendipity_lang_zh.inc.phpplugins
serendipity_event_contentrewrite
serendipity_event_emoticate
serendipity_event_entryproperties/UTF-8
@ -376,8 +376,8 @@ class Cache_Lite
|
||||
}
|
||||
}
|
||||
if ($this->_automaticCleaningFactor>0 && ($this->_automaticCleaningFactor==1 || mt_rand(1, $this->_automaticCleaningFactor)==1)) {
|
||||
$this->clean(false, 'old');
|
||||
}
|
||||
$this->clean(false, 'old');
|
||||
}
|
||||
if ($this->_writeControl) {
|
||||
$res = $this->_writeAndControl($data);
|
||||
if (is_bool($res)) {
|
||||
@ -599,7 +599,7 @@ class Cache_Lite
|
||||
$motif = ($group) ? 'cache_'.$group.'_' : 'cache_';
|
||||
}
|
||||
if ($this->_memoryCaching) {
|
||||
foreach($this->_memoryCachingArray as $key => $v) {
|
||||
foreach($this->_memoryCachingArray as $key => $v) {
|
||||
if (strpos($key, $motif) !== false) {
|
||||
unset($this->_memoryCachingArray[$key]);
|
||||
$this->_memoryCachingCounter = $this->_memoryCachingCounter - 1;
|
||||
|
@ -89,7 +89,7 @@ class HTTP_Request {
|
||||
* @var string
|
||||
*/
|
||||
var $_user;
|
||||
|
||||
|
||||
/**
|
||||
* Basic Auth Password
|
||||
* @var string
|
||||
@ -101,25 +101,25 @@ class HTTP_Request {
|
||||
* @var object Net_Socket
|
||||
*/
|
||||
var $_sock;
|
||||
|
||||
|
||||
/**
|
||||
* Proxy server
|
||||
* @var string
|
||||
*/
|
||||
var $_proxy_host;
|
||||
|
||||
|
||||
/**
|
||||
* Proxy port
|
||||
* @var integer
|
||||
*/
|
||||
var $_proxy_port;
|
||||
|
||||
|
||||
/**
|
||||
* Proxy username
|
||||
* @var string
|
||||
*/
|
||||
var $_proxy_user;
|
||||
|
||||
|
||||
/**
|
||||
* Proxy password
|
||||
* @var string
|
||||
@ -133,7 +133,7 @@ class HTTP_Request {
|
||||
var $_postData;
|
||||
|
||||
/**
|
||||
* Request body
|
||||
* Request body
|
||||
* @var string
|
||||
*/
|
||||
var $_body;
|
||||
@ -145,7 +145,7 @@ class HTTP_Request {
|
||||
var $_bodyDisallowed = array('TRACE');
|
||||
|
||||
/**
|
||||
* Files to post
|
||||
* Files to post
|
||||
* @var array
|
||||
*/
|
||||
var $_postFiles = array();
|
||||
@ -155,25 +155,25 @@ class HTTP_Request {
|
||||
* @var float
|
||||
*/
|
||||
var $_timeout;
|
||||
|
||||
|
||||
/**
|
||||
* HTTP_Response object
|
||||
* @var object HTTP_Response
|
||||
*/
|
||||
var $_response;
|
||||
|
||||
|
||||
/**
|
||||
* Whether to allow redirects
|
||||
* @var boolean
|
||||
*/
|
||||
var $_allowRedirects;
|
||||
|
||||
|
||||
/**
|
||||
* Maximum redirects allowed
|
||||
* @var integer
|
||||
*/
|
||||
var $_maxRedirects;
|
||||
|
||||
|
||||
/**
|
||||
* Current number of redirects
|
||||
* @var integer
|
||||
@ -193,7 +193,7 @@ class HTTP_Request {
|
||||
var $_listeners = array();
|
||||
|
||||
/**
|
||||
* Whether to save response body in response object property
|
||||
* Whether to save response body in response object property
|
||||
* @var bool
|
||||
*/
|
||||
var $_saveBody = true;
|
||||
@ -286,7 +286,7 @@ class HTTP_Request {
|
||||
$this->addHeader('Accept-Encoding', 'gzip');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Generates a Host header for HTTP/1.1 requests
|
||||
*
|
||||
@ -303,14 +303,14 @@ class HTTP_Request {
|
||||
|
||||
} elseif ($this->_url->port == 443 AND strcasecmp($this->_url->protocol, 'https') == 0 AND strpos($this->_url->url, ':443') !== false) {
|
||||
$host = $this->_url->host . ':' . $this->_url->port;
|
||||
|
||||
|
||||
} else {
|
||||
$host = $this->_url->host;
|
||||
}
|
||||
|
||||
return $host;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Resets the object to its initial state (DEPRECATED).
|
||||
* Takes the same parameters as the constructor.
|
||||
@ -344,7 +344,7 @@ class HTTP_Request {
|
||||
$this->addHeader('Host', $this->_generateHostHeader());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets a proxy to be used
|
||||
*
|
||||
@ -438,8 +438,8 @@ class HTTP_Request {
|
||||
function addQueryString($name, $value, $preencoded = false)
|
||||
{
|
||||
$this->_url->addQueryString($name, $value, $preencoded);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the querystring to literally what you supply
|
||||
*
|
||||
@ -546,7 +546,7 @@ class HTTP_Request {
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears any postdata that has been added (DEPRECATED).
|
||||
* Clears any postdata that has been added (DEPRECATED).
|
||||
*
|
||||
* Useful for multiple request scenarios.
|
||||
*
|
||||
@ -570,9 +570,9 @@ class HTTP_Request {
|
||||
$cookies = isset($this->_requestHeaders['cookie']) ? $this->_requestHeaders['cookie']. '; ' : '';
|
||||
$this->addHeader('Cookie', $cookies . $name . '=' . $value);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Clears any cookies that have been added (DEPRECATED).
|
||||
* Clears any cookies that have been added (DEPRECATED).
|
||||
*
|
||||
* Useful for multiple request scenarios
|
||||
*
|
||||
@ -645,7 +645,7 @@ class HTTP_Request {
|
||||
AND $this->getResponseCode() < 399
|
||||
AND !empty($this->_response->_headers['location'])) {
|
||||
|
||||
|
||||
|
||||
$redirect = $this->_response->_headers['location'];
|
||||
|
||||
// Absolute URL
|
||||
@ -655,7 +655,7 @@ class HTTP_Request {
|
||||
// Absolute path
|
||||
} elseif ($redirect[0] == '/') {
|
||||
$this->_url->path = $redirect;
|
||||
|
||||
|
||||
// Relative path
|
||||
} elseif (substr($redirect, 0, 3) == '../' OR substr($redirect, 0, 2) == './') {
|
||||
if (substr($this->_url->path, -1) == '/') {
|
||||
@ -665,7 +665,7 @@ class HTTP_Request {
|
||||
}
|
||||
$redirect = Net_URL::resolvePath($redirect);
|
||||
$this->_url->path = $redirect;
|
||||
|
||||
|
||||
// Filename, no path
|
||||
} else {
|
||||
if (substr($this->_url->path, -1) == '/') {
|
||||
@ -842,7 +842,7 @@ class HTTP_Request {
|
||||
$request .= 'Content-Length: ' . strlen($this->_body) . "\r\n\r\n";
|
||||
$request .= $this->_body;
|
||||
}
|
||||
|
||||
|
||||
return $request;
|
||||
}
|
||||
|
||||
@ -894,7 +894,7 @@ class HTTP_Request {
|
||||
|
||||
|
||||
/**
|
||||
* Removes a Listener from the list of listeners
|
||||
* Removes a Listener from the list of listeners
|
||||
*
|
||||
* @param object HTTP_Request_Listener instance to detach
|
||||
* @return boolean whether the listener was successfully detached
|
||||
@ -951,13 +951,13 @@ class HTTP_Response
|
||||
* @var string
|
||||
*/
|
||||
var $_protocol;
|
||||
|
||||
|
||||
/**
|
||||
* Return code
|
||||
* @var string
|
||||
*/
|
||||
var $_code;
|
||||
|
||||
|
||||
/**
|
||||
* Response headers
|
||||
* @var array
|
||||
@ -965,7 +965,7 @@ class HTTP_Response
|
||||
var $_headers;
|
||||
|
||||
/**
|
||||
* Cookies set in response
|
||||
* Cookies set in response
|
||||
* @var array
|
||||
*/
|
||||
var $_cookies;
|
||||
@ -1078,7 +1078,7 @@ class HTTP_Response
|
||||
list($headername, $headervalue) = explode(':', $header, 2);
|
||||
$headername = strtolower($headername);
|
||||
$headervalue = ltrim($headervalue);
|
||||
|
||||
|
||||
if ('set-cookie' != $headername) {
|
||||
if (isset($this->_headers[$headername])) {
|
||||
$this->_headers[$headername] .= ',' . $headervalue;
|
||||
@ -1154,7 +1154,7 @@ class HTTP_Response
|
||||
if (0 == $this->_chunkLength) {
|
||||
$line = $this->_sock->readLine();
|
||||
if (preg_match('/^([0-9a-f]+)/i', $line, $matches)) {
|
||||
$this->_chunkLength = hexdec($matches[1]);
|
||||
$this->_chunkLength = hexdec($matches[1]);
|
||||
// Chunk with zero length indicates the end
|
||||
if (0 == $this->_chunkLength) {
|
||||
$this->_sock->readLine(); // make this an eof()
|
||||
|
@ -122,12 +122,12 @@ class ONYX_RSS
|
||||
($file && file_exists($file) && $time <= $this->rss['cache_age'] && $mod >= (time() - ($this->rss['cache_age'] * 60))))
|
||||
{
|
||||
clearstatcache();
|
||||
|
||||
|
||||
require_once S9Y_PEAR_PATH . 'HTTP/Request.php';
|
||||
serendipity_request_start();
|
||||
$req = new HTTP_Request($uri, array('allowRedirects' => true, 'maxRedirects' => 5));
|
||||
$res = $req->sendRequest();
|
||||
|
||||
|
||||
if (PEAR::isError($res) || $req->getResponseCode() != '200')
|
||||
{
|
||||
serendipity_request_end();
|
||||
|
@ -60,15 +60,15 @@ class Text_Wiki_Parse_Code extends Text_Wiki_Parse {
|
||||
'attr' => array('type' => '')
|
||||
);
|
||||
} else {
|
||||
// get the attributes...
|
||||
$attr = $this->getAttrs($args);
|
||||
|
||||
// ... and make sure we have a 'type'
|
||||
if (! isset($attr['type'])) {
|
||||
$attr['type'] = '';
|
||||
}
|
||||
|
||||
// retain the options
|
||||
// get the attributes...
|
||||
$attr = $this->getAttrs($args);
|
||||
|
||||
// ... and make sure we have a 'type'
|
||||
if (! isset($attr['type'])) {
|
||||
$attr['type'] = '';
|
||||
}
|
||||
|
||||
// retain the options
|
||||
$options = array(
|
||||
'text' => $matches[3],
|
||||
'attr' => $attr
|
||||
|
@ -5,7 +5,7 @@
|
||||
class Text_Wiki_Render_Xhtml_Function extends Text_Wiki_Render {
|
||||
|
||||
var $conf = array(
|
||||
// list separator for params and throws
|
||||
// list separator for params and throws
|
||||
'list_sep' => ', ',
|
||||
|
||||
// the "main" format string
|
||||
|
@ -39,9 +39,9 @@ class Text_Wiki_Render_Xhtml_Wikilink extends Text_Wiki_Render {
|
||||
if (isset($this->conf['exists_callback'])) {
|
||||
$callback =& $this->conf['exists_callback'];
|
||||
} else {
|
||||
$callback = false;
|
||||
$callback = false;
|
||||
}
|
||||
|
||||
|
||||
if ($callback) {
|
||||
// use the callback function
|
||||
$exists = call_user_func($callback, $page);
|
||||
|
@ -292,54 +292,54 @@ class Text_Wiki_Rule {
|
||||
|
||||
/**
|
||||
*
|
||||
* Simple method to extract 'option="value"' portions of wiki markup,
|
||||
* typically used only in macros.
|
||||
*
|
||||
* The syntax is pretty strict; there can be no spaces between the
|
||||
* option name, the equals, and the first double-quote; the value
|
||||
* must be surrounded by double-quotes. You can escape characters in
|
||||
* the value with a backslash, and the backslash will be stripped for
|
||||
* you.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @param string $text The "macro options" portion of macro markup.
|
||||
*
|
||||
* @return array An associative array of key-value pairs where the
|
||||
* key is the option name and the value is the option value.
|
||||
* Simple method to extract 'option="value"' portions of wiki markup,
|
||||
* typically used only in macros.
|
||||
*
|
||||
* The syntax is pretty strict; there can be no spaces between the
|
||||
* option name, the equals, and the first double-quote; the value
|
||||
* must be surrounded by double-quotes. You can escape characters in
|
||||
* the value with a backslash, and the backslash will be stripped for
|
||||
* you.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @param string $text The "macro options" portion of macro markup.
|
||||
*
|
||||
* @return array An associative array of key-value pairs where the
|
||||
* key is the option name and the value is the option value.
|
||||
*
|
||||
*/
|
||||
|
||||
function getMacroArgs($text)
|
||||
{
|
||||
// find the =" sections;
|
||||
$tmp = explode('="', trim($text));
|
||||
|
||||
// basic setup
|
||||
$k = count($tmp) - 1;
|
||||
$arg = array();
|
||||
$key = null;
|
||||
|
||||
// loop through the sections
|
||||
foreach ($tmp as $i => $val) {
|
||||
|
||||
// first element is always the first key
|
||||
if ($i == 0) {
|
||||
$key = trim($val);
|
||||
continue;
|
||||
}
|
||||
|
||||
// find the last double-quote in the value.
|
||||
// the part to the left is the value for the last key,
|
||||
// the part to the right is the next key name
|
||||
$pos = strrpos($val, '"');
|
||||
$arg[$key] = stripslashes(substr($val, 0, $pos));
|
||||
$key = trim(substr($val, $pos+1));
|
||||
|
||||
}
|
||||
|
||||
return $arg;
|
||||
|
||||
// find the =" sections;
|
||||
$tmp = explode('="', trim($text));
|
||||
|
||||
// basic setup
|
||||
$k = count($tmp) - 1;
|
||||
$arg = array();
|
||||
$key = null;
|
||||
|
||||
// loop through the sections
|
||||
foreach ($tmp as $i => $val) {
|
||||
|
||||
// first element is always the first key
|
||||
if ($i == 0) {
|
||||
$key = trim($val);
|
||||
continue;
|
||||
}
|
||||
|
||||
// find the last double-quote in the value.
|
||||
// the part to the left is the value for the last key,
|
||||
// the part to the right is the next key name
|
||||
$pos = strrpos($val, '"');
|
||||
$arg[$key] = stripslashes(substr($val, 0, $pos));
|
||||
$key = trim(substr($val, $pos+1));
|
||||
|
||||
}
|
||||
|
||||
return $arg;
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -189,21 +189,21 @@ class Text_Wiki_Rule_blockquote extends Text_Wiki_Rule {
|
||||
{
|
||||
$type = $options['type'];
|
||||
$level = $options['level'];
|
||||
|
||||
// set up indenting so that the results look nice; we do this
|
||||
// in two steps to avoid str_pad mathematics. ;-)
|
||||
$pad = str_pad('', $level, "\t");
|
||||
$pad = str_replace("\t", ' ', $pad);
|
||||
|
||||
// starting
|
||||
if ($type == 'start') {
|
||||
return "$pad<blockquote>";
|
||||
}
|
||||
|
||||
// ending
|
||||
if ($type == 'end') {
|
||||
return $pad . "</blockquote>\n";
|
||||
}
|
||||
|
||||
// set up indenting so that the results look nice; we do this
|
||||
// in two steps to avoid str_pad mathematics. ;-)
|
||||
$pad = str_pad('', $level, "\t");
|
||||
$pad = str_replace("\t", ' ', $pad);
|
||||
|
||||
// starting
|
||||
if ($type == 'start') {
|
||||
return "$pad<blockquote>";
|
||||
}
|
||||
|
||||
// ending
|
||||
if ($type == 'end') {
|
||||
return $pad . "</blockquote>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -84,15 +84,15 @@ class Text_Wiki_Rule_center extends Text_Wiki_Rule {
|
||||
|
||||
function renderXhtml($options)
|
||||
{
|
||||
if ($options['type'] == 'start') {
|
||||
//return "\n<center>\n";
|
||||
return '<div style="text-align: center;">';
|
||||
}
|
||||
|
||||
if ($options['type'] == 'end') {
|
||||
//return "</center>\n";
|
||||
return '</div>';
|
||||
}
|
||||
if ($options['type'] == 'start') {
|
||||
//return "\n<center>\n";
|
||||
return '<div style="text-align: center;">';
|
||||
}
|
||||
|
||||
if ($options['type'] == 'end') {
|
||||
//return "</center>\n";
|
||||
return '</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -35,8 +35,8 @@
|
||||
*/
|
||||
|
||||
class Text_Wiki_Rule_code extends Text_Wiki_Rule {
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* The regular expression used to find source text matching this
|
||||
@ -47,10 +47,10 @@ class Text_Wiki_Rule_code extends Text_Wiki_Rule {
|
||||
* @var string
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
var $regex = '/^(\<code( .+)?\>)\n(.+)\n(\<\/code\>)(\s|$)/Umsi';
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Generates a token entry for the matched text. Token options are:
|
||||
@ -65,12 +65,12 @@ class Text_Wiki_Rule_code extends Text_Wiki_Rule {
|
||||
* the source text.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
function process(&$matches)
|
||||
{
|
||||
// are there additional arguments?
|
||||
$args = trim($matches[2]);
|
||||
|
||||
|
||||
if ($args == '') {
|
||||
$options = array(
|
||||
'text' => $matches[3],
|
||||
@ -82,11 +82,11 @@ class Text_Wiki_Rule_code extends Text_Wiki_Rule {
|
||||
'args' => $this->getMacroArgs($args)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
return $this->addToken($options) . $matches[5];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Renders a token into text matching the requested format.
|
||||
@ -99,36 +99,36 @@ class Text_Wiki_Rule_code extends Text_Wiki_Rule {
|
||||
* @return string The text rendered from the token options.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
function renderXhtml($options)
|
||||
{
|
||||
// trim opening and closing whitespace
|
||||
$text = trim($options['text']);
|
||||
$args = $options['args'];
|
||||
|
||||
|
||||
if (strtolower($args['type']) == 'php') {
|
||||
|
||||
// PHP code example
|
||||
|
||||
|
||||
// PHP code example
|
||||
|
||||
// add the PHP tags
|
||||
$text = "<?php\n" . $options['text'] . "\n?>"; // <?php
|
||||
|
||||
|
||||
// convert tabs to four spaces
|
||||
$text = str_replace("\t", " ", $text);
|
||||
|
||||
|
||||
// colorize the code block (also converts HTML entities and adds
|
||||
// <code>...</code> tags)
|
||||
ob_start();
|
||||
highlight_string($text);
|
||||
$text = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
|
||||
// replace <br /> tags with simple newlines
|
||||
//$text = str_replace("<br />", "\n", $text);
|
||||
|
||||
|
||||
// replace non-breaking space with simple spaces
|
||||
//$text = str_replace(" ", " ", $text);
|
||||
|
||||
|
||||
// replace <br /> tags with simple newlines
|
||||
// replace non-breaking space with simple spaces
|
||||
// translate old HTML to new XHTML
|
||||
@ -141,18 +141,18 @@ class Text_Wiki_Rule_code extends Text_Wiki_Rule {
|
||||
'color="' => 'style="color:'
|
||||
);
|
||||
$text = strtr($text, $map);
|
||||
|
||||
|
||||
// get rid of the last newline inside the code block
|
||||
// (becuase higlight_string puts one there)
|
||||
if (substr($text, -8) == "\n</code>") {
|
||||
$text = substr($text, 0, -8) . "</code>";
|
||||
}
|
||||
|
||||
|
||||
// done
|
||||
$text = "<pre>$text</pre>";
|
||||
|
||||
|
||||
} elseif (strtolower($args['type']) == 'html') {
|
||||
|
||||
|
||||
// HTML code example:
|
||||
// add <html> opening and closing tags,
|
||||
// convert tabs to four spaces,
|
||||
@ -161,7 +161,7 @@ class Text_Wiki_Rule_code extends Text_Wiki_Rule {
|
||||
$text = "<html>\n$text\n</html>";
|
||||
$text = htmlentities($text);
|
||||
$text = "<pre><code>$text</code></pre>";
|
||||
|
||||
|
||||
} else {
|
||||
// generic code example:
|
||||
// convert tabs to four spaces,
|
||||
@ -170,7 +170,7 @@ class Text_Wiki_Rule_code extends Text_Wiki_Rule {
|
||||
$text = htmlentities($text);
|
||||
$text = "<pre><code>$text</code></pre>";
|
||||
}
|
||||
|
||||
|
||||
return "\n$text\n";
|
||||
}
|
||||
}
|
||||
|
@ -88,17 +88,17 @@ class Text_Wiki_Rule_colortext extends Text_Wiki_Rule {
|
||||
function process(&$matches)
|
||||
{
|
||||
$start = $this->addToken(
|
||||
array(
|
||||
'type' => 'start',
|
||||
'color' => $matches[1]
|
||||
)
|
||||
array(
|
||||
'type' => 'start',
|
||||
'color' => $matches[1]
|
||||
)
|
||||
);
|
||||
|
||||
$end = $this->addToken(
|
||||
array(
|
||||
'type' => 'end',
|
||||
'color' => $matches[1]
|
||||
)
|
||||
array(
|
||||
'type' => 'end',
|
||||
'color' => $matches[1]
|
||||
)
|
||||
);
|
||||
|
||||
return $start . $matches[2] . $end;
|
||||
|
@ -91,12 +91,12 @@ class Text_Wiki_Rule_embed extends Text_Wiki_Rule {
|
||||
|
||||
function renderXhtml($options)
|
||||
{
|
||||
$file = $this->_conf['base'] . $options['path'];
|
||||
ob_start();
|
||||
include($file);
|
||||
$output = ob_get_contents();
|
||||
ob_end_clean();
|
||||
return $output;
|
||||
}
|
||||
$file = $this->_conf['base'] . $options['path'];
|
||||
ob_start();
|
||||
include($file);
|
||||
$output = ob_get_contents();
|
||||
ob_end_clean();
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -91,13 +91,13 @@ class Text_Wiki_Rule_emphasis extends Text_Wiki_Rule {
|
||||
|
||||
function renderXhtml($options)
|
||||
{
|
||||
if ($options['type'] == 'start') {
|
||||
return '<em>';
|
||||
}
|
||||
|
||||
if ($options['type'] == 'end') {
|
||||
return '</em>';
|
||||
}
|
||||
if ($options['type'] == 'start') {
|
||||
return '<em>';
|
||||
}
|
||||
|
||||
if ($options['type'] == 'end') {
|
||||
return '</em>';
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -151,12 +151,12 @@ class Text_Wiki_Rule_freelink extends Text_Wiki_Rule {
|
||||
// the page exists, show a link to the page
|
||||
$href = $this->_conf['view_url'];
|
||||
if (strpos($href, '%s') === false) {
|
||||
// use the old form
|
||||
$href = $href . $page . '#' . $anchor;
|
||||
} else {
|
||||
// use the new form
|
||||
$href = sprintf($href, $page . '#' . $anchor);
|
||||
}
|
||||
// use the old form
|
||||
$href = $href . $page . '#' . $anchor;
|
||||
} else {
|
||||
// use the new form
|
||||
$href = sprintf($href, $page . '#' . $anchor);
|
||||
}
|
||||
return "<a href=\"$href\">$text</a>";
|
||||
|
||||
} else {
|
||||
@ -165,12 +165,12 @@ class Text_Wiki_Rule_freelink extends Text_Wiki_Rule {
|
||||
// the "new page" text
|
||||
$href = $this->_conf['new_url'];
|
||||
if (strpos($href, '%s') === false) {
|
||||
// use the old form
|
||||
$href = $href . $page;
|
||||
} else {
|
||||
// use the new form
|
||||
$href = sprintf($href, $page);
|
||||
}
|
||||
// use the old form
|
||||
$href = $href . $page;
|
||||
} else {
|
||||
// use the new form
|
||||
$href = sprintf($href, $page);
|
||||
}
|
||||
return $text . "<a href=\"$href\">{$this->_conf['new_text']}</a>";
|
||||
|
||||
}
|
||||
|
@ -73,20 +73,20 @@ class Text_Wiki_Rule_image extends Text_Wiki_Rule {
|
||||
|
||||
function process(&$matches)
|
||||
{
|
||||
$pos = strpos($matches[2], ' ');
|
||||
|
||||
if ($pos === false) {
|
||||
$options = array(
|
||||
'src' => $matches[2],
|
||||
'args' => array());
|
||||
} else {
|
||||
// everything after the space is macro options
|
||||
$options = array(
|
||||
'src' => substr($matches[2], 0, $pos),
|
||||
'args' => $this->getMacroArgs(substr($matches[2], $pos+1))
|
||||
);
|
||||
}
|
||||
|
||||
$pos = strpos($matches[2], ' ');
|
||||
|
||||
if ($pos === false) {
|
||||
$options = array(
|
||||
'src' => $matches[2],
|
||||
'args' => array());
|
||||
} else {
|
||||
// everything after the space is macro options
|
||||
$options = array(
|
||||
'src' => substr($matches[2], 0, $pos),
|
||||
'args' => $this->getMacroArgs(substr($matches[2], $pos+1))
|
||||
);
|
||||
}
|
||||
|
||||
return $this->addToken($options);
|
||||
}
|
||||
|
||||
@ -106,31 +106,31 @@ class Text_Wiki_Rule_image extends Text_Wiki_Rule {
|
||||
|
||||
function renderXhtml($options)
|
||||
{
|
||||
$src = '"' . $this->_conf['base'] . $options['src'] . '"';
|
||||
|
||||
if (isset($options['args']['link'])) {
|
||||
// this image has a wikilink
|
||||
$href = $this->_wiki->getRuleConf('wikilink', 'view_url') .
|
||||
$options['args']['link'];
|
||||
} else {
|
||||
// image is not linked
|
||||
$href = null;
|
||||
}
|
||||
|
||||
// unset these so they don't show up as attributes
|
||||
unset($options['args']['src']);
|
||||
unset($options['args']['link']);
|
||||
|
||||
$attr = '';
|
||||
foreach ($options['args'] as $key => $val) {
|
||||
$attr .= "$key=\"$val\" ";
|
||||
}
|
||||
|
||||
if ($href) {
|
||||
return "<a href=\"$href\"><img src=$src $attr/></a>";
|
||||
} else {
|
||||
return "<img src=$src $attr/>";
|
||||
}
|
||||
}
|
||||
$src = '"' . $this->_conf['base'] . $options['src'] . '"';
|
||||
|
||||
if (isset($options['args']['link'])) {
|
||||
// this image has a wikilink
|
||||
$href = $this->_wiki->getRuleConf('wikilink', 'view_url') .
|
||||
$options['args']['link'];
|
||||
} else {
|
||||
// image is not linked
|
||||
$href = null;
|
||||
}
|
||||
|
||||
// unset these so they don't show up as attributes
|
||||
unset($options['args']['src']);
|
||||
unset($options['args']['link']);
|
||||
|
||||
$attr = '';
|
||||
foreach ($options['args'] as $key => $val) {
|
||||
$attr .= "$key=\"$val\" ";
|
||||
}
|
||||
|
||||
if ($href) {
|
||||
return "<a href=\"$href\"><img src=$src $attr/></a>";
|
||||
} else {
|
||||
return "<img src=$src $attr/>";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -69,12 +69,12 @@ class Text_Wiki_Rule_include extends Text_Wiki_Rule {
|
||||
|
||||
function process(&$matches)
|
||||
{
|
||||
$file = $this->_conf['base'] . $matches[2];
|
||||
ob_start();
|
||||
include($file);
|
||||
$output = ob_get_contents();
|
||||
ob_end_clean();
|
||||
return $output;
|
||||
$file = $this->_conf['base'] . $matches[2];
|
||||
ob_start();
|
||||
include($file);
|
||||
$output = ob_get_contents();
|
||||
ob_end_clean();
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -50,36 +50,36 @@ class Text_Wiki_Rule_interwiki extends Text_Wiki_Rule {
|
||||
|
||||
function parse()
|
||||
{
|
||||
// described interwiki links
|
||||
$tmp_regex = '/\[' . $this->regex . ' (.+?)\]/';
|
||||
// described interwiki links
|
||||
$tmp_regex = '/\[' . $this->regex . ' (.+?)\]/';
|
||||
$this->_wiki->_source = preg_replace_callback(
|
||||
$tmp_regex,
|
||||
array(&$this, 'processDescr'),
|
||||
$this->_wiki->_source
|
||||
);
|
||||
|
||||
// standalone interwiki links
|
||||
|
||||
// standalone interwiki links
|
||||
$tmp_regex = '/' . $this->regex . '/';
|
||||
$this->_wiki->_source = preg_replace_callback(
|
||||
$tmp_regex,
|
||||
array(&$this, 'process'),
|
||||
$this->_wiki->_source
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Generates a replacement for the matched standalone interwiki text.
|
||||
* Token options are:
|
||||
*
|
||||
* 'site' => The key name for the Text_Wiki interwiki array map,
|
||||
* usually the name of the interwiki site.
|
||||
*
|
||||
* 'page' => The page on the target interwiki to link to.
|
||||
*
|
||||
* 'text' => The text to display as the link.
|
||||
* Generates a replacement for the matched standalone interwiki text.
|
||||
* Token options are:
|
||||
*
|
||||
* 'site' => The key name for the Text_Wiki interwiki array map,
|
||||
* usually the name of the interwiki site.
|
||||
*
|
||||
* 'page' => The page on the target interwiki to link to.
|
||||
*
|
||||
* 'text' => The text to display as the link.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
@ -89,7 +89,7 @@ class Text_Wiki_Rule_interwiki extends Text_Wiki_Rule {
|
||||
* the source text, plus any text priot to the match.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
function process(&$matches)
|
||||
{
|
||||
$options = array(
|
||||
@ -97,27 +97,27 @@ class Text_Wiki_Rule_interwiki extends Text_Wiki_Rule {
|
||||
'page' => $matches[2],
|
||||
'text' => $matches[0]
|
||||
);
|
||||
|
||||
|
||||
// if not in the interwiki map, don't make it an interwiki link
|
||||
if (isset($this->_conf['sites'][$options['site']])) {
|
||||
return $this->addToken($options);
|
||||
} else {
|
||||
return $matches[0];
|
||||
}
|
||||
return $this->addToken($options);
|
||||
} else {
|
||||
return $matches[0];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Generates a replacement for described interwiki links. Token
|
||||
* options are:
|
||||
*
|
||||
* 'site' => The key name for the Text_Wiki interwiki array map,
|
||||
* usually the name of the interwiki site.
|
||||
*
|
||||
* 'page' => The page on the target interwiki to link to.
|
||||
*
|
||||
* 'text' => The text to display as the link.
|
||||
* Generates a replacement for described interwiki links. Token
|
||||
* options are:
|
||||
*
|
||||
* 'site' => The key name for the Text_Wiki interwiki array map,
|
||||
* usually the name of the interwiki site.
|
||||
*
|
||||
* 'page' => The page on the target interwiki to link to.
|
||||
*
|
||||
* 'text' => The text to display as the link.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
@ -127,7 +127,7 @@ class Text_Wiki_Rule_interwiki extends Text_Wiki_Rule {
|
||||
* the source text, plus any text priot to the match.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
function processDescr(&$matches)
|
||||
{
|
||||
$options = array(
|
||||
@ -135,16 +135,16 @@ class Text_Wiki_Rule_interwiki extends Text_Wiki_Rule {
|
||||
'page' => $matches[2],
|
||||
'text' => $matches[3]
|
||||
);
|
||||
|
||||
|
||||
// if not in the interwiki map, don't make it an interwiki link
|
||||
if (isset($this->_conf['sites'][$options['site']])) {
|
||||
return $this->addToken($options);
|
||||
} else {
|
||||
return $matches[0];
|
||||
}
|
||||
return $this->addToken($options);
|
||||
} else {
|
||||
return $matches[0];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Renders a token into text matching the requested format.
|
||||
@ -157,38 +157,37 @@ class Text_Wiki_Rule_interwiki extends Text_Wiki_Rule {
|
||||
* @return string The text rendered from the token options.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
function renderXhtml($options)
|
||||
{
|
||||
$site = $options['site'];
|
||||
$page = $options['page'];
|
||||
$text = $options['text'];
|
||||
|
||||
|
||||
if (isset($this->_conf['sites'][$site])) {
|
||||
$href = $this->_conf['sites'][$site];
|
||||
} else {
|
||||
return $text;
|
||||
}
|
||||
|
||||
// old form where page is at end,
|
||||
// or new form with %s placeholder for sprintf()?
|
||||
if (strpos($href, '%s') === false) {
|
||||
// use the old form
|
||||
$href = $href . $page;
|
||||
} else {
|
||||
// use the new form
|
||||
$href = sprintf($href, $page);
|
||||
}
|
||||
|
||||
// allow for alternative targets
|
||||
if (isset($this->_conf['target']) &&
|
||||
trim($this->_conf['target']) != '') {
|
||||
$target = 'target="' . $this->_conf['target'] . '"';
|
||||
} else {
|
||||
$target = '';
|
||||
}
|
||||
|
||||
// old form where page is at end,
|
||||
// or new form with %s placeholder for sprintf()?
|
||||
if (strpos($href, '%s') === false) {
|
||||
// use the old form
|
||||
$href = $href . $page;
|
||||
} else {
|
||||
// use the new form
|
||||
$href = sprintf($href, $page);
|
||||
}
|
||||
|
||||
// allow for alternative targets
|
||||
if (isset($this->_conf['target']) &&
|
||||
trim($this->_conf['target']) != '') {
|
||||
$target = 'target="' . $this->_conf['target'] . '"';
|
||||
} else {
|
||||
$target = '';
|
||||
}
|
||||
|
||||
|
||||
return "<a $target href=\"$href\">$text</a>";
|
||||
}
|
||||
}
|
||||
|
@ -33,8 +33,8 @@
|
||||
*/
|
||||
|
||||
class Text_Wiki_Rule_italic extends Text_Wiki_Rule {
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* The regular expression used to parse the source text and find
|
||||
@ -47,10 +47,10 @@ class Text_Wiki_Rule_italic extends Text_Wiki_Rule {
|
||||
* @see parse()
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
var $regex = "/''(()|[^'].*)''/U";
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Generates a replacement for the matched text. Token options are:
|
||||
@ -67,15 +67,15 @@ class Text_Wiki_Rule_italic extends Text_Wiki_Rule {
|
||||
* emphasized.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
function process(&$matches)
|
||||
{
|
||||
$start = $this->addToken(array('type' => 'start'));
|
||||
$end = $this->addToken(array('type' => 'end'));
|
||||
return $start . $matches[1] . $end;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Renders a token into text matching the requested format.
|
||||
@ -88,16 +88,16 @@ class Text_Wiki_Rule_italic extends Text_Wiki_Rule {
|
||||
* @return string The text rendered from the token options.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
function renderXhtml($options)
|
||||
{
|
||||
if ($options['type'] == 'start') {
|
||||
return '<i>';
|
||||
}
|
||||
|
||||
if ($options['type'] == 'end') {
|
||||
return '</i>';
|
||||
}
|
||||
if ($options['type'] == 'start') {
|
||||
return '<i>';
|
||||
}
|
||||
|
||||
if ($options['type'] == 'end') {
|
||||
return '</i>';
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -253,11 +253,11 @@ class Text_Wiki_Rule_list extends Text_Wiki_Rule {
|
||||
// attempt XHTML compliance so that sub-lists are part
|
||||
// of a list item, not between list items
|
||||
if ($level > 0) {
|
||||
$pre = '<li style="list-style: none;">';
|
||||
$post = '</li>';
|
||||
$pre = '<li style="list-style: none;">';
|
||||
$post = '</li>';
|
||||
} else {
|
||||
$pre = '';
|
||||
$post = '';
|
||||
$pre = '';
|
||||
$post = '';
|
||||
}
|
||||
|
||||
switch ($type) {
|
||||
|
@ -32,7 +32,7 @@
|
||||
*/
|
||||
|
||||
class Text_Wiki_Rule_paragraph extends Text_Wiki_Rule {
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* The regular expression used to find source text matching this
|
||||
@ -43,10 +43,10 @@ class Text_Wiki_Rule_paragraph extends Text_Wiki_Rule {
|
||||
* @var string
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
var $regex = "/^.*?\n\n/m";
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Generates a token entry for the matched text. Token options are:
|
||||
@ -63,55 +63,55 @@ class Text_Wiki_Rule_paragraph extends Text_Wiki_Rule {
|
||||
* the source text.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
function process(&$matches)
|
||||
{
|
||||
$delim = $this->_wiki->delim;
|
||||
|
||||
// was anything there?
|
||||
if (trim($matches[0]) == '') {
|
||||
return '';
|
||||
}
|
||||
|
||||
// does the match start with a delimiter?
|
||||
if (substr($matches[0], 0, 1) != $delim) {
|
||||
// no.
|
||||
$delim = $this->_wiki->delim;
|
||||
|
||||
// was anything there?
|
||||
if (trim($matches[0]) == '') {
|
||||
return '';
|
||||
}
|
||||
|
||||
// does the match start with a delimiter?
|
||||
if (substr($matches[0], 0, 1) != $delim) {
|
||||
// no.
|
||||
$start = $this->addToken(array('type' => 'start'));
|
||||
$end = $this->addToken(array('type' => 'end'));
|
||||
return $start . trim($matches[0]) . $end;
|
||||
}
|
||||
|
||||
|
||||
// the line starts with a delimiter. read in the delimited
|
||||
// token number, check the token, and see if we should
|
||||
// skip it.
|
||||
|
||||
|
||||
// loop starting at the second character (we already know
|
||||
// the first is a delimiter) until we find another
|
||||
// delimiter; the text between them is a token key number.
|
||||
$key = '';
|
||||
$len = strlen($matches[0]);
|
||||
for ($i = 1; $i < $len; $i++) {
|
||||
$char = $matches[0]{$i};
|
||||
if ($char == $delim) {
|
||||
break;
|
||||
} else {
|
||||
$key .= $char;
|
||||
}
|
||||
$len = strlen($matches[0]);
|
||||
for ($i = 1; $i < $len; $i++) {
|
||||
$char = $matches[0]{$i};
|
||||
if ($char == $delim) {
|
||||
break;
|
||||
} else {
|
||||
$key .= $char;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// look at the token and see if it's skippable (if we skip,
|
||||
// it will not be marked as a paragraph)
|
||||
$token_type = $this->_wiki->_tokens[$key][0];
|
||||
if (in_array($token_type, $this->_conf['skip'])) {
|
||||
return $matches[0];
|
||||
return $matches[0];
|
||||
} else {
|
||||
$start = $this->addToken(array('type' => 'start'));
|
||||
$end = $this->addToken(array('type' => 'end'));
|
||||
return $start . trim($matches[0]) . $end;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Renders a token into text matching the requested format.
|
||||
@ -124,15 +124,15 @@ class Text_Wiki_Rule_paragraph extends Text_Wiki_Rule {
|
||||
* @return string The text rendered from the token options.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
function renderXhtml($options)
|
||||
{
|
||||
extract($options); //type
|
||||
|
||||
|
||||
if ($type == 'start') {
|
||||
return '<p>';
|
||||
}
|
||||
|
||||
|
||||
if ($type == 'end') {
|
||||
return "</p>\n\n";
|
||||
}
|
||||
|
@ -35,8 +35,8 @@
|
||||
*/
|
||||
|
||||
class Text_Wiki_Rule_phpcode extends Text_Wiki_Rule {
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* The regular expression used to find source text matching this
|
||||
@ -47,10 +47,10 @@ class Text_Wiki_Rule_phpcode extends Text_Wiki_Rule {
|
||||
* @var string
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
var $regex = '/^(\<php\>)\n(.+)\n(\<\/php\>)(\s|$)/Umsi';
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Generates a token entry for the matched text. Token options are:
|
||||
@ -65,14 +65,14 @@ class Text_Wiki_Rule_phpcode extends Text_Wiki_Rule {
|
||||
* the source text.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
function process(&$matches)
|
||||
{
|
||||
$options = array('text' => $matches[2]);
|
||||
return $this->addToken($options) . $matches[4];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Renders a token into text matching the requested format.
|
||||
@ -85,49 +85,49 @@ class Text_Wiki_Rule_phpcode extends Text_Wiki_Rule {
|
||||
* @return string The text rendered from the token options.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
function renderXhtml($options)
|
||||
{
|
||||
// add the PHP tags
|
||||
$text = "<?php\n" . $options['text'] . "\n?>"; // <?php
|
||||
|
||||
// convert tabs to four spaces
|
||||
$text = str_replace("\t", " ", $text);
|
||||
|
||||
// colorize the code block (also converts HTML entities and adds
|
||||
// <code>...</code> tags)
|
||||
ob_start();
|
||||
highlight_string($text);
|
||||
$text = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
// replace <br /> tags with simple newlines
|
||||
//$text = str_replace("<br />", "\n", $text);
|
||||
|
||||
// replace non-breaking space with simple spaces
|
||||
//$text = str_replace(" ", " ", $text);
|
||||
|
||||
// replace <br /> tags with simple newlines
|
||||
// replace non-breaking space with simple spaces
|
||||
// translate old HTML to new XHTML
|
||||
// courtesy of research by A. Kalin :-)
|
||||
$map = array(
|
||||
'<br />' => "\n",
|
||||
' ' => ' ',
|
||||
'<font' => '<span',
|
||||
'</font>' => '</span>',
|
||||
'color="' => 'style="color:'
|
||||
);
|
||||
$text = strtr($text, $map);
|
||||
|
||||
// get rid of the last newline inside the code block
|
||||
// (becuase higlight_string puts one there)
|
||||
if (substr($text, -8) == "\n</code>") {
|
||||
$text = substr($text, 0, -8) . "</code>";
|
||||
}
|
||||
|
||||
// done
|
||||
return "\n<pre>$text</pre>\n";
|
||||
// add the PHP tags
|
||||
$text = "<?php\n" . $options['text'] . "\n?>"; // <?php
|
||||
|
||||
// convert tabs to four spaces
|
||||
$text = str_replace("\t", " ", $text);
|
||||
|
||||
// colorize the code block (also converts HTML entities and adds
|
||||
// <code>...</code> tags)
|
||||
ob_start();
|
||||
highlight_string($text);
|
||||
$text = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
// replace <br /> tags with simple newlines
|
||||
//$text = str_replace("<br />", "\n", $text);
|
||||
|
||||
// replace non-breaking space with simple spaces
|
||||
//$text = str_replace(" ", " ", $text);
|
||||
|
||||
// replace <br /> tags with simple newlines
|
||||
// replace non-breaking space with simple spaces
|
||||
// translate old HTML to new XHTML
|
||||
// courtesy of research by A. Kalin :-)
|
||||
$map = array(
|
||||
'<br />' => "\n",
|
||||
' ' => ' ',
|
||||
'<font' => '<span',
|
||||
'</font>' => '</span>',
|
||||
'color="' => 'style="color:'
|
||||
);
|
||||
$text = strtr($text, $map);
|
||||
|
||||
// get rid of the last newline inside the code block
|
||||
// (becuase higlight_string puts one there)
|
||||
if (substr($text, -8) == "\n</code>") {
|
||||
$text = substr($text, 0, -8) . "</code>";
|
||||
}
|
||||
|
||||
// done
|
||||
return "\n<pre>$text</pre>\n";
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -86,7 +86,7 @@ class Text_Wiki_Rule_phplookup extends Text_Wiki_Rule {
|
||||
|
||||
function renderXhtml($options)
|
||||
{
|
||||
$text = trim($options['text']);
|
||||
$text = trim($options['text']);
|
||||
return "<a href=\"http://php.net/$text\">$text</a>";
|
||||
}
|
||||
}
|
||||
|
@ -67,10 +67,10 @@ class Text_Wiki_Rule_prefilter extends Text_Wiki_Rule {
|
||||
|
||||
// finally, compress all instances of 3 or more newlines
|
||||
// down to two newlines.
|
||||
$find = "/\n{3,}/m";
|
||||
$replace = "\n\n";
|
||||
$this->_wiki->_source = preg_replace($find, $replace,
|
||||
$this->_wiki->_source);
|
||||
$find = "/\n{3,}/m";
|
||||
$replace = "\n\n";
|
||||
$this->_wiki->_source = preg_replace($find, $replace,
|
||||
$this->_wiki->_source);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -74,68 +74,68 @@ class Text_Wiki_Rule_table extends Text_Wiki_Rule {
|
||||
* table elements and cell text.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
function process(&$matches)
|
||||
{
|
||||
// out eventual return value
|
||||
$return = '';
|
||||
|
||||
|
||||
// start a new table
|
||||
$return .= $this->addToken(array('type' => 'table_start'));
|
||||
|
||||
|
||||
// rows are separated by newlines in the matched text
|
||||
$rows = explode("\n", $matches[1]);
|
||||
|
||||
|
||||
// loop through each row
|
||||
foreach ($rows as $row) {
|
||||
|
||||
|
||||
// start a new row
|
||||
$return .= $this->addToken(array('type' => 'row_start'));
|
||||
|
||||
|
||||
// cells are separated by double-pipes
|
||||
$cell = explode("||", $row);
|
||||
|
||||
|
||||
// get the last cell number
|
||||
$last = count($cell) - 1;
|
||||
|
||||
|
||||
// by default, cells span only one column (their own)
|
||||
$span = 1;
|
||||
|
||||
|
||||
// ignore cell zero, and ignore the "last" cell; cell zero
|
||||
// is before the first double-pipe, and the "last" cell is
|
||||
// after the last double-pipe. both are always empty.
|
||||
for ($i = 1; $i < $last; $i ++) {
|
||||
|
||||
|
||||
// if there is no content at all, then it's an instance
|
||||
// of two sets of || next to each other, indicating a
|
||||
// colspan.
|
||||
if ($cell[$i] == '') {
|
||||
|
||||
|
||||
// add to the span and loop to the next cell
|
||||
$span += 1;
|
||||
continue;
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
// this cell has content.
|
||||
|
||||
|
||||
// find the alignment, if any.
|
||||
if (substr($cell[$i], 0, 2) == '> ') {
|
||||
// set to right-align and strip the tag
|
||||
$align = 'right';
|
||||
$cell[$i] = substr($cell[$i], 2);
|
||||
// set to right-align and strip the tag
|
||||
$align = 'right';
|
||||
$cell[$i] = substr($cell[$i], 2);
|
||||
} elseif (substr($cell[$i], 0, 2) == '= ') {
|
||||
// set to center-align and strip the tag
|
||||
$align = 'center';
|
||||
$cell[$i] = substr($cell[$i], 2);
|
||||
// set to center-align and strip the tag
|
||||
$align = 'center';
|
||||
$cell[$i] = substr($cell[$i], 2);
|
||||
} elseif (substr($cell[$i], 0, 2) == '< ') {
|
||||
// set to left-align and strip the tag
|
||||
$align = 'left';
|
||||
$cell[$i] = substr($cell[$i], 2);
|
||||
// set to left-align and strip the tag
|
||||
$align = 'left';
|
||||
$cell[$i] = substr($cell[$i], 2);
|
||||
} else {
|
||||
$align = null;
|
||||
$align = null;
|
||||
}
|
||||
|
||||
|
||||
// start a new cell...
|
||||
$return .= $this->addToken(
|
||||
array (
|
||||
@ -144,10 +144,10 @@ class Text_Wiki_Rule_table extends Text_Wiki_Rule {
|
||||
'colspan' => $span
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
// ...add the content...
|
||||
$return .= trim($cell[$i]);
|
||||
|
||||
|
||||
// ...and end the cell.
|
||||
$return .= $this->addToken(
|
||||
array (
|
||||
@ -156,26 +156,26 @@ class Text_Wiki_Rule_table extends Text_Wiki_Rule {
|
||||
'colspan' => $span
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
// reset the colspan.
|
||||
$span = 1;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
// end the row
|
||||
$return .= $this->addToken(array('type' => 'row_end'));
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
// end the table
|
||||
$return .= $this->addToken(array('type' => 'table_end'));
|
||||
|
||||
|
||||
// we're done!
|
||||
return "\n$return\n";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Renders a token into text matching the requested format.
|
||||
@ -193,56 +193,56 @@ class Text_Wiki_Rule_table extends Text_Wiki_Rule {
|
||||
{
|
||||
// make nice variable names (type, align, colspan)
|
||||
extract($options);
|
||||
|
||||
|
||||
$pad = ' ';
|
||||
|
||||
|
||||
$border = (isset($this->_conf['border']))
|
||||
? $this->_conf['border'] : '1';
|
||||
|
||||
? $this->_conf['border'] : '1';
|
||||
|
||||
$spacing = (isset($this->_conf['spacing']))
|
||||
? $this->_conf['spacing'] : '0';
|
||||
|
||||
? $this->_conf['spacing'] : '0';
|
||||
|
||||
$padding = (isset($this->_conf['padding']))
|
||||
? $this->_conf['padding'] : '4';
|
||||
|
||||
? $this->_conf['padding'] : '4';
|
||||
|
||||
switch ($type) {
|
||||
|
||||
|
||||
case 'table_start':
|
||||
return "<table border=\"$border\" " .
|
||||
"cellspacing=\"$spacing\" " .
|
||||
"cellpadding=\"$padding\">\n";
|
||||
"cellspacing=\"$spacing\" " .
|
||||
"cellpadding=\"$padding\">\n";
|
||||
break;
|
||||
|
||||
|
||||
case 'table_end':
|
||||
return "</table>\n";
|
||||
break;
|
||||
|
||||
|
||||
case 'row_start':
|
||||
return "$pad<tr>\n";
|
||||
break;
|
||||
|
||||
|
||||
case 'row_end':
|
||||
return "$pad</tr>\n";
|
||||
break;
|
||||
|
||||
|
||||
case 'cell_start':
|
||||
$tmp = $pad . $pad . '<td';
|
||||
$tmp = $pad . $pad . '<td';
|
||||
if ($colspan > 1) {
|
||||
$tmp .= " colspan=\"$colspan\"";
|
||||
}
|
||||
if ($align) {
|
||||
$tmp .= " align=\"$align\"";
|
||||
$tmp .= " align=\"$align\"";
|
||||
}
|
||||
return $tmp . '>';
|
||||
break;
|
||||
|
||||
|
||||
case 'cell_end':
|
||||
return "</td>\n";
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
return '';
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -43,8 +43,8 @@ class Text_Wiki_Rule_tighten extends Text_Wiki_Rule {
|
||||
|
||||
function parse()
|
||||
{
|
||||
$this->_wiki->_source = str_replace("\n", '',
|
||||
$this->_wiki->_source);
|
||||
$this->_wiki->_source = str_replace("\n", '',
|
||||
$this->_wiki->_source);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -41,8 +41,8 @@
|
||||
*/
|
||||
|
||||
class Text_Wiki_Rule_url extends Text_Wiki_Rule {
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* When doing numbered references (footnote-style references), we
|
||||
@ -53,10 +53,10 @@ class Text_Wiki_Rule_url extends Text_Wiki_Rule {
|
||||
* @var int
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
var $footnoteCount = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* An array of filename extensions that indicate a file is an image.
|
||||
@ -66,25 +66,25 @@ class Text_Wiki_Rule_url extends Text_Wiki_Rule {
|
||||
* @var array
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
var $img_ext = array('.jpg', '.png', '.gif');
|
||||
|
||||
|
||||
|
||||
|
||||
function Text_Wiki_Rule_url(&$obj, $name)
|
||||
{
|
||||
parent::Text_Wiki_Rule($obj, $name);
|
||||
|
||||
parent::Text_Wiki_Rule($obj, $name);
|
||||
|
||||
$this->regex =
|
||||
"(http:\/\/|https:\/\/|ftp:\/\/|gopher:\/\/|news:\/\/|mailto:)" . // protocols
|
||||
"(" .
|
||||
"[^ \\/\"\'{$this->_wiki->delim}]*\\/" . // no spaces, \, /, ", or single quotes;
|
||||
")*" .
|
||||
"[^ \\t\\n\\/\"\'{$this->_wiki->delim}]*" .
|
||||
"[A-Za-z0-9\\/?=&~_]";
|
||||
|
||||
"(http:\/\/|https:\/\/|ftp:\/\/|gopher:\/\/|news:\/\/|mailto:)" . // protocols
|
||||
"(" .
|
||||
"[^ \\/\"\'{$this->_wiki->delim}]*\\/" . // no spaces, \, /, ", or single quotes;
|
||||
")*" .
|
||||
"[^ \\t\\n\\/\"\'{$this->_wiki->delim}]*" .
|
||||
"[A-Za-z0-9\\/?=&~_]";
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* A somewhat complex parsing method to find three different kinds
|
||||
@ -93,17 +93,17 @@ class Text_Wiki_Rule_url extends Text_Wiki_Rule {
|
||||
* @access public
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
function parse()
|
||||
{
|
||||
// -------------------------------------------------------------
|
||||
//
|
||||
// Described-reference (named) URLs.
|
||||
//
|
||||
|
||||
|
||||
// the regular expression for this kind of URL
|
||||
$tmp_regex = '/\[(' . $this->regex . ') ([^\]]+)\]/';
|
||||
|
||||
|
||||
// use a custom callback processing method to generate
|
||||
// the replacement text for matches.
|
||||
$this->_wiki->_source = preg_replace_callback(
|
||||
@ -111,16 +111,16 @@ class Text_Wiki_Rule_url extends Text_Wiki_Rule {
|
||||
array(&$this, 'processDescr'),
|
||||
$this->_wiki->_source
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
// -------------------------------------------------------------
|
||||
//
|
||||
// Numbered-reference (footnote-style) URLs.
|
||||
//
|
||||
|
||||
|
||||
// the regular expression for this kind of URL
|
||||
$tmp_regex = '/\[(' . $this->regex . ')\]/U';
|
||||
|
||||
|
||||
// use a custom callback processing method to generate
|
||||
// the replacement text for matches.
|
||||
$this->_wiki->_source = preg_replace_callback(
|
||||
@ -128,17 +128,17 @@ class Text_Wiki_Rule_url extends Text_Wiki_Rule {
|
||||
array(&$this, 'processFootnote'),
|
||||
$this->_wiki->_source
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
// -------------------------------------------------------------
|
||||
//
|
||||
// Normal inline URLs.
|
||||
//
|
||||
|
||||
|
||||
// the regular expression for this kind of URL
|
||||
|
||||
$tmp_regex = '/(^|[^A-Za-z])(' . $this->regex . ')(.*?)/';
|
||||
|
||||
|
||||
$tmp_regex = '/(^|[^A-Za-z])(' . $this->regex . ')(.*?)/';
|
||||
|
||||
// use the standard callback for inline URLs
|
||||
$this->_wiki->_source = preg_replace_callback(
|
||||
$tmp_regex,
|
||||
@ -146,8 +146,8 @@ class Text_Wiki_Rule_url extends Text_Wiki_Rule {
|
||||
$this->_wiki->_source
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Process inline URLs and return replacement text with a delimited
|
||||
@ -168,7 +168,7 @@ class Text_Wiki_Rule_url extends Text_Wiki_Rule {
|
||||
* @return string The processed text replacement.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
function process(&$matches)
|
||||
{
|
||||
// set options
|
||||
@ -177,12 +177,12 @@ class Text_Wiki_Rule_url extends Text_Wiki_Rule {
|
||||
'href' => $matches[2],
|
||||
'text' => $matches[2]
|
||||
);
|
||||
|
||||
|
||||
// tokenize
|
||||
return $matches[1] . $this->addToken($options) . $matches[5];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Process numbered (footnote) URLs and return replacement text with
|
||||
@ -203,24 +203,24 @@ class Text_Wiki_Rule_url extends Text_Wiki_Rule {
|
||||
* @return string The processed text replacement.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
function processFootnote(&$matches)
|
||||
{
|
||||
// keep a running count for footnotes
|
||||
$this->footnoteCount++;
|
||||
|
||||
|
||||
// set options
|
||||
$options = array(
|
||||
'type' => 'footnote',
|
||||
'href' => $matches[1],
|
||||
'text' => $this->footnoteCount
|
||||
);
|
||||
|
||||
|
||||
// tokenize
|
||||
return $this->addToken($options);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Process described-reference (named-reference) URLs and return
|
||||
@ -241,7 +241,7 @@ class Text_Wiki_Rule_url extends Text_Wiki_Rule {
|
||||
* @return string The processed text replacement.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
function processDescr(&$matches)
|
||||
{
|
||||
// set options
|
||||
@ -250,12 +250,12 @@ class Text_Wiki_Rule_url extends Text_Wiki_Rule {
|
||||
'href' => $matches[1],
|
||||
'text' => $matches[4]
|
||||
);
|
||||
|
||||
|
||||
// tokenize
|
||||
return $this->addToken($options);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Renders a token into text matching the requested format.
|
||||
@ -268,48 +268,48 @@ class Text_Wiki_Rule_url extends Text_Wiki_Rule {
|
||||
* @return string The text rendered from the token options.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
function renderXhtml($options)
|
||||
{
|
||||
// create local variables from the options array (text,
|
||||
// href, type)
|
||||
extract($options);
|
||||
|
||||
|
||||
// find the rightmost dot and determine the filename
|
||||
// extension.
|
||||
$pos = strrpos($href, '.');
|
||||
$ext = strtolower(substr($href, $pos));
|
||||
|
||||
|
||||
// does the filename extension indicate an image file?
|
||||
if (in_array($ext, $this->img_ext)) {
|
||||
|
||||
|
||||
// create alt text for the image
|
||||
if (! isset($text) || $text == '') {
|
||||
$text = basename($href);
|
||||
}
|
||||
|
||||
|
||||
// generate an image tag
|
||||
$output = "<img src=\"$href\" alt=\"$text\" />";
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
// allow for alternative targets
|
||||
if (isset($this->_conf['target']) &&
|
||||
trim($this->_conf['target']) != '') {
|
||||
$target = 'target="' . $this->_conf['target'] . '"';
|
||||
} else {
|
||||
$target = '';
|
||||
}
|
||||
|
||||
|
||||
// allow for alternative targets
|
||||
if (isset($this->_conf['target']) &&
|
||||
trim($this->_conf['target']) != '') {
|
||||
$target = 'target="' . $this->_conf['target'] . '"';
|
||||
} else {
|
||||
$target = '';
|
||||
}
|
||||
|
||||
// generate a regular link (not an image)
|
||||
$output = "<a $target href=\"$href\">$text</a>";
|
||||
|
||||
|
||||
// make numbered references look like footnotes
|
||||
if ($type == 'footnote') {
|
||||
$output = '<sup>' . $output . '</sup>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
@ -37,8 +37,8 @@
|
||||
*/
|
||||
|
||||
class Text_Wiki_Rule_wikilink extends Text_Wiki_Rule {
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Constructor. We override the Text_Wiki_Rule constructor so we can
|
||||
@ -51,11 +51,11 @@ class Text_Wiki_Rule_wikilink extends Text_Wiki_Rule {
|
||||
* @param string $name The token name to use for this rule.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
function Text_Wiki_Rule_wikilink(&$obj, $name)
|
||||
{
|
||||
parent::Text_Wiki_Rule($obj, $name);
|
||||
|
||||
|
||||
$this->regex =
|
||||
"(!?" . // START WikiPage pattern (1)
|
||||
"[A-Z]" . // 1 upper
|
||||
@ -71,8 +71,8 @@ class Text_Wiki_Rule_wikilink extends Text_Wiki_Rule {
|
||||
"[-A-Za-z0-9_]" . // 1 dash, alpha, digit, or underscore
|
||||
")?)?)"; // end subpatterns (/4)(/3)(/2)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* First parses for described links, then for standalone links.
|
||||
@ -82,17 +82,17 @@ class Text_Wiki_Rule_wikilink extends Text_Wiki_Rule {
|
||||
* @return void
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
function parse()
|
||||
{
|
||||
// described wiki links
|
||||
$tmp_regex = '/\[' . $this->regex . ' (.+?)\]/';
|
||||
// described wiki links
|
||||
$tmp_regex = '/\[' . $this->regex . ' (.+?)\]/';
|
||||
$this->_wiki->_source = preg_replace_callback(
|
||||
$tmp_regex,
|
||||
array(&$this, 'processDescr'),
|
||||
$this->_wiki->_source
|
||||
);
|
||||
|
||||
|
||||
// standalone wiki links
|
||||
$tmp_regex = '/(^|[^A-Za-z0-9\-_])' . $this->regex . '/';
|
||||
$this->_wiki->_source = preg_replace_callback(
|
||||
@ -101,8 +101,8 @@ class Text_Wiki_Rule_wikilink extends Text_Wiki_Rule {
|
||||
$this->_wiki->_source
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Generates a replacement for described links. Token options are:
|
||||
@ -121,7 +121,7 @@ class Text_Wiki_Rule_wikilink extends Text_Wiki_Rule {
|
||||
* the source text, plus any text priot to the match.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
function processDescr(&$matches)
|
||||
{
|
||||
// set the options
|
||||
@ -130,12 +130,12 @@ class Text_Wiki_Rule_wikilink extends Text_Wiki_Rule {
|
||||
'text' => $matches[5],
|
||||
'anchor' => $matches[3]
|
||||
);
|
||||
|
||||
|
||||
// create and return the replacement token and preceding text
|
||||
return $this->addToken($options); // . $matches[7];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Generates a replacement for standalone links. Token options are:
|
||||
@ -154,7 +154,7 @@ class Text_Wiki_Rule_wikilink extends Text_Wiki_Rule {
|
||||
* the source text, plus any text prior to the match.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
function process(&$matches)
|
||||
{
|
||||
// when prefixed with !, it's explicitly not a wiki link.
|
||||
@ -162,19 +162,19 @@ class Text_Wiki_Rule_wikilink extends Text_Wiki_Rule {
|
||||
if ($matches[2][0] == '!') {
|
||||
return $matches[1] . substr($matches[2], 1) . $matches[3];
|
||||
}
|
||||
|
||||
|
||||
// set the options
|
||||
$options = array(
|
||||
'page' => $matches[2],
|
||||
'text' => $matches[2] . $matches[3],
|
||||
'anchor' => $matches[3]
|
||||
);
|
||||
|
||||
|
||||
// create and return the replacement token and preceding text
|
||||
return $matches[1] . $this->addToken($options);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Renders a token into text matching the requested format.
|
||||
@ -187,55 +187,55 @@ class Text_Wiki_Rule_wikilink extends Text_Wiki_Rule {
|
||||
* @return string The text rendered from the token options.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
function renderXhtml($options)
|
||||
{
|
||||
// make nice variable names (page, anchor, text)
|
||||
extract($options);
|
||||
|
||||
|
||||
// does the page exist?
|
||||
if (in_array($page, $this->_conf['pages'])) {
|
||||
|
||||
|
||||
// yes, link to the page view, but we have to build
|
||||
// the HREF. we support both the old form where
|
||||
// the page always comes at the end, and the new
|
||||
// form that uses %s for sprintf()
|
||||
$href = $this->_conf['view_url'];
|
||||
|
||||
|
||||
if (strpos($href, '%s') === false) {
|
||||
// use the old form
|
||||
$href = $href . $page . $anchor;
|
||||
} else {
|
||||
// use the new form
|
||||
$href = sprintf($href, $page . $anchor);
|
||||
}
|
||||
|
||||
// use the old form
|
||||
$href = $href . $page . $anchor;
|
||||
} else {
|
||||
// use the new form
|
||||
$href = sprintf($href, $page . $anchor);
|
||||
}
|
||||
|
||||
return "<a href=\"$href\">$text</a>";
|
||||
|
||||
|
||||
}
|
||||
|
||||
// no, link to a create-page url, but only if new_url is set
|
||||
if (! isset($this->_conf['new_url']) ||
|
||||
trim($this->_conf['new_url']) == '') {
|
||||
return $text;
|
||||
} else {
|
||||
|
||||
|
||||
// no, link to a create-page url, but only if new_url is set
|
||||
if (! isset($this->_conf['new_url']) ||
|
||||
trim($this->_conf['new_url']) == '') {
|
||||
return $text;
|
||||
} else {
|
||||
|
||||
// yes, link to the page view, but we have to build
|
||||
// the HREF. we support both the old form where
|
||||
// the page always comes at the end, and the new
|
||||
// form that uses sprintf()
|
||||
$href = $this->_conf['new_url'];
|
||||
|
||||
|
||||
if (strpos($href, '%s') === false) {
|
||||
// use the old form
|
||||
$href = $href . $page;
|
||||
} else {
|
||||
// use the new form
|
||||
$href = sprintf($href, $page);
|
||||
}
|
||||
|
||||
return $text . "<a href=\"$href\">{$this->_conf['new_text']}</a>";
|
||||
}
|
||||
// use the old form
|
||||
$href = $href . $page;
|
||||
} else {
|
||||
// use the new form
|
||||
$href = sprintf($href, $page);
|
||||
}
|
||||
|
||||
return $text . "<a href=\"$href\">{$this->_conf['new_text']}</a>";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -245,7 +245,7 @@ function XML_RPC_Server_debugmsg($m)
|
||||
* ),
|
||||
* 1,
|
||||
* 0
|
||||
* );
|
||||
* );
|
||||
* </code>
|
||||
*
|
||||
* @category Web Services
|
||||
@ -553,8 +553,8 @@ class XML_RPC_Server
|
||||
$XML_RPC_xh[$parser]['isf'] = 0;
|
||||
$XML_RPC_xh[$parser]['params'] = array();
|
||||
$XML_RPC_xh[$parser]['method'] = '';
|
||||
$XML_RPC_xh[$parser]['stack'] = array();
|
||||
$XML_RPC_xh[$parser]['valuestack'] = array();
|
||||
$XML_RPC_xh[$parser]['stack'] = array();
|
||||
$XML_RPC_xh[$parser]['valuestack'] = array();
|
||||
|
||||
$plist = '';
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
@ -70,10 +70,10 @@ if (!($type = @$_REQUEST['type'])) {
|
||||
ob_end_clean();
|
||||
log_pingback('NO TYPE HANDED!');
|
||||
}
|
||||
|
||||
|
||||
// WordPress pingbacks don't give any parameter. If it is a XML POST asume it's a pigback
|
||||
if ($_SERVER['CONTENT_TYPE'] == 'text/xml' && isset($HTTP_RAW_POST_DATA)) {
|
||||
$type = 'pingback';
|
||||
$type = 'pingback';
|
||||
}
|
||||
else {
|
||||
$type = 'normal';
|
||||
|
@ -132,13 +132,13 @@ if (isset($serendipity['GET']['adminAction']) && ($serendipity['GET']['adminActi
|
||||
'parent_id' => $serendipity['GET']['id']
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
$target_url = '?serendipity[action]=admin&serendipity[adminModule]=comments&serendipity[adminAction]=doReply&serendipity[id]=' . (int)$serendipity['GET']['id'] . '&serendipity[entry_id]=' . (int)$serendipity['GET']['entry_id'] . '&serendipity[noBanner]=true&serendipity[noSidebar]=true&' . serendipity_setFormToken('url');
|
||||
$data = $serendipity['POST'];
|
||||
$data['replyTo'] = (int)$serendipity['GET']['id'];
|
||||
$out = serendipity_printComments($c);
|
||||
$serendipity['smarty']->display(serendipity_getTemplateFile('comments.tpl', 'serendipityPath'));
|
||||
|
||||
|
||||
if (!isset($data['name'])) {
|
||||
$data['name'] = $serendipity['serendipityRealname'];
|
||||
}
|
||||
@ -157,7 +157,7 @@ if (isset($serendipity['GET']['adminAction']) && ($serendipity['GET']['adminActi
|
||||
$data['url'] = $comment[0]['url'];
|
||||
$data['replyTo'] = $comment[0]['parent_id'];
|
||||
$data['comment'] = $comment[0]['body'];
|
||||
|
||||
|
||||
/* If we are in preview, we get data from our form */
|
||||
} elseif (isset($serendipity['POST']['preview'])) {
|
||||
$data['name'] = $serendipity['POST']['name'];
|
||||
@ -174,7 +174,7 @@ if (isset($serendipity['GET']['adminAction']) && ($serendipity['GET']['adminActi
|
||||
'timestamp' => time()
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
serendipity_printComments($pc_data);
|
||||
$serendipity['smarty']->display(serendipity_getTemplateFile('comments.tpl', 'serendipityPath'));
|
||||
}
|
||||
@ -184,7 +184,7 @@ if (isset($serendipity['GET']['adminAction']) && ($serendipity['GET']['adminActi
|
||||
substr($data['url'], 0, 8) != 'https://') {
|
||||
$data['url'] = 'http://' . $data['url'];
|
||||
}
|
||||
|
||||
|
||||
serendipity_displayCommentForm(
|
||||
$serendipity['GET']['entry_id'],
|
||||
$target_url,
|
||||
@ -309,21 +309,21 @@ var origwidth = '';
|
||||
|
||||
function highlightComment(id, checkvalue) {
|
||||
var comment = document.getElementById(id);
|
||||
|
||||
|
||||
if (origborder == '') {
|
||||
origborder = comment.style.borderColor;
|
||||
if (origborder == '') {
|
||||
origborder = '#FFFFFF';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (origwidth == '') {
|
||||
origwidth = comment.style.borderWidth;
|
||||
if (origwidth == '' || origwidth == 0) {
|
||||
origwidth = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (checkvalue) {
|
||||
comment.style.borderColor = '#FF0000';
|
||||
comment.style.borderWidth = origwidth;
|
||||
@ -457,10 +457,10 @@ foreach ($sql as $rs) {
|
||||
serendipity_plugin_api::hook_event('backend_view_comment', $comment, '&serendipity[page]='. $page . $searchString);
|
||||
$class = 'serendipity_admin_list_item_' . (($i % 2 == 0 ) ? 'even' : 'uneven');
|
||||
if ($comment['status'] == 'pending') {
|
||||
$class .= ' serendipity_admin_comment_pending';
|
||||
$class .= ' serendipity_admin_comment_pending';
|
||||
$header_class = 'serendipityAdminMsgNote serendipity_admin_comment_pending_header';
|
||||
} elseif (strstr($comment['status'], 'confirm')) {
|
||||
$class .= ' serendipity_admin_comment_pending serendipity_admin_comment_confirm';
|
||||
$class .= ' serendipity_admin_comment_pending serendipity_admin_comment_confirm';
|
||||
$header_class = 'serendipityAdminMsgNote serendipity_admin_comment_pending_header serendipity_admin_comment_confirm_header';
|
||||
} else {
|
||||
$header_class = '';
|
||||
@ -471,7 +471,7 @@ foreach ($sql as $rs) {
|
||||
substr($comment['url'], 0, 8) != 'https://') {
|
||||
$comment['url'] = 'http://' . $comment['url'];
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="<?php echo $header_class; ?>">
|
||||
|
@ -28,16 +28,16 @@ switch ($serendipity['GET']['adminAction']) {
|
||||
if (!is_array($file) || !serendipity_checkPermission('adminImagesDelete') || (!serendipity_checkPermission('adminImagesMaintainOthers') && $file['authorid'] != '0' && $file['authorid'] != $serendipity['authorid'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$fullfile = $serendipity['serendipityPath'] . $serendipity['uploadPath'] . $file['path'] . $file['name'] . '.' . $file['extension'];
|
||||
$httpfile = $serendipity['serendipityHTTPPath'] . $serendipity['uploadHTTPPath'] . $file['path'] . $file['name'] . '.' . $file['extension'];
|
||||
|
||||
$img = new imgedit($fullfile, $httpfile);
|
||||
|
||||
|
||||
// Set the filenames used for the cropping areas. Width/Height are automagically detected. Orientation is either horizontal or vertical.
|
||||
$img->setArea('imgedit_area.gif', 'h');
|
||||
$img->setArea('imgedit_varea.gif', 'v');
|
||||
|
||||
|
||||
// Let the IMGEditor do its magic. It will parse its results straightly into a template variable array.
|
||||
$img->main();
|
||||
$serendipity['smarty']->assign('imgedit', $img->imgedit_smarty);
|
||||
@ -54,7 +54,7 @@ switch ($serendipity['GET']['adminAction']) {
|
||||
// Make the form to actually do sync with deleting or not
|
||||
$n = "\n";
|
||||
$warning = preg_replace('#\\\n#', '<br />', WARNING_THIS_BLAHBLAH);
|
||||
echo '<div class="serendipityAdminMsgNote">' . $warning . '</div>';
|
||||
echo '<div class="serendipityAdminMsgNote">' . $warning . '</div>';
|
||||
echo ' <form method="POST" action="serendipity_admin.php?serendipity[adminModule]=media&serendipity[adminAction]=doSync">' . $n;
|
||||
echo ' <p>' . $n . ' <fieldset>' . $n;
|
||||
echo ' <legend>' . SYNC_OPTION_LEGEND . '</legend>' . $n;
|
||||
@ -204,7 +204,7 @@ switch ($serendipity['GET']['adminAction']) {
|
||||
|
||||
$new_media = array();
|
||||
$serendipity['POST']['imageurl'] = htmlspecialchars($serendipity['POST']['imageurl']);
|
||||
|
||||
|
||||
// First find out whether to fetch a file or accept an upload
|
||||
if ($serendipity['POST']['imageurl'] != '' && $serendipity['POST']['imageurl'] != 'http://') {
|
||||
if (!empty($serendipity['POST']['target_filename'][2])) {
|
||||
@ -315,7 +315,7 @@ switch ($serendipity['GET']['adminAction']) {
|
||||
|
||||
$tfile = serendipity_uploadSecure(basename($tfile));
|
||||
|
||||
if (serendipity_isActiveFile($tfile)) {
|
||||
if (serendipity_isActiveFile($tfile)) {
|
||||
$messages[] = ERROR_FILE_FORBIDDEN .' '. $tfile;
|
||||
continue;
|
||||
}
|
||||
@ -550,7 +550,7 @@ switch ($serendipity['GET']['adminAction']) {
|
||||
printf(DIRECTORY_CREATED, $serendipity['POST']['name']);
|
||||
@umask(0000);
|
||||
@chmod($serendipity['serendipityPath'] . $serendipity['uploadPath'] . $new_dir, 0777);
|
||||
|
||||
|
||||
// Apply parent ACL to new child.
|
||||
$array_parent_read = serendipity_ACLGet(0, 'directory', 'read', $serendipity['POST']['parent']);
|
||||
$array_parent_write = serendipity_ACLGet(0, 'directory', 'write', $serendipity['POST']['parent']);
|
||||
@ -707,7 +707,7 @@ switch ($serendipity['GET']['adminAction']) {
|
||||
<script language="javascript" type="text/javascript">
|
||||
location.href="<?php echo $serendipity['adminFile_redirect'] ?>";
|
||||
</script>
|
||||
<noscript><a href="<?php echo $serendipity['adminFile_redirect'] ?>"><?php echo DONE ?></a></noscript>
|
||||
<noscript><a href="<?php echo $serendipity['adminFile_redirect'] ?>"><?php echo DONE ?></a></noscript>
|
||||
<?php
|
||||
}
|
||||
break;
|
||||
@ -727,7 +727,7 @@ switch ($serendipity['GET']['adminAction']) {
|
||||
<script language="javascript" type="text/javascript">
|
||||
location.href="<?php echo $serendipity['adminFile_redirect'] ?>";
|
||||
</script>
|
||||
<noscript><a href="<?php echo $serendipity['adminFile_redirect'] ?>"><?php echo DONE ?></a></noscript>
|
||||
<noscript><a href="<?php echo $serendipity['adminFile_redirect'] ?>"><?php echo DONE ?></a></noscript>
|
||||
<?php
|
||||
}
|
||||
break;
|
||||
@ -827,7 +827,7 @@ switch ($serendipity['GET']['adminAction']) {
|
||||
|
||||
function showMediaLibrary($messages=false, $addvar_check = false) {
|
||||
global $serendipity;
|
||||
|
||||
|
||||
if (!serendipity_checkPermission('adminImagesView')) {
|
||||
return;
|
||||
}
|
||||
|
@ -27,8 +27,8 @@ class Serendipity_Import {
|
||||
* @access public
|
||||
* @return string HTML-code of a interface/user hint
|
||||
*/
|
||||
function getImportNotes() {
|
||||
return "";
|
||||
function getImportNotes() {
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
@ -40,7 +40,7 @@ class Serendipity_Import {
|
||||
*/
|
||||
function getCharsets($utf8_default = true) {
|
||||
$charsets = array();
|
||||
|
||||
|
||||
if (!$utf8_default) {
|
||||
$charsets['native'] = LANG_CHARSET;
|
||||
}
|
||||
@ -52,11 +52,11 @@ class Serendipity_Import {
|
||||
if (LANG_CHARSET != 'ISO-8859-1') {
|
||||
$charsets['ISO-8859-1'] = 'ISO-8859-1';
|
||||
}
|
||||
|
||||
|
||||
if ($utf8_default) {
|
||||
$charsets['native'] = LANG_CHARSET;
|
||||
}
|
||||
|
||||
|
||||
return $charsets;
|
||||
}
|
||||
|
||||
@ -90,7 +90,7 @@ class Serendipity_Import {
|
||||
return $string;
|
||||
}
|
||||
return $out;
|
||||
|
||||
|
||||
case 'UTF-8':
|
||||
default:
|
||||
$out = utf8_decode($string);
|
||||
@ -130,7 +130,7 @@ class Serendipity_Import {
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the transcoding table, depending on whether it was enabled for the instance of the importer plugin
|
||||
*
|
||||
@ -179,16 +179,16 @@ class Serendipity_Import {
|
||||
case 'ISO-8859-1':
|
||||
$dbn = 'latin1';
|
||||
break;
|
||||
|
||||
|
||||
case 'UTF-8':
|
||||
$dbn = 'utf8';
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if ($dbn && $serendipity['dbNames']) {
|
||||
mysql_query("SET NAMES " . $dbn, $db);
|
||||
}
|
||||
|
||||
|
||||
$return = &mysql_query($query, $db);
|
||||
mysql_select_db($serendipity['dbName'], $serendipity['dbConn']);
|
||||
serendipity_db_reconnect();
|
||||
|
@ -3,7 +3,7 @@
|
||||
# All rights reserved. See LICENSE file for licensing details
|
||||
|
||||
/****************************************************************
|
||||
* Blogger Importer v0.2, by Jawish Hameed (jawish.org) *
|
||||
* Blogger Importer v0.2, by Jawish Hameed (jawish.org) *
|
||||
****************************************************************/
|
||||
|
||||
require_once S9Y_PEAR_PATH . 'HTTP/Request.php';
|
||||
@ -12,8 +12,8 @@ class Serendipity_Import_Blogger extends Serendipity_Import {
|
||||
var $info = array('software' => 'Blogger.com [using API]');
|
||||
var $data = array();
|
||||
var $inputFields = array();
|
||||
|
||||
|
||||
|
||||
|
||||
function Serendipity_Import_Blogger($data) {
|
||||
global $serendipity;
|
||||
|
||||
@ -23,114 +23,114 @@ class Serendipity_Import_Blogger extends Serendipity_Import {
|
||||
'name' => 'bCategory',
|
||||
'value' => 0,
|
||||
'default' => $this->_getCategoryList()),
|
||||
|
||||
|
||||
array('text' => ACTIVATE_AUTODISCOVERY,
|
||||
'type' => 'bool',
|
||||
'name' => 'autodiscovery',
|
||||
'default' => 'false'),
|
||||
|
||||
|
||||
array('text' => CHARSET,
|
||||
'type' => 'list',
|
||||
'name' => 'bCharset',
|
||||
'value' => 'UTF-8',
|
||||
'default' => $this->getCharsets())
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
function getImportNotes(){
|
||||
if (empty($_REQUEST['token'])) {
|
||||
$msg = 'In order to import your blog on Blogger, Serendipity needs to be able to access it via Google\'s Blogger Data APIs.';
|
||||
$msg .= 'Login to your Google/Blogger account and then click the link below.';
|
||||
$msg .= '<a class="block_level standalone" href="https://www.google.com/accounts/AuthSubRequest?scope=http%3A%2F%2Fwww.blogger.com%2Ffeeds%2F&session=1&secure=0&next='. urlencode('http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']) .'">Go to Google to grant access</a>';
|
||||
return $msg;
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function getImportNotes(){
|
||||
if (empty($_REQUEST['token'])) {
|
||||
$msg = 'In order to import your blog on Blogger, Serendipity needs to be able to access it via Google\'s Blogger Data APIs.';
|
||||
$msg .= 'Login to your Google/Blogger account and then click the link below.';
|
||||
$msg .= '<a class="block_level standalone" href="https://www.google.com/accounts/AuthSubRequest?scope=http%3A%2F%2Fwww.blogger.com%2Ffeeds%2F&session=1&secure=0&next='. urlencode('http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']) .'">Go to Google to grant access</a>';
|
||||
return $msg;
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
function validateData() {
|
||||
return sizeof($this->data);
|
||||
}
|
||||
|
||||
function getInputFields() {
|
||||
// Make sure Google login has been completed
|
||||
if (!empty($_REQUEST['token'])) {
|
||||
|
||||
// Prepare session token request
|
||||
$req = new HTTP_Request('https://www.google.com/accounts/AuthSubSessionToken');
|
||||
$req->addHeader('Authorization', 'AuthSub token="'. $_REQUEST['token'] .'"');
|
||||
|
||||
// Request token
|
||||
$req->sendRequest();
|
||||
|
||||
// Handle token reponse
|
||||
if ($req->getResponseCode() != '200') return;
|
||||
|
||||
// Extract Auth token
|
||||
preg_match_all('/^(.+)=(.+)$/m', $req->getResponseBody(), $matches);
|
||||
$tokens = array_combine($matches[1], $matches[2]);
|
||||
unset($matches);
|
||||
|
||||
// Add hidden auth token field to input field list
|
||||
array_unshift($this->inputFields, array( 'text' => 'Google Auth Token (leave alone)',
|
||||
'type' => 'input',
|
||||
'name' => 'bAuthToken',
|
||||
'default' => $tokens['Token']));
|
||||
|
||||
// Prepare blog list request
|
||||
$req = new HTTP_Request('http://www.blogger.com/feeds/default/blogs');
|
||||
$req->addHeader('GData-Version', 2);
|
||||
$req->addHeader('Authorization', 'AuthSub token="'. $tokens['Token'] .'"');
|
||||
|
||||
// Fetch blog list
|
||||
$req->sendRequest();
|
||||
|
||||
// Handle errors
|
||||
if ($req->getResponseCode() != '200') return false;
|
||||
|
||||
// Load list
|
||||
$bXml = simplexml_load_string($req->getResponseBody());
|
||||
|
||||
// Generate list of the blogs under the authenticated account
|
||||
$bList = array();
|
||||
foreach ($bXml->entry as $entry) {
|
||||
$bList[substr($entry->id, strpos($entry->id, 'blog-') + 5)] = $entry->title;
|
||||
}
|
||||
|
||||
// Add blog list to input fields for selection
|
||||
array_unshift($this->inputFields, array('text' => 'Blog to import',
|
||||
'type' => 'list',
|
||||
'name' => 'bId',
|
||||
'value' => 0,
|
||||
'default' => $bList));
|
||||
|
||||
return $this->inputFields;
|
||||
} else {
|
||||
return array();
|
||||
}
|
||||
function getInputFields() {
|
||||
// Make sure Google login has been completed
|
||||
if (!empty($_REQUEST['token'])) {
|
||||
|
||||
// Prepare session token request
|
||||
$req = new HTTP_Request('https://www.google.com/accounts/AuthSubSessionToken');
|
||||
$req->addHeader('Authorization', 'AuthSub token="'. $_REQUEST['token'] .'"');
|
||||
|
||||
// Request token
|
||||
$req->sendRequest();
|
||||
|
||||
// Handle token reponse
|
||||
if ($req->getResponseCode() != '200') return;
|
||||
|
||||
// Extract Auth token
|
||||
preg_match_all('/^(.+)=(.+)$/m', $req->getResponseBody(), $matches);
|
||||
$tokens = array_combine($matches[1], $matches[2]);
|
||||
unset($matches);
|
||||
|
||||
// Add hidden auth token field to input field list
|
||||
array_unshift($this->inputFields, array( 'text' => 'Google Auth Token (leave alone)',
|
||||
'type' => 'input',
|
||||
'name' => 'bAuthToken',
|
||||
'default' => $tokens['Token']));
|
||||
|
||||
// Prepare blog list request
|
||||
$req = new HTTP_Request('http://www.blogger.com/feeds/default/blogs');
|
||||
$req->addHeader('GData-Version', 2);
|
||||
$req->addHeader('Authorization', 'AuthSub token="'. $tokens['Token'] .'"');
|
||||
|
||||
// Fetch blog list
|
||||
$req->sendRequest();
|
||||
|
||||
// Handle errors
|
||||
if ($req->getResponseCode() != '200') return false;
|
||||
|
||||
// Load list
|
||||
$bXml = simplexml_load_string($req->getResponseBody());
|
||||
|
||||
// Generate list of the blogs under the authenticated account
|
||||
$bList = array();
|
||||
foreach ($bXml->entry as $entry) {
|
||||
$bList[substr($entry->id, strpos($entry->id, 'blog-') + 5)] = $entry->title;
|
||||
}
|
||||
|
||||
// Add blog list to input fields for selection
|
||||
array_unshift($this->inputFields, array('text' => 'Blog to import',
|
||||
'type' => 'list',
|
||||
'name' => 'bId',
|
||||
'value' => 0,
|
||||
'default' => $bList));
|
||||
|
||||
return $this->inputFields;
|
||||
} else {
|
||||
return array();
|
||||
}
|
||||
}
|
||||
|
||||
function _getCategoryList() {
|
||||
$res = serendipity_fetchCategories('all');
|
||||
$ret = array(0 => NO_CATEGORY);
|
||||
if (is_array($res)) {
|
||||
foreach ($res as $v) {
|
||||
$ret[$v['categoryid']] = $v['category_name'];
|
||||
}
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
function import() {
|
||||
global $serendipity;
|
||||
|
||||
// Force user to select a blog to act on
|
||||
if (empty($this->data['bId']) || $this->data['bId'] == 0) {
|
||||
echo 'Please select a blog to import!';
|
||||
return false;
|
||||
}
|
||||
|
||||
// Save this so we can return it to its original value at the end of this method.
|
||||
|
||||
function _getCategoryList() {
|
||||
$res = serendipity_fetchCategories('all');
|
||||
$ret = array(0 => NO_CATEGORY);
|
||||
if (is_array($res)) {
|
||||
foreach ($res as $v) {
|
||||
$ret[$v['categoryid']] = $v['category_name'];
|
||||
}
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
function import() {
|
||||
global $serendipity;
|
||||
|
||||
// Force user to select a blog to act on
|
||||
if (empty($this->data['bId']) || $this->data['bId'] == 0) {
|
||||
echo 'Please select a blog to import!';
|
||||
return false;
|
||||
}
|
||||
|
||||
// Save this so we can return it to its original value at the end of this method.
|
||||
$noautodiscovery = isset($serendipity['noautodiscovery']) ? $serendipity['noautodiscovery'] : false;
|
||||
|
||||
if ($this->data['autodiscovery'] == 'false') {
|
||||
@ -138,143 +138,143 @@ class Serendipity_Import_Blogger extends Serendipity_Import {
|
||||
}
|
||||
|
||||
$this->getTransTable();
|
||||
|
||||
// Prepare export request
|
||||
$req = new HTTP_Request('http://www.blogger.com/feeds/'. $this->data['bId'] .'/archive');
|
||||
$req->addHeader('GData-Version', 2);
|
||||
$req->addHeader('Authorization', 'AuthSub token="'. $this->data['bAuthToken'] .'"');
|
||||
|
||||
// Attempt fetch blog export
|
||||
$req->sendRequest();
|
||||
|
||||
// Handle errors
|
||||
if ($req->getResponseCode() != '200') {
|
||||
echo "Error occured while trying to export the blog.";
|
||||
return false;
|
||||
}
|
||||
|
||||
// Export success
|
||||
echo '<span class="block_level">Successfully exported entries from Blogger</span>';
|
||||
|
||||
// Get Serendipity authors list
|
||||
$authorList = array();
|
||||
$s9y_users = serendipity_fetchUsers();
|
||||
foreach ($s9y_users as $user) {
|
||||
$authorList[$user['authorid']] = $user['username'];
|
||||
}
|
||||
unset($s9y_users);
|
||||
|
||||
// Load export
|
||||
$bXml = simplexml_load_string($req->getResponseBody());
|
||||
|
||||
// Process entries
|
||||
$entryList = $entryFailList = array();
|
||||
foreach ($bXml->entry as $bEntry) {
|
||||
|
||||
// Check entry type
|
||||
switch ($bEntry->category['term']) {
|
||||
case 'http://schemas.google.com/blogger/2008/kind#post':
|
||||
// Process posts:
|
||||
|
||||
// Create author if not in serendipity
|
||||
$author = (string) $bEntry->author->name;
|
||||
if (!array_search($author, $authorList)) {
|
||||
serendipity_db_insert( 'authors',
|
||||
array( 'right_publish' => 1,
|
||||
'realname' => $author,
|
||||
'username' => $author,
|
||||
'userlevel' => 0,
|
||||
'password' => md5($this->data['defaultpass']))
|
||||
);
|
||||
$authorid = serendipity_db_insert_id('authors', 'authorid');
|
||||
$authorList[$authorid] = $author;
|
||||
}
|
||||
|
||||
$sEntry = array('title' => $this->decode((string) $bEntry->title),
|
||||
'isdraft' => ($bEntry->children('http://purl.org/atom/app#')->control->draft == 'yes') ? 'true' : 'false',
|
||||
'allow_comments' => (count($bEntry->xpath("*[@rel='replies']")) > 0) ? 'true' : 'false',
|
||||
'timestamp' => strtotime($bEntry->published),
|
||||
'body' => $this->strtr((string) $bEntry->content),
|
||||
'extended' => '',
|
||||
'categories' => $this->data['bCategory'],
|
||||
'author' => $author,
|
||||
'authorid' => $authorid
|
||||
);
|
||||
|
||||
// Add entry to s9y
|
||||
echo '..~.. ';
|
||||
if (is_int($id = serendipity_updertEntry($sEntry))) {
|
||||
// Add entry id to processed table for later lookups
|
||||
$entryList[(string) $bEntry->id] = array($id, $sEntry['title'], 0);
|
||||
} else {
|
||||
// Add to fail list
|
||||
$entryFailList[] = $sEntry['title'];
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'http://schemas.google.com/blogger/2008/kind#comment':
|
||||
// Process comments:
|
||||
|
||||
// Extract entry id for comment
|
||||
$cEntryId = $bEntry->xpath("thr:in-reply-to[@ref]");
|
||||
$cEntryId = (string) $cEntryId[0]['ref'];
|
||||
|
||||
// Check to make sure the related entry has been added to s9y
|
||||
if (array_key_exists($cEntryId, $entryList)) {
|
||||
// Add to s9y
|
||||
$sComment = array( 'entry_id ' => $entryList[$cEntryId][0],
|
||||
'parent_id' => 0,
|
||||
'timestamp' => strtotime($bEntry->published),
|
||||
'author' => (string) $bEntry->author->name,
|
||||
'email' => (string) $bEntry->author->email,
|
||||
'url' => (string) (isset($bEntry->author->uri)) ? $bEntry->author->uri : '',
|
||||
'ip' => '',
|
||||
'status' => 'approved',
|
||||
'body' => $this->strtr((string) $bEntry->content),
|
||||
'subscribed'=> 'false',
|
||||
'type' => 'NORMAL'
|
||||
);
|
||||
serendipity_db_insert('comments', $sComment);
|
||||
|
||||
// Update entry list with comment count
|
||||
$entryList[$cEntryId][2]++;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Report on resultant authors
|
||||
echo '<span class="block_level">Current list of authors: </span>'. join(', ', array_values($authorList));
|
||||
|
||||
// Do cleanup and report on entries
|
||||
echo '<span class="block_level">The following entries were successfully imported:</span>';
|
||||
echo '<ul>';
|
||||
foreach ($entryList as $eId => $eDetails) {
|
||||
// Update comment count for entry in s9y
|
||||
serendipity_db_query("UPDATE ". $serendipity['dbPrefix'] ."entries SET comments = ". $eDetails[2] ." WHERE id = ". $eDetails[0]);
|
||||
|
||||
echo '<li>'. $eDetails[1] .' comments('. $eDetails[2] .')</li>';
|
||||
}
|
||||
echo '</ul>';
|
||||
|
||||
// Report fails
|
||||
echo '<span class="block_level">The following entries ran into trouble and was not imported:</span>';
|
||||
echo '<ul>';
|
||||
foreach ($entryFailList as $eId => $eDetails) {
|
||||
echo '<li>'. $eDetails .'</li>';
|
||||
}
|
||||
echo '</ul>';
|
||||
|
||||
// Reset autodiscovery
|
||||
$serendipity['noautodiscovery'] = $noautodiscovery;
|
||||
|
||||
// All done!
|
||||
echo '<span class="msg_notice">Import finished.</span>';
|
||||
return true;
|
||||
}
|
||||
|
||||
// Prepare export request
|
||||
$req = new HTTP_Request('http://www.blogger.com/feeds/'. $this->data['bId'] .'/archive');
|
||||
$req->addHeader('GData-Version', 2);
|
||||
$req->addHeader('Authorization', 'AuthSub token="'. $this->data['bAuthToken'] .'"');
|
||||
|
||||
// Attempt fetch blog export
|
||||
$req->sendRequest();
|
||||
|
||||
// Handle errors
|
||||
if ($req->getResponseCode() != '200') {
|
||||
echo "Error occured while trying to export the blog.";
|
||||
return false;
|
||||
}
|
||||
|
||||
// Export success
|
||||
echo '<span class="block_level">Successfully exported entries from Blogger</span>';
|
||||
|
||||
// Get Serendipity authors list
|
||||
$authorList = array();
|
||||
$s9y_users = serendipity_fetchUsers();
|
||||
foreach ($s9y_users as $user) {
|
||||
$authorList[$user['authorid']] = $user['username'];
|
||||
}
|
||||
unset($s9y_users);
|
||||
|
||||
// Load export
|
||||
$bXml = simplexml_load_string($req->getResponseBody());
|
||||
|
||||
// Process entries
|
||||
$entryList = $entryFailList = array();
|
||||
foreach ($bXml->entry as $bEntry) {
|
||||
|
||||
// Check entry type
|
||||
switch ($bEntry->category['term']) {
|
||||
case 'http://schemas.google.com/blogger/2008/kind#post':
|
||||
// Process posts:
|
||||
|
||||
// Create author if not in serendipity
|
||||
$author = (string) $bEntry->author->name;
|
||||
if (!array_search($author, $authorList)) {
|
||||
serendipity_db_insert( 'authors',
|
||||
array( 'right_publish' => 1,
|
||||
'realname' => $author,
|
||||
'username' => $author,
|
||||
'userlevel' => 0,
|
||||
'password' => md5($this->data['defaultpass']))
|
||||
);
|
||||
$authorid = serendipity_db_insert_id('authors', 'authorid');
|
||||
$authorList[$authorid] = $author;
|
||||
}
|
||||
|
||||
$sEntry = array('title' => $this->decode((string) $bEntry->title),
|
||||
'isdraft' => ($bEntry->children('http://purl.org/atom/app#')->control->draft == 'yes') ? 'true' : 'false',
|
||||
'allow_comments' => (count($bEntry->xpath("*[@rel='replies']")) > 0) ? 'true' : 'false',
|
||||
'timestamp' => strtotime($bEntry->published),
|
||||
'body' => $this->strtr((string) $bEntry->content),
|
||||
'extended' => '',
|
||||
'categories' => $this->data['bCategory'],
|
||||
'author' => $author,
|
||||
'authorid' => $authorid
|
||||
);
|
||||
|
||||
// Add entry to s9y
|
||||
echo '..~.. ';
|
||||
if (is_int($id = serendipity_updertEntry($sEntry))) {
|
||||
// Add entry id to processed table for later lookups
|
||||
$entryList[(string) $bEntry->id] = array($id, $sEntry['title'], 0);
|
||||
} else {
|
||||
// Add to fail list
|
||||
$entryFailList[] = $sEntry['title'];
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'http://schemas.google.com/blogger/2008/kind#comment':
|
||||
// Process comments:
|
||||
|
||||
// Extract entry id for comment
|
||||
$cEntryId = $bEntry->xpath("thr:in-reply-to[@ref]");
|
||||
$cEntryId = (string) $cEntryId[0]['ref'];
|
||||
|
||||
// Check to make sure the related entry has been added to s9y
|
||||
if (array_key_exists($cEntryId, $entryList)) {
|
||||
// Add to s9y
|
||||
$sComment = array( 'entry_id ' => $entryList[$cEntryId][0],
|
||||
'parent_id' => 0,
|
||||
'timestamp' => strtotime($bEntry->published),
|
||||
'author' => (string) $bEntry->author->name,
|
||||
'email' => (string) $bEntry->author->email,
|
||||
'url' => (string) (isset($bEntry->author->uri)) ? $bEntry->author->uri : '',
|
||||
'ip' => '',
|
||||
'status' => 'approved',
|
||||
'body' => $this->strtr((string) $bEntry->content),
|
||||
'subscribed'=> 'false',
|
||||
'type' => 'NORMAL'
|
||||
);
|
||||
serendipity_db_insert('comments', $sComment);
|
||||
|
||||
// Update entry list with comment count
|
||||
$entryList[$cEntryId][2]++;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Report on resultant authors
|
||||
echo '<span class="block_level">Current list of authors: </span>'. join(', ', array_values($authorList));
|
||||
|
||||
// Do cleanup and report on entries
|
||||
echo '<span class="block_level">The following entries were successfully imported:</span>';
|
||||
echo '<ul>';
|
||||
foreach ($entryList as $eId => $eDetails) {
|
||||
// Update comment count for entry in s9y
|
||||
serendipity_db_query("UPDATE ". $serendipity['dbPrefix'] ."entries SET comments = ". $eDetails[2] ." WHERE id = ". $eDetails[0]);
|
||||
|
||||
echo '<li>'. $eDetails[1] .' comments('. $eDetails[2] .')</li>';
|
||||
}
|
||||
echo '</ul>';
|
||||
|
||||
// Report fails
|
||||
echo '<span class="block_level">The following entries ran into trouble and was not imported:</span>';
|
||||
echo '<ul>';
|
||||
foreach ($entryFailList as $eId => $eDetails) {
|
||||
echo '<li>'. $eDetails .'</li>';
|
||||
}
|
||||
echo '</ul>';
|
||||
|
||||
// Reset autodiscovery
|
||||
$serendipity['noautodiscovery'] = $noautodiscovery;
|
||||
|
||||
// All done!
|
||||
echo '<span class="msg_notice">Import finished.</span>';
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -133,35 +133,35 @@ class Serendipity_Import_Generic extends Serendipity_Import {
|
||||
function import_wpxrss() {
|
||||
// TODO: Backtranscoding to NATIVE charset. Currently only works with UTF-8.
|
||||
$dry_run = false;
|
||||
|
||||
|
||||
$serendipity['noautodiscovery'] = 1;
|
||||
$uri = $this->data['url'];
|
||||
require_once S9Y_PEAR_PATH . 'HTTP/Request.php';
|
||||
serendipity_request_start();
|
||||
$req = new HTTP_Request($uri, array('allowRedirects' => true, 'maxRedirects' => 5));
|
||||
$res = $req->sendRequest();
|
||||
|
||||
|
||||
if (PEAR::isError($res) || $req->getResponseCode() != '200') {
|
||||
serendipity_request_end();
|
||||
echo '<span class="block_level">' . IMPORT_FAILED . ': ' . htmlspecialchars($this->data['url']) . '</span>';
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$fContent = $req->getResponseBody();
|
||||
serendipity_request_end();
|
||||
echo '<span class="block_level">' . strlen($fContent) . " Bytes</span>";
|
||||
|
||||
|
||||
if (version_compare(PHP_VERSION, '5.0') === -1) {
|
||||
echo '<span class="block_level">';
|
||||
printf(UNMET_REQUIREMENTS, 'PHP >= 5.0');
|
||||
echo "</span>";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$xml = simplexml_load_string($fContent);
|
||||
unset($fContent);
|
||||
|
||||
|
||||
|
||||
|
||||
/* ************* USERS **********************/
|
||||
$_s9y_users = serendipity_fetchUsers();
|
||||
$s9y_users = array();
|
||||
@ -211,12 +211,12 @@ class Serendipity_Import_Generic extends Serendipity_Import {
|
||||
$wp_items = $item->children($wp_ns);
|
||||
$dc_items = $item->children($dc_ns);
|
||||
$content_items = $item->children($content_ns);
|
||||
|
||||
|
||||
// TODO: Attachments not handled
|
||||
if ((string)$wp_items->post_type == 'attachment' OR (string)$wp_items->post_type == 'page') {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$entry = array(
|
||||
'title' => (string)$item->title,
|
||||
'isdraft' => ((string)$wp_items->status == 'publish' ? 'false' : 'true'),
|
||||
@ -224,7 +224,7 @@ class Serendipity_Import_Generic extends Serendipity_Import {
|
||||
'categories' => array(),
|
||||
'body' => (string)$content_items->encoded
|
||||
);
|
||||
|
||||
|
||||
if (preg_match('@^([0-9]{4})\-([0-9]{2})\-([0-9]{2}) ([0-9]{2}):([0-9]{2}):([0-9]{2})$@', (string)$wp_items->post_date, $timematch)) {
|
||||
$entry['timestamp'] = mktime($timematch[4], $timematch[5], $timematch[6], $timematch[2], $timematch[3], $timematch[1]);
|
||||
} else {
|
||||
@ -244,7 +244,7 @@ class Serendipity_Import_Generic extends Serendipity_Import {
|
||||
$cstring = (string)$item->category;
|
||||
$entry['categories'][] = $s9y_cat[$cstring];
|
||||
}
|
||||
|
||||
|
||||
$wp_user = (string)$dc_items->creator;
|
||||
if (!isset($s9y_users[$wp_user])) {
|
||||
if ($dry_run) {
|
||||
@ -258,13 +258,13 @@ class Serendipity_Import_Generic extends Serendipity_Import {
|
||||
}
|
||||
|
||||
$entry['authorid'] = $s9y_users[$wp_user]['authorid'];
|
||||
|
||||
|
||||
if ($dry_run) {
|
||||
$id = time();
|
||||
} else {
|
||||
$id = serendipity_updertEntry($entry);
|
||||
}
|
||||
|
||||
|
||||
$s9y_cid = array(); // Holds comment ids to s9y ids association.
|
||||
$c_i = 0;
|
||||
foreach($wp_items->comment AS $comment) {
|
||||
@ -296,7 +296,7 @@ class Serendipity_Import_Generic extends Serendipity_Import {
|
||||
} else {
|
||||
$s9y_comment['timestamp'] = time();
|
||||
}
|
||||
|
||||
|
||||
if ($dry_run) {
|
||||
$cid = time();
|
||||
} else {
|
||||
@ -308,7 +308,7 @@ class Serendipity_Import_Generic extends Serendipity_Import {
|
||||
}
|
||||
$s9y_cid[$c_id] = $cid;
|
||||
}
|
||||
|
||||
|
||||
echo "<span class='msg_notice'>Entry '" . htmlspecialchars($entry['title']) . "' ($c_i comments) imported.</span>";
|
||||
}
|
||||
return true;
|
||||
|
@ -135,7 +135,7 @@ class Serendipity_Import_LiveJournalXML extends Serendipity_Import {
|
||||
);
|
||||
unset($vals);
|
||||
}
|
||||
|
||||
|
||||
return $tree;
|
||||
}
|
||||
|
||||
@ -204,17 +204,17 @@ class Serendipity_Import_LiveJournalXML extends Serendipity_Import {
|
||||
printf(FILE_NOT_FOUND, htmlspecialchars($this->data['url']));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$file = file_get_contents($this->data['url']);
|
||||
$tree =& $this->parseXML($file);
|
||||
$serendipity['noautodiscovery'] = 1;
|
||||
|
||||
|
||||
foreach($tree[0]['children'] AS $idx => $entry) {
|
||||
if (!is_array($entry)) continue;
|
||||
if ($entry['tag'] != 'entry') {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$new_entry = array(
|
||||
'allow_comments' => true,
|
||||
'extended' => '',
|
||||
@ -222,7 +222,7 @@ class Serendipity_Import_LiveJournalXML extends Serendipity_Import {
|
||||
'isdraft' => ($this->data['type'] == 'draft' ? 'true' : 'false'),
|
||||
'categories' => array($this->data['category'] => $this->data['category'])
|
||||
);
|
||||
|
||||
|
||||
if (!is_array($entry['children'])) continue;
|
||||
|
||||
foreach($entry['children'] AS $idx2 => $entrydata) {
|
||||
@ -238,11 +238,11 @@ class Serendipity_Import_LiveJournalXML extends Serendipity_Import {
|
||||
case 'date':
|
||||
$new_entry['timestamp'] = $this->getTimestamp($entrydata['value']);
|
||||
break;
|
||||
|
||||
|
||||
case 'subject':
|
||||
$new_entry['title'] = $entrydata['value'];
|
||||
break;
|
||||
|
||||
|
||||
case 'event':
|
||||
$new_entry['body'] = $entrydata['value'];
|
||||
break;
|
||||
@ -266,7 +266,7 @@ class Serendipity_Import_LiveJournalXML extends Serendipity_Import {
|
||||
}
|
||||
echo '<span class="msg_notice">Inserted comments for entry #' . $id . '</span>';
|
||||
}
|
||||
|
||||
|
||||
if (function_exists('ob_flush')) {
|
||||
@ob_flush();
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ class Serendipity_Import_Nucleus extends Serendipity_Import {
|
||||
if ($this->data['autodiscovery'] == 'false') {
|
||||
$serendipity['noautodiscovery'] = 1;
|
||||
}
|
||||
|
||||
|
||||
$this->getTransTable();
|
||||
|
||||
$this->data['prefix'] = serendipity_db_escape_string($this->data['prefix']);
|
||||
|
@ -238,7 +238,7 @@ class Serendipity_Import_phpbb extends Serendipity_Import {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Comments */
|
||||
$topic_id = $entries[$x]['topic_id'];
|
||||
$c_res = @$this->nativeQuery("SELECT t.topic_title,
|
||||
@ -259,7 +259,7 @@ class Serendipity_Import_phpbb extends Serendipity_Import {
|
||||
if (!$c_res) {
|
||||
return sprintf(COULDNT_SELECT_COMMENT_INFO, mysql_error($gdb));
|
||||
}
|
||||
|
||||
|
||||
while ($a = mysql_fetch_assoc($c_res)) {
|
||||
if ($a['post_id'] == $entries[$x]['post_id']) {
|
||||
continue;
|
||||
|
@ -104,10 +104,10 @@ class Serendipity_Import_Serendipity extends Serendipity_Import {
|
||||
echo 'Dupe-Check: <pre>' . print_r($dupes, true) . '</pre>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$res = $this->nativeQuery("SELECT * FROM {$this->data['prefix']}" . $table . " " . $where, $s9ydb);
|
||||
echo mysql_error($s9ydb);
|
||||
|
||||
|
||||
if (!$res || mysql_num_rows($res) < 1) {
|
||||
return false;
|
||||
}
|
||||
@ -119,7 +119,7 @@ class Serendipity_Import_Serendipity extends Serendipity_Import {
|
||||
foreach($primary_keys AS $primary_key) {
|
||||
$primary_vals[$primary_key] = $row[$primary_key];
|
||||
if ($table == 'comments') {
|
||||
$primary_vals['entry_id'] = $row['entry_id'];
|
||||
$primary_vals['entry_id'] = $row['entry_id'];
|
||||
}
|
||||
unset($row[$primary_key]);
|
||||
}
|
||||
@ -131,15 +131,15 @@ class Serendipity_Import_Serendipity extends Serendipity_Import {
|
||||
if (is_array($fix_relations)) {
|
||||
foreach($fix_relations AS $primary_key => $fix_relation) {
|
||||
foreach($fix_relation AS $fix_relation_table => $fix_relation_primary_key) {
|
||||
|
||||
if ($table == 'comments' && $fix_relation_table == 'entries') {
|
||||
$assoc_val = $primary_vals['entry_id'];
|
||||
} elseif (isset($primary_vals[$fix_relation_primary_key])) {
|
||||
|
||||
if ($table == 'comments' && $fix_relation_table == 'entries') {
|
||||
$assoc_val = $primary_vals['entry_id'];
|
||||
} elseif (isset($primary_vals[$fix_relation_primary_key])) {
|
||||
$assoc_val = $primary_vals[$fix_relation_primary_key];
|
||||
} else {
|
||||
$assoc_val = $row[$primary_key];
|
||||
$assoc_val = $row[$primary_key];
|
||||
}
|
||||
|
||||
|
||||
if (!$this->execute && empty($assoc_val)) {
|
||||
if ($this->debug) {
|
||||
echo '<pre>';
|
||||
@ -150,7 +150,7 @@ class Serendipity_Import_Serendipity extends Serendipity_Import {
|
||||
}
|
||||
|
||||
$new_val = $this->storage[$fix_relation_table][$fix_relation_primary_key][$assoc_val];
|
||||
|
||||
|
||||
if ($skip_dupes && $assoc_val == $new_val) {
|
||||
$insert = false;
|
||||
}
|
||||
@ -158,7 +158,7 @@ class Serendipity_Import_Serendipity extends Serendipity_Import {
|
||||
if (!empty($new_val)) {
|
||||
$row[$primary_key] = $new_val;
|
||||
}
|
||||
|
||||
|
||||
if (!$this->execute && $this->debug) {
|
||||
echo "<span>Fix relation from $fix_relation_table.$fix_relation_primary_key={$primary_vals[$fix_relation_primary_key]} to {$row[$primary_key]} (assoc_val: $assoc_val)</span>";
|
||||
}
|
||||
@ -190,11 +190,11 @@ class Serendipity_Import_Serendipity extends Serendipity_Import {
|
||||
$this->storage[$table][$primary_key][$primary_val] = $this->counter;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
foreach($this->storage[$table] AS $primary_key => $primary_data) {
|
||||
foreach($primary_data AS $primary_val => $replace_val) {
|
||||
serendipity_set_config_var('import_s9y_' . $table . '_' . $primary_key . '_' . $primary_val, $replace_val, 99);
|
||||
}
|
||||
foreach($primary_data AS $primary_val => $replace_val) {
|
||||
serendipity_set_config_var('import_s9y_' . $table . '_' . $primary_key . '_' . $primary_val, $replace_val, 99);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ($this->debug && !$this->execute) {
|
||||
@ -202,7 +202,7 @@ class Serendipity_Import_Serendipity extends Serendipity_Import {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!$this->execute) {
|
||||
echo 'Storage on '. $table . ':<pre>' . print_r($this->storage[$table], true) . '</pre>';
|
||||
} else {
|
||||
@ -458,7 +458,7 @@ class Serendipity_Import_Serendipity extends Serendipity_Import {
|
||||
if (!is_array($this->data['targets'])) {
|
||||
return "No targets selected";
|
||||
}
|
||||
|
||||
|
||||
$this->storage = array();
|
||||
foreach($this->data['targets'] AS $target) {
|
||||
$this->{'import_' . $target}($s9ydb);
|
||||
|
@ -2,7 +2,7 @@
|
||||
# Copyright (c) 2003-2005, Tim Putnam
|
||||
|
||||
/*****************************************************************
|
||||
* VoodooPad Importer, by Tim Putnam
|
||||
* VoodooPad Importer, by Tim Putnam
|
||||
* http://deepbluesea.fracsoft.com *
|
||||
*****************************************************************/
|
||||
|
||||
@ -39,7 +39,7 @@ class Serendipity_Import_VoodooPad extends Serendipity_Import {
|
||||
var $data = array();
|
||||
var $inputFields = array();
|
||||
var $force_recode = false;
|
||||
|
||||
|
||||
function Serendipity_Import_VoodooPad($data) {
|
||||
$this->data = $data;
|
||||
$this->inputFields = array(
|
||||
@ -89,7 +89,7 @@ class Serendipity_Import_VoodooPad extends Serendipity_Import {
|
||||
$file = $_FILES['serendipity']['tmp_name']['import']['voodooPadXML'];
|
||||
|
||||
// Create a parser and set it up with the callbacks
|
||||
$xml_parser = xml_parser_create('');
|
||||
$xml_parser = xml_parser_create('');
|
||||
xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, 0);
|
||||
xml_set_element_handler($xml_parser, "start_element_handler", "end_element_handler");
|
||||
xml_set_character_data_handler($xml_parser, "character_data_handler");
|
||||
@ -98,7 +98,7 @@ class Serendipity_Import_VoodooPad extends Serendipity_Import {
|
||||
if (!file_exists($file)) {
|
||||
die(sprintf(DOCUMENT_NOT_FOUND, htmlspecialchars($file)));
|
||||
}
|
||||
|
||||
|
||||
if(!($handle = fopen($file, "r"))) {
|
||||
die(sprintf(SKIPPING_FILE_UNREADABLE, htmlspecialchars($file)));
|
||||
}
|
||||
@ -117,7 +117,7 @@ class Serendipity_Import_VoodooPad extends Serendipity_Import {
|
||||
// so loop through building and/or updating page objects
|
||||
while(list($key_a) = each($elements)) {
|
||||
$name = $elements[$key_a]->name;
|
||||
|
||||
|
||||
switch ($name) {
|
||||
case 'data': // <data> indicates the start of the VoodooPad entry, so create page object
|
||||
$thispage = array();
|
||||
@ -138,10 +138,10 @@ class Serendipity_Import_VoodooPad extends Serendipity_Import {
|
||||
$thispage['timestamp'] = time();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$thispage['filename'] = $mykey.'.htm';
|
||||
// Thanks for pointing this out to me and not just fixing it, I'm learning.
|
||||
$thispage['permalink'] = $serendipity['serendipityHTTPPath'] . 'index.php?serendipity[subpage]=' . $mykey;
|
||||
$thispage['permalink'] = $serendipity['serendipityHTTPPath'] . 'index.php?serendipity[subpage]=' . $mykey;
|
||||
break;
|
||||
|
||||
case 'alias': // The title and the string used to match links
|
||||
@ -162,7 +162,7 @@ class Serendipity_Import_VoodooPad extends Serendipity_Import {
|
||||
if (!isset($thispage['id'])) {
|
||||
echo '<span class="block_level">'.IMPORTER_VOODOO_CREATINGPAGE.': '. $mykey.'</span>';
|
||||
serendipity_db_insert('staticpages', $thispage);
|
||||
$serendipity["POST"]["staticpage"] = serendipity_db_insert_id("staticpages", 'id');
|
||||
$serendipity["POST"]["staticpage"] = serendipity_db_insert_id("staticpages", 'id');
|
||||
} elseif ($this->data['updateExisting'] == 'true') {
|
||||
echo '<span class="block_level">'.IMPORTER_VOODOO_UPDATINGPAGE.': '. $mykey.'</span>';
|
||||
serendipity_db_update("staticpages", array("id" => $thispage["id"]), $thispage);
|
||||
@ -174,7 +174,7 @@ class Serendipity_Import_VoodooPad extends Serendipity_Import {
|
||||
echo '<span class="block_level">'.IMPORTER_VOODOO_RECORDURL.': '.$thispage['headline'].'</span>';
|
||||
$aliases[$thispage['headline']] = $thispage['content'];
|
||||
}
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -192,9 +192,9 @@ class Serendipity_Import_VoodooPad extends Serendipity_Import {
|
||||
|
||||
// **TODO** Change this to pull out only entries for the current wiki
|
||||
echo '<p>'.IMPORTER_VOODOO_WRITEINTRALINKS.'</p>';
|
||||
|
||||
$pages= &serendipity_db_query("SELECT * FROM {$serendipity['dbPrefix']}staticpages ORDER BY pagetitle DESC");
|
||||
|
||||
|
||||
$pages= &serendipity_db_query("SELECT * FROM {$serendipity['dbPrefix']}staticpages ORDER BY pagetitle DESC");
|
||||
|
||||
foreach ($pages as $thispage) {
|
||||
// Parse the content string
|
||||
foreach ($aliases as $alias => $permalink) {
|
||||
@ -204,13 +204,13 @@ class Serendipity_Import_VoodooPad extends Serendipity_Import {
|
||||
for ($counter = 0; $counter <= 12; $counter+=1) {
|
||||
unset ($thispage[$counter]);
|
||||
}
|
||||
|
||||
|
||||
// Write back to the database
|
||||
serendipity_db_update("staticpages", array("id" => $thispage["id"]), $thispage);
|
||||
}
|
||||
|
||||
|
||||
echo '<span class="msg_success">' . DONE . '</span>';
|
||||
}
|
||||
}
|
||||
|
||||
// Search and replace avoiding content of links
|
||||
// **TODO** Fix this to avoid short links screwing up longer links
|
||||
@ -219,16 +219,16 @@ class Serendipity_Import_VoodooPad extends Serendipity_Import {
|
||||
$ns = '';
|
||||
for ($i = 0; $i < count($r); $i++) {
|
||||
if ($r[$i] == "<") {
|
||||
$i+=2;
|
||||
$i+=2;
|
||||
continue;
|
||||
}
|
||||
$r[$i] = eregi_replace(sql_regcase($alias), '<a href="'.$link.'">'.$alias.'</a>', $r[$i]);
|
||||
}
|
||||
|
||||
return join("", $r);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// XML Parser callbacks
|
||||
function start_element_handler($parser, $name, $attribs){
|
||||
global $elements, $stack, $count, $depth;
|
||||
@ -237,29 +237,29 @@ function start_element_handler($parser, $name, $attribs){
|
||||
$element = new element;
|
||||
$elements[$id] = $element;
|
||||
$elements[$id]->name = $name;
|
||||
|
||||
|
||||
while(list($key, $value) = each($attribs)) {
|
||||
$elements[$id]->attributes[$key] = $value;
|
||||
}
|
||||
|
||||
|
||||
$elements[$id]->depth = $depth;
|
||||
array_push($stack, $id);
|
||||
|
||||
|
||||
$count++;
|
||||
$depth++;
|
||||
}
|
||||
|
||||
function end_element_handler($parser, $name){
|
||||
global $stack, $depth;
|
||||
|
||||
|
||||
array_pop($stack);
|
||||
|
||||
|
||||
$depth--;
|
||||
}
|
||||
|
||||
function character_data_handler($parser, $data){
|
||||
global $elements, $stack;
|
||||
|
||||
|
||||
$elements[$stack[count($stack)-1]]->data .= $data;
|
||||
}
|
||||
|
||||
|
@ -49,11 +49,11 @@ class Serendipity_Import_WordPress extends Serendipity_Import {
|
||||
'type' => 'bool',
|
||||
'name' => 'autodiscovery',
|
||||
'default' => 'false'),
|
||||
|
||||
|
||||
array('text' => IMPORT_WP_PAGES,
|
||||
'type' => 'bool',
|
||||
'name' => 'import_all',
|
||||
'default' => 'false'
|
||||
'default' => 'false'
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -100,7 +100,7 @@ class Serendipity_Import_WordPress extends Serendipity_Import {
|
||||
if (!@mysql_select_db($this->data['name'])) {
|
||||
return sprintf(COULDNT_SELECT_DB, mysql_error($wpdb));
|
||||
}
|
||||
|
||||
|
||||
// This will hold the s9y <-> WP ID associations.
|
||||
$assoc = array();
|
||||
|
||||
@ -113,12 +113,12 @@ class Serendipity_Import_WordPress extends Serendipity_Import {
|
||||
if ($debug) echo "<span class='block_level'>Importing users...</span>";
|
||||
for ($x=0, $c = mysql_num_rows($res) ; $x < $c ; $x++) {
|
||||
$users[$x] = mysql_fetch_assoc($res);
|
||||
|
||||
|
||||
$data = array('right_publish' => (!isset($users[$x]['user_level']) || $users[$x]['user_level'] >= 1) ? 1 : 0,
|
||||
'realname' => $users[$x]['user_login'],
|
||||
'username' => $users[$x]['user_login'],
|
||||
'password' => $users[$x]['user_pass']); // WP uses md5, too.
|
||||
|
||||
|
||||
if (isset($users[$x]['user_level']) && $users[$x]['user_level'] <= 1) {
|
||||
$data['userlevel'] = USERLEVEL_EDITOR;
|
||||
} elseif (isset($users[$x]['user_level']) && $users[$x]['user_level'] < 5) {
|
||||
@ -126,19 +126,19 @@ class Serendipity_Import_WordPress extends Serendipity_Import {
|
||||
} else {
|
||||
$data['userlevel'] = USERLEVEL_ADMIN;
|
||||
}
|
||||
|
||||
|
||||
if ($serendipity['serendipityUserlevel'] < $data['userlevel']) {
|
||||
$data['userlevel'] = $serendipity['serendipityUserlevel'];
|
||||
}
|
||||
|
||||
|
||||
serendipity_db_insert('authors', $this->strtrRecursive($data));
|
||||
$users[$x]['authorid'] = serendipity_db_insert_id('authors', 'authorid');
|
||||
|
||||
|
||||
// Set association.
|
||||
$assoc['users'][$users[$x]['ID']] = $users[$x]['authorid'];
|
||||
}
|
||||
if ($debug) echo "<span class='msg_success'>Imported users.</span>";
|
||||
|
||||
|
||||
// Clean memory
|
||||
unset($users);
|
||||
}
|
||||
@ -158,7 +158,7 @@ class Serendipity_Import_WordPress extends Serendipity_Import {
|
||||
for ($x=0 ; $x<mysql_num_rows($res) ; $x++) {
|
||||
$categories[] = mysql_fetch_assoc($res);
|
||||
}
|
||||
|
||||
|
||||
// Insert all categories as top level (we need to know everyone's ID before we can represent the hierarchy).
|
||||
for ($x=0, $c = sizeof($categories) ; $x < $c ; $x++) {
|
||||
$cat = array('category_name' => $categories[$x]['cat_name'],
|
||||
@ -166,14 +166,14 @@ class Serendipity_Import_WordPress extends Serendipity_Import {
|
||||
'parentid' => 0,
|
||||
'category_left' => 0,
|
||||
'category_right' => 0);
|
||||
|
||||
|
||||
serendipity_db_insert('category', $this->strtrRecursive($cat));
|
||||
$categories[$x]['categoryid'] = serendipity_db_insert_id('category', 'categoryid');
|
||||
|
||||
|
||||
// Set association.
|
||||
$assoc['categories'][$categories[$x]['cat_ID']] = $categories[$x]['categoryid'];
|
||||
}
|
||||
|
||||
|
||||
foreach ($categories as $cat) {
|
||||
if ($cat['category_parent'] != 0) {
|
||||
// Find the parent
|
||||
@ -184,7 +184,7 @@ class Serendipity_Import_WordPress extends Serendipity_Import {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($par_id != 0) {
|
||||
serendipity_db_query("UPDATE {$serendipity['dbPrefix']}category
|
||||
SET parentid={$par_id}
|
||||
@ -225,7 +225,7 @@ class Serendipity_Import_WordPress extends Serendipity_Import {
|
||||
for ($x=0 ; $x<mysql_num_rows($res) ; $x++) {
|
||||
$categories[] = mysql_fetch_assoc($res);
|
||||
}
|
||||
|
||||
|
||||
// Insert all categories as top level (we need to know everyone's ID before we can represent the hierarchy).
|
||||
for ($x=0, $c = sizeof($categories) ; $x < $c ; $x++) {
|
||||
$cat = array('category_name' => $categories[$x]['cat_name'],
|
||||
@ -233,14 +233,14 @@ class Serendipity_Import_WordPress extends Serendipity_Import {
|
||||
'parentid' => 0,
|
||||
'category_left' => 0,
|
||||
'category_right' => 0);
|
||||
|
||||
|
||||
serendipity_db_insert('category', $this->strtrRecursive($cat));
|
||||
$categories[$x]['categoryid'] = serendipity_db_insert_id('category', 'categoryid');
|
||||
|
||||
|
||||
// Set association.
|
||||
$assoc['categories'][$categories[$x]['cat_ID']] = $categories[$x]['categoryid'];
|
||||
}
|
||||
|
||||
|
||||
foreach ($categories as $cat) {
|
||||
if ($cat['category_parent'] != 0) {
|
||||
// Find the parent
|
||||
@ -251,7 +251,7 @@ class Serendipity_Import_WordPress extends Serendipity_Import {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($par_id != 0) {
|
||||
serendipity_db_query("UPDATE {$serendipity['dbPrefix']}category
|
||||
SET parentid={$par_id}
|
||||
@ -285,11 +285,11 @@ class Serendipity_Import_WordPress extends Serendipity_Import {
|
||||
if ($debug) echo "<span class='block_level'>Importing entries...</span>";
|
||||
for ($x=0, $c = mysql_num_rows($res) ; $x < $c ; $x++ ) {
|
||||
$entries[$x] = mysql_fetch_assoc($res);
|
||||
|
||||
|
||||
$content = explode('<!--more-->', $entries[$x]['post_content'], 2);
|
||||
$body = $content[0];
|
||||
$extended = $content[1];
|
||||
|
||||
|
||||
$entry = array('title' => $this->decode($entries[$x]['post_title']), // htmlentities() is called later, so we can leave this.
|
||||
'isdraft' => ($entries[$x]['post_status'] == 'publish') ? 'false' : 'true',
|
||||
'allow_comments' => ($entries[$x]['comment_status'] == 'open' ) ? 'true' : 'false',
|
||||
@ -297,13 +297,13 @@ class Serendipity_Import_WordPress extends Serendipity_Import {
|
||||
'body' => $this->strtr($body),
|
||||
'extended' => $this->strtr($extended),
|
||||
'authorid' => $assoc['users'][$entries[$x]['post_author']]);
|
||||
|
||||
|
||||
if (!is_int($entries[$x]['entryid'] = serendipity_updertEntry($entry))) {
|
||||
printf(COULDNT_SELECT_ENTRY_INFO, mysql_error($wpdb));
|
||||
echo "<span class='block_level'>ID: {$entries[$x]['ID']} - {$entry['title']}</span>";
|
||||
return $entries[$x]['entryid'];
|
||||
}
|
||||
|
||||
|
||||
$assoc['entries'][$entries[$x]['ID']] = $entries[$x]['entryid'];
|
||||
}
|
||||
if ($debug) echo "<span class='msg_success'>Imported entries...</span>";
|
||||
@ -311,7 +311,7 @@ class Serendipity_Import_WordPress extends Serendipity_Import {
|
||||
// Clean memory
|
||||
unset($entries);
|
||||
}
|
||||
|
||||
|
||||
/* Entry/category (WP < 2.3 style)*/
|
||||
$no_entrycat = false;
|
||||
$res = @$this->nativeQuery("SELECT * FROM {$this->data['prefix']}post2cat;", $wpdb);
|
||||
|
@ -385,7 +385,7 @@ if ( (int)$serendipity['GET']['step'] == 0 ) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!$showWritableNote) {
|
||||
echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, WRITABLE);
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ if ($serendipity['GET']['adminAction'] == 'save' && serendipity_checkFormToken()
|
||||
if (!is_array($_POST[$item['var']])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// Check that no user may assign groups he's not allowed to.
|
||||
foreach($_POST[$item['var']] AS $groupkey => $groupval) {
|
||||
if (in_array($groupval, $valid_groups)) {
|
||||
|
@ -105,7 +105,7 @@ if (isset($_GET['serendipity']['plugin_to_conf'])) {
|
||||
if (!isset($_POST['serendipity']['plugin']['activate'][$config_item][$out_value])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$out_values[] = $out_value;
|
||||
}
|
||||
$value = implode(',', $out_values);
|
||||
@ -250,7 +250,7 @@ if (isset($_GET['serendipity']['plugin_to_conf'])) {
|
||||
$props['local_documentation'] = 'plugins/' . $props['pluginPath'] . '/README';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$pluginstack[$class_data['true_name']] = $props;
|
||||
} else {
|
||||
// False is returned if a plugin could not be instantiated
|
||||
|
@ -27,11 +27,11 @@ class template_option {
|
||||
|
||||
function set_config($item, $value) {
|
||||
global $serendipity;
|
||||
|
||||
|
||||
serendipity_db_query("DELETE FROM {$serendipity['dbPrefix']}options
|
||||
WHERE okey = 't_" . serendipity_db_escape_string($serendipity['template']) . "'
|
||||
AND name = '" . serendipity_db_escape_string($item) . "'");
|
||||
|
||||
|
||||
if ($this->config[$item]['scope'] == 'global') {
|
||||
serendipity_db_query("DELETE FROM {$serendipity['dbPrefix']}options
|
||||
WHERE okey = 't_global'
|
||||
@ -102,7 +102,7 @@ if (is_array($template_config)) {
|
||||
include S9Y_INCLUDE_PATH . 'include/functions_plugins_admin.inc.php';
|
||||
|
||||
$template_vars =& serendipity_loadThemeOptions($template_config);
|
||||
|
||||
|
||||
$template_options = new template_option();
|
||||
$template_options->import($template_config);
|
||||
$template_options->values =& $template_vars;
|
||||
@ -168,7 +168,7 @@ echo '<h3>' . SELECT_TEMPLATE . '</h3>';
|
||||
} else {
|
||||
$preview .= ' ';
|
||||
}
|
||||
|
||||
|
||||
if ($preview_link) {
|
||||
$preview .= '</a>';
|
||||
}
|
||||
|
@ -80,10 +80,10 @@ function memSnap($tshow = '') {
|
||||
if (!function_exists('errorToExceptionHandler')) {
|
||||
function errorToExceptionHandler($errNo, $errStr, $errFile = '', $errLine = NULL, $errContext = array()) {
|
||||
global $serendipity;
|
||||
|
||||
|
||||
$rep = ini_get('error_reporting');
|
||||
$args = func_get_args();
|
||||
|
||||
|
||||
// respect user has set php error_reporting to not display any errors at all
|
||||
if (!($rep & $errStr)) { return false; }
|
||||
// user used @ to specify ignoring all errors or $php_errormsg messages returned with error_reporting = 0
|
||||
@ -96,14 +96,14 @@ if (!function_exists('errorToExceptionHandler')) {
|
||||
return false;
|
||||
}
|
||||
// any other errors go here - throw errors as exception
|
||||
if ($serendipity['production'] === 'debug') {
|
||||
|
||||
if ($serendipity['production'] === 'debug') {
|
||||
|
||||
// We don't want the notices - but everything else !
|
||||
echo '<p> == FULL DEBUG ERROR MODE == </p>';
|
||||
echo '<pre>';
|
||||
// trying to be as detailled as possible - but beware using args containing sensibel data like passwords
|
||||
if (function_exists('debug_backtrace') && version_compare(PHP_VERSION, '5.3.6') >= 0) {
|
||||
if ( version_compare(PHP_VERSION, '5.4') >= 0 ) {
|
||||
if ( version_compare(PHP_VERSION, '5.4') >= 0 ) {
|
||||
$debugbacktrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 8);
|
||||
} else {
|
||||
$debugbacktrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
|
||||
@ -121,7 +121,7 @@ if (!function_exists('errorToExceptionHandler')) {
|
||||
echo '</pre>'; // if using throw new ... this ending tag will not be send and displayed, but it still looks better and browsers don't really care
|
||||
exit; // make sure to exit in case of database connection errors.
|
||||
}
|
||||
if ($serendipity['production'] === false) {
|
||||
if ($serendipity['production'] === false) {
|
||||
echo '<p> == TESTING ERROR MODE == </p>';
|
||||
echo '<pre>';
|
||||
// see notes above
|
||||
@ -132,8 +132,8 @@ if (!function_exists('errorToExceptionHandler')) {
|
||||
}
|
||||
echo '</pre>'; // if using throw new ... this ending tag will not be send and displayed, but it still looks better and browsers don't really care
|
||||
exit; // make sure to exit in case of database connection errors.
|
||||
}
|
||||
if ($serendipity['production'] === true) {
|
||||
}
|
||||
if ($serendipity['production'] === true) {
|
||||
if( $serendipity['serendipityUserlevel'] >= USERLEVEL_ADMIN ) {
|
||||
// ToDo: enhance for more special serendipity error needs
|
||||
$str = '<p> == SERENDIPITY ERROR == </p>';
|
||||
|
@ -85,7 +85,7 @@ function serendipity_db_insert($table, $values, $action = 'execute')
|
||||
}
|
||||
|
||||
$q = "INSERT INTO {$serendipity['dbPrefix']}$table ($names) values ($vals)";
|
||||
|
||||
|
||||
if ($action == 'execute') {
|
||||
return serendipity_db_query($q);
|
||||
} else {
|
||||
@ -147,11 +147,11 @@ function serendipity_db_get_interval($val, $ival = 900) {
|
||||
$ts = 'NOW()';
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
switch($val) {
|
||||
case 'interval':
|
||||
return $interval;
|
||||
|
||||
|
||||
default:
|
||||
case 'ts':
|
||||
return $ts;
|
||||
@ -172,7 +172,7 @@ function serendipity_db_implode($string, &$array, $type = 'int') {
|
||||
if (!is_array($array)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
foreach($array AS $idx => $key) {
|
||||
if ($type == 'int') {
|
||||
$new_array[$idx] = (int)$key;
|
||||
|
@ -86,7 +86,7 @@ function &serendipity_db_query($sql, $single = false, $result_type = "both", $re
|
||||
if ($benchmark) {
|
||||
$end = microtime_float();
|
||||
mysql_query("INSERT INTO BLOGLOG (request, timestamp, sql, exec_time, ip) VALUES ('" . serendipity_db_escape_string($_SERVER['REQUEST_URI']) . "', NOW(), '" . serendipity_db_escape_string($sql) . "', '" . (number_format($end-$start, 10)) . "', '" . serendipity_db_escape_string($_SERVER['REMOTE_ADDR']) . "')");
|
||||
|
||||
|
||||
$psql = $sql;
|
||||
$psql = preg_replace('@[0-9]{10}@', 'TIMESTAMP', $psql);
|
||||
mysql_query("UPDATE BLOGLOG_TOTAL SET counter = counter + 1 WHERE sql = '" . serendipity_db_escape_string($psql) . "'");
|
||||
|
@ -255,7 +255,7 @@ function &serendipity_db_query($sql, $single = false, $result_type = "both", $re
|
||||
$rows = array();
|
||||
|
||||
foreach($serendipity['dbSth']->fetchAll($result_type) AS $row) {
|
||||
$row = serendipity_db_sqlite_fetch_array($row, $result_type);
|
||||
$row = serendipity_db_sqlite_fetch_array($row, $result_type);
|
||||
if (!empty($assocKey)) {
|
||||
// You can fetch a key-associated array via the two function parameters assocKey and assocVal
|
||||
if (empty($assocVal)) {
|
||||
|
@ -49,7 +49,7 @@ function serendipity_db_connect()
|
||||
return $serendipity['dbConn'];
|
||||
}
|
||||
|
||||
// SQLite3 doesn't support persistent connections
|
||||
// SQLite3 doesn't support persistent connections
|
||||
$serendipity['dbConn'] = sqlite3_open($serendipity['serendipityPath'] . $serendipity['dbName'] . '.db');
|
||||
|
||||
return $serendipity['dbConn'];
|
||||
|
@ -110,7 +110,7 @@ function generate_resultset($cursor, $result_type = 'sqlr_BOTH') {
|
||||
}
|
||||
}
|
||||
}
|
||||
return $return_row;
|
||||
return $return_row;
|
||||
}
|
||||
|
||||
function &serendipity_db_query($sql, $single = false, $result_type = "both", $reportErr = false, $assocKey = false, $assocVal = false, $expectError = false) {
|
||||
@ -149,7 +149,7 @@ function &serendipity_db_query($sql, $single = false, $result_type = "both", $re
|
||||
$cur = sqlrcur_alloc($serendipity['dbConn']);
|
||||
$sql_b="INSERT INTO BLOGLOG (request, timestamp, sql, exec_time, ip) VALUES ('" . serendipity_db_escape_string($_SERVER['REQUEST_URI']) . "', NOW(), '" . serendipity_db_escape_string($sql) . "', '" . (number_format($end-$start, 10)) . "', '" . serendipity_db_escape_string($_SERVER['REMOTE_ADDR']) . "')";
|
||||
$c = sqlrcur_sendQuery($cur, $sql_b);
|
||||
|
||||
|
||||
$psql = $sql;
|
||||
$psql = preg_replace('@[0-9]{10}@', 'TIMESTAMP', $psql);
|
||||
$sql_U="UPDATE BLOGLOG_TOTAL SET counter = counter + 1 WHERE sql = '" . serendipity_db_escape_string($psql) . "'";
|
||||
@ -205,7 +205,7 @@ function &serendipity_db_query($sql, $single = false, $result_type = "both", $re
|
||||
|
||||
$row=generate_resultset($cur);
|
||||
$rows=array();
|
||||
|
||||
|
||||
for($idx=0, $idxc = count($row); $idx < $idxc ; $idx++) {
|
||||
if (!empty($assocKey)) {
|
||||
// You can fetch a key-associated array via the two function parameters assocKey and assocVal
|
||||
@ -218,7 +218,7 @@ function &serendipity_db_query($sql, $single = false, $result_type = "both", $re
|
||||
$rows = $row;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $rows;
|
||||
|
||||
}
|
||||
@ -267,7 +267,7 @@ function serendipity_db_insert_id($table = '', $id = '') {
|
||||
*/
|
||||
function serendipity_db_affected_rows() {
|
||||
global $serendipity;
|
||||
|
||||
|
||||
/* int sqlrcur_affectedRows(int sqlrcurref)
|
||||
* Returns the number of rows that were updated, inserted or deleted by the query.
|
||||
* Not all databases support this call.
|
||||
@ -459,7 +459,7 @@ function serendipity_db_schema_import($query) {
|
||||
static $replace = array('int(11) not null auto_increment', 'primary key',
|
||||
'unsigned' , 'FULLTEXT', 'FULLTEXT', 'enum (\'true\', \'false\') NOT NULL default \'true\'', 'LONGTEXT');
|
||||
static $is_utf8 = null;
|
||||
|
||||
|
||||
if ($is_utf8 === null) {
|
||||
$search[] = '{UTF_8}';
|
||||
if ((isset($_POST['charset']) && $_POST['charset'] == 'UTF-8/') ||
|
||||
@ -479,7 +479,7 @@ function serendipity_db_schema_import($query) {
|
||||
static $replace = array('SERIAL', 'primary key', '',
|
||||
'', '', 'BOOLEAN NOT NULL', 'int2', 'int4', 'int4', 'int4', '', 'text');
|
||||
break;
|
||||
|
||||
|
||||
case "sqlite":
|
||||
static $search = array('{AUTOINCREMENT}', '{PRIMARY}', '{UNSIGNED}', '{FULLTEXT}', '{FULLTEXT_MYSQL}', '{BOOLEAN}', '{UTF_8}', '{TEXT}');
|
||||
static $replace = array('INTEGER', 'PRIMARY KEY', '', '', '', 'BOOLEAN NOT NULL', '', 'LONGTEXT');
|
||||
|
@ -157,14 +157,14 @@ function serendipity_strftime($format, $timestamp = null, $useOffset = true, $us
|
||||
}
|
||||
$out = strftime($format, $timestamp);
|
||||
break;
|
||||
|
||||
|
||||
case 'persian-utf8':
|
||||
if ($timestamp == null) {
|
||||
$timestamp = serendipity_serverOffsetHour();
|
||||
} elseif ($useOffset) {
|
||||
$timestamp = serendipity_serverOffsetHour($timestamp);
|
||||
}
|
||||
|
||||
|
||||
require_once S9Y_INCLUDE_PATH . 'include/functions_calendars.inc.php';
|
||||
$out = persian_strftime_utf($format, $timestamp);
|
||||
break;
|
||||
@ -202,7 +202,7 @@ function serendipity_formatTime($format, $time, $useOffset = true, $useDate = fa
|
||||
$cache[$format] = str_replace('%e', '%d', $cache[$format]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return serendipity_mb('ucfirst', serendipity_strftime($cache[$format], (int)$time, $useOffset, $useDate));
|
||||
}
|
||||
|
||||
@ -739,7 +739,7 @@ function serendipity_track_referrer($entry = 0) {
|
||||
|
||||
$ts = serendipity_db_get_interval('ts');
|
||||
$interval = serendipity_db_get_interval('interval', 900);
|
||||
|
||||
|
||||
$url_parts['query'] = substr($url_parts['query'], 0, 255);
|
||||
|
||||
$suppressq = "SELECT count(1)
|
||||
|
@ -126,8 +126,8 @@ function p2g($j_y, $j_m, $j_d){
|
||||
*/
|
||||
function persian_strftime_utf($format, $timestamp='') {
|
||||
|
||||
if($timestamp==''){
|
||||
$timestamp = mktime();
|
||||
if($timestamp==''){
|
||||
$timestamp = mktime();
|
||||
}
|
||||
|
||||
$g_d=date('j', $timestamp);
|
||||
@ -276,10 +276,10 @@ function persian_strftime_utf($format, $timestamp='') {
|
||||
function persian_date_utf($format, $timestamp='') {
|
||||
|
||||
if($timestamp==''){
|
||||
$timestamp = mktime();
|
||||
$timestamp = mktime();
|
||||
}
|
||||
|
||||
$g_d=date('j', $timestamp);
|
||||
$g_d=date('j', $timestamp);
|
||||
$g_m=date('n', $timestamp);
|
||||
$g_y=date('Y', $timestamp);
|
||||
|
||||
@ -288,8 +288,8 @@ function persian_date_utf($format, $timestamp='') {
|
||||
$j_days_in_month = array(0, 31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
|
||||
$leap = 0;
|
||||
if ($g_m>1 && (($g_y%4==0 && $g_y%100!=0) || ($g_y%400==0))){
|
||||
$j_days_in_month[12]++;
|
||||
$leap = 1;
|
||||
$j_days_in_month[12]++;
|
||||
$leap = 1;
|
||||
}
|
||||
|
||||
$j_month_name = array('', 'فروردین', 'اردیبهشت', 'خرداد', 'تیر',
|
||||
@ -360,7 +360,7 @@ function persian_date_utf($format, $timestamp='') {
|
||||
$output_str.=$j_days_in_month[$jm];
|
||||
break;
|
||||
case 'L':
|
||||
$output_str.=$leap;
|
||||
$output_str.=$leap;
|
||||
break;
|
||||
case 'o':
|
||||
case 'Y':
|
||||
@ -444,71 +444,71 @@ function persian_date_utf($format, $timestamp='') {
|
||||
* @return int returned timestamp
|
||||
*/
|
||||
function persian_mktime($hour='', $min='', $sec='', $mon='', $day='', $year='', $is_dst=-1){
|
||||
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
|
||||
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
|
||||
|
||||
if ( (string) $hour == '') { $hour = persian_date_utf('H'); }
|
||||
if ( (string) $min == '') { $min = persian_date_utf('i'); }
|
||||
if ( (string) $sec == '') { $sec = persian_date_utf('s'); }
|
||||
if ( (string) $day == '') { $day = persian_date_utf('j'); }
|
||||
if ( (string) $mon == '') { $mon = persian_date_utf('n'); }
|
||||
if ( (string) $year == '') { $year = persian_date_utf('Y'); }
|
||||
if ( (string) $hour == '') { $hour = persian_date_utf('H'); }
|
||||
if ( (string) $min == '') { $min = persian_date_utf('i'); }
|
||||
if ( (string) $sec == '') { $sec = persian_date_utf('s'); }
|
||||
if ( (string) $day == '') { $day = persian_date_utf('j'); }
|
||||
if ( (string) $mon == '') { $mon = persian_date_utf('n'); }
|
||||
if ( (string) $year == '') { $year = persian_date_utf('Y'); }
|
||||
|
||||
/*
|
||||
an ugly, beta code snippet to support days <= zero!
|
||||
it should work, but days in one or more months should calculate!
|
||||
*/
|
||||
/*
|
||||
an ugly, beta code snippet to support days <= zero!
|
||||
it should work, but days in one or more months should calculate!
|
||||
*/
|
||||
|
||||
/*
|
||||
if($day <= 0){
|
||||
// change sign
|
||||
$day = abs($day);
|
||||
/*
|
||||
if($day <= 0){
|
||||
// change sign
|
||||
$day = abs($day);
|
||||
|
||||
// calculate months and days that shall decrease
|
||||
// this do-while has a lot of errors!!!
|
||||
do{
|
||||
// $month_days = $j_days_in_month[$mon]
|
||||
$months = floor($day/30);
|
||||
$days = $day % 30;
|
||||
}while();
|
||||
// calculate months and days that shall decrease
|
||||
// this do-while has a lot of errors!!!
|
||||
do{
|
||||
// $month_days = $j_days_in_month[$mon]
|
||||
$months = floor($day/30);
|
||||
$days = $day % 30;
|
||||
}while();
|
||||
|
||||
$mon -= $months;
|
||||
$day -= $days;
|
||||
if ($day < 1) {
|
||||
$mon--;
|
||||
}
|
||||
}
|
||||
*/
|
||||
$mon -= $months;
|
||||
$day -= $days;
|
||||
if ($day < 1) {
|
||||
$mon--;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
if($mon <= 0){
|
||||
// change sign
|
||||
$mon = abs($mon);
|
||||
if($mon <= 0){
|
||||
// change sign
|
||||
$mon = abs($mon);
|
||||
|
||||
// calculate years and months that shall decrease
|
||||
$years = floor($mon/12);
|
||||
$months = $mon % 12;
|
||||
// calculate years and months that shall decrease
|
||||
$years = floor($mon/12);
|
||||
$months = $mon % 12;
|
||||
|
||||
$year -= $years;
|
||||
$mon -= $months;
|
||||
if ($mon < 1) {
|
||||
$year--;
|
||||
$mon += 12;
|
||||
}
|
||||
}
|
||||
$year -= $years;
|
||||
$mon -= $months;
|
||||
if ($mon < 1) {
|
||||
$year--;
|
||||
$mon += 12;
|
||||
}
|
||||
}
|
||||
|
||||
if ($day < 1) {
|
||||
$temp_month = $mon-1;
|
||||
$temp_year = $year;
|
||||
if($temp_month <= 0){
|
||||
$temp_month = 12;
|
||||
$temp_year--;
|
||||
}
|
||||
if ($temp_month>1 && (($temp_year%4==0 && $temp_year%100!=0) || ($temp_year%400==0))){
|
||||
$j_days_in_month[12] = 30;
|
||||
}else{
|
||||
$j_days_in_month[12] = 29;
|
||||
}
|
||||
$day += $j_days_in_month[$temp_month];
|
||||
}
|
||||
if ($day < 1) {
|
||||
$temp_month = $mon-1;
|
||||
$temp_year = $year;
|
||||
if($temp_month <= 0){
|
||||
$temp_month = 12;
|
||||
$temp_year--;
|
||||
}
|
||||
if ($temp_month>1 && (($temp_year%4==0 && $temp_year%100!=0) || ($temp_year%400==0))){
|
||||
$j_days_in_month[12] = 30;
|
||||
}else{
|
||||
$j_days_in_month[12] = 29;
|
||||
}
|
||||
$day += $j_days_in_month[$temp_month];
|
||||
}
|
||||
|
||||
list($year, $mon, $day)=p2g($year, $mon, $day);
|
||||
return mktime($hour, $min, $sec, $mon, $day, $year, $is_dst);
|
||||
|
@ -41,7 +41,7 @@ function serendipity_checkCommentToken($token, $cid) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $goodtoken;
|
||||
}
|
||||
|
||||
@ -406,7 +406,7 @@ function serendipity_printComments($comments, $parentid = 0, $depth = 0, $trace
|
||||
if (isset($comment['title'])) {
|
||||
$comment['title'] = htmlspecialchars($comment['title']);
|
||||
}
|
||||
|
||||
|
||||
if (serendipity_userLoggedIn()) {
|
||||
if ($comment['subscribed'] == 'true') {
|
||||
if ($comment['status'] == 'approved') {
|
||||
@ -539,7 +539,7 @@ function serendipity_deleteComment($id, $entry_id, $type='comments', $token=fals
|
||||
$goodtoken = serendipity_checkCommentToken($token, $id);
|
||||
|
||||
if ($_SESSION['serendipityAuthedUser'] === true || $goodtoken) {
|
||||
|
||||
|
||||
$admin = '';
|
||||
if (!$goodtoken && !serendipity_checkPermission('adminEntriesMaintainOthers')) {
|
||||
$admin = " AND authorid = " . (int)$_SESSION['serendipityAuthorid'];
|
||||
@ -547,7 +547,7 @@ function serendipity_deleteComment($id, $entry_id, $type='comments', $token=fals
|
||||
// Load articles author id and check it
|
||||
$sql = serendipity_db_query("SELECT authorid FROM {$serendipity['dbPrefix']}entries
|
||||
WHERE entry_id = ". $entry_id, true);
|
||||
if ($sql['authorid'] != $serendipity['authorid']) {
|
||||
if ($sql['authorid'] != $serendipity['authorid']) {
|
||||
return false; // wrong user having no adminEntriesMaintainOthers right
|
||||
}
|
||||
|
||||
@ -657,7 +657,7 @@ function serendipity_approveComment($cid, $entry_id, $force = false, $moderate =
|
||||
". ((!serendipity_checkPermission('adminEntriesMaintainOthers') && $force !== true && !$goodtoken) ? "AND e.authorid = '". (int)$serendipity['authorid'] ."'" : '') ."
|
||||
". (($force === true) ? "" : "AND status = 'pending'");
|
||||
$rs = serendipity_db_query($sql, true);
|
||||
|
||||
|
||||
// Check for adminEntriesMaintainOthers
|
||||
if (!$force && !$goodtoken && $rs['entry_authorid'] != $serendipity['authorid'] && !serendipity_checkPermission('adminEntriesMaintainOthers')) {
|
||||
return false; // wrong user having no adminEntriesMaintainOthers right
|
||||
@ -697,7 +697,7 @@ function serendipity_approveComment($cid, $entry_id, $force = false, $moderate =
|
||||
AND type = 'NORMAL'
|
||||
AND entry_id = " . (int)$entry_id . "
|
||||
GROUP BY entry_id", true);
|
||||
|
||||
|
||||
$counter_tb = serendipity_db_query("SELECT count(id) AS counter
|
||||
FROM {$serendipity['dbPrefix']}comments
|
||||
WHERE status = 'approved'
|
||||
@ -745,7 +745,7 @@ function serendipity_approveComment($cid, $entry_id, $force = false, $moderate =
|
||||
*/
|
||||
function serendipity_confirmMail($cid, $hash) {
|
||||
global $serendipity;
|
||||
|
||||
|
||||
$q = "SELECT c.entry_id, e.title, e.timestamp, e.id
|
||||
FROM {$serendipity['dbPrefix']}comments AS c
|
||||
JOIN {$serendipity['dbPrefix']}entries AS e
|
||||
@ -769,7 +769,7 @@ function serendipity_confirmMail($cid, $hash) {
|
||||
serendipity_sendComment($cid, $row['email'], $name, $email, $url, $id, $row['title'], $comments, $type, serendipity_db_bool($ca['moderate_comments']));
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
serendipity_approveComment($cid, $confirm['entry_id'], true);
|
||||
return $confirm;
|
||||
} else {
|
||||
@ -840,7 +840,7 @@ function serendipity_insertComment($id, $commentInfo, $type = 'NORMAL', $source
|
||||
} else {
|
||||
$subscribe = 'false';
|
||||
}
|
||||
|
||||
|
||||
$dbhash = md5(uniqid(rand(), true));
|
||||
|
||||
if ($status == 'confirm') {
|
||||
@ -941,7 +941,7 @@ function serendipity_insertComment($id, $commentInfo, $type = 'NORMAL', $source
|
||||
if ($GLOBALS['tb_logging']) {
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
|
||||
return $cid;
|
||||
}
|
||||
|
||||
@ -1007,7 +1007,7 @@ function serendipity_saveComment($id, $commentInfo, $type = 'NORMAL', $source =
|
||||
fwrite($fp, '[' . date('d.m.Y H:i') . '] insert comment into DB' . "\n");
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
|
||||
$commentInfo['comment_cid'] = serendipity_insertComment($id, $commentInfo, $type, $source, $ca);
|
||||
$commentInfo['comment_id'] = $id;
|
||||
serendipity_plugin_api::hook_event('frontend_saveComment_finish', $ca, $commentInfo);
|
||||
@ -1166,7 +1166,7 @@ function serendipity_sendComment($comment_id, $to, $fromName, $fromEmail, $fromU
|
||||
$action_more = '';
|
||||
foreach($eventData['action_more'] as $action) {
|
||||
$action_more .= "\n" . str_repeat(' ', 3) . $action;
|
||||
}
|
||||
}
|
||||
|
||||
if ($type == 'TRACKBACK' || $type == 'PINGBACK') {
|
||||
|
||||
|
@ -333,7 +333,7 @@ function serendipity_load_configuration($author = null) {
|
||||
if ((empty($author) || empty($serendipity['baseURL'])) && (! empty($serendipity['defaultBaseURL']))) {
|
||||
$serendipity['baseURL'] = $serendipity['defaultBaseURL'];
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Store default language
|
||||
$serendipity['default_lang'] = $serendipity['lang'];
|
||||
@ -390,7 +390,7 @@ function serendipity_login($use_external = true) {
|
||||
if (empty($serendipity['POST']['auto'])) {
|
||||
serendipity_deleteCookie('author_information');
|
||||
serendipity_deleteCookie('author_information_iv');
|
||||
|
||||
|
||||
return false;
|
||||
} else {
|
||||
serendipity_issueAutologin(
|
||||
@ -415,7 +415,7 @@ function serendipity_login($use_external = true) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$data = array('ext' => $use_external, 'mode' => 2, 'user' => $serendipity['POST']['user'], 'pass' => $serendipity['POST']['pass']);
|
||||
serendipity_plugin_api::hook_event('backend_loginfail', $data);
|
||||
}
|
||||
@ -514,7 +514,7 @@ function serendipity_authenticate_author($username = '', $password = '', $is_has
|
||||
global $serendipity;
|
||||
static $debug = false;
|
||||
static $debugc = 0;
|
||||
|
||||
|
||||
if ($debug) {
|
||||
$fp = fopen('login.log', 'a');
|
||||
flock($fp, LOCK_EX);
|
||||
@ -559,7 +559,7 @@ function serendipity_authenticate_author($username = '', $password = '', $is_has
|
||||
|
||||
// Old MD5 hashing routine. Will convert user.
|
||||
if (empty($row['hashtype']) || $row['hashtype'] == 0) {
|
||||
|
||||
|
||||
if (isset($serendipity['hashkey']) && (time() - $serendipity['hashkey']) >= 15768000) {
|
||||
die('You can no longer login with an old-style MD5 hash to prevent MD5-Hostage abuse.
|
||||
Please ask the Administrator to set you a new password.');
|
||||
@ -576,7 +576,7 @@ function serendipity_authenticate_author($username = '', $password = '', $is_has
|
||||
$is_valid_user = true;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ( ($is_hashed === false && (string)$row['password'] === (string)serendipity_hash($password)) ||
|
||||
($is_hashed !== false && (string)$row['password'] === (string)$password) ) {
|
||||
@ -586,7 +586,7 @@ function serendipity_authenticate_author($username = '', $password = '', $is_has
|
||||
} else {
|
||||
if ($debug) fwrite($fp, date('Y-m-d H:i') . ' - INValidated ' . $row['password'] . ' == ' . ($is_hashed === false ? 'unhash:' . serendipity_hash($password) : 'hash:' . $password) . "\n");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// This code is only reached, if the password before is valid.
|
||||
@ -606,7 +606,7 @@ function serendipity_authenticate_author($username = '', $password = '', $is_has
|
||||
$_SESSION['serendipityAuthedUser'] = $serendipity['serendipityAuthedUser'] = true;
|
||||
$_SESSION['serendipityRightPublish']= $serendipity['serendipityRightPublish'] = $row['right_publish'];
|
||||
$_SESSION['serendipityHashType'] = $serendipity['serendipityHashType'] = $row['hashtype'];
|
||||
|
||||
|
||||
serendipity_load_configuration($serendipity['authorid']);
|
||||
serendipity_setCookie('userDefLang', $serendipity['lang'], false);
|
||||
return true;
|
||||
@ -616,7 +616,7 @@ function serendipity_authenticate_author($username = '', $password = '', $is_has
|
||||
|
||||
// Only reached, when proper login did not yet return true.
|
||||
if ($debug) fwrite($fp, date('Y-m-d H:i') . ' - FAIL.' . "\n");
|
||||
|
||||
|
||||
$_SESSION['serendipityAuthedUser'] = false;
|
||||
serendipity_session_destroy();
|
||||
}
|
||||
@ -702,7 +702,7 @@ function serendipity_setCookie($name, $value, $securebyprot = true) {
|
||||
} else {
|
||||
$secure = false;
|
||||
}
|
||||
|
||||
|
||||
// If HTTP-Hosts like "localhost" are used, current browsers reject cookies.
|
||||
// In this case, we disregard the HTTP host to be able to set that cookie.
|
||||
if (substr_count($host, '.') < 1) {
|
||||
@ -736,7 +736,7 @@ function serendipity_deleteCookie($name) {
|
||||
if (substr_count($host, '.') < 1) {
|
||||
$host = '';
|
||||
}
|
||||
|
||||
|
||||
setcookie("serendipity[$name]", '', time()-4000, $serendipity['serendipityHTTPPath'], $host);
|
||||
unset($_COOKIE[$name]);
|
||||
unset($serendipity['COOKIE'][$name]);
|
||||
@ -865,7 +865,7 @@ function serendipity_iframe_create($mode, &$entry) {
|
||||
|
||||
$_SESSION['save_entry'] = $entry;
|
||||
$_SESSION['save_entry_POST'] = $serendipity['POST'];
|
||||
|
||||
|
||||
$attr = '';
|
||||
switch($mode) {
|
||||
case 'save':
|
||||
@ -2086,7 +2086,7 @@ function serendipity_setFormToken($type = 'form') {
|
||||
*/
|
||||
function &serendipity_loadThemeOptions(&$template_config, $okey = '', $bc_bool = false) {
|
||||
global $serendipity;
|
||||
|
||||
|
||||
if (empty($okey)) {
|
||||
$okey = $serendipity['template'];
|
||||
}
|
||||
@ -2105,8 +2105,8 @@ function &serendipity_loadThemeOptions(&$template_config, $okey = '', $bc_bool =
|
||||
$template_vars[$item['var']] = $item['default'];
|
||||
}
|
||||
}
|
||||
if($bc_bool) {
|
||||
foreach($template_vars AS $k => $i) {
|
||||
if($bc_bool) {
|
||||
foreach($template_vars AS $k => $i) {
|
||||
if($i == 'true' || $i == 'false') {
|
||||
$template_vars[$k] = serendipity_db_bool($i);
|
||||
}
|
||||
@ -2126,7 +2126,7 @@ function &serendipity_loadThemeOptions(&$template_config, $okey = '', $bc_bool =
|
||||
*/
|
||||
function serendipity_loadGlobalThemeOptions(&$template_config, &$template_loaded_config, $supported = array()) {
|
||||
global $serendipity;
|
||||
|
||||
|
||||
if ($supported['navigation']) {
|
||||
$navlinks = array();
|
||||
|
||||
@ -2144,7 +2144,7 @@ function serendipity_loadGlobalThemeOptions(&$template_config, &$template_loaded
|
||||
if (!isset($template_loaded_config['amount']) || empty($template_loaded_config['amount'])) {
|
||||
$template_loaded_config['amount'] = $conf_amount['default'];
|
||||
}
|
||||
|
||||
|
||||
// Check if we are currently inside the admin interface.
|
||||
if ($serendipity['POST']['adminModule'] == 'templates' && $serendipity['POST']['adminAction'] == 'configure' && !empty($serendipity['POST']['template']['amount'])) {
|
||||
$template_loaded_config['amount'] = (int)$serendipity['POST']['template']['amount'];
|
||||
@ -2155,7 +2155,7 @@ function serendipity_loadGlobalThemeOptions(&$template_config, &$template_loaded
|
||||
'title' => $template_loaded_config['navlink' . $i . 'text'],
|
||||
'href' => $template_loaded_config['navlink' . $i . 'url']
|
||||
);
|
||||
|
||||
|
||||
$template_config[] = array(
|
||||
'var' => 'navlink' . $i . 'text',
|
||||
'name' => NAV_LINK_TEXT . ' #' . ($i+1),
|
||||
@ -2171,10 +2171,10 @@ function serendipity_loadGlobalThemeOptions(&$template_config, &$template_loaded
|
||||
'scope' => 'global'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
$serendipity['smarty']->assignByRef('navlinks', $navlinks);
|
||||
}
|
||||
|
||||
|
||||
// Forward thinking. ;-)
|
||||
serendipity_plugin_api::hook_event('backend_templates_globalthemeoptions', $template_config, $supported);
|
||||
}
|
||||
@ -2198,7 +2198,7 @@ function serendipity_hasPluginPermissions($plugin, $groupid = null) {
|
||||
|
||||
if ($forbidden === null || ($groupid !== null && !isset($forbidden[$groupid]))) {
|
||||
$forbidden = array();
|
||||
|
||||
|
||||
if ($groupid === null) {
|
||||
$groups = serendipity_checkPermission(null, null, 'all');
|
||||
} else {
|
||||
@ -2226,7 +2226,7 @@ function serendipity_hasPluginPermissions($plugin, $groupid = null) {
|
||||
|
||||
function serendipity_hash($string) {
|
||||
global $serendipity;
|
||||
|
||||
|
||||
if (empty($serendipity['hashkey'])) {
|
||||
serendipity_set_config_var('hashkey', time(), 0);
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ function serendipity_getMultiCategoriesSQL($cats, $invert = false) {
|
||||
$cat_sql_array[] = " (c.category_left " . ($invert ? " NOT " : "") . " BETWEEN " . implode(' AND ', serendipity_fetchCategoryRange($categoryid)) . ')';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (count($cat_sql_array) < 1) {
|
||||
return '';
|
||||
}
|
||||
@ -386,7 +386,7 @@ function &serendipity_fetchEntries($range = null, $full = true, $limit = '', $fe
|
||||
LEFT JOIN {$serendipity['dbPrefix']}category c
|
||||
ON ec.categoryid = c.categoryid";
|
||||
}
|
||||
|
||||
|
||||
if ($joinown) {
|
||||
$cond['joins'] .= $joinown;
|
||||
}
|
||||
@ -399,7 +399,7 @@ function &serendipity_fetchEntries($range = null, $full = true, $limit = '', $fe
|
||||
if (isset($serendipity['GET']['page']) && ($serendipity['GET']['page'] > 1 || serendipity_db_bool($serendipity['archiveSortStable'])) && !strstr($limit, ',')) {
|
||||
if (serendipity_db_bool($serendipity['archiveSortStable'])) {
|
||||
$totalEntries = serendipity_getTotalEntries();
|
||||
|
||||
|
||||
$totalPages = ceil($totalEntries / $limit);
|
||||
if ($totalPages <= 0 ) {
|
||||
$totalPages = 1;
|
||||
@ -745,7 +745,7 @@ function serendipity_rebuildCategoryTree($parent = 0, $left = 0) {
|
||||
function &serendipity_searchEntries($term, $limit = '', $searchresults = '') {
|
||||
global $serendipity;
|
||||
static $log_queries = false;
|
||||
|
||||
|
||||
if ($log_queries) {
|
||||
$fp = fopen($serendipity['serendipityPath'] . '/archives/queries.csv', 'a');
|
||||
fwrite($fp, date('Y-m-d H:i') . ';'
|
||||
@ -772,7 +772,7 @@ function &serendipity_searchEntries($term, $limit = '', $searchresults = '') {
|
||||
$serendipity['dbType'] == 'pdo-postgres') {
|
||||
$cond['group'] = '';
|
||||
$cond['distinct'] = 'DISTINCT';
|
||||
|
||||
|
||||
$r = serendipity_db_query("SELECT count(routine_name) AS counter
|
||||
FROM information_schema.routines
|
||||
WHERE routine_name LIKE 'to_tsvector'
|
||||
@ -898,11 +898,11 @@ function &serendipity_searchEntries($term, $limit = '', $searchresults = '') {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (is_array($search)){
|
||||
serendipity_fetchEntryData($search);
|
||||
}
|
||||
|
||||
|
||||
return $search;
|
||||
}
|
||||
|
||||
@ -923,7 +923,7 @@ function serendipity_printEntryFooter($suffix = '.html', $totalEntries = null) {
|
||||
if ($totalEntries === null) {
|
||||
$totalEntries = serendipity_getTotalEntries();
|
||||
}
|
||||
|
||||
|
||||
$limits = explode(',', $serendipity['fetchLimit']);
|
||||
if (!empty($limits[1])) {
|
||||
$limit = (int)$limits[1];
|
||||
@ -1049,7 +1049,7 @@ function serendipity_printEntries($entries, $extended = 0, $preview = false, $sm
|
||||
return; // no display of this item
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// We shouldn't return here, because we want Smarty to handle the output
|
||||
if (!is_array($entries) || $entries[0] == false || !isset($entries[0]['timestamp'])) {
|
||||
$entries = array();
|
||||
@ -1234,9 +1234,9 @@ function serendipity_printEntries($entries, $extended = 0, $preview = false, $sm
|
||||
}
|
||||
|
||||
if ($smarty_fetch === 'return') {
|
||||
return $dategroup;
|
||||
}
|
||||
|
||||
return $dategroup;
|
||||
}
|
||||
|
||||
$serendipity['smarty']->assignByRef('entries', $dategroup);
|
||||
unset($entries, $dategroup);
|
||||
|
||||
|
@ -173,7 +173,7 @@ function serendipity_printEntryForm($targetURL, $hiddens = array(), $entry = arr
|
||||
'body' => 'serendipity[body]',
|
||||
'extended' => 'serendipity[extended]'
|
||||
);
|
||||
|
||||
|
||||
$template_vars['entry_template'] = serendipity_getTemplateFile('admin/entries.tpl', 'serendipityPath');
|
||||
|
||||
$serendipity['smarty']->registerPlugin('modifier', 'emit_htmlarea_code', 'serendipity_emit_htmlarea_code');
|
||||
@ -571,7 +571,7 @@ function serendipity_emit_htmlarea_code($item, $jsname, $spawnMulti = false) {
|
||||
if (empty($xinha_custom)) {
|
||||
$xinha_custom = 'htmlarea/my_custom.js';
|
||||
}
|
||||
|
||||
|
||||
if (!$init) {
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
@ -672,7 +672,7 @@ function serendipity_emit_htmlarea_code($item, $jsname, $spawnMulti = false) {
|
||||
return editorextended;
|
||||
} else if (typeof(htmlarea_editors) != 'undefined') {
|
||||
return htmlarea_editors[editor_id];
|
||||
}
|
||||
}
|
||||
return 'undefined';
|
||||
}
|
||||
<?php } ?>
|
||||
@ -752,9 +752,9 @@ function serendipity_emit_htmlarea_code($item, $jsname, $spawnMulti = false) {
|
||||
}
|
||||
echo '"separator" ]' . "\n";
|
||||
} ?>
|
||||
|
||||
|
||||
];
|
||||
|
||||
|
||||
if (typeof('s9y_xinha') != 'undefined') {
|
||||
s9y_xinha(editor<?php echo $jsname; ?>);
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ function serendipity_isActiveFile($file) {
|
||||
if ($core) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
$eventData = false;
|
||||
serendipity_plugin_api::hook_event('backend_media_check', $eventData, $file);
|
||||
return $eventData;
|
||||
@ -573,7 +573,7 @@ function serendipity_insertImageInDatabase($filename, $directory, $authorid = 0,
|
||||
serendipity_db_escape_string($directory),
|
||||
serendipity_db_escape_string($realname)
|
||||
);
|
||||
|
||||
|
||||
$sql = serendipity_db_query($query);
|
||||
if (is_string($sql)) {
|
||||
echo $query . '<br />';
|
||||
@ -609,7 +609,7 @@ function serendipity_makeThumbnail($file, $directory = '', $size = false, $thumb
|
||||
if ($size === false) {
|
||||
$size = $serendipity['thumbSize'];
|
||||
}
|
||||
|
||||
|
||||
if ($size < 1) {
|
||||
return array(0,0);
|
||||
}
|
||||
@ -1142,7 +1142,7 @@ function serendipity_syncThumbs($deleteThumbs = false) {
|
||||
if (@unlink($fthumb)) {
|
||||
printf(DELETE_THUMBNAIL . "<br />\n", $sThumb);
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1156,7 +1156,7 @@ function serendipity_syncThumbs($deleteThumbs = false) {
|
||||
AND extension = '" . serendipity_db_escape_string($f[1]) . "'"
|
||||
);
|
||||
serendipity_ACL_SQL($cond, false, 'directory');
|
||||
|
||||
|
||||
$rs = serendipity_db_query("SELECT *
|
||||
FROM {$serendipity['dbPrefix']}images AS i
|
||||
{$cond['joins']}
|
||||
@ -1406,8 +1406,8 @@ function serendipity_calculate_aspect_size($width, $height, $size, $constraint =
|
||||
$ratio = $height / $width;
|
||||
$newheight = round($size * $ratio);
|
||||
// Limit calculated dimension to at least 1px
|
||||
if ($newheight <= 0) {
|
||||
$newheight = 1;
|
||||
if ($newheight <= 0) {
|
||||
$newheight = 1;
|
||||
}
|
||||
$newsize = array($size, $newheight);
|
||||
} else {
|
||||
@ -1469,7 +1469,7 @@ function serendipity_displayImageList($page = 0, $lineBreak = NULL, $manage = fa
|
||||
$perPage++;
|
||||
}
|
||||
$start = ($page-1) * $perPage;
|
||||
|
||||
|
||||
if ($manage && $limit_path == NULL) {
|
||||
## SYNCH START ##
|
||||
$aExclude = array("CVS" => true, ".svn" => true, "_vti_cnf" => true); // _vti_cnf to exclude frontpage extensions on windows servers
|
||||
@ -2375,7 +2375,7 @@ function serendipity_parseMediaProperties(&$dprops, &$keywords, &$media, &$props
|
||||
'val' => $val,
|
||||
'title' => htmlspecialchars($parts[0])
|
||||
);
|
||||
|
||||
|
||||
if (!is_array($GLOBALS['IPTC'])) {
|
||||
// Your templates config.inc.php or any of the language files can declare this variable,
|
||||
// if you want to use other default settings for this. No interface ability to declare this
|
||||
@ -2723,10 +2723,10 @@ function serendipity_prepareMedia(&$file, $url = '') {
|
||||
if (file_exists($file['full_thumb'] . '.png')) {
|
||||
$file['full_thumb'] .= '.png';
|
||||
$file['full_thumbHTTP'] .= '.png';
|
||||
$file['show_thumb'] .= '.png';
|
||||
$file['show_thumb'] .= '.png';
|
||||
$sThumbSource .= '.png';
|
||||
}
|
||||
|
||||
|
||||
if (empty($file['realname'])) {
|
||||
$file['realname'] = $file['name'] . (empty($file['extension']) ? '' : '.' . $file['extension']);
|
||||
}
|
||||
@ -3128,7 +3128,7 @@ function &serendipity_getMetaData($file, &$info) {
|
||||
if (!file_exists($file)) {
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
if (function_exists('iptcparse') && is_array($info) && isset($info['APP13'])) {
|
||||
$iptc = iptcparse($info['APP13']);
|
||||
foreach($IPTC_Fields AS $field => $desc) {
|
||||
@ -3138,7 +3138,7 @@ function &serendipity_getMetaData($file, &$info) {
|
||||
} else {
|
||||
$ret['IPTC'][$desc] = trim($iptc[$field]);
|
||||
}
|
||||
|
||||
|
||||
switch ($desc) {
|
||||
case 'IPTCDateCreated':
|
||||
$ret['IPTC'][$desc] = serendipity_metaFieldConvert($ret['IPTC'][$desc],'IPTCdate');
|
||||
@ -3146,7 +3146,7 @@ function &serendipity_getMetaData($file, &$info) {
|
||||
case 'IPTCTimeCreated':
|
||||
$ret['IPTC'][$desc] = serendipity_metaFieldConvert($ret['IPTC'][$desc],'IPTCtime');
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -288,7 +288,7 @@ function serendipity_parseTemplate($filename, $areas = null, $onlyFlags=null) {
|
||||
|
||||
$config = @include($filename);
|
||||
if (! is_array($config)) {
|
||||
printf(INCLUDE_ERROR,$filename);
|
||||
printf(INCLUDE_ERROR,$filename);
|
||||
}
|
||||
|
||||
foreach ( $config as $n => $category ) {
|
||||
@ -397,7 +397,7 @@ function serendipity_guessInput($type, $name, $value='', $default='') {
|
||||
if ($value === null) {
|
||||
$value = $default;
|
||||
}
|
||||
|
||||
|
||||
echo '<input class="input_radio" id="radio_cfg_' . $name . '_yes" type="radio" name="' . $name . '" value="true" ';
|
||||
echo (($value == true) ? 'checked="checked"' : ''). ' /><label for="radio_cfg_' . $name . '_yes"> ' . YES . '</label> ';
|
||||
echo '<input class="input_radio" id="radio_cfg_' . $name . '_no" type="radio" name="' . $name . '" value="false" ';
|
||||
@ -578,7 +578,7 @@ function serendipity_printConfigTemplate($config, $from = false, $noForm = false
|
||||
if (in_array('hideValue', $item['flags'])) {
|
||||
$value = '';
|
||||
}
|
||||
|
||||
|
||||
if (!$showDangerous && $item['view'] == 'dangerous') {
|
||||
continue;
|
||||
}
|
||||
@ -826,7 +826,7 @@ function serendipity_installFiles($serendipity_core = '') {
|
||||
if ($fp) {
|
||||
fwrite($fp, 'php_value register_globals off'. "\n" .'php_value session.use_trans_sid 0');
|
||||
fclose($fp);
|
||||
|
||||
|
||||
$safeFP = @fopen($serendipity_core . '.installer_detection_failsafe', 'w');
|
||||
fclose($safeFP);
|
||||
$sock = fsockopen($serendipity_host, $_SERVER['SERVER_PORT'], $errorno, $errorstring, 10);
|
||||
@ -1060,7 +1060,7 @@ function serendipity_httpCoreDir() {
|
||||
if (!empty($_SERVER['ORIG_PATH_TRANSLATED'])) {
|
||||
return dirname(realpath($_SERVER['ORIG_PATH_TRANSLATED'])) . '/';
|
||||
}
|
||||
|
||||
|
||||
return $_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['PHP_SELF']) . '/';
|
||||
}
|
||||
|
||||
@ -1297,7 +1297,7 @@ function serendipity_verifyFTPChecksums() {
|
||||
|
||||
// Load the checksums
|
||||
$f = S9Y_INCLUDE_PATH . 'checksums.inc.php';
|
||||
|
||||
|
||||
if (!file_exists($f) || filesize($f) < 1) {
|
||||
return $badsums;
|
||||
}
|
||||
|
@ -137,7 +137,7 @@ function serendipity_makeFilename($str, $stripDots = false) {
|
||||
|
||||
// Nuke chars not allowed in our URI
|
||||
$str = preg_replace('#[^' . PAT_FILENAME . ']#i', '', $str);
|
||||
}
|
||||
}
|
||||
|
||||
// Check if dots are allowed
|
||||
if ($stripDots) {
|
||||
@ -564,7 +564,7 @@ function serendipity_makePermalink($format, $data, $type = 'entry') {
|
||||
$parent_path[] = serendipity_makeFilename($parent['category_name'], true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$replacements =
|
||||
array(
|
||||
|
@ -366,7 +366,7 @@ function serendipity_plugin_config(&$plugin, &$bag, &$name, &$desc, &$config_nam
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($showSubmit && $postKey != 'plugin') {
|
||||
if ($showSubmit && $postKey != 'plugin') {
|
||||
?>
|
||||
<div style="margin: 0px auto 0px 0px; text-align: right">
|
||||
<input type="submit" name="SAVECONF" value="<?php echo SAVE; ?>" class="serendipityPrettyButton input_button" />
|
||||
@ -381,7 +381,7 @@ function serendipity_plugin_config(&$plugin, &$bag, &$name, &$desc, &$config_nam
|
||||
|
||||
$elcount = 0;
|
||||
$htmlnugget = array();
|
||||
|
||||
|
||||
|
||||
$out_stack = array();
|
||||
|
||||
@ -429,7 +429,7 @@ function serendipity_plugin_config(&$plugin, &$bag, &$name, &$desc, &$config_nam
|
||||
|
||||
$is_multi_select = false;
|
||||
$ctype = $cbag->get('type');
|
||||
|
||||
|
||||
ob_start();
|
||||
switch ($ctype) {
|
||||
case 'seperator':
|
||||
@ -642,7 +642,7 @@ function serendipity_plugin_config(&$plugin, &$bag, &$name, &$desc, &$config_nam
|
||||
function change_preview(id)
|
||||
{
|
||||
var text_box = document.getElementById('serendipity[template][' + id + ']');
|
||||
var image_box = document.getElementById(id + '_preview');
|
||||
var image_box = document.getElementById(id + '_preview');
|
||||
var filename = text_box.value;
|
||||
image_box.style.backgroundImage = 'url(' + filename + ')';
|
||||
image_box.style.backgroundRepeat = 'no-repeat';
|
||||
@ -696,7 +696,7 @@ EOS;
|
||||
echo '<script src="' . serendipity_getTemplateFile('dragdrop.js') . '" type="text/javascript"></script>';
|
||||
$serendipity['sequencejs_output'] = true;
|
||||
}
|
||||
|
||||
|
||||
// I want this generic sequence widget to hide the ID, but
|
||||
// display a name or description with an optional picture.
|
||||
// (This would allow users to identify choices by thumbnail.)
|
||||
@ -737,7 +737,7 @@ EOS;
|
||||
}
|
||||
|
||||
// Make sure all the items are in the order list; new items
|
||||
// go on the end (new items could have been added without
|
||||
// go on the end (new items could have been added without
|
||||
// this config item being updated)
|
||||
// Also fill out thumbnails and display names
|
||||
foreach ($items as $id => $junk) {
|
||||
@ -818,7 +818,7 @@ EOS;
|
||||
print ' <li id="'.$id.'" class="sequence_item pluginmanager_item_even">' . "\n";
|
||||
// Make a handle with ID 'g$id'
|
||||
print ' <div id="g'.$id.'" class="pluginmanager_grablet sequence_grablet"><a href="#"></a></div>' . "\n";
|
||||
|
||||
|
||||
if ($checkable) {
|
||||
print ' <input type="checkbox" onclick="sort_' . $config_item . '_Sequence();" name="serendipity[' . $postKey . ']' . '[activate][' . $config_item . '][' . $id . ']" ' . (in_array($id, $store_order) ? ' checked="checked" ' : '') . ' value="true" id="activate_' . $id . '" />' . "\n";
|
||||
}
|
||||
@ -931,7 +931,7 @@ EOS;
|
||||
$out_stack[$config_item] = ob_get_contents();
|
||||
ob_end_clean();
|
||||
}
|
||||
|
||||
|
||||
if (is_array($config_groups)) {
|
||||
$hid = 0;
|
||||
$folded = true;
|
||||
@ -978,7 +978,7 @@ EOS;
|
||||
|
||||
echo '<tr><td colspan="2" style="height: 100px" id="configuration_footer"> </td></tr>';
|
||||
}
|
||||
|
||||
|
||||
echo implode("\n", $out_stack);
|
||||
|
||||
if ($showTable) {
|
||||
|
@ -40,7 +40,7 @@ function serendipity_printEntries_rss(&$entries, $version, $comments = false, $f
|
||||
if (is_array($entries)) {
|
||||
foreach ($entries as $key => $_entry) {
|
||||
$entry = &$entries[$key];
|
||||
|
||||
|
||||
if (isset($entry['entrytimestamp'])) {
|
||||
$e_ts = $entry['entrytimestamp'];
|
||||
} else {
|
||||
@ -60,7 +60,7 @@ function serendipity_printEntries_rss(&$entries, $version, $comments = false, $f
|
||||
$entry['author'] .= ' - ' . $entry['ctitle'];
|
||||
}
|
||||
$entry['title'] = (!empty($entry['author']) ? $entry['author'] : ANONYMOUS) . ': ' . $entry['title'];
|
||||
|
||||
|
||||
// No HTML allowed here:
|
||||
$entry['body'] = strip_tags($entry['body']);
|
||||
}
|
||||
@ -155,5 +155,5 @@ function serendipity_printEntries_rss(&$entries, $version, $comments = false, $f
|
||||
$entry['per_entry_display_dat'] = $entry['display_dat'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -187,7 +187,7 @@ function serendipity_smarty_fetchPrintEntries($params, &$smarty) {
|
||||
if (empty($params['fetchDrafts'])) {
|
||||
$params['fetchDrafts'] = false;
|
||||
}
|
||||
|
||||
|
||||
if (!empty($params['entryprops'])) {
|
||||
if (preg_match_all('@(.*)(!)?=[\'"]*([^\'"]+)[\'"]*(,|$)@imsU', $params['entryprops'], $m)) {
|
||||
foreach($m[0] AS $idx => $p) {
|
||||
@ -337,7 +337,7 @@ function serendipity_smarty_fetchPrintEntries($params, &$smarty) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($params['returncode'] == 'query') {
|
||||
return print_r($entry, true);
|
||||
}
|
||||
@ -746,7 +746,7 @@ function &serendipity_smarty_printComments($params, &$smarty) {
|
||||
if (empty($params['depth'])) {
|
||||
$params['depth'] = 0;
|
||||
}
|
||||
|
||||
|
||||
if (empty($params['trace'])) {
|
||||
$params['trace'] = null;
|
||||
}
|
||||
@ -754,11 +754,11 @@ function &serendipity_smarty_printComments($params, &$smarty) {
|
||||
if (empty($params['block'])) {
|
||||
$params['block'] = 'COMMENTS';
|
||||
}
|
||||
|
||||
|
||||
if (empty($params['template'])) {
|
||||
$params['template'] = 'comments.tpl';
|
||||
}
|
||||
|
||||
|
||||
$out = serendipity_printComments($comments, $params['mode'], $params['depth'], $params['trace'], $params['block'], $params['template']);
|
||||
return $out;
|
||||
}
|
||||
@ -816,7 +816,7 @@ function serendipity_smarty_getImageSize($params, &$smarty) {
|
||||
if (!isset($params['file'])) {
|
||||
trigger_error("Smarty Error: " . __FUNCTION__ .": missing 'file' parameter", E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!isset($params['assign'])) {
|
||||
trigger_error("Smarty Error: " . __FUNCTION__ .": missing 'assign' parameter", E_USER_WARNING);
|
||||
return;
|
||||
@ -876,10 +876,10 @@ function serendipity_smarty_init($vars = array()) {
|
||||
if (LANG_CHARSET != 'UTF-8') {
|
||||
@define('SMARTY_RESOURCE_CHAR_SET', LANG_CHARSET);
|
||||
}
|
||||
|
||||
|
||||
// Default Smarty Engine will be used
|
||||
@define('SMARTY_DIR', S9Y_PEAR_PATH . 'Smarty/libs/');
|
||||
|
||||
|
||||
if (!class_exists('Smarty')) {
|
||||
include SMARTY_DIR . 'Smarty.class.php';
|
||||
}
|
||||
@ -892,7 +892,7 @@ function serendipity_smarty_init($vars = array()) {
|
||||
if (!class_exists('Serendipity_Smarty')) {
|
||||
include 'serendipity_smarty_class.inc.php';
|
||||
}
|
||||
|
||||
|
||||
if (!class_exists('Serendipity_Smarty')) {
|
||||
return false;
|
||||
}
|
||||
@ -907,14 +907,14 @@ function serendipity_smarty_init($vars = array()) {
|
||||
$_SESSION['no_smarty'] = $prev_smarty;
|
||||
|
||||
// enable security policy by instance of the Smarty_Security class
|
||||
$serendipity['smarty']->enableSecurity('Serendipity_Smarty_Security_Policy');
|
||||
$serendipity['smarty']->enableSecurity('Serendipity_Smarty_Security_Policy');
|
||||
|
||||
// debugging...
|
||||
#echo '<pre>';print_r($serendipity['smarty']);echo '</pre>';#exit;
|
||||
#$serendipity['smarty']->testInstall();exit;
|
||||
|
||||
/**
|
||||
* prüfe auf eventuelle API Änderungen in 3.2 [smarty_modifier_foobar, --> [smarty_modifier_foobar, smarty_function_foobar, smarty_block_foobar] (siehe class) ]
|
||||
* check for upcoming API changes in 3.2 [smarty_modifier_foobar, --> [smarty_modifier_foobar, smarty_function_foobar, smarty_block_foobar] (see class) ]
|
||||
* smarty_modifier_foobar(Smarty $smarty, $string, …) vs. smarty_modifier_foobar($string, …)
|
||||
**/
|
||||
$serendipity['smarty']->registerPlugin('modifier', 'makeFilename', 'serendipity_makeFilename');
|
||||
@ -938,9 +938,9 @@ function serendipity_smarty_init($vars = array()) {
|
||||
$serendipity['smarty']->registerPlugin('function', 'pickKey', 'serendipity_smarty_pickKey');
|
||||
$serendipity['smarty']->registerPlugin('function', 'serendipity_showCommentForm', 'serendipity_smarty_showCommentForm');
|
||||
$serendipity['smarty']->registerPlugin('function', 'serendipity_getImageSize', 'serendipity_smarty_getImageSize');
|
||||
|
||||
|
||||
$serendipity['smarty']->registerFilter('pre', 'serendipity_replaceSmartyVars');
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (!isset($serendipity['smarty_raw_mode'])) {
|
||||
|
@ -323,7 +323,7 @@ function add_trackback ($id, $title, $url, $name, $excerpt) {
|
||||
|
||||
// Decode HTML Entities
|
||||
$excerpt = trackback_body_strip($excerpt);
|
||||
|
||||
|
||||
$comment = array(
|
||||
'title' => $title,
|
||||
'url' => $url,
|
||||
@ -390,7 +390,7 @@ function add_trackback ($id, $title, $url, $name, $excerpt) {
|
||||
function add_pingback ($id, $postdata) {
|
||||
global $serendipity;
|
||||
log_pingback("Reached add_pingback. ID:[$id]");
|
||||
|
||||
|
||||
// XML-RPC Method call without named parameter. This seems to be the default way using XML-RPC
|
||||
if(preg_match('@<methodCall>\s*<methodName>\s*pingback.ping\s*</methodName>\s*<params>\s*<param>\s*<value>\s*<string>([^<]*)</string>\s*</value>\s*</param>\s*<param>\s*<value>\s*<string>([^<]*)</string>\s*</value>\s*</param>\s*</params>\s*</methodCall>@is', $postdata, $matches)) {
|
||||
log_pingback("Pingback wp structure.");
|
||||
@ -410,7 +410,7 @@ function add_pingback ($id, $postdata) {
|
||||
$id = evaluateIdByLocalUrl($local);
|
||||
log_pingback("ID set to $id");
|
||||
}
|
||||
|
||||
|
||||
if ($id>0) {
|
||||
// first check, if we already have this pingback
|
||||
$comments = serendipity_fetchComments($id,1,'co.id',true,'PINGBACK'," AND co.url='" . serendipity_db_escape_string($remote) . "'");
|
||||
@ -458,7 +458,7 @@ function add_pingback ($id, $postdata) {
|
||||
|
||||
function evaluateIdByLocalUrl($localUrl) {
|
||||
global $serendipity;
|
||||
|
||||
|
||||
// Build an ID searchpattern in configured permaling structure:
|
||||
$permalink_article = $serendipity['permalinkStructure'];
|
||||
log_pingback("perma: $permalink_article");
|
||||
@ -467,7 +467,7 @@ function evaluateIdByLocalUrl($localUrl) {
|
||||
$permalink_article = str_replace('?','\?',$permalink_article);
|
||||
$permalink_article = str_replace('%id%','(\d+)',$permalink_article);
|
||||
$permalink_article = str_replace('%title%','[^/]*',$permalink_article);
|
||||
$permalink_article_regex = '@' . $permalink_article . '$@';
|
||||
$permalink_article_regex = '@' . $permalink_article . '$@';
|
||||
log_pingback("regex: $permalink_article_regex");
|
||||
|
||||
if (preg_match($permalink_article_regex, $localUrl, $matches)) {
|
||||
@ -499,17 +499,17 @@ function getPingbackParam($paramName, $data) {
|
||||
*/
|
||||
function fetchPingbackData( &$comment) {
|
||||
global $serendipity;
|
||||
|
||||
|
||||
// Don't fetch remote page, if not explicitly allowed in serendipity_config_local.php:
|
||||
if (empty($serendipity['pingbackFetchPage'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// If we don't have a comment or a commentors url, stop it.
|
||||
if (!isset($comment) || !is_array($comment) || !isset($comment['url'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Max amount of characters fetched from the page doing a pingback:
|
||||
$fetchPageMaxLength = 200;
|
||||
if (isset($serendipity['pingbackFetchPageMaxLength'])){
|
||||
@ -517,9 +517,9 @@ function fetchPingbackData( &$comment) {
|
||||
}
|
||||
require_once S9Y_PEAR_PATH . 'HTTP/Request.php';
|
||||
$url = $comment['url'];
|
||||
|
||||
|
||||
if (function_exists('serendipity_request_start')) serendipity_request_start();
|
||||
|
||||
|
||||
// Request the page
|
||||
$req = new HTTP_Request($url, array('allowRedirects' => true, 'maxRedirects' => 5, 'timeout' => 20, 'readTimeout' => array(5,0)));
|
||||
|
||||
@ -527,7 +527,7 @@ function fetchPingbackData( &$comment) {
|
||||
$responses = "/(200 OK)|(30[0-9] Found)/"; // |(30[0-9] Moved)
|
||||
if ((PEAR::isError($req->sendRequest()) || preg_match($responses, $req->getResponseCode()))) {
|
||||
// nothing to do,
|
||||
}
|
||||
}
|
||||
else {
|
||||
$fContent = $req->getResponseBody();
|
||||
|
||||
@ -535,7 +535,7 @@ function fetchPingbackData( &$comment) {
|
||||
if (preg_match('@<head[^>]*>.*?<title[^>]*>(.*?)</title>.*?</head>@is',$fContent,$matches)) {
|
||||
$comment['title'] = html_entity_decode(strip_tags($matches[1]), ENT_COMPAT, LANG_CHARSET);
|
||||
}
|
||||
|
||||
|
||||
// Try to get content from first <p> tag on:
|
||||
if (preg_match('@<p[^>]*>(.*?)</body>@is',$fContent,$matches)) {
|
||||
$body = $matches[1];
|
||||
@ -554,24 +554,24 @@ function fetchPingbackData( &$comment) {
|
||||
$comment['comment'] = $body . '[..]';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (function_exists('serendipity_request_end')) serendipity_request_end();
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Strips any unneeded code from trackback / pingback bodies returning pure (UTF8) text.
|
||||
*/
|
||||
function trackback_body_strip( $body ){
|
||||
// replace non brakeable space with normal space:
|
||||
// replace non brakeable space with normal space:
|
||||
$body = str_replace(' ', ' ', $body);
|
||||
|
||||
// strip html entities and tags.
|
||||
$body = html_entity_decode(strip_tags($body), ENT_COMPAT, LANG_CHARSET);
|
||||
|
||||
// replace whitespace with single space
|
||||
// replace whitespace with single space
|
||||
$body = preg_replace('@\s+@s', ' ', $body);
|
||||
|
||||
|
||||
return $body;
|
||||
}
|
||||
|
||||
@ -760,7 +760,7 @@ function serendipity_handle_references($id, $author, $title, $text, $dry_run = f
|
||||
if ($debug && is_string($row)) {
|
||||
echo $row . "<br />\n";
|
||||
}
|
||||
|
||||
|
||||
$names[$i] = strip_tags($names[$i]);
|
||||
if (empty($names[$i])) {
|
||||
if ($debug) echo "Found reference $locations[$i] w/o name. Adding location as name.";
|
||||
|
@ -49,13 +49,13 @@ if ($serendipity['smarty_raw_mode']) {
|
||||
if (!is_array($entry) || count($entry) < 1 || !is_array($entry[0])) {
|
||||
unset($serendipity['GET']['id']);
|
||||
$entry = array(array());
|
||||
$serendipity['head_title'] = htmlspecialchars($serendipity['blogTitle']);
|
||||
$serendipity['head_subtitle'] = '';
|
||||
$serendipity['smarty']->assign('head_title', $serendipity['head_title']);
|
||||
$serendipity['smarty']->assign('head_subtitle', $serendipity['head_subtitle']);
|
||||
$serendipity['head_title'] = htmlspecialchars($serendipity['blogTitle']);
|
||||
$serendipity['head_subtitle'] = '';
|
||||
$serendipity['smarty']->assign('head_title', $serendipity['head_title']);
|
||||
$serendipity['smarty']->assign('head_subtitle', $serendipity['head_subtitle']);
|
||||
$serendipity['view'] = '404';
|
||||
serendipity_header('HTTP/1.0 404 Not found');
|
||||
serendipity_header('Status: 404 Not found');
|
||||
serendipity_header('HTTP/1.0 404 Not found');
|
||||
serendipity_header('Status: 404 Not found');
|
||||
}
|
||||
|
||||
serendipity_printEntries($entry, 1);
|
||||
|
@ -32,7 +32,7 @@ function serendipity_plugin_api_frontend_header($event_name, &$bag, &$eventData,
|
||||
// Only execute if current template does not have its own jquery.js file
|
||||
// jquery can be disabled if a template's config.inc.php or a plugin sets
|
||||
// $serendipity['capabilities']['jquery'] = false
|
||||
|
||||
|
||||
$check = serendipity_getTemplateFile('jquery.js');
|
||||
if (!$check && $serendipity['capabilities']['jquery']) {
|
||||
?>
|
||||
@ -141,7 +141,7 @@ class serendipity_plugin_api
|
||||
// Secure Plugin path. No leading slashes, no backslashes, no "up" directories
|
||||
$pluginPath = preg_replace('@^(/)@', '', $pluginPath);
|
||||
$pluginPath = str_replace(array('..', "\\"), array('', '/'), serendipity_db_escape_string($pluginPath));
|
||||
|
||||
|
||||
if ($pluginPath == 'online_repository') {
|
||||
$pluginPath = $key;
|
||||
}
|
||||
@ -596,7 +596,7 @@ class serendipity_plugin_api
|
||||
$p->serendipity_owner = $owner[0];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$p->pluginPath = $p->act_pluginPath = $pluginPath;
|
||||
if (empty($p->act_pluginPath)) {
|
||||
$p->act_pluginPath = $class_name;
|
||||
@ -862,7 +862,7 @@ class serendipity_plugin_api
|
||||
if (count($plugins) == 0) {
|
||||
$serendipity['prevent_sidebar_plugins_' . $side] = true;
|
||||
}
|
||||
|
||||
|
||||
$loggedin = false;
|
||||
if (serendipity_userLoggedIn() && serendipity_checkPermission('adminPlugins')) {
|
||||
$loggedin = true;
|
||||
@ -879,7 +879,7 @@ class serendipity_plugin_api
|
||||
$show_plugin = $plugin->generate_content($title);
|
||||
$content = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
|
||||
if ($loggedin) {
|
||||
$content .= '<div class="serendipity_edit_nugget"><a href="' . $serendipity['serendipityHTTPPath'] . 'serendipity_admin.php?serendipity[adminModule]=plugins&serendipity[plugin_to_conf]=' . htmlentities($plugin->instance) . '">' . EDIT . '</a></div>';
|
||||
}
|
||||
@ -1045,12 +1045,12 @@ class serendipity_plugin_api
|
||||
$apifunc($event_name, $bag, $eventData, $addData);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (function_exists('serendipity_plugin_api_pre_event_hook')) {
|
||||
$apifunc = 'serendipity_plugin_api_pre_event_hook';
|
||||
$apifunc($event_name, $bag, $eventData, $addData);
|
||||
}
|
||||
|
||||
|
||||
if (is_array($plugins)) {
|
||||
// foreach() operates on copies of values, but we want to operate on references, so we use while()
|
||||
@reset($plugins);
|
||||
@ -1149,7 +1149,7 @@ class serendipity_plugin_api
|
||||
if (file_exists($probelang)) {
|
||||
include $probelang;
|
||||
}
|
||||
|
||||
|
||||
include $path . '/lang_en.inc.php';
|
||||
}
|
||||
}
|
||||
|
@ -218,7 +218,7 @@ class serendipity_calendar_plugin extends serendipity_plugin {
|
||||
} else {
|
||||
$catid = false;
|
||||
}
|
||||
|
||||
|
||||
if ($catid) {
|
||||
$base_query = 'C' . $catid;
|
||||
$add_query = '/' . $base_query;
|
||||
@ -477,7 +477,7 @@ class serendipity_archives_plugin extends serendipity_plugin {
|
||||
$ts = mktime(0, 0, 0, date('m'), 1);
|
||||
|
||||
$add_query = '';
|
||||
|
||||
|
||||
$category_set = isset($serendipity['GET']['category']);
|
||||
if ($category_set) {
|
||||
$base_query = 'C' . (int)$serendipity['GET']['category'];
|
||||
@ -490,13 +490,13 @@ class serendipity_archives_plugin extends serendipity_plugin {
|
||||
$freq = $this->get_config('frequency', 'months');
|
||||
|
||||
echo '<ul class="plainList">' . "\n";
|
||||
|
||||
|
||||
if ($serendipity['dbType'] == 'sqlite' || $serendipity['dbType'] == 'sqlite3') {
|
||||
$dist_sql = 'count(e.id) AS orderkey';
|
||||
} else {
|
||||
$dist_sql = 'count(DISTINCT e.id) AS orderkey';
|
||||
}
|
||||
|
||||
|
||||
for($x = 0; $x < $max_x; $x++) {
|
||||
$current_ts = $ts;
|
||||
switch($freq) {
|
||||
@ -586,7 +586,7 @@ class serendipity_archives_plugin extends serendipity_plugin {
|
||||
if (empty($ec['orderkey'])) {
|
||||
$ec['orderkey'] = '0';
|
||||
}
|
||||
$hidden_by_zero_count = $hide_zero_count && ( $ec['orderkey'] == '0');
|
||||
$hidden_by_zero_count = $hide_zero_count && ( $ec['orderkey'] == '0');
|
||||
$html_count .= ' (' . $ec['orderkey'] . ')';
|
||||
}
|
||||
}
|
||||
@ -844,10 +844,10 @@ class serendipity_syndication_plugin extends serendipity_plugin {
|
||||
|
||||
case 'show_googlereader':
|
||||
$radio = array();
|
||||
|
||||
|
||||
$radio['value'][] = 'true';
|
||||
$radio['desc'][] = YES;
|
||||
|
||||
|
||||
$radio['value'][] = 'false';
|
||||
$radio['desc'][] = NO;
|
||||
|
||||
|
@ -1,41 +1,41 @@
|
||||
<?php
|
||||
// serendipity_smarty_class.inc.php 2013-01-24 Ian
|
||||
|
||||
|
||||
// define secure_dir and trusted_dirs for Serendipity_Smarty_Security_Policy class.
|
||||
@define('S9Y_TEMPLATE_FALLBACK', $serendipity['serendipityPath'] . $serendipity['templatePath'] . 'default');
|
||||
@define('S9Y_TEMPLATE_USERDEFAULT', $serendipity['serendipityPath'] . $serendipity['templatePath'] . $serendipity['template']);
|
||||
@define('S9Y_TEMPLATE_SECUREDIR', $serendipity['serendipityPath'] . $serendipity['templatePath']);
|
||||
|
||||
|
||||
// Create a wrapper class extended from Smarty_Security - which allows access to S9Y-plugin and S9Y-template dirs
|
||||
|
||||
// Create a wrapper class extended from Smarty_Security - which allows access to S9Y-plugin and S9Y-template dirs
|
||||
class Serendipity_Smarty_Security_Policy extends Smarty_Security
|
||||
{
|
||||
{
|
||||
// these are the allowed functions only. - default as is
|
||||
public $php_functions = array('isset', 'empty', 'count', 'sizeof', 'in_array', 'is_array', 'time', 'nl2br');
|
||||
// to disable all PHP functions
|
||||
#public $php_functions = null;
|
||||
|
||||
|
||||
// remove PHP tags
|
||||
public $php_handling = Smarty::PHP_REMOVE; // = 2
|
||||
|
||||
|
||||
// set allowed modifiers only. (default = array( 'escape', 'count' );)
|
||||
public $php_modifiers = array('escape', 'sprintf', 'sizeof', 'count', 'rand', 'print_r', 'str_repeat', 'nl2br');
|
||||
|
||||
|
||||
public $allow_constants = true;
|
||||
|
||||
public $allow_super_globals = true;
|
||||
|
||||
public $allow_super_globals = true;
|
||||
|
||||
// array of template directories that are considered secure. No need, as ...TemplateDir concidered secure implicitly. (unproofed)
|
||||
public $secure_dir = array(S9Y_TEMPLATE_SECUREDIR); // do we need this then?
|
||||
|
||||
|
||||
// actually no need, as template dirs are explicit defined as trusted_dirs. (unproofed)
|
||||
public $trusted_dir = array(S9Y_TEMPLATE_USERDEFAULT, S9Y_TEMPLATE_FALLBACK); // do we need this then?
|
||||
|
||||
|
||||
#public $modifiers = array(); // can be omitted, when all allowed
|
||||
|
||||
|
||||
// to test this - overwrites Serendipity_Smarty::default_modifiers and Serendipity_Smarty_Security_Policy::php_modifiers - modifier 'escape' not allowed by security setting
|
||||
#public $allowed_modifiers = array('escape:"htmlall"');
|
||||
|
||||
|
||||
// This allows the fetch() and include calls to pull .tpl files from any directory,
|
||||
// so that symlinked plugin directories outside the s9y path can be included properly.
|
||||
// TODO / FUTURE: If Smarty will implement a seperation option to dissect fetch() from
|
||||
@ -45,9 +45,9 @@ class Serendipity_Smarty_Security_Policy extends Smarty_Security
|
||||
public function isTrustedResourceDir($path) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public static function test()
|
||||
{
|
||||
{
|
||||
var_dump(get_called_class());
|
||||
}
|
||||
}
|
||||
@ -57,20 +57,20 @@ class Serendipity_Smarty extends Smarty
|
||||
{
|
||||
// bc mode for plugins Smarty2 compat INCLUDE_ANY fetch() calls - to avoid an undefinied property error.
|
||||
public $security_settings = false;
|
||||
|
||||
|
||||
|
||||
|
||||
public function __set($name, $value) {
|
||||
if ($name == 'security') {
|
||||
if ($value) {
|
||||
$this->enableSecurity('Serendipity_Smarty_Security_Policy');
|
||||
} else {
|
||||
$this->disableSecurity();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
parent::__set($name, $value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* It is often helpful to access the Smarty object from anywhere in your code, e.g in Plugins.
|
||||
* Enables the Smarty object by instance always. The singleton pattern ensures that there is only one instance of the object available.
|
||||
@ -88,13 +88,13 @@ class Serendipity_Smarty extends Smarty
|
||||
$instance = new Serendipity_Smarty();
|
||||
}
|
||||
return $instance;
|
||||
}
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
// Class Constructor. These automatically get set with each new instance.
|
||||
parent::__construct();
|
||||
|
||||
|
||||
// call the objects initialization parameters
|
||||
self::setParams();
|
||||
}
|
||||
@ -102,17 +102,17 @@ class Serendipity_Smarty extends Smarty
|
||||
// smarty (3.1.x) object main parameter setup
|
||||
private function setParams()
|
||||
{
|
||||
global $serendipity;
|
||||
|
||||
global $serendipity;
|
||||
|
||||
// some documentary from the smarty forum
|
||||
/*
|
||||
Adressing a specific $template_dir (see 3.1 release notes)
|
||||
|
||||
|
||||
Smarty 3.1 introduces the $template_dir index notation.
|
||||
$smarty->fetch('[foo]bar.tpl') and {include file="[foo]bar.tpl"} require the template bar.tpl to be loaded from $template_dir['foo'];
|
||||
Smarty::setTemplateDir() and Smarty::addTemplateDir() offer ways to define indexes along with the actual directories.
|
||||
Smarty::setTemplateDir() and Smarty::addTemplateDir() offer ways to define indexes along with the actual directories.
|
||||
*/
|
||||
|
||||
|
||||
/* +++++++++++++++++++++++++++++++++++++++++++
|
||||
Set all directory setters
|
||||
Smarty will always use the first template found in order of the given array. Move the least significant directory to the end.
|
||||
@ -120,7 +120,7 @@ class Serendipity_Smarty extends Smarty
|
||||
|
||||
// initiate templateDir setter
|
||||
$this->setTemplateDir(array(S9Y_TEMPLATE_USERDEFAULT));
|
||||
|
||||
|
||||
// set addTemplate array with the blogs used template anyway
|
||||
$serendipity['addTemplateDir'] = array($serendipity['serendipityPath'] . $serendipity['templatePath'] . $serendipity['defaultTemplate']);
|
||||
/*
|
||||
@ -130,7 +130,7 @@ class Serendipity_Smarty extends Smarty
|
||||
// merge engine only templates to addTemplate array
|
||||
$p = explode(',', $serendipity['template_engine']);
|
||||
foreach($p AS $te) {
|
||||
$serendipity['addTemplateDir'][] = $serendipity['serendipityPath'] . $serendipity['templatePath'] . $te;
|
||||
$serendipity['addTemplateDir'][] = $serendipity['serendipityPath'] . $serendipity['templatePath'] . $te;
|
||||
}
|
||||
// add secure dir to template path, in case engine did have entries
|
||||
$serendipity['addTemplateDir'][] = S9Y_TEMPLATE_SECUREDIR;
|
||||
@ -138,38 +138,38 @@ class Serendipity_Smarty extends Smarty
|
||||
$serendipity['addTemplateDir'][] = $serendipity['serendipityPath'] . 'plugins';
|
||||
// add default template to addTemplate array, if not already set in engine
|
||||
$serendipity['addTemplateDir'][] = S9Y_TEMPLATE_FALLBACK;
|
||||
|
||||
|
||||
// expand smarty objects (add)TemplateDir setter with $serendipity['addTemplateDir'] as is
|
||||
$this->addTemplateDir($serendipity['addTemplateDir']);
|
||||
|
||||
$this->addTemplateDir($serendipity['addTemplateDir']);
|
||||
|
||||
// setTemplateDir again to unified getTemplateDir() to avoid doubles for (engine, default and main templates)
|
||||
$this->setTemplateDir(array_values(array_unique($this->getTemplateDir()))); // reset keys to be unique
|
||||
|
||||
$this->setCompileDir($serendipity['serendipityPath'] . PATH_SMARTY_COMPILE);
|
||||
|
||||
|
||||
$this->setConfigDir(array(S9Y_TEMPLATE_USERDEFAULT));
|
||||
|
||||
|
||||
if (!is_dir($this->getCompileDir()) || !is_writable($this->getCompileDir())) {
|
||||
if(ini_get('display_errors') == 0 || ini_get('display_errors') == 'off') printf(DIRECTORY_WRITE_ERROR, $this->getCompileDir());
|
||||
trigger_error(sprintf(DIRECTORY_WRITE_ERROR, $this->getCompileDir()), E_USER_ERROR);
|
||||
}
|
||||
|
||||
|
||||
#cache# $this->setCacheDir($serendipity['serendipityPath'] . 'cache'); // (enable #cache# properties)
|
||||
|
||||
|
||||
/*
|
||||
here we go with our other Smarty class properties, which can all be called by their property name (recommended)
|
||||
$smarty->use_sub_dirs = true; or by $smarty->setUseSubDirs(true); and echo $smarty->getUseSubDirs();
|
||||
as the latter's would run through an internal __call() wrapper function.
|
||||
Note: rodneyrehm - From within the Smarty class context you can safely access properties like Smarty::$use_sub_dirs directly.
|
||||
*/
|
||||
|
||||
|
||||
/* +++++++++++++++++++++++++++++++++++
|
||||
Set Smarty caching
|
||||
Set Smarty caching
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
Caching is disabled, as long as we haven't figured out on how to use it best here....
|
||||
|
||||
|
||||
Note: rodneyrehm
|
||||
A cache_id is (ideally) supposed to identify a single page.
|
||||
md5(REQUEST_URI) may _seem_ to be doing that, but /foo.html and /foo.html?foo=bar are the same resource
|
||||
@ -183,7 +183,7 @@ class Serendipity_Smarty extends Smarty
|
||||
post-123|comments|feed (if you have a comment feed for a certain post)
|
||||
now you can clearCache('post-123') and comments and comments|feed are killed as well.
|
||||
*/
|
||||
|
||||
|
||||
// does set cache also need to be set to true?
|
||||
#cache# $this->cache_modified_check = true; // to be used with display() method only, must be true to enable 304 headers
|
||||
|
||||
@ -191,7 +191,7 @@ class Serendipity_Smarty extends Smarty
|
||||
Note: rodneyrehm
|
||||
$cache_modified_check only works if you're using display() - it won't do anything on fetch().
|
||||
It won't do anything if you have non-caching plugins or {insert} tags, either.
|
||||
|
||||
|
||||
We're working on making this more intelligent for 3.2, but<75> work with what you've got in 3.1 first.
|
||||
*/
|
||||
|
||||
@ -201,7 +201,7 @@ class Serendipity_Smarty extends Smarty
|
||||
So each cache_id / compile_id combination may have their own cache lifetime.
|
||||
The point is simply, that once the cache lifetime (expiration date) has been saved to the cache file,
|
||||
it cannot be altered except for clearing and regenerating said cache file
|
||||
|
||||
|
||||
Template Inheritance
|
||||
Using is_cached() on sub-templates has to set up caching before is_cached() calls,
|
||||
e.g if (!$smarty->isCached('sub_test.tpl')) { $smarty->assign('foo', $foo); }.
|
||||
@ -231,7 +231,7 @@ class Serendipity_Smarty extends Smarty
|
||||
cache_lifetime and poll a secondary modified time from somewhere. You could then implement the serve-stale-until-updated caching approach.
|
||||
I'll blog about this<EFBFBD> probably around christmas
|
||||
*/
|
||||
|
||||
|
||||
// set the cache_lifetime for index.tpl to 5 minutes
|
||||
#cache# $this->cache_lifetime = 300; // $this->setCacheLifetime(300); // 86400; // one day: 60*60*24
|
||||
|
||||
@ -244,7 +244,7 @@ class Serendipity_Smarty extends Smarty
|
||||
$smarty->fetch('application.tpl',$cache_id);
|
||||
It is entirely up to you what is taken into account for the cache_id (URL, etc.)
|
||||
*/
|
||||
|
||||
|
||||
// does this mean $this->setCacheId($id); is useless here and has to be set where the actual templates are called? or does ist work as something default?
|
||||
/*
|
||||
Note: rodneyrehm
|
||||
@ -262,14 +262,14 @@ class Serendipity_Smarty extends Smarty
|
||||
In such a case you should use a product id as cache id.
|
||||
$this->cache_id($id); // $this->setCacheId($id);
|
||||
*/
|
||||
|
||||
#cache# $this->cache_id = md5($_SERVER['REQUEST_URI']); // this isn't a good idea either, better have it disabled or use a special id
|
||||
/*
|
||||
|
||||
#cache# $this->cache_id = md5($_SERVER['REQUEST_URI']); // this isn't a good idea either, better have it disabled or use a special id
|
||||
/*
|
||||
Note: Ian
|
||||
What kind of Serendipity ID could this be?
|
||||
- see Rodneys first caching note
|
||||
*/
|
||||
|
||||
|
||||
/* ++++++++++++++++++++++++++++++++++++++++++++++
|
||||
Set all other needed Smarty class properties
|
||||
*/
|
||||
@ -277,16 +277,16 @@ class Serendipity_Smarty extends Smarty
|
||||
#???# $this->merge_compiled_includes = true; // $this->setMergeCompiledIncludes(true); // what is this for?
|
||||
|
||||
// default here to be overwritten by $serendipity['production'] == 'debug' - see below!
|
||||
$this->debugging = false; // $this->setDebugging(false);
|
||||
$this->debugging = false; // $this->setDebugging(false);
|
||||
|
||||
// Smarty will create subdirectories under the compiled templates and cache directories if $use_sub_dirs is set to TRUE, default is FALSE.
|
||||
$this->use_sub_dirs = ( ini_get('safe_mode') ? false : true ); // $this->setUseSubDirs(false); // cache and compile dir only
|
||||
|
||||
// Smarty should update the cache files automatically if $smarty->compile_check is true.
|
||||
// Smarty should update the cache files automatically if $smarty->compile_check is true.
|
||||
$this->compile_check = true; // $this->setCompileCheck(true);
|
||||
#$this->compile_check = COMPILECHECK_OFF (false) - template files will not be checked
|
||||
#$this->compile_check = COMPILECHECK_ON (true) - template files will always be checked
|
||||
#$this->compile_check = COMPILECHECK_CACHEMISS - template files will be checked, if caching is enabled and there is no existing cache file, or it has expired
|
||||
#$this->compile_check = COMPILECHECK_CACHEMISS - template files will be checked, if caching is enabled and there is no existing cache file, or it has expired
|
||||
/*
|
||||
Note: rodneyrehm
|
||||
If you actually manage to build a page from a single template (with inclusions and plugins and stuff)
|
||||
@ -305,17 +305,17 @@ class Serendipity_Smarty extends Smarty
|
||||
// production == debug extends from s9y version information (alpha|beta|cvs) is always debug | USE ===
|
||||
if ($serendipity['production'] === 'debug') {
|
||||
$this->force_compile = true; // $this->setForceCompile(true);
|
||||
$this->caching = false; // $this->setCaching(false);
|
||||
$this->caching = false; // $this->setCaching(false);
|
||||
$this->debugging = true; // $this->setDebugging(true);
|
||||
}
|
||||
|
||||
|
||||
// set smarty error reporting. General error_reporting is set in serendipity/serendipity_config.inc.php
|
||||
$this->error_reporting = E_ALL & ~(E_NOTICE|E_STRICT);
|
||||
|
||||
|
||||
// we use our own error_handler and get in conflicts with smarty?
|
||||
// $this->muteExpectedErrors();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
Note: Ian
|
||||
These BC methods are to be kept as long as not converted to new syntax in additional plugins
|
||||
@ -323,7 +323,7 @@ class Serendipity_Smarty extends Smarty
|
||||
serendipity_event_communityrating.php, serendipity_event_customarchive.php, serendipity_event_microformats.php,
|
||||
serendipity_event_multilingual.php, serendipity_event_smartymarkup.php, serendipity_event_staticpage.php
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Registers custom function to be used in templates - BC mode Smarty 2 -> 3
|
||||
*
|
||||
@ -382,8 +382,8 @@ class Serendipity_Smarty extends Smarty
|
||||
}
|
||||
|
||||
public static function test()
|
||||
{
|
||||
{
|
||||
var_dump(get_called_class());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -240,7 +240,7 @@ class serendipity_smarty_emulator_xml extends serendipity_smarty_emulator {
|
||||
echo "<serendipity>\n";
|
||||
ob_end_flush(); // This ends the started ob from index.php!
|
||||
}
|
||||
|
||||
|
||||
function serendipity_smarty_emulator_xml() {
|
||||
$this->__construct();
|
||||
}
|
||||
@ -265,7 +265,7 @@ class serendipity_smarty_emulator_xml extends serendipity_smarty_emulator {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Assign one or multiple template variable by reference - Smarty API Change > 3.0
|
||||
*
|
||||
|
@ -504,11 +504,10 @@
|
||||
'default' => true,
|
||||
'permission' => 'blogConfiguration'
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
array_push( $res['display']['items'],
|
||||
array('var' => 'serverOffsetHours',
|
||||
'title' => INSTALL_OFFSET,
|
||||
|
@ -158,7 +158,7 @@ if (preg_match(PAT_ARCHIVES, $uri, $matches) || isset($serendipity['GET']['range
|
||||
|
||||
if (isset($day) && !is_numeric($day)) {
|
||||
$day = date('d');
|
||||
}
|
||||
}
|
||||
|
||||
switch($serendipity['calendar']) {
|
||||
case 'gregorian':
|
||||
@ -497,7 +497,7 @@ if (preg_match(PAT_ARCHIVES, $uri, $matches) || isset($serendipity['GET']['range
|
||||
}
|
||||
|
||||
$uInfo = serendipity_fetchUsers($serendipity['GET']['viewAuthor']);
|
||||
|
||||
|
||||
if (!is_array($uInfo)) {
|
||||
$serendipity['view'] = '404';
|
||||
$serendipity['viewtype'] = '404_3';
|
||||
|
@ -37,11 +37,11 @@ while(($file = readdir($d)) !== false) {
|
||||
if ($file[0] == '.') {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (!is_dir($base . '/' . $file)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$tfile = $base . '/' . $file . '/lang_en.inc.php';
|
||||
$sfile = $base . '/' . $file . '/lang_' . $lang . '.inc.php';
|
||||
|
||||
@ -56,14 +56,14 @@ while(($file = readdir($d)) !== false) {
|
||||
echo "NOTICE: English language of $file does not exist.\n";
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (file_exists($sfile)) {
|
||||
echo "Parsing differences for $file - ";
|
||||
include $sfile;
|
||||
$current = get_defined_constants();
|
||||
$const['missing'][$file] = array_diff($current, $const['checked']);
|
||||
$const['checked'] = array_merge($const['checked'], $current);
|
||||
|
||||
|
||||
echo count($const['missing'][$file]) . " missing constants.\n";
|
||||
} else {
|
||||
$const['missing'][$file] = $const['native'][$file];
|
||||
@ -109,7 +109,7 @@ foreach($const['missing'] AS $file => $constants) {
|
||||
@define('COMMENT_TOKENS_DESC', 'If tokens are used, comments can be approved and deleted by clicking the email links without requiring login access to the blog. Note that this is a convenience feature, and if your mails get hijacked, those people can approve/delete the referenced comment without further authentication.');
|
||||
@define('COMMENT_NOTOKENMATCH', 'Moderation link has expired or comment #%s has already been approved or deleted');
|
||||
@define('TRACKBACK_NOTOKENMATCH', 'Moderation link has expired or trackback #%s has already been approved or deleted');
|
||||
@define('BADTOKEN', 'Invalid Moderation Link');
|
||||
@define('BADTOKEN', 'Invalid Moderation Link');
|
||||
|
||||
@define('CONFIRMATION_MAIL_ALWAYS', "Hello %s,\n\nYou have sent a new comment to \"%s\". Your comment was:\n\n%s\n\nThe owner of the blog has enabled mail verification, so you need to click on the following link to authenticate your comment:\n<%s>\n");
|
||||
@define('CONFIRMATION_MAIL_ONCE', "Hello %s,\n\nYou have sent a new comment to \"%s\". Your comment was:\n\n%s\n\nThe owner of the blog has enabled one-time mail verification, so you need to click on the following link to authenticate your comment:\n<%s>\n\nAfter you have done that, you can always post comments on that blog with your username and e-mail address without receiving such notifications.");
|
||||
|
@ -2,8 +2,8 @@
|
||||
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
|
||||
# All rights reserved. See LICENSE file for licensing details
|
||||
# Translated by
|
||||
# (c) 2006 Aphonex Li <aphonex.li@gmail.com>
|
||||
# http://www.cexten.com
|
||||
# (c) 2006 Aphonex Li <aphonex.li@gmail.com>
|
||||
# http://www.cexten.com
|
||||
/* vim: set sts=4 ts=4 expandtab : */
|
||||
|
||||
@define('LANG_CHARSET', 'UTF-8');
|
||||
@ -631,8 +631,8 @@
|
||||
@define('ENTRY_PUBLISHED_FUTURE', '这篇文章未公开'); // Translate
|
||||
@define('ENTRIES_BY', '作者 %s'); // Translate
|
||||
@define('PREVIOUS', '上一页'); // Translate
|
||||
@define('NEXT', '下一页');
|
||||
@define('APPROVE', '审核');
|
||||
@define('NEXT', '下一页');
|
||||
@define('APPROVE', '审核');
|
||||
|
||||
@define('DO_MARKUP_DESCRIPTION', '套用自动化格式到文章内 (表情, 符号 *, /, _, ...)。关闭这项功能将会保存任何文章内出现的 HTML 语法。');
|
||||
@define('CATEGORY_ALREADY_EXIST', '类别 "%s" 已经存在');
|
||||
@ -816,7 +816,7 @@
|
||||
@define('AUTHORS_SHOW_ARTICLE_COUNT_DESC', '如果开启这个设定,作者的文章会显示在名称旁。');
|
||||
@define('CUSTOM_ADMIN_INTERFACE', '可用自订的管理界面');
|
||||
|
||||
@define('COMMENT_NOT_ADDED', '你的回复不能加入因为这篇文章不允许回复,输入了错误信息,或不通过垃圾管理。');
|
||||
@define('COMMENT_NOT_ADDED', '你的回复不能加入因为这篇文章不允许回复,输入了错误信息,或不通过垃圾管理。');
|
||||
@define('INSTALL_TRACKREF', '记录来源');
|
||||
@define('INSTALL_TRACKREF_DESC', '开启记录来源会显示那个网站引用了你的文章。你可以关闭这个功能如果你收到太多垃圾广告。');
|
||||
@define('CATEGORIES_HIDE_PARENT', '隐藏选择的类别');
|
||||
@ -923,7 +923,7 @@
|
||||
@define('COMMENT_TOKENS_DESC', 'If tokens are used, comments can be approved and deleted by clicking the email links without requiring login access to the blog. Note that this is a convenience feature, and if your mails get hijacked, those people can approve/delete the referenced comment without further authentication.');
|
||||
@define('COMMENT_NOTOKENMATCH', 'Moderation link has expired or comment #%s has already been approved or deleted');
|
||||
@define('TRACKBACK_NOTOKENMATCH', 'Moderation link has expired or trackback #%s has already been approved or deleted');
|
||||
@define('BADTOKEN', 'Invalid Moderation Link');
|
||||
@define('BADTOKEN', 'Invalid Moderation Link');
|
||||
|
||||
@define('CONFIRMATION_MAIL_ALWAYS', "Hello %s,\n\nYou have sent a new comment to \"%s\". Your comment was:\n\n%s\n\nThe owner of the blog has enabled mail verification, so you need to click on the following link to authenticate your comment:\n<%s>\n");
|
||||
@define('CONFIRMATION_MAIL_ONCE', "Hello %s,\n\nYou have sent a new comment to \"%s\". Your comment was:\n\n%s\n\nThe owner of the blog has enabled one-time mail verification, so you need to click on the following link to authenticate your comment:\n<%s>\n\nAfter you have done that, you can always post comments on that blog with your username and e-mail address without receiving such notifications.");
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -812,7 +812,7 @@
|
||||
@define('AUTHORS_SHOW_ARTICLE_COUNT', 'Vis antal artikler ved siden af forfatternavn?');
|
||||
@define('AUTHORS_SHOW_ARTICLE_COUNT_DESC', 'Hvis aktiv, vises antallet af artikler forfatteren har skrevet i paranteser ved siden af forfatternavnet.');
|
||||
@define('CUSTOM_ADMIN_INTERFACE', 'Tilpasset administrator interface');
|
||||
|
||||
|
||||
@define('COMMENT_NOT_ADDED', 'Din kommentar kunne ikke tilføjes af en af følgende grunde: kommentarer til denne artikel er blevet deaktiveret, du indtastede forkerte data, eller din kommentar blev fanget af antispam beskyttelsen');
|
||||
@define('INSTALL_TRACKREF', 'Visning af referencer?');
|
||||
@define('INSTALL_TRACKREF_DESC', 'Aktiverer du reference visning, vil du kunne se hvilke sites der henviser til dine artikler. Dette bliver tit misbrugt til spam.');
|
||||
@ -920,7 +920,7 @@
|
||||
@define('COMMENT_TOKENS_DESC', 'If tokens are used, comments can be approved and deleted by clicking the email links without requiring login access to the blog. Note that this is a convenience feature, and if your mails get hijacked, those people can approve/delete the referenced comment without further authentication.');
|
||||
@define('COMMENT_NOTOKENMATCH', 'Moderation link has expired or comment #%s has already been approved or deleted');
|
||||
@define('TRACKBACK_NOTOKENMATCH', 'Moderation link has expired or trackback #%s has already been approved or deleted');
|
||||
@define('BADTOKEN', 'Invalid Moderation Link');
|
||||
@define('BADTOKEN', 'Invalid Moderation Link');
|
||||
|
||||
@define('CONFIRMATION_MAIL_ALWAYS', "Hello %s,\n\nYou have sent a new comment to \"%s\". Your comment was:\n\n%s\n\nThe owner of the blog has enabled mail verification, so you need to click on the following link to authenticate your comment:\n<%s>\n");
|
||||
@define('CONFIRMATION_MAIL_ONCE', "Hello %s,\n\nYou have sent a new comment to \"%s\". Your comment was:\n\n%s\n\nThe owner of the blog has enabled one-time mail verification, so you need to click on the following link to authenticate your comment:\n<%s>\n\nAfter you have done that, you can always post comments on that blog with your username and e-mail address without receiving such notifications.");
|
||||
|
@ -249,7 +249,7 @@
|
||||
@define('PUBLISH', 'Julkaise');
|
||||
@define('PREVIEW', 'Esikatselu');
|
||||
@define('DATE', 'Päiväys');
|
||||
@define('DATE_FORMAT_2', 'Y-m-d H:i');
|
||||
@define('DATE_FORMAT_2', 'Y-m-d H:i');
|
||||
@define('DATE_INVALID', 'Päiväyksen muoto on virheellinen. Oikea muoto on VVVV-KK-PP TT:MM.');
|
||||
@define('CATEGORY_PLUGIN_DESC', 'Näyttää kategoriat.');
|
||||
@define('ALL_AUTHORS', 'Kaikki kirjoittajat');
|
||||
@ -630,60 +630,60 @@
|
||||
@define('NEXT', 'Seuraava');
|
||||
@define('APPROVE', 'Hyväksy');
|
||||
@define('DO_MARKUP_DESCRIPTION', 'Tee tekstille notaatiomuutokset (hymiöt, lyhennelmät käyttäen *, /, _, ...). Kieltämällä tämä säilyy HTML-koodi tekstissä sellaisenaan.');
|
||||
@define('CATEGORY_ALREADY_EXIST', 'Kategoria nimellä "%s" on jo olemassa');
|
||||
@define('IMPORT_NOTES', 'Huom:');
|
||||
@define('ERROR_FILE_FORBIDDEN', 'Et saa tuoda tiedostoja, joissa on interaktiivista sisältöä');
|
||||
@define('ADMIN', 'Ylläpito');
|
||||
@define('ADMIN_FRONTPAGE', 'Etusivu');
|
||||
@define('QUOTE', 'Lainaus');
|
||||
@define('IFRAME_SAVE', 'Serendipity tallettaa merkintääsi, luo paluuviitteitä ja suorittaaa mahdollisia XML-RPC kutsuja. Tässä voi vierähtää tovi..');
|
||||
@define('IFRAME_SAVE_DRAFT', 'Merkintäsi luonnos on talletettu.');
|
||||
@define('IFRAME_PREVIEW', 'Serendipity luo merkintäsi esikatseluversiota...');
|
||||
@define('IFRAME_WARNING', 'Selaimesi ei tue "iframe"ja. Muokkaa serendipity_config.inc.php tiedostoa ja aseta $serendipity[\'use_iframe\'] muuttujan arvoksi FALSE.');
|
||||
@define('CATEGORY_ALREADY_EXIST', 'Kategoria nimellä "%s" on jo olemassa');
|
||||
@define('IMPORT_NOTES', 'Huom:');
|
||||
@define('ERROR_FILE_FORBIDDEN', 'Et saa tuoda tiedostoja, joissa on interaktiivista sisältöä');
|
||||
@define('ADMIN', 'Ylläpito');
|
||||
@define('ADMIN_FRONTPAGE', 'Etusivu');
|
||||
@define('QUOTE', 'Lainaus');
|
||||
@define('IFRAME_SAVE', 'Serendipity tallettaa merkintääsi, luo paluuviitteitä ja suorittaaa mahdollisia XML-RPC kutsuja. Tässä voi vierähtää tovi..');
|
||||
@define('IFRAME_SAVE_DRAFT', 'Merkintäsi luonnos on talletettu.');
|
||||
@define('IFRAME_PREVIEW', 'Serendipity luo merkintäsi esikatseluversiota...');
|
||||
@define('IFRAME_WARNING', 'Selaimesi ei tue "iframe"ja. Muokkaa serendipity_config.inc.php tiedostoa ja aseta $serendipity[\'use_iframe\'] muuttujan arvoksi FALSE.');
|
||||
@define('NONE', 'ei yhtään');
|
||||
@define('USERCONF_CAT_DEFAULT_NEW_ENTRY', 'Uusien merkintöjen oletusasetukset');
|
||||
@define('UPGRADE', 'Päivitä');
|
||||
@define('UPGRADE_TO_VERSION', 'Päivitä versioon %s');
|
||||
@define('DELETE_DIRECTORY', 'Tuhoa hakemisto');
|
||||
@define('DELETE_DIRECTORY_DESC', 'Olet aikeissa tuhota hakemiston, jossa on media-tiedostoja, mahdollisesti sellaisia, jotka ovat käytössä merkinnöissäsi.');
|
||||
@define('FORCE_DELETE', 'Tuhoa hakemisto kaikkine tiedostoineen, mukaan lukien tiedostot, jotka eivät Serendipityn mielestä liity blogiisi');
|
||||
@define('CREATE_DIRECTORY', 'Luo hakemisto');
|
||||
@define('CREATE_NEW_DIRECTORY', 'Luo uusi hakemisto');
|
||||
@define('CREATE_DIRECTORY_DESC', 'Uusien media-tiedostohakemistojen luominen. Valitse nimi uudelle hakemistolle ja halutessasi sille päähakemisto.');
|
||||
@define('BASE_DIRECTORY', 'Juurihakemisto');
|
||||
@define('USERLEVEL_EDITOR_DESC', 'Toimittaja');
|
||||
@define('USERLEVEL_CHIEF_DESC', 'Päätoimittaja');
|
||||
@define('USERLEVEL_ADMIN_DESC', 'Ylläpitäjä');
|
||||
@define('USERCONF_USERLEVEL', 'Käyttäjätaso');
|
||||
@define('USERCONF_CAT_DEFAULT_NEW_ENTRY', 'Uusien merkintöjen oletusasetukset');
|
||||
@define('UPGRADE', 'Päivitä');
|
||||
@define('UPGRADE_TO_VERSION', 'Päivitä versioon %s');
|
||||
@define('DELETE_DIRECTORY', 'Tuhoa hakemisto');
|
||||
@define('DELETE_DIRECTORY_DESC', 'Olet aikeissa tuhota hakemiston, jossa on media-tiedostoja, mahdollisesti sellaisia, jotka ovat käytössä merkinnöissäsi.');
|
||||
@define('FORCE_DELETE', 'Tuhoa hakemisto kaikkine tiedostoineen, mukaan lukien tiedostot, jotka eivät Serendipityn mielestä liity blogiisi');
|
||||
@define('CREATE_DIRECTORY', 'Luo hakemisto');
|
||||
@define('CREATE_NEW_DIRECTORY', 'Luo uusi hakemisto');
|
||||
@define('CREATE_DIRECTORY_DESC', 'Uusien media-tiedostohakemistojen luominen. Valitse nimi uudelle hakemistolle ja halutessasi sille päähakemisto.');
|
||||
@define('BASE_DIRECTORY', 'Juurihakemisto');
|
||||
@define('USERLEVEL_EDITOR_DESC', 'Toimittaja');
|
||||
@define('USERLEVEL_CHIEF_DESC', 'Päätoimittaja');
|
||||
@define('USERLEVEL_ADMIN_DESC', 'Ylläpitäjä');
|
||||
@define('USERCONF_USERLEVEL', 'Käyttäjätaso');
|
||||
@define('USERCONF_USERLEVEL_DESC', 'Käyttäjätasoa käytetään määrittämän käyttäjän oikeudet tähän blogiin.');
|
||||
@define('USER_SELF_INFO', 'Kirjautuneena %s (%s)');
|
||||
@define('ADMIN_ENTRIES', 'Merkinnät');
|
||||
@define('RECHECK_INSTALLATION', 'Tarkista uudestaan');
|
||||
@define('IMAGICK_EXEC_ERROR', 'Suoritus epäonnistui: "%s", virhe: %s, paluuarvo: %d');
|
||||
@define('INSTALL_OFFSET_DESC', 'Anna aikaero sinun aikavyöhykkeesi ja palvelimen aikavyöhykkeen (palvelimella kello on nyt: %clock%) välillä');
|
||||
@define('UNMET_REQUIREMENTS', 'Edellytys: %s ei täyttynyt');
|
||||
@define('ADMIN_ENTRIES', 'Merkinnät');
|
||||
@define('RECHECK_INSTALLATION', 'Tarkista uudestaan');
|
||||
@define('IMAGICK_EXEC_ERROR', 'Suoritus epäonnistui: "%s", virhe: %s, paluuarvo: %d');
|
||||
@define('INSTALL_OFFSET_DESC', 'Anna aikaero sinun aikavyöhykkeesi ja palvelimen aikavyöhykkeen (palvelimella kello on nyt: %clock%) välillä');
|
||||
@define('UNMET_REQUIREMENTS', 'Edellytys: %s ei täyttynyt');
|
||||
@define('CHARSET', 'Merkistö');
|
||||
@define('AUTOLANG', 'Käytä lukijan selaimen kieltä oletuskielenä');
|
||||
@define('AUTOLANG_DESC', 'Jos otat tämän käyttöön, esitetään blogisi käyttöliittymä ja merkinnät käyttäjän selaimen kielellä, jos mahdollista.');
|
||||
@define('INSTALL_AUTODETECT_URL', 'Havaitse käytetty HTTP-isäntä automaattisesti');
|
||||
@define('INSTALL_AUTODETECT_URL_DESC', 'Jos valitset kyllä, Serendipity käyttää vierailijan käyttämäää HTTP-isäntänimeä BaseURL:ina. Tätä käyttämällä voit antaa blogillesi useamman verkkonimen ja käyttää samaa verkkonimeä kaikissa linkeissä, joita vierailija käyttää lukiessaan blogiasi.');
|
||||
@define('INSTALL_AUTODETECT_URL_DESC', 'Jos valitset kyllä, Serendipity käyttää vierailijan käyttämäää HTTP-isäntänimeä BaseURL:ina. Tätä käyttämällä voit antaa blogillesi useamman verkkonimen ja käyttää samaa verkkonimeä kaikissa linkeissä, joita vierailija käyttää lukiessaan blogiasi.');
|
||||
@define('CONVERT_HTMLENTITIES', 'Yritä konvertoida HTML-entiteetit automaattisesti?');
|
||||
@define('EMPTY_SETTING', 'Kentän "%s" syöte on epäkelpo!');
|
||||
@define('USERCONF_REALNAME', 'Nimi');
|
||||
@define('USERCONF_REALNAME_DESC', 'Kirjoittajan koko nimi. Tämä on se nimi, joka näytetään lukijoille');
|
||||
@define('HOTLINK_DONE', 'Tiedostoa linkitetään.<br />Tehty.');
|
||||
@define('ENTER_MEDIA_URL_METHOD', 'Hakutapa:');
|
||||
@define('ADD_MEDIA_BLAHBLAH_NOTE', 'Huom: Jos linkität kuvan toiselta palvelimelta tarvitset siihen luvan, jollei palvelin ole omasi. Linkittämällä voit käyttää kuvia tallettamatta niitä paikallisesti.');
|
||||
@define('MEDIA_HOTLINKED', 'Linkitetty palvelimelta');
|
||||
@define('FETCH_METHOD_IMAGE', 'Hae kuva palvelimellesi');
|
||||
@define('FETCH_METHOD_HOTLINK', 'Linkitä kohdepalvelimelta');
|
||||
@define('DELETE_HOTLINK_FILE', 'Poistettu linkitetty tiedosto nimeltä <b>%s</b>');
|
||||
@define('USERCONF_REALNAME', 'Nimi');
|
||||
@define('USERCONF_REALNAME_DESC', 'Kirjoittajan koko nimi. Tämä on se nimi, joka näytetään lukijoille');
|
||||
@define('HOTLINK_DONE', 'Tiedostoa linkitetään.<br />Tehty.');
|
||||
@define('ENTER_MEDIA_URL_METHOD', 'Hakutapa:');
|
||||
@define('ADD_MEDIA_BLAHBLAH_NOTE', 'Huom: Jos linkität kuvan toiselta palvelimelta tarvitset siihen luvan, jollei palvelin ole omasi. Linkittämällä voit käyttää kuvia tallettamatta niitä paikallisesti.');
|
||||
@define('MEDIA_HOTLINKED', 'Linkitetty palvelimelta');
|
||||
@define('FETCH_METHOD_IMAGE', 'Hae kuva palvelimellesi');
|
||||
@define('FETCH_METHOD_HOTLINK', 'Linkitä kohdepalvelimelta');
|
||||
@define('DELETE_HOTLINK_FILE', 'Poistettu linkitetty tiedosto nimeltä <b>%s</b>');
|
||||
@define('SYNDICATION_PLUGIN_SHOW_MAIL', 'Näytä sähköpostiosoitteet?');
|
||||
@define('IMAGE_MORE_INPUT', 'Lisää lisää kuvia');
|
||||
@define('BACKEND_TITLE', 'Lisätietoja laajennoksen omissa asetuksissa');
|
||||
@define('BACKEND_TITLE_FOR_NUGGET', 'Voit määrittää otsikon raapaleellesi käytettäväksi laajennosten asetuksissa. Hyödyllinen, mikäli käytät useampia raapaleita.');
|
||||
@define('CATEGORIES_ALLOW_SELECT', 'Saavatko vierailijat valita useampia kategorioita yhtäaikaisesti?');
|
||||
@define('CATEGORIES_ALLOW_SELECT_DESC', 'Jos sallit, katselijat voivat valita useamman kategorian katseltavaksi yhtäaikaisesti.');
|
||||
@define('BACKEND_TITLE', 'Lisätietoja laajennoksen omissa asetuksissa');
|
||||
@define('BACKEND_TITLE_FOR_NUGGET', 'Voit määrittää otsikon raapaleellesi käytettäväksi laajennosten asetuksissa. Hyödyllinen, mikäli käytät useampia raapaleita.');
|
||||
@define('CATEGORIES_ALLOW_SELECT', 'Saavatko vierailijat valita useampia kategorioita yhtäaikaisesti?');
|
||||
@define('CATEGORIES_ALLOW_SELECT_DESC', 'Jos sallit, katselijat voivat valita useamman kategorian katseltavaksi yhtäaikaisesti.');
|
||||
@define('PAGE_BROWSE_PLUGINS', 'Sivu (%s/%s), sisältää yhteensä %s laajennosta.');
|
||||
@define('INSTALL_CAT_PERMALINKS', 'Permalinkit');
|
||||
@define('INSTALL_CAT_PERMALINKS_DESC', 'Blogisi permalinkkien lausekkeiden määrittely. Suosittelemme, että käytät oletuksia; jos et, niin yritä sisällyttää lausekkeeseen %id% arvo estääksesi Serendipityä tekemästä tietokantahakua kohdeosoittetta varten.');
|
||||
@ -811,7 +811,7 @@
|
||||
@define('AUTHORS_SHOW_ARTICLE_COUNT_DESC', 'Kirjoitusten määrä näytetään suluissa kirjoittajan nimen perässä, jos valitset tämän.');
|
||||
@define('CUSTOM_ADMIN_INTERFACE', 'Muokkausliittymä käytettävissä');
|
||||
|
||||
@define('COMMENT_NOT_ADDED', 'Kommenttia ei lisätty, koska joko merkinnän kommentointi on kielletty, jokin antamasi tieto oli kelvoton tai kommenttisi katsottiin roskapostiksi. ');
|
||||
@define('COMMENT_NOT_ADDED', 'Kommenttia ei lisätty, koska joko merkinnän kommentointi on kielletty, jokin antamasi tieto oli kelvoton tai kommenttisi katsottiin roskapostiksi. ');
|
||||
@define('INSTALL_TRACKREF', 'Otetaanko viittajaseuranta käyttöön?');
|
||||
@define('INSTALL_TRACKREF_DESC', 'Viittajaseurannalla pidetään kirjaa merkintöihisi viittaavista linkeistä. Tätä usein väärinkäytetään "referrer-spam"-mäykseen. Hae googlesta selitys hakusanoilla: referrer spam.');
|
||||
@define('CATEGORIES_HIDE_PARENT', 'Piilota valittu kategoriavanhempi?');
|
||||
@ -921,7 +921,7 @@
|
||||
@define('COMMENT_TOKENS_DESC', 'If tokens are used, comments can be approved and deleted by clicking the email links without requiring login access to the blog. Note that this is a convenience feature, and if your mails get hijacked, those people can approve/delete the referenced comment without further authentication.');
|
||||
@define('COMMENT_NOTOKENMATCH', 'Moderation link has expired or comment #%s has already been approved or deleted');
|
||||
@define('TRACKBACK_NOTOKENMATCH', 'Moderation link has expired or trackback #%s has already been approved or deleted');
|
||||
@define('BADTOKEN', 'Invalid Moderation Link');
|
||||
@define('BADTOKEN', 'Invalid Moderation Link');
|
||||
|
||||
@define('CONFIRMATION_MAIL_ALWAYS', "Hello %s,\n\nYou have sent a new comment to \"%s\". Your comment was:\n\n%s\n\nThe owner of the blog has enabled mail verification, so you need to click on the following link to authenticate your comment:\n<%s>\n");
|
||||
@define('CONFIRMATION_MAIL_ONCE', "Hello %s,\n\nYou have sent a new comment to \"%s\". Your comment was:\n\n%s\n\nThe owner of the blog has enabled one-time mail verification, so you need to click on the following link to authenticate your comment:\n<%s>\n\nAfter you have done that, you can always post comments on that blog with your username and e-mail address without receiving such notifications.");
|
||||
|
@ -671,7 +671,7 @@
|
||||
@define('CONVERT_HTMLENTITIES', 'A HTML bejegyzések automatikus konvertálása?');
|
||||
@define('EMPTY_SETTING', 'Nem adtál meg értéket ehhez: "%s"!');
|
||||
@define('USERCONF_REALNAME', 'Valódi név');
|
||||
@define('USERCONF_REALNAME_DESC', 'A szerző teljes neve. Ezt látják az olvasók.');
|
||||
@define('USERCONF_REALNAME_DESC', 'A szerző teljes neve. Ezt látják az olvasók.');
|
||||
@define('HOTLINK_DONE', 'Fájl közvetlen hivatkozás létrehozva.<br />Kész.');
|
||||
@define('ENTER_MEDIA_URL_METHOD', 'Letöltési mód:');
|
||||
@define('ADD_MEDIA_BLAHBLAH_NOTE', 'Megjegyzés: ha a közvetlen hivatkozást választod, bizonyosodj meg arról, hogy van-e jogod ehhez, vagy a szerver ahova mutatsz a tiéd. Ezzel a módszerrel úgy jeleníthetsz meg képeket, hogy azok nem kerülnek hozzád lementésre.');
|
||||
@ -919,7 +919,7 @@
|
||||
@define('COMMENT_TOKENS_DESC', 'Amennyiben tokeneket használunk, a hozzászólásokat elfogadhatjuk vagy törölhetjük az emailben kapott linkre kattintva a blogba való bejelentkezés nélkül. Ez egy kényelmi funkció, de amennyiben egy ilyen email illetéktelenek kezébe kerül, ők is manipulálhatnak a kérdéses hozzászólásokkal további azonosítás nélkül.');
|
||||
@define('COMMENT_NOTOKENMATCH', 'A moderációs link lejárt, vagy a #%s számú hozzászólás már elfogadott/törölt');
|
||||
@define('TRACKBACK_NOTOKENMATCH', 'A moderációs link lejárt, vagy a #%s számú visszahivatkozás már elfogadott/törölt');
|
||||
@define('BADTOKEN', 'Érvénytelen moderációs link');
|
||||
@define('BADTOKEN', 'Érvénytelen moderációs link');
|
||||
|
||||
@define('CONFIRMATION_MAIL_ALWAYS', "Hello %s,\n\nÚj hozzászólást küldtél ehhez: \"%s\". A hozzászólásod ez volt:\n\n%s\n\nA blog tulajdonosa engedélyezte az email-es ellenőrzést, így a következő linkre kell kattintanod hogy azonosítsd a hozzászólásodat:\n<%s>\n");
|
||||
@define('CONFIRMATION_MAIL_ONCE', "Hello %s,\n\nÚj hozzászólást küldtél ehhez: \"%s\". A hozzászólásod ez volt:\n\n%s\n\nA blog tulajdonosa engedélyezte az egyszeri email-es ellenőrzést, így a következő linkre kell kattintanod hogy azonosítsd a hozzászólásodat:\n<%s>\n\nMiután megtetted ezt, küldhetsz hozzászólásokat a felhasználóneveddel és email címeddel anélkül hogy újabb azonosító emailt kapnál.");
|
||||
|
@ -281,7 +281,7 @@
|
||||
@define('ORIGINAL_SHORT', 'Upphafl.');
|
||||
@define('APPLY_MARKUP_TO', 'Virkja textabreytingar á %s');
|
||||
@define('CALENDAR_BEGINNING_OF_WEEK', 'Upphaf vikunnar');
|
||||
@define('SERENDIPITY_NEEDS_UPGRADE', 'Serendipity hefur tekið eftir að stillingarnar þínar eru uppsettar fyrir útgáfu %s, en núverandi útgáfa er %s. Þú þarft því að uppfæra! <a href="%s">Smelltu hér</a>');
|
||||
@define('SERENDIPITY_NEEDS_UPGRADE', 'Serendipity hefur tekið eftir að stillingarnar þínar eru uppsettar fyrir útgáfu %s, en núverandi útgáfa er %s. Þú þarft því að uppfæra! <a href="%s">Smelltu hér</a>');
|
||||
@define('SERENDIPITY_UPGRADER_WELCOME', 'Góðan dag, og velkomin í uppfærsluforrit Serendipity.');
|
||||
@define('SERENDIPITY_UPGRADER_PURPOSE', 'Ég er hér til að hjálpa þér að uppfæra Serendipity %s uppsetninguna þína.');
|
||||
@define('SERENDIPITY_UPGRADER_WHY', 'Þú sérð þessi skilaboð vegna þess að þú hefur sett upp Serendipity %s, en þú hefur ekki uppfært gagnagrunnsuppsetninguna til að passa við þessa útgáfu');
|
||||
@ -922,7 +922,7 @@
|
||||
@define('COMMENT_TOKENS_DESC', 'If tokens are used, comments can be approved and deleted by clicking the email links without requiring login access to the blog. Note that this is a convenience feature, and if your mails get hijacked, those people can approve/delete the referenced comment without further authentication.');
|
||||
@define('COMMENT_NOTOKENMATCH', 'Moderation link has expired or comment #%s has already been approved or deleted');
|
||||
@define('TRACKBACK_NOTOKENMATCH', 'Moderation link has expired or trackback #%s has already been approved or deleted');
|
||||
@define('BADTOKEN', 'Invalid Moderation Link');
|
||||
@define('BADTOKEN', 'Invalid Moderation Link');
|
||||
|
||||
@define('CONFIRMATION_MAIL_ALWAYS', "Hello %s,\n\nYou have sent a new comment to \"%s\". Your comment was:\n\n%s\n\nThe owner of the blog has enabled mail verification, so you need to click on the following link to authenticate your comment:\n<%s>\n");
|
||||
@define('CONFIRMATION_MAIL_ONCE', "Hello %s,\n\nYou have sent a new comment to \"%s\". Your comment was:\n\n%s\n\nThe owner of the blog has enabled one-time mail verification, so you need to click on the following link to authenticate your comment:\n<%s>\n\nAfter you have done that, you can always post comments on that blog with your username and e-mail address without receiving such notifications.");
|
||||
|
@ -518,7 +518,7 @@ $i18n_filename_to = array('_', 'a', 'A', 'a', 'A', 'b', 'B', 'c', 'C', 'c', 'C
|
||||
@define('VIEW_COMMENT', 'Zobacz komentarz');
|
||||
@define('VIEW_ENTRY', 'Zobacz wpis');
|
||||
@define('DELETE_FILE_FAIL' , 'Usuwanie pliku <b>%s</b> nie powiodło się');
|
||||
@define('DELETE_THUMBNAIL', 'Usunięto minturkę o nazwie <b>%s</b>');
|
||||
@define('DELETE_THUMBNAIL', 'Usunięto minturkę o nazwie <b>%s</b>');
|
||||
@define('DELETE_FILE', 'Usunięto plik o nazwie <b>%s</b>');
|
||||
@define('ABOUT_TO_DELETE_FILE', 'Masz zamiar usunąc plik <b>%s</b><br />Jeśli w którymś z wpisów zostało zdefiniowane odwołanie do pliku, plik ten nie będzie więcej dla tego odwałania dostępny (link nie będzie działał prawidłowo).<br />Czy chcesz kontynuować?<br /><br />');
|
||||
@define('TRACKBACK_SENDING', 'Wysyłanie śladu do URI %s...');
|
||||
|
@ -749,7 +749,7 @@
|
||||
@define('PLUGIN_GROUP_STATISTICS', 'إحصائيات');
|
||||
@define('PERMISSION_PERSONALCONFIGURATION', 'personalConfiguration: Access personal configuration');
|
||||
@define('PERMISSION_PERSONALCONFIGURATIONUSERLEVEL', 'personalConfigurationUserlevel: Change userlevels');
|
||||
@define('PERMISSION_PERSONALCONFIGURATIONNOCREATE', 'personalConfigurationNoCreate: Change "forbid creating entries"');
|
||||
@define('PERMISSION_PERSONALCONFIGURATIONNOCREATE', 'personalConfigurationNoCreate: Change "forbid creating entries"');
|
||||
@define('PERMISSION_PERSONALCONFIGURATIONRIGHTPUBLISH', 'personalConfigurationRightPublish: Change right to publish entries');
|
||||
@define('PERMISSION_SITECONFIGURATION', 'siteConfiguration: Access system configuration');
|
||||
@define('PERMISSION_BLOGCONFIGURATION', 'blogConfiguration: Access blog-centric configuration');
|
||||
@ -840,7 +840,7 @@
|
||||
@define('COMMENT_TOKENS_DESC', 'If tokens are used, comments can be approved and deleted by clicking the email links without requiring login access to the blog. Note that this is a convenience feature, and if your mails get hijacked, those people can approve/delete the referenced comment without further authentication.');
|
||||
@define('COMMENT_NOTOKENMATCH', 'Moderation link has expired or comment #%s has already been approved or deleted');
|
||||
@define('TRACKBACK_NOTOKENMATCH', 'Moderation link has expired or trackback #%s has already been approved or deleted');
|
||||
@define('BADTOKEN', 'Invalid Moderation Link');
|
||||
@define('BADTOKEN', 'Invalid Moderation Link');
|
||||
|
||||
@define('CONFIRMATION_MAIL_ALWAYS', "Hello %s,\n\nYou have sent a new comment to \"%s\". Your comment was:\n\n%s\n\nThe owner of the blog has enabled mail verification, so you need to click on the following link to authenticate your comment:\n<%s>\n");
|
||||
@define('CONFIRMATION_MAIL_ONCE', "Hello %s,\n\nYou have sent a new comment to \"%s\". Your comment was:\n\n%s\n\nThe owner of the blog has enabled one-time mail verification, so you need to click on the following link to authenticate your comment:\n<%s>\n\nAfter you have done that, you can always post comments on that blog with your username and e-mail address without receiving such notifications.");
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -748,7 +748,7 @@
|
||||
@define('PLUGIN_GROUP_STATISTICS', 'புள்ளிவிபரங்கள்');
|
||||
@define('PERMISSION_PERSONALCONFIGURATION', 'personalConfiguration: Access personal configuration');
|
||||
@define('PERMISSION_PERSONALCONFIGURATIONUSERLEVEL', 'personalConfigurationUserlevel: Change userlevels');
|
||||
@define('PERMISSION_PERSONALCONFIGURATIONNOCREATE', 'personalConfigurationNoCreate: Change "forbid creating entries"');
|
||||
@define('PERMISSION_PERSONALCONFIGURATIONNOCREATE', 'personalConfigurationNoCreate: Change "forbid creating entries"');
|
||||
@define('PERMISSION_PERSONALCONFIGURATIONRIGHTPUBLISH', 'personalConfigurationRightPublish: Change right to publish entries');
|
||||
@define('PERMISSION_SITECONFIGURATION', 'siteConfiguration: Access system configuration');
|
||||
@define('PERMISSION_BLOGCONFIGURATION', 'blogConfiguration: Access blog-centric configuration');
|
||||
@ -921,7 +921,7 @@
|
||||
@define('COMMENT_TOKENS_DESC', 'If tokens are used, comments can be approved and deleted by clicking the email links without requiring login access to the blog. Note that this is a convenience feature, and if your mails get hijacked, those people can approve/delete the referenced comment without further authentication.');
|
||||
@define('COMMENT_NOTOKENMATCH', 'Moderation link has expired or comment #%s has already been approved or deleted');
|
||||
@define('TRACKBACK_NOTOKENMATCH', 'Moderation link has expired or trackback #%s has already been approved or deleted');
|
||||
@define('BADTOKEN', 'Invalid Moderation Link');
|
||||
@define('BADTOKEN', 'Invalid Moderation Link');
|
||||
|
||||
@define('CONFIRMATION_MAIL_ALWAYS', "Hello %s,\n\nYou have sent a new comment to \"%s\". Your comment was:\n\n%s\n\nThe owner of the blog has enabled mail verification, so you need to click on the following link to authenticate your comment:\n<%s>\n");
|
||||
@define('CONFIRMATION_MAIL_ONCE', "Hello %s,\n\nYou have sent a new comment to \"%s\". Your comment was:\n\n%s\n\nThe owner of the blog has enabled one-time mail verification, so you need to click on the following link to authenticate your comment:\n<%s>\n\nAfter you have done that, you can always post comments on that blog with your username and e-mail address without receiving such notifications.");
|
||||
|
@ -2,7 +2,7 @@
|
||||
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
|
||||
# All rights reserved. See LICENSE file for licensing details
|
||||
# Translated by CapriSkye <admin@capriskye.com>
|
||||
# http://open.38.com
|
||||
# http://open.38.com
|
||||
/* vim: set sts=4 ts=4 expandtab : */
|
||||
|
||||
@define('LANG_CHARSET', 'UTF-8');
|
||||
@ -815,7 +815,7 @@ $i18n_unknown = 'tw';
|
||||
@define('AUTHORS_SHOW_ARTICLE_COUNT_DESC', '如果開啟這個設定,作者的文章數會顯示在名稱旁邊。');
|
||||
@define('CUSTOM_ADMIN_INTERFACE', '可用自訂的管理介面');
|
||||
|
||||
@define('COMMENT_NOT_ADDED', '您的迴響不能加入因為此篇文章不允許迴響,輸入了錯誤的訊息,或不通過垃圾管理。');
|
||||
@define('COMMENT_NOT_ADDED', '您的迴響不能加入因為此篇文章不允許迴響,輸入了錯誤的訊息,或不通過垃圾管理。');
|
||||
@define('INSTALL_TRACKREF', '記錄來源?');
|
||||
@define('INSTALL_TRACKREF_DESC', '開啟記錄來源會顯示哪個網站引用了您的文章。您可以關閉這個功能如果收到太多垃圾廣告。');
|
||||
@define('CATEGORIES_HIDE_PARENT', '隱藏選擇的類別?');
|
||||
@ -925,7 +925,7 @@ $i18n_unknown = 'tw';
|
||||
@define('COMMENT_TOKENS_DESC', 'If tokens are used, comments can be approved and deleted by clicking the email links without requiring login access to the blog. Note that this is a convenience feature, and if your mails get hijacked, those people can approve/delete the referenced comment without further authentication.');
|
||||
@define('COMMENT_NOTOKENMATCH', 'Moderation link has expired or comment #%s has already been approved or deleted');
|
||||
@define('TRACKBACK_NOTOKENMATCH', 'Moderation link has expired or trackback #%s has already been approved or deleted');
|
||||
@define('BADTOKEN', 'Invalid Moderation Link');
|
||||
@define('BADTOKEN', 'Invalid Moderation Link');
|
||||
|
||||
@define('CONFIRMATION_MAIL_ALWAYS', "Hello %s,\n\nYou have sent a new comment to \"%s\". Your comment was:\n\n%s\n\nThe owner of the blog has enabled mail verification, so you need to click on the following link to authenticate your comment:\n<%s>\n");
|
||||
@define('CONFIRMATION_MAIL_ONCE', "Hello %s,\n\nYou have sent a new comment to \"%s\". Your comment was:\n\n%s\n\nThe owner of the blog has enabled one-time mail verification, so you need to click on the following link to authenticate your comment:\n<%s>\n\nAfter you have done that, you can always post comments on that blog with your username and e-mail address without receiving such notifications.");
|
||||
|
@ -2,7 +2,7 @@
|
||||
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
|
||||
# All rights reserved. See LICENSE file for licensing details
|
||||
# Translated by CapriSkye <admin@capriskye.com>
|
||||
# http://open.38.com
|
||||
# http://open.38.com
|
||||
/* vim: set sts=4 ts=4 expandtab : */
|
||||
|
||||
@define('LANG_CHARSET', 'UTF-8');
|
||||
|
@ -2,8 +2,8 @@
|
||||
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
|
||||
# All rights reserved. See LICENSE file for licensing details
|
||||
# Translated by
|
||||
# (c) 2006 Aphonex Li <aphonex.li@gmail.com>
|
||||
# http://www.cexten.com
|
||||
# (c) 2006 Aphonex Li <aphonex.li@gmail.com>
|
||||
# http://www.cexten.com
|
||||
/* vim: set sts=4 ts=4 expandtab : */
|
||||
|
||||
@define('LANG_CHARSET', 'UTF-8');
|
||||
@ -630,8 +630,8 @@
|
||||
@define('ENTRY_PUBLISHED_FUTURE', '这篇文章未公开'); // Translate
|
||||
@define('ENTRIES_BY', '作者 %s'); // Translate
|
||||
@define('PREVIOUS', '上一页'); // Translate
|
||||
@define('NEXT', '下一页');
|
||||
@define('APPROVE', '审核');
|
||||
@define('NEXT', '下一页');
|
||||
@define('APPROVE', '审核');
|
||||
|
||||
@define('DO_MARKUP_DESCRIPTION', '套用自动化格式到文章内 (表情, 符号 *, /, _, ...)。关闭这项功能将会保存任何文章内出现的 HTML 语法。');
|
||||
@define('CATEGORY_ALREADY_EXIST', '类别 "%s" 已经存在');
|
||||
@ -815,7 +815,7 @@
|
||||
@define('AUTHORS_SHOW_ARTICLE_COUNT_DESC', '如果开启这个设定,作者的文章会显示在名称旁。');
|
||||
@define('CUSTOM_ADMIN_INTERFACE', '可用自订的管理界面');
|
||||
|
||||
@define('COMMENT_NOT_ADDED', '你的回复不能加入因为这篇文章不允许回复,输入了错误信息,或不通过垃圾管理。');
|
||||
@define('COMMENT_NOT_ADDED', '你的回复不能加入因为这篇文章不允许回复,输入了错误信息,或不通过垃圾管理。');
|
||||
@define('INSTALL_TRACKREF', '记录来源');
|
||||
@define('INSTALL_TRACKREF_DESC', '开启记录来源会显示那个网站引用了你的文章。你可以关闭这个功能如果你收到太多垃圾广告。');
|
||||
@define('CATEGORIES_HIDE_PARENT', '隐藏选择的类别');
|
||||
@ -922,7 +922,7 @@
|
||||
@define('COMMENT_TOKENS_DESC', 'If tokens are used, comments can be approved and deleted by clicking the email links without requiring login access to the blog. Note that this is a convenience feature, and if your mails get hijacked, those people can approve/delete the referenced comment without further authentication.');
|
||||
@define('COMMENT_NOTOKENMATCH', 'Moderation link has expired or comment #%s has already been approved or deleted');
|
||||
@define('TRACKBACK_NOTOKENMATCH', 'Moderation link has expired or trackback #%s has already been approved or deleted');
|
||||
@define('BADTOKEN', 'Invalid Moderation Link');
|
||||
@define('BADTOKEN', 'Invalid Moderation Link');
|
||||
|
||||
@define('CONFIRMATION_MAIL_ALWAYS', "Hello %s,\n\nYou have sent a new comment to \"%s\". Your comment was:\n\n%s\n\nThe owner of the blog has enabled mail verification, so you need to click on the following link to authenticate your comment:\n<%s>\n");
|
||||
@define('CONFIRMATION_MAIL_ONCE', "Hello %s,\n\nYou have sent a new comment to \"%s\". Your comment was:\n\n%s\n\nThe owner of the blog has enabled one-time mail verification, so you need to click on the following link to authenticate your comment:\n<%s>\n\nAfter you have done that, you can always post comments on that blog with your username and e-mail address without receiving such notifications.");
|
||||
|
@ -37,11 +37,11 @@ while(($file = readdir($d)) !== false) {
|
||||
if ($file[0] == '.') {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (!is_dir($base . '/' . $file)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$tfile = $base . '/' . $file . '/lang_en.inc.php';
|
||||
$sfile = $base . '/' . $file . '/lang_' . $lang . '.inc.php';
|
||||
|
||||
@ -56,14 +56,14 @@ while(($file = readdir($d)) !== false) {
|
||||
echo "NOTICE: English language of $file does not exist.\n";
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (file_exists($sfile)) {
|
||||
echo "Parsing differences for $file - ";
|
||||
include $sfile;
|
||||
$current = get_defined_constants();
|
||||
$const['missing'][$file] = array_diff($current, $const['checked']);
|
||||
$const['checked'] = array_merge($const['checked'], $current);
|
||||
|
||||
|
||||
echo count($const['missing'][$file]) . " missing constants.\n";
|
||||
} else {
|
||||
$const['missing'][$file] = $const['native'][$file];
|
||||
@ -109,7 +109,7 @@ foreach($const['missing'] AS $file => $constants) {
|
||||
@define('COMMENT_TOKENS_DESC', 'If tokens are used, comments can be approved and deleted by clicking the email links without requiring login access to the blog. Note that this is a convenience feature, and if your mails get hijacked, those people can approve/delete the referenced comment without further authentication.');
|
||||
@define('COMMENT_NOTOKENMATCH', 'Moderation link has expired or comment #%s has already been approved or deleted');
|
||||
@define('TRACKBACK_NOTOKENMATCH', 'Moderation link has expired or trackback #%s has already been approved or deleted');
|
||||
@define('BADTOKEN', 'Invalid Moderation Link');
|
||||
@define('BADTOKEN', 'Invalid Moderation Link');
|
||||
|
||||
@define('CONFIRMATION_MAIL_ALWAYS', "Hello %s,\n\nYou have sent a new comment to \"%s\". Your comment was:\n\n%s\n\nThe owner of the blog has enabled mail verification, so you need to click on the following link to authenticate your comment:\n<%s>\n");
|
||||
@define('CONFIRMATION_MAIL_ONCE', "Hello %s,\n\nYou have sent a new comment to \"%s\". Your comment was:\n\n%s\n\nThe owner of the blog has enabled one-time mail verification, so you need to click on the following link to authenticate your comment:\n<%s>\n\nAfter you have done that, you can always post comments on that blog with your username and e-mail address without receiving such notifications.");
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -249,7 +249,7 @@
|
||||
@define('PUBLISH', 'Julkaise');
|
||||
@define('PREVIEW', 'Esikatselu');
|
||||
@define('DATE', 'Päiväys');
|
||||
@define('DATE_FORMAT_2', 'Y-m-d H:i');
|
||||
@define('DATE_FORMAT_2', 'Y-m-d H:i');
|
||||
@define('DATE_INVALID', 'Päiväyksen muoto on virheellinen. Oikea muoto on VVVV-KK-PP TT:MM.');
|
||||
@define('CATEGORY_PLUGIN_DESC', 'Näyttää kategoriat.');
|
||||
@define('ALL_AUTHORS', 'Kaikki kirjoittajat');
|
||||
@ -630,60 +630,60 @@
|
||||
@define('NEXT', 'Seuraava');
|
||||
@define('APPROVE', 'Hyväksy');
|
||||
@define('DO_MARKUP_DESCRIPTION', 'Tee tekstille notaatiomuutokset (hymiöt, lyhennelmät käyttäen *, /, _, ...). Kieltämällä tämä säilyy HTML-koodi tekstissä sellaisenaan.');
|
||||
@define('CATEGORY_ALREADY_EXIST', 'Kategoria nimellä "%s" on jo olemassa');
|
||||
@define('IMPORT_NOTES', 'Huom:');
|
||||
@define('ERROR_FILE_FORBIDDEN', 'Et saa tuoda tiedostoja, joissa on interaktiivista sisältöä');
|
||||
@define('ADMIN', 'Ylläpito');
|
||||
@define('ADMIN_FRONTPAGE', 'Etusivu');
|
||||
@define('QUOTE', 'Lainaus');
|
||||
@define('IFRAME_SAVE', 'Serendipity tallettaa merkintääsi, luo paluuviitteitä ja suorittaaa mahdollisia XML-RPC kutsuja. Tässä voi vierähtää tovi..');
|
||||
@define('IFRAME_SAVE_DRAFT', 'Merkintäsi luonnos on talletettu.');
|
||||
@define('IFRAME_PREVIEW', 'Serendipity luo merkintäsi esikatseluversiota...');
|
||||
@define('IFRAME_WARNING', 'Selaimesi ei tue "iframe"ja. Muokkaa serendipity_config.inc.php tiedostoa ja aseta $serendipity[\'use_iframe\'] muuttujan arvoksi FALSE.');
|
||||
@define('CATEGORY_ALREADY_EXIST', 'Kategoria nimellä "%s" on jo olemassa');
|
||||
@define('IMPORT_NOTES', 'Huom:');
|
||||
@define('ERROR_FILE_FORBIDDEN', 'Et saa tuoda tiedostoja, joissa on interaktiivista sisältöä');
|
||||
@define('ADMIN', 'Ylläpito');
|
||||
@define('ADMIN_FRONTPAGE', 'Etusivu');
|
||||
@define('QUOTE', 'Lainaus');
|
||||
@define('IFRAME_SAVE', 'Serendipity tallettaa merkintääsi, luo paluuviitteitä ja suorittaaa mahdollisia XML-RPC kutsuja. Tässä voi vierähtää tovi..');
|
||||
@define('IFRAME_SAVE_DRAFT', 'Merkintäsi luonnos on talletettu.');
|
||||
@define('IFRAME_PREVIEW', 'Serendipity luo merkintäsi esikatseluversiota...');
|
||||
@define('IFRAME_WARNING', 'Selaimesi ei tue "iframe"ja. Muokkaa serendipity_config.inc.php tiedostoa ja aseta $serendipity[\'use_iframe\'] muuttujan arvoksi FALSE.');
|
||||
@define('NONE', 'ei yhtään');
|
||||
@define('USERCONF_CAT_DEFAULT_NEW_ENTRY', 'Uusien merkintöjen oletusasetukset');
|
||||
@define('UPGRADE', 'Päivitä');
|
||||
@define('UPGRADE_TO_VERSION', 'Päivitä versioon %s');
|
||||
@define('DELETE_DIRECTORY', 'Tuhoa hakemisto');
|
||||
@define('DELETE_DIRECTORY_DESC', 'Olet aikeissa tuhota hakemiston, jossa on media-tiedostoja, mahdollisesti sellaisia, jotka ovat käytössä merkinnöissäsi.');
|
||||
@define('FORCE_DELETE', 'Tuhoa hakemisto kaikkine tiedostoineen, mukaan lukien tiedostot, jotka eivät Serendipityn mielestä liity blogiisi');
|
||||
@define('CREATE_DIRECTORY', 'Luo hakemisto');
|
||||
@define('CREATE_NEW_DIRECTORY', 'Luo uusi hakemisto');
|
||||
@define('CREATE_DIRECTORY_DESC', 'Uusien media-tiedostohakemistojen luominen. Valitse nimi uudelle hakemistolle ja halutessasi sille päähakemisto.');
|
||||
@define('BASE_DIRECTORY', 'Juurihakemisto');
|
||||
@define('USERLEVEL_EDITOR_DESC', 'Toimittaja');
|
||||
@define('USERLEVEL_CHIEF_DESC', 'Päätoimittaja');
|
||||
@define('USERLEVEL_ADMIN_DESC', 'Ylläpitäjä');
|
||||
@define('USERCONF_USERLEVEL', 'Käyttäjätaso');
|
||||
@define('USERCONF_CAT_DEFAULT_NEW_ENTRY', 'Uusien merkintöjen oletusasetukset');
|
||||
@define('UPGRADE', 'Päivitä');
|
||||
@define('UPGRADE_TO_VERSION', 'Päivitä versioon %s');
|
||||
@define('DELETE_DIRECTORY', 'Tuhoa hakemisto');
|
||||
@define('DELETE_DIRECTORY_DESC', 'Olet aikeissa tuhota hakemiston, jossa on media-tiedostoja, mahdollisesti sellaisia, jotka ovat käytössä merkinnöissäsi.');
|
||||
@define('FORCE_DELETE', 'Tuhoa hakemisto kaikkine tiedostoineen, mukaan lukien tiedostot, jotka eivät Serendipityn mielestä liity blogiisi');
|
||||
@define('CREATE_DIRECTORY', 'Luo hakemisto');
|
||||
@define('CREATE_NEW_DIRECTORY', 'Luo uusi hakemisto');
|
||||
@define('CREATE_DIRECTORY_DESC', 'Uusien media-tiedostohakemistojen luominen. Valitse nimi uudelle hakemistolle ja halutessasi sille päähakemisto.');
|
||||
@define('BASE_DIRECTORY', 'Juurihakemisto');
|
||||
@define('USERLEVEL_EDITOR_DESC', 'Toimittaja');
|
||||
@define('USERLEVEL_CHIEF_DESC', 'Päätoimittaja');
|
||||
@define('USERLEVEL_ADMIN_DESC', 'Ylläpitäjä');
|
||||
@define('USERCONF_USERLEVEL', 'Käyttäjätaso');
|
||||
@define('USERCONF_USERLEVEL_DESC', 'Käyttäjätasoa käytetään määrittämän käyttäjän oikeudet tähän blogiin.');
|
||||
@define('USER_SELF_INFO', 'Kirjautuneena %s (%s)');
|
||||
@define('ADMIN_ENTRIES', 'Merkinnät');
|
||||
@define('RECHECK_INSTALLATION', 'Tarkista uudestaan');
|
||||
@define('IMAGICK_EXEC_ERROR', 'Suoritus epäonnistui: "%s", virhe: %s, paluuarvo: %d');
|
||||
@define('INSTALL_OFFSET_DESC', 'Anna aikaero sinun aikavyöhykkeesi ja palvelimen aikavyöhykkeen (palvelimella kello on nyt: %clock%) välillä');
|
||||
@define('UNMET_REQUIREMENTS', 'Edellytys: %s ei täyttynyt');
|
||||
@define('ADMIN_ENTRIES', 'Merkinnät');
|
||||
@define('RECHECK_INSTALLATION', 'Tarkista uudestaan');
|
||||
@define('IMAGICK_EXEC_ERROR', 'Suoritus epäonnistui: "%s", virhe: %s, paluuarvo: %d');
|
||||
@define('INSTALL_OFFSET_DESC', 'Anna aikaero sinun aikavyöhykkeesi ja palvelimen aikavyöhykkeen (palvelimella kello on nyt: %clock%) välillä');
|
||||
@define('UNMET_REQUIREMENTS', 'Edellytys: %s ei täyttynyt');
|
||||
@define('CHARSET', 'Merkistö');
|
||||
@define('AUTOLANG', 'Käytä lukijan selaimen kieltä oletuskielenä');
|
||||
@define('AUTOLANG_DESC', 'Jos otat tämän käyttöön, esitetään blogisi käyttöliittymä ja merkinnät käyttäjän selaimen kielellä, jos mahdollista.');
|
||||
@define('INSTALL_AUTODETECT_URL', 'Havaitse käytetty HTTP-isäntä automaattisesti');
|
||||
@define('INSTALL_AUTODETECT_URL_DESC', 'Jos valitset kyllä, Serendipity käyttää vierailijan käyttämäää HTTP-isäntänimeä BaseURL:ina. Tätä käyttämällä voit antaa blogillesi useamman verkkonimen ja käyttää samaa verkkonimeä kaikissa linkeissä, joita vierailija käyttää lukiessaan blogiasi.');
|
||||
@define('INSTALL_AUTODETECT_URL_DESC', 'Jos valitset kyllä, Serendipity käyttää vierailijan käyttämäää HTTP-isäntänimeä BaseURL:ina. Tätä käyttämällä voit antaa blogillesi useamman verkkonimen ja käyttää samaa verkkonimeä kaikissa linkeissä, joita vierailija käyttää lukiessaan blogiasi.');
|
||||
@define('CONVERT_HTMLENTITIES', 'Yritä konvertoida HTML-entiteetit automaattisesti?');
|
||||
@define('EMPTY_SETTING', 'Kentän "%s" syöte on epäkelpo!');
|
||||
@define('USERCONF_REALNAME', 'Nimi');
|
||||
@define('USERCONF_REALNAME_DESC', 'Kirjoittajan koko nimi. Tämä on se nimi, joka näytetään lukijoille');
|
||||
@define('HOTLINK_DONE', 'Tiedostoa linkitetään.<br />Tehty.');
|
||||
@define('ENTER_MEDIA_URL_METHOD', 'Hakutapa:');
|
||||
@define('ADD_MEDIA_BLAHBLAH_NOTE', 'Huom: Jos linkität kuvan toiselta palvelimelta tarvitset siihen luvan, jollei palvelin ole omasi. Linkittämällä voit käyttää kuvia tallettamatta niitä paikallisesti.');
|
||||
@define('MEDIA_HOTLINKED', 'Linkitetty palvelimelta');
|
||||
@define('FETCH_METHOD_IMAGE', 'Hae kuva palvelimellesi');
|
||||
@define('FETCH_METHOD_HOTLINK', 'Linkitä kohdepalvelimelta');
|
||||
@define('DELETE_HOTLINK_FILE', 'Poistettu linkitetty tiedosto nimeltä <b>%s</b>');
|
||||
@define('USERCONF_REALNAME', 'Nimi');
|
||||
@define('USERCONF_REALNAME_DESC', 'Kirjoittajan koko nimi. Tämä on se nimi, joka näytetään lukijoille');
|
||||
@define('HOTLINK_DONE', 'Tiedostoa linkitetään.<br />Tehty.');
|
||||
@define('ENTER_MEDIA_URL_METHOD', 'Hakutapa:');
|
||||
@define('ADD_MEDIA_BLAHBLAH_NOTE', 'Huom: Jos linkität kuvan toiselta palvelimelta tarvitset siihen luvan, jollei palvelin ole omasi. Linkittämällä voit käyttää kuvia tallettamatta niitä paikallisesti.');
|
||||
@define('MEDIA_HOTLINKED', 'Linkitetty palvelimelta');
|
||||
@define('FETCH_METHOD_IMAGE', 'Hae kuva palvelimellesi');
|
||||
@define('FETCH_METHOD_HOTLINK', 'Linkitä kohdepalvelimelta');
|
||||
@define('DELETE_HOTLINK_FILE', 'Poistettu linkitetty tiedosto nimeltä <b>%s</b>');
|
||||
@define('SYNDICATION_PLUGIN_SHOW_MAIL', 'Näytä sähköpostiosoitteet?');
|
||||
@define('IMAGE_MORE_INPUT', 'Lisää lisää kuvia');
|
||||
@define('BACKEND_TITLE', 'Lisätietoja laajennoksen omissa asetuksissa');
|
||||
@define('BACKEND_TITLE_FOR_NUGGET', 'Voit määrittää otsikon raapaleellesi käytettäväksi laajennosten asetuksissa. Hyödyllinen, mikäli käytät useampia raapaleita.');
|
||||
@define('CATEGORIES_ALLOW_SELECT', 'Saavatko vierailijat valita useampia kategorioita yhtäaikaisesti?');
|
||||
@define('CATEGORIES_ALLOW_SELECT_DESC', 'Jos sallit, katselijat voivat valita useamman kategorian katseltavaksi yhtäaikaisesti.');
|
||||
@define('BACKEND_TITLE', 'Lisätietoja laajennoksen omissa asetuksissa');
|
||||
@define('BACKEND_TITLE_FOR_NUGGET', 'Voit määrittää otsikon raapaleellesi käytettäväksi laajennosten asetuksissa. Hyödyllinen, mikäli käytät useampia raapaleita.');
|
||||
@define('CATEGORIES_ALLOW_SELECT', 'Saavatko vierailijat valita useampia kategorioita yhtäaikaisesti?');
|
||||
@define('CATEGORIES_ALLOW_SELECT_DESC', 'Jos sallit, katselijat voivat valita useamman kategorian katseltavaksi yhtäaikaisesti.');
|
||||
@define('PAGE_BROWSE_PLUGINS', 'Sivu (%s/%s), sisältää yhteensä %s laajennosta.');
|
||||
@define('INSTALL_CAT_PERMALINKS', 'Permalinkit');
|
||||
@define('INSTALL_CAT_PERMALINKS_DESC', 'Blogisi permalinkkien lausekkeiden määrittely. Suosittelemme, että käytät oletuksia; jos et, niin yritä sisällyttää lausekkeeseen %id% arvo estääksesi Serendipityä tekemästä tietokantahakua kohdeosoittetta varten.');
|
||||
@ -811,7 +811,7 @@
|
||||
@define('AUTHORS_SHOW_ARTICLE_COUNT_DESC', 'Kirjoitusten määrä näytetään suluissa kirjoittajan nimen perässä, jos valitset tämän.');
|
||||
@define('CUSTOM_ADMIN_INTERFACE', 'Muokkausliittymä käytettävissä');
|
||||
|
||||
@define('COMMENT_NOT_ADDED', 'Kommenttia ei lisätty, koska joko merkinnän kommentointi on kielletty, jokin antamasi tieto oli kelvoton tai kommenttisi katsottiin roskapostiksi. ');
|
||||
@define('COMMENT_NOT_ADDED', 'Kommenttia ei lisätty, koska joko merkinnän kommentointi on kielletty, jokin antamasi tieto oli kelvoton tai kommenttisi katsottiin roskapostiksi. ');
|
||||
@define('INSTALL_TRACKREF', 'Otetaanko viittajaseuranta käyttöön?');
|
||||
@define('INSTALL_TRACKREF_DESC', 'Viittajaseurannalla pidetään kirjaa merkintöihisi viittaavista linkeistä. Tätä usein väärinkäytetään "referrer-spam"-mäykseen. Hae googlesta selitys hakusanoilla: referrer spam.');
|
||||
@define('CATEGORIES_HIDE_PARENT', 'Piilota valittu kategoriavanhempi?');
|
||||
@ -921,7 +921,7 @@
|
||||
@define('COMMENT_TOKENS_DESC', 'If tokens are used, comments can be approved and deleted by clicking the email links without requiring login access to the blog. Note that this is a convenience feature, and if your mails get hijacked, those people can approve/delete the referenced comment without further authentication.');
|
||||
@define('COMMENT_NOTOKENMATCH', 'Moderation link has expired or comment #%s has already been approved or deleted');
|
||||
@define('TRACKBACK_NOTOKENMATCH', 'Moderation link has expired or trackback #%s has already been approved or deleted');
|
||||
@define('BADTOKEN', 'Invalid Moderation Link');
|
||||
@define('BADTOKEN', 'Invalid Moderation Link');
|
||||
|
||||
@define('CONFIRMATION_MAIL_ALWAYS', "Hello %s,\n\nYou have sent a new comment to \"%s\". Your comment was:\n\n%s\n\nThe owner of the blog has enabled mail verification, so you need to click on the following link to authenticate your comment:\n<%s>\n");
|
||||
@define('CONFIRMATION_MAIL_ONCE', "Hello %s,\n\nYou have sent a new comment to \"%s\". Your comment was:\n\n%s\n\nThe owner of the blog has enabled one-time mail verification, so you need to click on the following link to authenticate your comment:\n<%s>\n\nAfter you have done that, you can always post comments on that blog with your username and e-mail address without receiving such notifications.");
|
||||
|
@ -518,7 +518,7 @@ $i18n_filename_to = array('_', 'a', 'A', 'a', 'A', 'b', 'B', 'c', 'C', 'c', 'C
|
||||
@define('VIEW_COMMENT', 'Zobacz komentarz');
|
||||
@define('VIEW_ENTRY', 'Zobacz wpis');
|
||||
@define('DELETE_FILE_FAIL' , 'Usuwanie pliku <b>%s</b> nie powiodło się');
|
||||
@define('DELETE_THUMBNAIL', 'Usuniêto minturkê o nazwie <b>%s</b>');
|
||||
@define('DELETE_THUMBNAIL', 'Usuniêto minturkê o nazwie <b>%s</b>');
|
||||
@define('DELETE_FILE', 'Usunięto plik o nazwie <b>%s</b>');
|
||||
@define('ABOUT_TO_DELETE_FILE', 'Masz zamiar usunąc plik <b>%s</b><br />Jeśli w którymś z wpisów zostało zdefiniowane odwołanie do pliku, plik ten nie będzie więcej dla tego odwałania dostępny (link nie będzie działał prawidłowo).<br />Czy chcesz kontynuować?<br /><br />');
|
||||
@define('TRACKBACK_SENDING', 'Wysyłanie śladu do URI %s...');
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -2,7 +2,7 @@
|
||||
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
|
||||
# All rights reserved. See LICENSE file for licensing details
|
||||
# Translated by CapriSkye <admin@capriskye.com>
|
||||
# http://open.38.com
|
||||
# http://open.38.com
|
||||
/* vim: set sts=4 ts=4 expandtab : */
|
||||
|
||||
@define('LANG_CHARSET', 'UTF-8');
|
||||
|
@ -2,7 +2,7 @@
|
||||
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
|
||||
# All rights reserved. See LICENSE file for licensing details
|
||||
# Translated by CapriSkye <admin@capriskye.com>
|
||||
# http://open.38.com
|
||||
# http://open.38.com
|
||||
/* vim: set sts=4 ts=4 expandtab : */
|
||||
|
||||
@define('LANG_CHARSET', 'big5');
|
||||
|
@ -2,8 +2,8 @@
|
||||
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
|
||||
# All rights reserved. See LICENSE file for licensing details
|
||||
# Translated by
|
||||
# (c) 2006 Aphonex Li <aphonex.li@gmail.com>
|
||||
# http://www.cexten.com
|
||||
# (c) 2006 Aphonex Li <aphonex.li@gmail.com>
|
||||
# http://www.cexten.com
|
||||
/* vim: set sts=4 ts=4 expandtab : */
|
||||
|
||||
@define('LANG_CHARSET', 'gb2312');
|
||||
@ -630,8 +630,8 @@
|
||||
@define('ENTRY_PUBLISHED_FUTURE', '这篇文章未公开'); // Translate
|
||||
@define('ENTRIES_BY', '作者 %s'); // Translate
|
||||
@define('PREVIOUS', '上一页'); // Translate
|
||||
@define('NEXT', '下一页');
|
||||
@define('APPROVE', '审核');
|
||||
@define('NEXT', '下一页');
|
||||
@define('APPROVE', '审核');
|
||||
|
||||
@define('DO_MARKUP_DESCRIPTION', '套用自动化格式到文章内 (表情, 符号 *, /, _, ...)。关闭这项功能将会保存任何文章内出现的 HTML 语法。');
|
||||
@define('CATEGORY_ALREADY_EXIST', '类别 "%s" 已经存在');
|
||||
@ -815,7 +815,7 @@
|
||||
@define('AUTHORS_SHOW_ARTICLE_COUNT_DESC', '如果开启这个设定,作者的文章会显示在名称旁。');
|
||||
@define('CUSTOM_ADMIN_INTERFACE', '可用自订的管理界面');
|
||||
|
||||
@define('COMMENT_NOT_ADDED', '你的回复不能加入因为这篇文章不允许回复,输入了错误信息,或不通过垃圾管理。');
|
||||
@define('COMMENT_NOT_ADDED', '你的回复不能加入因为这篇文章不允许回复,输入了错误信息,或不通过垃圾管理。');
|
||||
@define('INSTALL_TRACKREF', '记录来源');
|
||||
@define('INSTALL_TRACKREF_DESC', '开启记录来源会显示那个网站引用了你的文章。你可以关闭这个功能如果你收到太多垃圾广告。');
|
||||
@define('CATEGORIES_HIDE_PARENT', '隐藏选择的类别');
|
||||
@ -922,7 +922,7 @@
|
||||
@define('COMMENT_TOKENS_DESC', 'If tokens are used, comments can be approved and deleted by clicking the email links without requiring login access to the blog. Note that this is a convenience feature, and if your mails get hijacked, those people can approve/delete the referenced comment without further authentication.');
|
||||
@define('COMMENT_NOTOKENMATCH', 'Moderation link has expired or comment #%s has already been approved or deleted');
|
||||
@define('TRACKBACK_NOTOKENMATCH', 'Moderation link has expired or trackback #%s has already been approved or deleted');
|
||||
@define('BADTOKEN', 'Invalid Moderation Link');
|
||||
@define('BADTOKEN', 'Invalid Moderation Link');
|
||||
|
||||
@define('CONFIRMATION_MAIL_ALWAYS', "Hello %s,\n\nYou have sent a new comment to \"%s\". Your comment was:\n\n%s\n\nThe owner of the blog has enabled mail verification, so you need to click on the following link to authenticate your comment:\n<%s>\n");
|
||||
@define('CONFIRMATION_MAIL_ONCE', "Hello %s,\n\nYou have sent a new comment to \"%s\". Your comment was:\n\n%s\n\nThe owner of the blog has enabled one-time mail verification, so you need to click on the following link to authenticate your comment:\n<%s>\n\nAfter you have done that, you can always post comments on that blog with your username and e-mail address without receiving such notifications.");
|
||||
|
@ -149,7 +149,7 @@ class serendipity_event_contentrewrite extends serendipity_event
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
preg_match('|^(.+)_([0-9]+)$|msU', $name, $switch);
|
||||
|
||||
|
@ -151,7 +151,7 @@ class serendipity_event_emoticate extends serendipity_event
|
||||
}
|
||||
|
||||
|
||||
function event_hook($event, &$bag, &$eventData, $addData = null) {
|
||||
function event_hook($event, &$bag, &$eventData, $addData = null) {
|
||||
global $serendipity;
|
||||
$hooks = &$bag->get('event_hooks');
|
||||
|
||||
|
@ -35,6 +35,6 @@
|
||||
@define('PLUGIN_EVENT_ENTRYPROPERTIES_CUSTOMFIELDS_DESC1', '你可以在你的博客模版中使用额外附加的自定义字段,从而将相关字段内容显示在页面上。你需要编辑entries.tpl这个模版文件,将Smarty标记( 例如{$entry.properties.ep_MyCustomField} )放在该模版文件中你想放置的合适位置,不过需要主意的是,要在每一个自定义字段前面添加前缀(prefix) ep_ 。');
|
||||
@define('PLUGIN_EVENT_ENTRYPROPERTIES_CUSTOMFIELDS_DESC2', '此处你可以输入一些自定义字段的名称,用逗号分割开来。这些自定义字段可以在任何一篇文章中被使用。不要在自定义字段的名称中使用特殊字符或空格。自定义字段的名称可以是 Customfield1, Customfield2 等等。 ' . PLUGIN_EVENT_ENTRYPROPERTIES_CUSTOMFIELDS_DESC1);
|
||||
@define('PLUGIN_EVENT_ENTRYPROPERTIES_CUSTOMFIELDS_DESC3', '可在“<a href="%s" target="_blank" title="' . PLUGIN_EVENT_ENTRYPROPERTIES_TITLE . '">配置插件</a>”中修改自定义字段。');
|
||||
|
||||
@define('PLUGIN_EVENT_ENTRYPROPERTIES_DISABLE_MARKUP', '禁止在此文章中使用标记语言方面的插件。');
|
||||
|
||||
@define('PLUGIN_EVENT_ENTRYPROPERTIES_DISABLE_MARKUP', '禁止在此文章中使用标记语言方面的插件。');
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
//Sticky post
|
||||
@define('PLUGIN_EVENT_ENTRYPROPERTIES_TITLE', 'Propiedades extendidas de las entradas');
|
||||
@define('PLUGIN_EVENT_ENTRYPROPERTIES_DESC', '(caché, artículos privados, sticky posts)');
|
||||
@define('PLUGIN_EVENT_ENTRYPROPERTIES_DESC', '(caché, artículos privados, sticky posts)');
|
||||
@define('PLUGIN_EVENT_ENTRYPROPERTIES_STICKYPOSTS', 'Marcar esta entrada como Sticky Post');
|
||||
@define('PLUGIN_EVENT_ENTRYPROPERTIES_ACCESS', 'Las entradas pueden ser leidas por');
|
||||
@define('PLUGIN_EVENT_ENTRYPROPERTIES_ACCESS_PRIVATE', 'Solamente el autor');
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
//Sticky post
|
||||
@define('PLUGIN_EVENT_ENTRYPROPERTIES_TITLE', 'Propriedades extra das entradas');
|
||||
@define('PLUGIN_EVENT_ENTRYPROPERTIES_DESC', '(cache, artigos privados, sticky posts)');
|
||||
@define('PLUGIN_EVENT_ENTRYPROPERTIES_DESC', '(cache, artigos privados, sticky posts)');
|
||||
@define('PLUGIN_EVENT_ENTRYPROPERTIES_STICKYPOSTS', 'Marcar esta entrada como Sticky Post');
|
||||
@define('PLUGIN_EVENT_ENTRYPROPERTIES_ACCESS', 'As entradas podem ser lidas por');
|
||||
@define('PLUGIN_EVENT_ENTRYPROPERTIES_ACCESS_PRIVATE', 'Eu próprio');
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user