[solved] target page after sidbarlogin

Creating and modifying plugins.
Post Reply
lordcoffee
Regular
Posts: 308
Joined: Tue Nov 29, 2005 10:22 pm
Location: Munich - Germany
Contact:

[solved] target page after sidbarlogin

Post 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
Last edited by lordcoffee on Tue Jul 03, 2007 11:17 am, edited 1 time in total.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: target page after sidbarlogin

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
lordcoffee
Regular
Posts: 308
Joined: Tue Nov 29, 2005 10:22 pm
Location: Munich - Germany
Contact:

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
lordcoffee
Regular
Posts: 308
Joined: Tue Nov 29, 2005 10:22 pm
Location: Munich - Germany
Contact:

Post 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
lordcoffee
Regular
Posts: 308
Joined: Tue Nov 29, 2005 10:22 pm
Location: Munich - Germany
Contact:

Post 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 :roll:

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" ?
lordcoffee
Regular
Posts: 308
Joined: Tue Nov 29, 2005 10:22 pm
Location: Munich - Germany
Contact:

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply