Skip to content

Instantly share code, notes, and snippets.

@cmb69
Last active January 17, 2018 17:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmb69/6f2823d13ffecc516f9341ade13e2b7e to your computer and use it in GitHub Desktop.
Save cmb69/6f2823d13ffecc516f9341ade13e2b7e to your computer and use it in GitHub Desktop.
Startseite – kein DC
cmsimple/classes/Search.php | 6 +++++-
cmsimple/functions.php | 6 ++++--
cmsimple/tplfuncs.php | 13 +++++++++++--
3 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/cmsimple/classes/Search.php b/cmsimple/classes/Search.php
index 1b5b458..6785cf4 100644
--- a/cmsimple/classes/Search.php
+++ b/cmsimple/classes/Search.php
@@ -214,7 +214,11 @@ class Search
$pageData = $pd_router->find_page($i);
$site = isset($pageData['title']) ? $pageData['title'] : '';
$title = XH_title($site, $h[$i]);
- $url = $sn . '?' . $u[$i] . '&search=' . urlencode($words);
+ if($i == 0) {
+ $url = $sn . '?&search=' . urlencode($words);
+ } else {
+ $url = $sn . '?' . $u[$i] . '&search=' . urlencode($words);
+ }
$o .= ' <li><a href="' . $url . '">' . $title . '</a>';
$description = isset($pageData['description'])
? $pageData['description'] : '';
diff --git a/cmsimple/functions.php b/cmsimple/functions.php
index ad45c2b..be756b9 100644
--- a/cmsimple/functions.php
+++ b/cmsimple/functions.php
@@ -934,7 +934,9 @@ function a($i, $x)
if ($i == 0 && !XH_ADM) {
if ($x == '' && $cf['locator']['show_homepage'] == 'true') {
- return '<a href="' . $sn . '?' . $u[0] . '">';
+ return '<a href="' . $sn . '">';
+ } else {
+ return '<a href="' . $sn . $x . '">';
}
}
return isset($u[$i])
@@ -2817,7 +2819,7 @@ function XH_getLocatorModel()
if ($cf['locator']['show_homepage'] == 'true') {
array_unshift(
$res,
- array($tx['locator']['home'], XH_getPageURL($firstPublishedPage))
+ array($tx['locator']['home'], ('./'))
);
if ($s > $firstPublishedPage && $h[$s] == $title) {
$res[] = array($h[$s], XH_getPageURL($s));
diff --git a/cmsimple/tplfuncs.php b/cmsimple/tplfuncs.php
index 468bcb3..ba0b5fd 100644
--- a/cmsimple/tplfuncs.php
+++ b/cmsimple/tplfuncs.php
@@ -31,7 +31,11 @@ function XH_renderPrevLink()
$index = XH_findPreviousPage();
if ($index !== false) {
- return '<link rel="prev" href="' . $sn . '?' . $u[$index] . '">';
+ if ($index == 0) {
+ return '<link rel="prev" href="' . $sn . '">';
+ } else {
+ return '<link rel="prev" href="' . $sn . '?' . $u[$index] . '">';
+ }
} else {
return '';
}
@@ -366,11 +370,16 @@ function mailformlink()
*/
function loginlink()
{
- global $s, $tx;
+ global $s, $tx, $su;
if (!XH_ADM) {
+ if ($su == '') {
+ return a($s > -1 ? $s : 0, '?&amp;login" rel="nofollow')
+ . $tx['menu']['login'] . '</a>';
+ } else {
return a($s > -1 ? $s : 0, '&amp;login" rel="nofollow')
. $tx['menu']['login'] . '</a>';
+ }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment