Customizing SMF > SMF Coding Discussion

Variable set in loadBoard() in Load.php, but Undefined when creating topic?

<< < (2/2)

Arantor:

--- Quote ---I wasn't sure what you meant by "push it into $board_info", so I improvised, but I guess I interpreted it correctly.
--- End quote ---

Yes, it simply means save it in $board_info somewhere.


--- Quote --- Does cache take preference over other data, so that if data isn't loaded into cache it gets ignored
--- End quote ---

Yes, that's sort of the point. Why go to the trouble of getting it from an expensive database query when you can get it cheaply from cache?


--- Quote ---Does the 1st code line "if (empty($temp))" somehow relate to cache?
--- End quote ---

Yes, if you look further up you'll see it attempt to fetch from cache and put it into $temp, and if $temp is empty, it wasn't available in the cache.


--- Quote ---Everything including individual declared variables, or just the arrays like $board_info?
--- End quote ---

Um... the code you posted actually mentions it specifically. It saves the content of $board_info, if there's a topic it saves it slightly differently because of the difference in what was loaded. (That's what cache_put_data does...)

MiY4Gi:
Thanks, I may never have figured out the problem without your help. I guess I'll mark this topic as solved.

MiY4Gi:
Just noticed now that SMF is still reporting an error in the Load.php file: Undefined index: anonymous_board. It only does this when a guest, or a spider, browses the forum.

As far as I can tell, it works fine for logged in users.

Any idea why this is happening?

MiY4Gi:
Bump.

Are there specific things in the Load.php files that don't get read/cached/whatever for guests, but do for logged-in users?

Navigation

[0] Message Index

[*] Previous page

Go to full version