My-Little-Forum / mylittleforum

A simple PHP and MySQL based internet forum that displays the messages in classical threaded view (tree structure)
GNU General Public License v3.0
121 stars 47 forks source link

Need for different IDs for the sidebars #333

Open auge8472 opened 6 years ago

auge8472 commented 6 years ago

The sidebars in the main views (threaded and tabled) has different IDs (#sidebar (thread view), #bottombar (table view)). Is the only reason their different position in the default theme or is there another reason (i.e. use of the IDs in JS)? If there is no need to distinguish them in the code, I tend to use one ID for both cases (different views, so the ID remains unique) at least for my theme which would simplify the CSS code for the sidebars elements.

The default theme needs a distinguishing feature when the position in the views should still be different from view to view in the future.

loesler commented 6 years ago

Check the related sources, e.g. https://github.com/ilosuna/mylittleforum/blob/master/js/main.js#L763

auge8472 commented 6 years ago

Thank you. As far as I can see, the line 769, where the variable main gets populated with the element reference for #sidebar or #bottombar (or false) it's the only place, where the IDs were in use.

So, if I would unify the IDs to #sidebar, in the JS-code nothing would break. The only serious issue is the distinction between a box on the side with a fixed width and a box below the main content which takes the full width in the default template. In the template Responsive 1 I set the boxes on top of the main content for narrow viewports and to the right side for wide viewports. It's because I can't substantiate the different behavoiur in the different views.

@derletztekick As I can see, you do use the threaded view as default view in your own forum. I am interested in the opinion of table-main-view-users. Do they use the information of the bottombar below the main content? If no, would they use these informations, when the bar moves to top (narrow screens) or to the side (wide screens)?

Do you have such users in your forum? Can any other operator contribute an opinion or reports from users?

loesler commented 6 years ago

If you specify the column names (e.g. user_view, fold_threads, thread_display) of the user table, I can select the values.

auge8472 commented 6 years ago

If you specify the column names (e.g. user_view, fold_threads, thread_display) of the user table, I can select the values.

Ähh, what you are talking about? CSS or JavaScript? The JS-side to fold the bars is not affected because the function will get triggered anyway (#bottombar or #sidebar or false). Am I right? The CSS-side needs the distinction for setting the width of the bars itself. But I can't select an Element with CSS on the base of a not direct sibling.

Other places are not affected because all child and ancestor elements can be placed relative to the bars.

Do you want to add the column names user_view, fold_threads, thread_display as IDs or classes to the HTML-code to be able to select them with JS? Do I miss your point and misunderstand you completely?

loesler commented 6 years ago

Ähh, what you are talking about? CSS or JavaScript?

SQL

Do they use the information of the bottombar below the main content?

If these information is stored in the database, I can select the values. If not, I don't have the required information.

auge8472 commented 5 months ago

I came across this issue again.

Do they use the information of the bottombar below the main content?

If these information is stored in the database, I can select the values

We store only the 0 or 1 for a closed or open sidebar in the database. It does not matter which form of presentation (sidebar or bottombar) is used. I'll take a look into the HTML- and CSS-code to decide, if and how the code for both cases can be unified.