DragonflyCMS Projects > Weather Harvest > How to set default weather? > Community Forums > Phoenix Netology
Forum Index > Miscellania > Weather Harvest

How to set default weather? Reply to topic


I'm using weather harvest WHdfc9 and dragonfly 9.0.5.0.

How do you set the default weather for anonymous and registered for the block? I can't seem to figure it out. I noticed there was a problem listed in this forum for anonymous, but the block code seems to be missing from the thread?

I love the module and it's great after you set it for our own account, but I can't seem to figure out how to set the default.

TIA

Please enter your server specs in your user profile! 😢


If you set it when logged in as admin only (not user) that should set the default for anonymous visitors.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


Phoenix wrote
If you set it when logged in as admin only (not user) that should set the default for anonymous visitors.


Thanks for responding!

The option to set the local weather disappears as soon as I log out. (Admin still logged in). Yes I do have the option to allow users to select their own weather turned on. I just ended up setting the weather station manually for user "0" in the database. That worked fine.

Please enter your server specs in your user profile! 😢


Hi. I am trying to set this up and I am having the same problem. I want the anonymous and registered users to use only the same default location. I tried setting the anonymous while logged in as only administrator, but then I logged in is showed me some other default that I never selected.

Can a block be copied, renamed, and altered to show only a set location for all site visitors?

Thanks.

Please enter your server specs in your user profile! 😢


As stated previously, and now re-confirmed, the default setting changes when you set it while logged as admin only i.e. logged out as a user.

This will be the setting presented to Anonymous (and logged out) users and works as intended.

Registered users have the ability to set their own default, and this capability also works as intended.

As admin only (logged out as user), it will still show the original default i.e. the setting of Lees Summit. In view of the persisting confusion that this seems to cause, I'll examine a better way for the system to allow for missing defaults.

You can force a block to use whatever code you wish
  • for block-WeatherHarvest.php:
    line 62 should be a blank line - insert $code = xxx; where xxx is the id for the location you want
  • for block-WHExtendFcast_ctr.php:
    line 68 should be a blank line - insert $code = xxx; where xxx is the id for the location you want
  • you could do a similar thing for the buoy block
Edit: confusion eliminated - use the attached updated blocks.
Attachment: whblocks.zip
Description updated blocks
Filename whblocks.zip
Filesize 5.82 KiB
Downloaded 0 Time(s)
You are not allowed to view/download this attachment

Donations & Audit for DragonflyCMS

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):

All times are Australia/Adelaide


Jump to: