PDA

View Full Version : Can someone explain: one template updates correctly, one doesn't (on the same page)?


kirblam
01-10-2007, 12:34 PM
I have a left sidebar as a result of placing more html in the header and footer templates. In the sidebar (html in the header template), I'd like to include the typical loginbox. There are also some items in the sidebar that rely on the var $show['member'] for whether to display or not. I also left the current loginbox in the navbar template until I get the sidebar working correctly.

After logging in, both loginboxes, correctly show the typical "Welcome User, your last visit etc"

When I click logout, I get to login.php?do=logout... However, only the loginbox in the navbar correctly reverts to username and password inputs. The one in the header template/sidebar retains the Welcome message. If I reload the page though, the sidebar login correctly figures out the state of the user and reacts accordingly.

I've tried various hacks to login.php ($show['member'] = false) in different lines to try to force the sidebar loginbox to behave. I've tried using plugins to debug the issue by showing $show['member']'s value and also $vbulletin->userinfo['userid']'s value.

In any case, everything I see indicates that either the header template is cached and doesn't get refreshed until a later event or that the logout process doesn't occur until after the header template is rendered. I'm a relative newbie so I'm guessing there's something fundamental I'm missing.

Thanks in advance,
K

noppid
01-10-2007, 04:08 PM
There's some Javasript and a hash involved in that logout thing IIRC. Are you sure you have a complete copy of the login box code and not just a simple form?

kirblam
01-10-2007, 07:59 PM
I believe the complete code is there for the login box. It functions well when actually logging in. I'll double check it though.

Also, the logout link is separate from the loginbox.

Plus, the issue affects other conditionals in the sidebar, not just the loginbox. Anything that relies on <if condition="$show['member']"> - any of those blocks still believe the member is logged in, but only in the header template. The other conditionals in the navbar template work OK.