in reply to Can't set timezone

Changing your theme won't take effect until *after* the resulting page is rendered. So you get the form, make your theme change, click submit, get back the form again with the old theme. Your next action (hitting submit again is what you did, but you could easily just click on any link) will be rendered with the new theme. It's just a quirk.

Replies are listed 'Best First'.
Re: Re: Can't set timezone
by chromatic (Archbishop) on Jan 02, 2001 at 10:56 UTC
    The theme variables are set in the Engine before code embedded in a node executes. I might play around with the theme changing code to see if I can regenerate $THEME in user settings.

    I think it'll work, but there could be an order-of-operation bug. We'll see.

    Update: My language is a bit imprecise. The real scoop is at EveryDevel (URL may be slightly off), with more than sufficient detail.

    What happens, basically, is that the Engine receives a request, sets some global variables (including $THEME, which holds theme settings for the user), loads the requested node, loads the display page for the node, executes any code in the node (and there is code in the user settings node), generates the page, sends it to the browser, and updates the database with the new settings.

    The code execution part changes the user setting that keeps track of which theme the user wants. It doesn't change $THEME accordingly. (In fact, it's probably already generated part of the page with the old theme).

    I don't have any timezone code in the current codebase. I think vroom added that to Perlmonks on his own.

      The theme variables are set in the Engine before code embedded in a node executes. I might play around with the theme changing code to see if I can regenerate $THEME in user settings.

      Surely the problem is that it's set *after* the code in the next node executes, rather than before?

      Otherwise it would work on the next page?

      Or am I missing something?

      Is the code available anywhere to look at? Or is it all proprietrary?

      Thanks,

      Tony

      ps Any ideas on the timezone bit?