Fix a lot of single issues and overhaul the language settings

see docs/NEWS and the plugin/changelog files for details
This commit is contained in:
Stephan Brunker 2019-10-13 22:49:03 +02:00
parent b10bbcc2e1
commit 502b837dd6
18 changed files with 730 additions and 596 deletions

View File

@ -1,3 +1,36 @@
* admin/personal.inc.php: removed setting of $_SESSION: serendipity_lang
(already set in serendipity_config.inc.php for all scenarios)
* compat.inc.php: function detectLanguage returns now NULL if
the detection failed, also doesn't change $serendipity['autolang']
anymore which remains 'en' as general fallback.
* functions.entries.php:
* function serendipity_printArchives() hooks now
into hook_event::'frontend_fetchentries' to get multilingual data,
also doesn't show months and years with zero entries.
* function fetchEntryCategories, fetchEntryData and fetchCategories
strips now data of multilingual tags
* plugin_api.inc.php: added function find_plugin_id which returns an
array of the ids of the installed instances of the given plugin
this is used for checking the configuration of that plugin in other
plugins
* functions.config.inc.php: function serendipity_load_configuration
sets the language back to 'autolang' (which is 'en') if the language
loaded does not exist. Also sets the value $serendipity['default_lang']
to the default language of the blog.
* functions.config.inc.php: removed the Cookie 'userDefLang' which is no
longer needed
* functions.config.inc.php: major rework of the functions
serendipity_getSessionLanguage and serendipity_getPostAuthSessionLanguage.
Those two functions should now process the user input via GET and POST,
store it into SESSION and COOKIE, and if no such input is given, fallback
to browser language negotiation and default language. More details in the
comments to that functions. $serendipity['detected_lang'] is the language
found from user input or browser negotiation.
* functions.routing.inc.php: fix some lookups from $_GET to $serendipity['GET']
* admin/plugins.inc.php: fix some lookups from $_GET to $serendipity['GET']
* created a new event hook 'multilingual_strip_langs' to strip tagged translation of elements
outside the sidebar (mostly categories in entry display).
Version 2.4-alpha1 ()
------------------------------------------------------------------------

View File

@ -104,11 +104,6 @@ if ($serendipity['GET']['adminAction'] == 'save' && serendipity_checkFormToken()
serendipity_updatePermalink($pl_data, 'author');
serendipity_plugin_api::hook_event('backend_users_edit', $pl_data);
}
if ($serendipity['authorid'] === $_SESSION['serendipityAuthorid']) {
if (is_null($serendipity['detected_lang'])) {
$_SESSION['serendipityLanguage'] = $serendipity['lang'];
}
}
$from = $_POST;
}
}

View File

@ -18,9 +18,9 @@ if (!class_exists('Smarty')) {
include_once SMARTY_DIR . 'Smarty.class.php';
}
if (isset($_GET['serendipity']['plugin_to_move']) && isset($_GET['submit']) && serendipity_checkFormToken()) {
if (isset($serendipity['GET']['plugin_to_move']) && isset($serendipity['GET']['submit']) && serendipity_checkFormToken()) {
if (isset($_GET['serendipity']['event_plugin'])) {
if (isset($serendipity['GET']['event_plugin'])) {
$plugins = serendipity_plugin_api::enum_plugins('event', false);
} else {
$plugins = serendipity_plugin_api::enum_plugins('event', true);
@ -32,7 +32,7 @@ if (isset($_GET['serendipity']['plugin_to_move']) && isset($_GET['submit']) && s
for($idx = 0; $idx < count($plugins); $idx++) {
$plugins[$idx]['sort_order'] = $idx;
if ($plugins[$idx]['name'] == $_GET['serendipity']['plugin_to_move']) {
if ($plugins[$idx]['name'] == $serendipity['GET']['plugin_to_move']) {
$idx_to_move = $idx;
}
}
@ -60,10 +60,10 @@ if (isset($_GET['serendipity']['plugin_to_move']) && isset($_GET['submit']) && s
It's a behavior which really has no meaning. */
}
if (isset($_GET['serendipity']['plugin_to_conf'])) {
if (isset($serendipity['GET']['plugin_to_conf'])) {
/* configure a specific instance */
$plugin =& serendipity_plugin_api::load_plugin($_GET['serendipity']['plugin_to_conf']);
$plugin =& serendipity_plugin_api::load_plugin($serendipity['GET']['plugin_to_conf']);
if (!($plugin->protected === FALSE || $plugin->serendipity_owner == '0' || $plugin->serendipity_owner == $serendipity['authorid'] || serendipity_checkPermission('adminPluginsMaintainOthers'))) {
return;

View File

@ -464,14 +464,15 @@ function serendipity_detectLang($use_include = false) {
if (in_array($preferred_language, $supported_languages)) {
if ($use_include) {
@include_once(S9Y_INCLUDE_PATH . 'lang/' . $charset . 'serendipity_lang_' . $preferred_language . '.inc.php');
$serendipity['autolang'] = $preferred_language;
//$serendipity['autolang'] = $preferred_language; -> according to the documentation, it should remain on 'en'
}
return $preferred_language;
} // endif
} // endforeach
} // endif
return $serendipity['lang'];
// negotiation failed
return null;
}
/**

View File

@ -328,10 +328,17 @@ function serendipity_load_configuration($author = null) {
$serendipity['baseURL'] = $serendipity['defaultBaseURL'];
}
// Store default language
// check language selection or fallback
if (isset($serendipity['lang']) && !isset($serendipity['languages'][$serendipity['lang']])) {
$serendipity['lang'] = $serendipity['autolang'];
}
if (empty($author)) {
$serendipity['default_lang'] = $serendipity['lang'];
}
}
/**
* Perform logout functions (destroys session data)
*
@ -661,7 +668,6 @@ function serendipity_load_userdata($username) {
$_SESSION['serendipityHashType'] = $serendipity['serendipityHashType'] = $row['hashtype'];
serendipity_load_configuration($serendipity['authorid']);
serendipity_setCookie('userDefLang', $serendipity['lang'], false);
return true;
}
@ -989,73 +995,96 @@ function serendipity_header($header) {
* having loaded the right language.
* Find a way to let plugins hook into that sequence :-)
*
* Rules of precedence:
* active user selection:
* 1. POST 'user_language' from plugin_multilingual sidebar dropdown
* 2. GET 'user_language' from article footer with option 'force full lanugage switch'
*
* prior user selection:
* 3. $_SESSION 'serendipityLanguage' from the running browser session
* 4. $_COOKIE 'serendipityLanguage' new session - user precedence
*
* no user selection:
* 5. new user - browser autodetect with serendipity_detectLang()
* 6. blog language from serendipity_load_configuration() - prior value of $serendipity['lang']
*
* or if a user is logged in
* 6. user language from serendipity_load_configuration(user) -> handled with a later call to
* serendipity_getPostAuthSessionLanguage()
* 8. default language
*
* @access public
* @return string Returns the name of the selected language.
*/
function serendipity_getSessionLanguage() {
global $serendipity;
// DISABLE THIS!
/*
if ($_SESSION['serendipityAuthedUser']) {
serendipity_header('X-Serendipity-InterfaceLangSource: Database');
return $serendipity['lang'];
}
*/
if (isset($serendipity['lang']) && !isset($serendipity['languages'][$serendipity['lang']])) {
$serendipity['lang'] = $serendipity['autolang'];
}
if (isset($_REQUEST['user_language']) && (!empty($serendipity['languages'][$_REQUEST['user_language']])) && !headers_sent()) {
serendipity_setCookie('serendipityLanguage', $_REQUEST['user_language'], false);
}
if (isset($serendipity['COOKIE']['serendipityLanguage'])) {
if ($serendipity['expose_s9y']) serendipity_header('X-Serendipity-InterfaceLangSource: Cookie');
$lang = $serendipity['COOKIE']['serendipityLanguage'];
} elseif (isset($serendipity['GET']['lang_selected']) && !empty($serendipity['languages'][$serendipity['GET']['lang_selected']])) {
// try POST
if (isset($serendipity['POST']['user_language']) && !empty($serendipity['languages'][$serendipity['POST']['user_language']])) {
$lang = $serendipity['POST']['user_language'];
if ($serendipity['expose_s9y']) serendipity_header('X-Serendipity-InterfaceLangSource: POST');
// try GET
} elseif (isset($serendipity['GET']['user_language']) && !empty($serendipity['languages'][$serendipity['GET']['user_language']])) {
$lang = $serendipity['GET']['user_language'];
if ($serendipity['expose_s9y']) serendipity_header('X-Serendipity-InterfaceLangSource: GET');
$lang = $serendipity['GET']['lang_selected'];
} elseif (serendipity_db_bool($serendipity['lang_content_negotiation'])) {
if ($serendipity['expose_s9y']) serendipity_header('X-Serendipity-InterfaceLangSource: Content-Negotiation');
$lang = serendipity_detectLang();
}
// save user selection into COOKIE and SESSION
if (isset($lang) && !headers_sent()) {
serendipity_setCookie('serendipityLanguage', $lang, false);
$serendipity['COOKIE']['serendipityLanguage'] = $lang;
}
if (isset($lang)) {
$serendipity['detected_lang'] = $lang;
} else {
if (! empty($_SESSION['serendipityLanguage'])) {
$_SESSION['serendipityLanguage'] = $lang;
}
// no active user selection, fall back to saved prior selections
if (!isset($lang)) {
// try SESSION
if (isset($_SESSION['serendipityLanguage']) && !empty($serendipity['languages'][$_SESSION['serendipityLanguage']])) {
$lang = $_SESSION['serendipityLanguage'];
} else {
if (isset($serendipity['COOKIE']['userDefLang']) && ! empty($serendipity['COOKIE']['userDefLang'])) {
$lang = $serendipity['COOKIE']['userDefLang'];
} else {
if ($serendipity['lang']) {
if ($serendipity['expose_s9y']) serendipity_header('X-Serendipity-InterfaceLangSource: SESSION');
// try COOKIE
} elseif (isset($serendipity['COOKIE']['serendipityLanguage']) && !empty($serendipity['languages'][$serendipity['COOKIE']['serendipityLanguage']])) {
$lang = $serendipity['COOKIE']['serendipityLanguage'];
if ($serendipity['expose_s9y']) serendipity_header('X-Serendipity-InterfaceLangSource: COOKIE');
// try Browser language negotiation
} elseif (serendipity_db_bool($serendipity['lang_content_negotiation'])) {
$lang = serendipity_detectLang(); // returns negotiated language
if (!empty($lang) && $serendipity['expose_s9y']) serendipity_header('X-Serendipity-InterfaceLangSource: Content-Negotiation');
}
// cache the result
if ($lang) $serendipity['detected_lang'] = $lang;
// try configuration: blog default language
if (empty($lang) && $serendipity['lang']) {
$lang = $serendipity['lang'];
} else {
// serendipity_load_configuration() failed to load language, go default
if ($serendipity['expose_s9y']) serendipity_header('X-Serendipity-InterfaceLangSource: Configuration');
}
// if everthing failed, fall back to autolang which is still 'en' because detectLang failed too
if (empty($lang)) {
$lang = $serendipity['autolang'];
}
}
}
$serendipity['detected_lang'] = null;
}
if (!isset($serendipity['languages'][$lang])) {
$serendipity['detected_lang'] = null;
return $serendipity['lang'];
} else {
$_SESSION['serendipityLanguage'] = $lang;
if (!is_null($serendipity['detected_lang'])) {
if ($serendipity['expose_s9y']) serendipity_header('X-Serendipity-InterfaceLang: ' . $lang);
}
// cache the result
if ($lang) $serendipity['detected_lang'] = $lang;
}
// save the result into SESSION
if ($lang) $_SESSION['serendipityLanguage'] = $lang;
if ($serendipity['expose_s9y']) serendipity_header('X-Serendipity-InterfaceLang: ' . $lang);
return $lang;
}
/**
* Gets the selected language from personal configuration if needed
* if getSessionLanguage detected a language by user selection or browser negotiation, it has priority
*
* This function also sets HTTP Headers and cookies to contain the language for follow-up requests
*
@ -1065,29 +1094,20 @@ function serendipity_getSessionLanguage() {
function serendipity_getPostAuthSessionLanguage() {
global $serendipity;
if (! is_null($serendipity['detected_lang'])) {
return $serendipity['detected_lang'];
}
// cached result from getSessionLanguage()
if (!empty($serendipity['detected_lang']) && !defined('IN_serendipity_admin')) return $serendipity['detected_lang'];
// if that returned the fallback language, try user default language or fallback
if ($_SESSION['serendipityAuthedUser']) {
if ($serendipity['expose_s9y']) serendipity_header('X-Serendipity-InterfaceLangSource: Database');
$lang = $serendipity['lang'];
} else {
$lang = (isset($_SESSION['serendipityLanguage'])) ? $_SESSION['serendipityLanguage'] : $serendipity['lang'];
}
if (!isset($serendipity['languages'][$lang])) {
$lang = $serendipity['lang'];
$lang = $serendipity['lang']; //$serendipity['lang'] is overwritten by load_configuration(user) and points to the user default language
}
// save the result into SESSION
$_SESSION['serendipityLanguage'] = $lang;
if ($serendipity['expose_s9y']) serendipity_header('X-Serendipity-InterfaceLang: ' . $lang);
if ($lang != $serendipity['lang']) {
$serendipity['content_lang'] = $lang;
}
return $lang;
}

View File

@ -146,10 +146,15 @@ function &serendipity_fetchEntryCategories($entryid) {
ORDER BY c.category_name ASC";
$cat =& serendipity_db_query($query);
if (!is_array($cat)) {
$arr = array();
return $arr;
} else {
foreach ($cat as $key => $catdata) {
serendipity_plugin_api::hook_event('multilingual_strip_langs',$cat[$key]['category_name']);
serendipity_plugin_api::hook_event('multilingual_strip_langs',$cat[$key]['category_description']);
}
return $cat;
}
}
@ -511,6 +516,8 @@ function serendipity_fetchEntryData(&$ret) {
if (is_array($search_ret)) {
foreach($search_ret AS $i => $entry) {
serendipity_plugin_api::hook_event('multilingual_strip_langs',$entry['category_name']);
serendipity_plugin_api::hook_event('multilingual_strip_langs',$entry['category_description']);
$ret[$assoc_ids[$entry['entryid']]]['categories'][] = $entry;
}
}
@ -722,9 +729,16 @@ function &serendipity_fetchCategories($authorid = null, $name = null, $order = n
$flat_cats = array();
$flat_cats[0] = NO_CATEGORY;
foreach($cats AS $catidx => $catdata) {
serendipity_plugin_api::hook_event('multilingual_strip_langs', $catdata['category_name']);
$flat_cats[$catdata['categoryid']] = str_repeat('&nbsp;', $catdata['depth']*2) . serendipity_specialchars($catdata['category_name']);
}
return $flat_cats;
} else {
foreach ($ret as $key => $catdata) {
serendipity_plugin_api::hook_event('multilingual_strip_langs',$ret[$key]['category_name']);
serendipity_plugin_api::hook_event('multilingual_strip_langs',$ret[$key]['category_description']);
}
return $ret;
}
}
return $ret;
@ -1659,18 +1673,25 @@ function serendipity_printArchives() {
$distinct = '';
}
// if another language than default is selected and hide option is set, hide untranslated articles
$sql_condition = array();
serendipity_plugin_api::hook_event('frontend_fetchentries', $sql_condition);
$q = "SELECT $distinct e.timestamp
FROM {$serendipity['dbPrefix']}entries e
" . (!empty($cat_sql) ? "
LEFT JOIN {$serendipity['dbPrefix']}entrycat ec
ON e.id = ec.entryid
LEFT JOIN {$serendipity['dbPrefix']}category c
ON ec.categoryid = c.categoryid" : "") . "
WHERE isdraft = 'false'"
ON ec.categoryid = c.categoryid" : "") .
$sql_condition['joins'] .
" WHERE isdraft = 'false'"
. $sql_condition['and']
. (!serendipity_db_bool($serendipity['showFutureEntries']) ? " AND timestamp <= " . serendipity_db_time() : '')
. (!empty($cat_sql) ? ' AND ' . $cat_sql : '')
. (!empty($serendipity['GET']['viewAuthor']) ? ' AND e.authorid = ' . (int)$serendipity['GET']['viewAuthor'] : '')
. (!empty($cat_sql) ? " GROUP BY e.id, e.timestamp" : '');
$entries =& serendipity_db_query($q, false, 'assoc');
$group = array();
@ -1682,7 +1703,7 @@ function serendipity_printArchives() {
$output = array();
for ($y = $thisYear; $y >= $lastYear; $y--) {
$output[$y]['year'] = $y;
for ($m = 12; $m >= 1; $m--) {
/* If the month we are checking are in the future, we drop it */
@ -1710,6 +1731,10 @@ function serendipity_printArchives() {
$entry_count = (int)$group[$y . (strlen($m) == 1 ? '0' : '') . $m];
if ($entry_count > 0) {
if (!array_key_exists($y,$output)) $output[$y]['year'] = $y;
/* A silly hack to get the maximum amount of entries per month */
if ($entry_count > $max) {
$max = $entry_count;
@ -1721,6 +1746,7 @@ function serendipity_printArchives() {
$data['link_summary'] = serendipity_archiveDateUrl($y . '/'. sprintf('%02s', $m) . $cat_get . $author_get, true);
$data['date'] = $s;
$output[$y]['months'][] = $data;
}
}
}

View File

@ -47,7 +47,7 @@ function locateHiddenVariables($_args) {
} elseif ($v[0] == 'A') { /* Author */
$url_author = substr($v, 1);
if (is_numeric($url_author)) {
$serendipity['GET']['viewAuthor'] = $_GET['viewAuthor'] = (int)$url_author;
$serendipity['GET']['viewAuthor'] = (int)$url_author;
unset($_args[$k]);
}
} elseif ($v == 'summary') { /* Summary */
@ -366,8 +366,8 @@ function serveEntry($matches) {
$id = false;
}
$_GET['serendipity']['action'] = 'read';
$_GET['serendipity']['id'] = $id;
$serendipity['GET']['action'] = 'read';
$serendipity['GET']['id'] = $id;
$title = serendipity_db_query("SELECT title FROM {$serendipity['dbPrefix']}entries WHERE id=$id AND isdraft = 'false' " . (!serendipity_db_bool($serendipity['showFutureEntries']) ? " AND timestamp <= " . serendipity_db_time() : ''), true);
if (is_array($title)) {

View File

@ -93,7 +93,7 @@ function errorHandlerCreateDOM(htmlStr) {
case 'backend_save':
case 'backend_publish':
// this is preview_iframe.tpl updertHooks [ NOT ONLY!! See freetags ]
if ($_GET['serendipity']['is_iframe'] == 'true' && $_GET['serendipity']['iframe_mode'] == 'save') {
if ($serendipity['GET']['is_iframe'] == 'true' && $serendipity['GET']['iframe_mode'] == 'save') {
echo "\n".'<script>document.addEventListener("DOMContentLoaded", function() { window.parent.serendipity.eraseEntryEditorCache(); });</script>'."\n";
}
break;
@ -263,6 +263,8 @@ class serendipity_plugin_api
}
serendipity_db_query("DELETE FROM {$serendipity['dbPrefix']}config where name LIKE '$plugin_instance_id/%'");
return;
}
/**
@ -1204,6 +1206,46 @@ class serendipity_plugin_api
return $instance;
}
/**
* Find the plugin instances for a given classname
*
* @access public
* @param string The classname of the plugin
* @param int The owner author
* @param boolean ignore hidden (deactivated) plugins
* @return object Array with ids of the installed plugin
*/
static function find_plugin_id($plugin_name,$authorid = 0, $ignore_hidden = true) {
global $serendipity;
$sql = "SELECT * from {$serendipity['dbPrefix']}plugins ";
$where = array();
$where[] = "(name LIKE '@" . serendipity_db_escape_string($plugin_name) . "%' OR name LIKE '" . serendipity_db_escape_string($plugin_name) . "%') ";
$where[] = "authorid='" . serendipity_db_escape_string($authorid) . "' ";
if ($ignore_hidden) $where[] = "NOT ( placement = 'hidden' OR placement = 'eventh') ";
if (count($where) > 0) {
$sql .= ' WHERE ' . implode(' AND ', $where);
}
$rs = serendipity_db_query($sql,false,'assoc');
$ids = array();
if (!empty($rs) & is_Array($rs)) {
foreach($rs as $line) {
$ex = explode(':',$line['name']);
$ids[] = $ex[1];
}
return $ids;
} else {
return null;
}
}
/**
* Probe for a language include with constants. Still include defines later on, if some constants were missing

View File

@ -1,3 +1,9 @@
1.41.4:
-------
* removed 'WHERE' keyword from fetchentries event hook, because that should be handled
by the issuing sql
1.41.3:
-------
* Add missing English language constant.

View File

@ -19,7 +19,7 @@ class serendipity_event_entryproperties extends serendipity_event
$propbag->add('description', PLUGIN_EVENT_ENTRYPROPERTIES_DESC);
$propbag->add('stackable', false);
$propbag->add('author', 'Garvin Hicking');
$propbag->add('version', '1.41.3');
$propbag->add('version', '1.41.4');
$propbag->add('requirements', array(
'serendipity' => '1.6',
'smarty' => '2.6.27',
@ -915,9 +915,7 @@ class serendipity_event_entryproperties extends serendipity_event
if (count($conds) > 0) {
$cond = implode(' AND ', $conds);
if (empty($eventData['and'])) {
$eventData['and'] = " WHERE $cond ";
} else {
if (!empty($eventData['and'])) {
$eventData['and'] .= " AND $cond ";
}
}
@ -934,7 +932,7 @@ class serendipity_event_entryproperties extends serendipity_event
$conds[] = 'ep_cache_body.value AS ep_cache_body,';
}
$cond = implode("\n", $conds);
$cond = implode("\n", $conds) . "\n";
if (empty($eventData['addkey'])) {
$eventData['addkey'] = $cond;
} else {

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,8 @@
2.38.2
-------
* Fix a call to NULL if no connection to the repositiory could
be archieved.
2.38.1:
-------
* Fix count_plugin_upgrades():

View File

@ -27,7 +27,7 @@ class serendipity_event_spartacus extends serendipity_event
$propbag->add('description', PLUGIN_EVENT_SPARTACUS_DESC);
$propbag->add('stackable', false);
$propbag->add('author', 'Garvin Hicking');
$propbag->add('version', '2.38.1');
$propbag->add('version', '2.38.2');
$propbag->add('requirements', array(
'serendipity' => '1.6',
));
@ -457,7 +457,7 @@ class serendipity_event_spartacus extends serendipity_event
$resolved_url = $url . ' (IP ' . $url_ip . ')';
$this->outputMSG('error', sprintf(PLUGIN_EVENT_SPARTACUS_FETCHERROR, $resolved_url));
//--JAM: START FIREWALL DETECTION
if ($response->getStatus()) {
if ((isset($response) && $response->getStatus())) {
$this->outputMSG('error', sprintf(PLUGIN_EVENT_SPARTACUS_REPOSITORY_ERROR, $response->getStatus()));
}
$check_health = true;

View File

@ -0,0 +1,2 @@
2.05.2
* Strip the translation tags in the category links if multilingual plugin is active

View File

@ -15,7 +15,7 @@ class serendipity_plugin_categories extends serendipity_plugin
$propbag->add('description', CATEGORY_PLUGIN_DESC);
$propbag->add('stackable', true);
$propbag->add('author', 'Serendipity Team');
$propbag->add('version', '2.05.2');
$propbag->add('version', '2.05.3');
$propbag->add('configuration', array('title', 'authorid', 'parent_base', 'hide_parent', 'image', 'sort_order', 'sort_method', 'allow_select', 'hide_parallel', 'show_count', 'show_all', 'smarty'));
$propbag->add('groups', array('FRONTEND_VIEWS'));
}
@ -255,6 +255,9 @@ class serendipity_plugin_categories extends serendipity_plugin
}
}
// strip language tags if multilingual plugin is active
serendipity_plugin_api::hook_event('multilingual_strip_langs',$cat['category_name']);
$categories[$cid]['feedCategoryURL'] = serendipity_feedCategoryURL($cat, 'serendipityHTTPPath');
$categories[$cid]['categoryURL'] = serendipity_categoryURL($cat, 'serendipityHTTPPath');
$categories[$cid]['paddingPx'] = $cat['depth']*6;

View File

@ -0,0 +1,4 @@
2.7
* using the sql condition set aquired by event_hook::'frontend_fetchentries'
to get the multilingual data set
* $this->title (= title in backend) set to plugin name

View File

@ -15,13 +15,11 @@ class serendipity_plugin_recententries extends serendipity_plugin
function introspect(&$propbag)
{
$this->title = $this->get_config('title', $this->title);
$propbag->add('name', PLUGIN_RECENTENTRIES_TITLE);
$propbag->add('description', PLUGIN_RECENTENTRIES_BLAHBLAH);
$propbag->add('stackable', true);
$propbag->add('author', 'Christian Machmeier, Christian Brabandt, Judebert, Don Chambers');
$propbag->add('version', '2.6');
$propbag->add('version', '2.7');
$propbag->add('requirements', array(
'serendipity' => '1.6',
'smarty' => '2.6.7',
@ -212,16 +210,16 @@ class serendipity_plugin_recententries extends serendipity_plugin
$sql_condition['joins'] = ' LEFT OUTER JOIN ' . $serendipity['dbPrefix'] . 'entrycat AS ec ON id = ec.entryid ' . $sql_condition['joins'];
}
// get 'hide untranslated entries' option from multilingual plugin via SQL
serendipity_plugin_api::hook_event('frontend_fetchentries', $sql_condition, array('noSticky' => true));
$sql_condition['addkey'] = rtrim($sql_condition['addkey'],",\n") . "\n";
$entries_query = "SELECT DISTINCT id,
title,
timestamp,
epm.value AS multilingual_title
{$sql_condition['addkey']}
FROM {$serendipity['dbPrefix']}entries AS e
{$sql_condition['joins']}
LEFT OUTER JOIN {$serendipity['dbPrefix']}entryproperties AS epm
ON (epm.entryid = e.id AND epm.property = 'multilingual_title_" . $serendipity['lang'] . "')
WHERE isdraft = 'false' {$sql_condition['and']}
$sql_order
$sql_number";

View File

@ -14,7 +14,7 @@ class serendipity_plugin_superuser extends serendipity_plugin
$propbag->add('description', ALLOWS_YOU_BLAHBLAH);
$propbag->add('stackable', false);
$propbag->add('author', 'Serendipity Team');
$propbag->add('version', '1.1');
$propbag->add('version', '1.1.1');
$propbag->add('configuration', array('https'));
$propbag->add('groups', array('FRONTEND_FEATURES'));
}
@ -46,7 +46,8 @@ class serendipity_plugin_superuser extends serendipity_plugin
$base = $serendipity['serendipityHTTPPath'];
}
$link = $base . ($serendipity['rewrite'] == 'none' ? $serendipity['indexFile'] .'?/' : '') . PATH_ADMIN;
//$link = $base . ($serendipity['rewrite'] == 'none' ? $serendipity['indexFile'] .'?/' : '') . PATH_ADMIN;
$link = $base . 'serendipity_admin.php';
$text = (($_SESSION['serendipityAuthedUser'] === true) ? SUPERUSER_OPEN_ADMIN : SUPERUSER_OPEN_LOGIN);
echo '<a href="' . $link . '" rel="nofollow" title="'. $text .'">'. $text .'</a>';
}