[WMTech] Optional Forums

[WMTech] Optional Forums 1.0.6

No permission to download
Ah, set the 'canHideOptionalForums' permission under 'forum' permissions.
'Not found response' is the wrong response (should be 'no permission'), I'll fix up the wording when I get a chance.
 
Just saw that addon create +60 db queries like
SELECT * FROM xf_ofs_forum_opt WHERE forum_id=XX
Is it normal?
 
Addon conflict with visibility of forum from different user group. In my case I have special user group for game accounts. All forums except one are hidden for this user group (View node: Revoke), but if addon is on, all subforums in same category are shown.
 
I really love your addon, but i am wondering about around 65 additional queries on my front page now.
Probably you fetch every single line from the both tables?

The data of forums is read anyway, so the forum_opt could be there?
Also the user_choice could be in the user_table or in one select?

But you know it probably better than me and may want to to explain why you have done it like it is done, please?
 
I really love your addon, but i am wondering about around 65 additional queries on my front page now.
Probably you fetch every single line from the both tables?

The data of forums is read anyway, so the forum_opt could be there?
Also the user_choice could be in the user_table or in one select?

But you know it probably better than me and may want to to explain why you have done it like it is done, please?

I would not expect an answer, the developer has abandoned his XF addons and the forum scene.

Yes I'm not active in XF anymore, and once I've tied off some loose ends I'll be exiting the forum space generally.
 
I just rewrite it.

The info which forums are optional and default goes to xf_forum. (minus 50% queries)
Then i want a switch for xf_user; if no forums are choosen, the value is 0 and nothing happens at all; (0 queries)

About the second table i am not shure; maybe it will be a serialized in xf_user also; then i could save the field from above.
Normally we should have always $user and $forum if we ask for viewperms. (then 0 queries)

Any more ideas?
 
Last edited:
It is done.
Instead of tables i use three new fields and save only the forums you want to hide. I also care for the categories.
I will test it now intern, then install and test it on a public forum for a while. The next steps should be an importer for the old values.
 
Finally i found out, that this addon doesnt care for the forum permission.
If you have different forums for different usergroups all {optional} forums are shown in the list to choose for hide/show.
 
When add/edit a forum you can decide if it should be optional to choose if a user can hide it.
Now i am not shure about default hide.
I have default hide now as suggestion when you call the form for hiding the first time or when saved nothing.
 
Last edited:
Next question

Main 1 (opt ?)
-- Sub 1.1 (opt)
-- Sub 1.2 (not opt)

If Sub 1.2 is not opt; Main 1 cant be opt automatically too?

Now you can:
Main 1 (opt)
-- Sub 1.1 (opt)
-- Sub 1.2 (not opt)

then Main 1 can be hidden
but if you show Main 1, then you see Sub 1.2. also.
or

Main 1 (not opt)
-- Sub 1.1 (opt)
-- Sub 1.2 (not opt)

then Main 1 is shown, Sub 1.2 also


Too make the function more understandable i show now all allowed forums (not cats), but with a disabled checkbox if not opt.
 
Add or edit forums

195901

Make optional? Shown or as a suggestion if nothing is choosen

195902


Nothing choosen, two are "hide by default" as a sugesstion to hide

195903

Normal view of forum_list
195904

Now i choose a forum to hide,
the not optional ones are shown, but not checkable.
You also dont see the forums that are not displayed at the list.

195905

Result
195906


Any more ideas to build in?
 
This addon makes a lot of unnessesary queries in XF1;
for every forum two queries, if i remember correct.
 
Top Bottom