Page 1 of 1
[solved] target page after sidbarlogin
Posted: Mon Jul 02, 2007 6:42 pm
by lordcoffee
Hi!
I'm using the sidebar loginform in another blog and have a problem that.
I'm using highlighting of the navbar links and it works just fine. When I'm on my first site the Homepage button is highlighted as it should be because I'm on the startpage (Startpage is "
http://mydomain.de").
When I login with the sidebar loginform it takes me to the frontpage but with a
http://mydomain.de "/index.php?". So the Navbar doesn't recognize the highliting thing anymore. Any help here?
Thanks, Lordcoffee
Re: target page after sidbarlogin
Posted: Mon Jul 02, 2007 7:10 pm
by garvinhicking
Hi!
How about
Code: Select all
{if $startpage == $bla or $startpage == $bla . '?'}
does that work? If not, you might need to check how Smarty allows to concatenace variables...or maybe use preg_match() within the IF...
Or you might just try "if {$is_startpage}"?
HTH,
Garvin
Posted: Mon Jul 02, 2007 9:00 pm
by lordcoffee
Hi, I think Idon't understand what you mean. I'm curently using this configuration for the Home:
Code: Select all
<li class="{if $startpage }current_{/if}page_item">
<a href="{$serendipityBaseURL}">{$CONST.HOMEPAGE}<span></span></a>
</li>
I extracted this code from abdussamads freshy port. It works fine each time I click on the "Homepage" button. but when I login with the loginform it redirects me to the
/index.php? page and the button isn't highlighted. When I now click one more time on the Homepage button it's highlighted agein. Hmmm...
Thanks one more time, Lordcoffee
Posted: Tue Jul 03, 2007 9:52 am
by garvinhicking
Hi!
Did you try this with serendipity 1.2 as well? I believe the startpage detection might only there include the page with "?"
Regards,
Garvin
Posted: Tue Jul 03, 2007 10:51 am
by lordcoffee
Hi, I've done the update to the current Serendipity 1.2-beta2.
After installation there was this error message:
CREATE INDEX categoryso_idx ON serendipity_category (sort_order);
/ Access denied for user 'XXX'@'localhost' to database 'XXX'
What have I todo now??? I dont't like errors
Lordcoffee
Posted: Tue Jul 03, 2007 11:01 am
by lordcoffee
Hi once more!
I've searched the forum and found the thread where you said that this would be no problem. Blog is still working
After updating the problem is the same. Maybe it has something to do with this line in the config.inc.php? :
Code: Select all
$serendipity['smarty']->assign(array('currpage'=> "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']));
Wouldn't it be easier (if it's possible of course) if the loginformplugin would redirect after the login to the "real" frontpage instead of "/index.php?index.php" ?
Posted: Tue Jul 03, 2007 11:24 am
by lordcoffee
I changed this in the plugin:
Code: Select all
if (isset($serendipity['POST']['action']) && isset($serendipity['POST']['user']) && isset($serendipity['POST']['pass'])) {
serendipity_login();
} elseif (isset($serendipity['POST']['action']) && isset($serendipity['POST']['logout'])) {serendipity_logout();
header("Location: {$serendipity['baseURL']}{$serendipity['indexFile']}");
exit;
}
to this:
Code: Select all
if (isset($serendipity['POST']['action']) && isset($serendipity['POST']['user']) && isset($serendipity['POST']['pass'])) {
serendipity_login();
header("Location: {$serendipity['baseURL']}{$serendipity['indexFile']}");
} elseif (isset($serendipity['POST']['action']) && isset($serendipity['POST']['logout'])) {
serendipity_logout();
header("Location: {$serendipity['baseURL']}{$serendipity['indexFile']}");
exit;
}
I saw that if I'm using a staticpage as startpage the loginform plugin redirects me to the "index.php?frontpage" after login but not after logout. So I searched in the serendipity_event_loginform.php where the login and logout "buttons" are and saw the difference between them.
Is this a clean solution???
Thanks, Lordcoffee
Posted: Tue Jul 03, 2007 11:29 am
by garvinhicking
Hi!
Maybe this one helps:
Code: Select all
<li class="{if $startpage OR $view == 'start'}current_{/if}page_item">
<a href="{$serendipityBaseURL}">{$CONST.HOMEPAGE}<span></span></a>
</li>
HTH,
Garvin