MyBB Hacks

Full Version: Opions?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I've been thinking about implementing a default forumdisplay filter option, except I'm not sure how I should do it.
For example, should the filter be always enforced?  Or if override-able, when should it be overridden or bypassed?
I'm thinking of implementing it as override-able, which is overridden when the user uses a different value to that specified.

For example, if I set default filter to:
filtertf_tag=Cheap
filterxt_prefix=3

And someone visits forumdisplay.php?fid=10&filterxt_icon=2, there'll be three filters active.  But if they visit forumdisplay.php?fid=10&filterxt_prefix=1 there'll be two filters active.
Array filters will override the defaults too.

Also considering whether variables, and possibly conditionals should be allowable there.

What are your opinions/suggestions?



Also, the filter by prefix/icon/uid/lastposteruid feature added in the v1.337 is a per-forum setting, but one wonders whether this should be done globally or on a per forum basis.  I'm thinking it might make more sense as a global setting than a per-forum one.  What do you think?
Hmm, I have to confess I'm a bit lost on the first question - so I can't really give an opinion.

On the second - yes, I  think it would make more sense as a global option - having said that, we would still have to code up the templates for specific forums - but it SHOULD save time - and reduce the chances of mistakes.
I rambled a bit, but basically, was wondering how to implement a default thread filter in forumdisplay.  Main issue being whether or not (and how) a user can override or disable this default filter.
For example, imagine a support forum where threads can have a status of "open" or "closed" (different to closing threads).  Perhaps you may only want open threads to displayed by default, so you could set a default filter on that forum.  But you also want the user to be able to view all threads too, so there needs to be a way for the user to disable this default filter.

Thanks for your opinion on the second thing Smile
Hmm, I have been thinking about this - I have a small resources section set up - and yes, if I click on a thread prefix to filter ONLY on that prefix then I end up in a dead end.

Example: I have a set of threads with different prefixes. If I click on the mesh prefix then it displays JUST the threads with mesh prefix. Unfortunately, the breadcrumb is still at forum level - so I can't get back to the forum - only the category.

See the screenshot (sorry about the dresses)

Link to forum

See the filter I chose - filterxt_prefix=2 - and see the breadcrumb - its not active. I added the little box at the side (under the search) so that users could go back to the forum - its just a link back to the forumdisplay. But thats pretty rubbish as its IN the thread list and so can be seen from the opening page of the forum.

What might be neat is if the filter was hooked into the breadcrumb somehow - something like

LeeFish / Sim Fish / Resources / Filter by Chosen prefix (in this case for me it would be mesh) and then the navigation trail can be used. Of course, not all users use the navigation - so it would be equally cool if there was a script or something that made it possible to display a dropdown box - ONLY if on a filtered page - where users can choose from all thread prefixes (back to forumdisplay) or certain prefixes - maybe even multiple prefixes.

Its just my contribution to the discussion Smile
You can do that with the $filters_set variable to some degree.
Example:

HTML Code
<div style="{$filters_set['__xt_prefix']['visiblecss']}">You are filtering by prefix [<a href="forumdisplay.php?fid={$fid}">remove filter</a>]</div>

or similar.
Can use Template Conditionals to add to the breadcrumb if you wish.

(11-18-2010 04:20 PM)ZiNgA BuRgA Wrote: [ -> ]Main issue being whether or not (and how) a user can override or disable this default filter.
If it is a variable, how about adding a variable like the [desc] and [asc] that MyBB has when sorting a thread, Yumi?

Example:
Default forumdisplay filter:
filtertf_status=Unsolved (has other value -> Solved)
filterxt_prefix=3 (has other value -> 1,2)

Other filter applied to this forum:
filtertf_question_type=Installation (has other value -> General)

When user doesn't filter thread (viewing forum display with a normal link), the variable will be "blank", no filter clean link displayed.
Installation
General

When user filter thread with filtertf_question_type=Installation, because there are three filter active automatically, the variable has a value, contained a link to view all Unsolved, Solved, prefix 1, 2 and 3.
Installation [View All]
General

When user click the [View All] link to view all thread with filtertf_question_type=Installation filtering only, the variable will has another value, contained a link to back to the default forumdisplay filter + Installation filter.
Installation [Default]
General

When user click the [Default] link, the value will be back to the [View All] link. Both of the values will be switched each other in the filter as long as the filter is active.

I don't know about using conditional. But I think, using conditional will make it more flexible than using variable? And we can have more control, Yumi?

That is my opinion for the first one, Yumi.

For the second one:
Yeah. I prefer to enable it as global.
That's a nice idea RateU.
I think I may have an idea about the URL scheme.  I think, the default filter will only be applied if no filter has been supplied in the URL.

So using the example above, if the default filter is:
filtertf_tag=Cheap
filterxt_prefix=3

And someone visits forumdisplay.php?fid=10&filterxt_icon=2, there'll be one filter active (the default filters will be disabled).

What I meant by variables is whether to allow them in the default filter string, eg, you specify a default filter of filterxt_uid={$mybb->user['uid']} or similar.

For your idea, maybe I'll have a key representing whether other filters are active in the filters_set array.
(11-21-2010 09:59 AM)ZiNgA BuRgA Wrote: [ -> ]What I meant by variables is whether to allow them in the default filter string, eg, you specify a default filter of filterxt_uid={$mybb->user['uid']} or similar.

I think I had misunderstood about what you meant by the variable, Yumi Biggrin

(11-21-2010 09:59 AM)ZiNgA BuRgA Wrote: [ -> ]I think, the default filter will only be applied if no filter has been supplied in the URL.

Do you mean, when a user visit the forumdisplay by clicking the forum name in forumbit with this kinds of url (default url): forumdisplay.php?fid=80, and if we have specified a default filter for that forum like this: filterxt_uid={$mybb->user['uid']},  they will see their threads only automatically without needing to click the filter, Yumi?

(11-21-2010 09:59 AM)ZiNgA BuRgA Wrote: [ -> ]For your idea, maybe I'll have a key representing whether other filters are active in the filters_set array.

Well, it is not an idea, Yumi. I think I just misunderstood what you meant,  and give a wrong opinion Biggrin

But I have a suggestion, and need opinion whether this is useful or not, Yumi (not related to this):
XThreads has an ability to "overwrite" some languages value:
  1. Thread Subject in newthread page.
    Example:
    We have Images Gallery application. It is better (I think) if the Thread Subject can be replaced with Image Title.
    We have Showcase Forum application. It is better (I think) if the Thread Subject can be replaced with Website Name.
    Right now, if we want to rename it, we need to create a newthread template.
  2. Maybe overwrite the New Thread in newthread page.
    Example:
    We have Images Gallery application. It is better (I think) if the New Thread can be replaced with New Image.
    We have Showcase Forum application. It is better (I think) if the New Thread can be replaced with New Website.
    Again, right now, if we want to rename it, we need to create a newthread template for this.


Not quite sure whether it is useful for other user or not.
(11-22-2010 06:28 AM)RateU Wrote: [ -> ]But I have a suggestion, and need opinion whether this is useful or not, Yumi (not related to this):
XThreads has an ability to "overwrite" some languages value:
  1. Thread Subject in newthread page.
    Example:
    We have Images Gallery application. It is better (I think) if the Thread Subject can be replaced with Image Title.
    We have Showcase Forum application. It is better (I think) if the Thread Subject can be replaced with Website Name.
    Right now, if we want to rename it, we need to create a newthread template.
  2. Maybe overwrite the New Thread in newthread page.
    Example:
    We have Images Gallery application. It is better (I think) if the New Thread can be replaced with New Image.
    We have Showcase Forum application. It is better (I think) if the New Thread can be replaced with New Website.
    Again, right now, if we want to rename it, we need to create a newthread template for this.


Not quite sure whether it is useful for other user or not.

Now that is an awesome idea. Indeed, it helps to preserve the illusion of "separateness". I use css buttons and I often just code the thread button in using the new thread template.
(11-22-2010 06:28 AM)RateU Wrote: [ -> ]Do you mean, when a user visit the forumdisplay by clicking the forum name in forumbit with this kinds of url (default url): forumdisplay.php?fid=80, and if we have specified a default filter for that forum like this: filterxt_uid={$mybb->user['uid']},  they will see their threads only automatically without needing to click the filter, Yumi?
Yeap.

As for the URL scheme, there's still an issue of how to disable all filters completely :/

(11-22-2010 06:28 AM)RateU Wrote: [ -> ]Well, it is not an idea, Yumi. I think I just misunderstood what you meant,  and give a wrong opinion Biggrin
Nah it's fine, I'll stick it in, it doesn't hurt.

(11-22-2010 06:28 AM)RateU Wrote: [ -> ]But I have a suggestion, and need opinion whether this is useful or not, Yumi (not related to this):
XThreads has an ability to "overwrite" some languages value:
That's an interesting idea.

How do you think I should do it though?
- language variable prefix?
- define a list of overwritten language variables?
Pages: 1 2
Reference URL's