MyBB Hacks

Full Version: [request] Advanced XThreads Prefix Filter
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i use XThreads prefix system, and we have more than only one prefix in one line.

before the subject we have 3 prefixes, one for "category" and one for "quality" and one for "language". every prefix is sortable. but you can only sort by one prefix. is it possible to create a menue with a triple dropdown-menu where you can select individually the Values List from all 3 prefixes, and the results are only Posts where the selected Values match?

Example:

prefix 1
values: value1, value2, value3, value4, value5
prefix 2
values: example1, example2, example3, example4, example5
prefix 3
values: test1, test2, test3, test4, test5

now i need a triple dropdown-menue, where you can select the values from prefix 1, prefix 2 and prefix 3, and for example: if you select the values "value2" & "example1" & "test4", and click on a search-button, results should only be displayed entries where this 3 values match.

possible?
Yes. I do exactly this on leefish. I have three prefixes set up.

http://www.leefish.nl/mybb/forumdisplay....http://www.leefish.nl/mybb/forumdisplay.php?filtertf_prefix=Sims2&filtertf_pfcat=Buy&fid=7&filtertf_dld_ep_prefix=OFB&sortby=lastpost&order=desc

I will get the template for it.

xxx_forumdisplay_searchforum_inline

Code:
<tr><td class="trow1" align="center">
<br />
			<form action="forumdisplay.php" method="get">
				<label>prefix1</label><select name="filtertf_prefix1">
<option value="">All</option>
<option value="px1"{$GLOBALS['filters_set']['prefix1']['selected']['px1']}>px1</option>
<option value="px2"{$GLOBALS['filters_set']['prefix1']['selected']['px2']}>px2</option>
 </select>

				<label>prefix2</label><select name="filtertf_prefix2">
					<option value="">All</option>
<option value="apx1"{$GLOBALS['filters_set']['prefix2']['selected']['apx1']}>apx1</option>
<option value="apx2"{$GLOBALS['filters_set']['prefix2']['selected']['apx2']}>apx2</option>
				
				</select>
				<label>prefix3</label><select name="filtertf_prefix3">
					<option value="">All</option>
<option value="opx1"{$GLOBALS['filters_set']['prefix3']['selected']['opx1']}>opx1</option>
<option value="opx2"{$GLOBALS['filters_set']['prefix3']['selected']['opx2']}>opx2</option>
				
				</select>


<br /><br />
<label><input type="submit" class="button" value="go" /></label>
				<input type="hidden" name="fid" value="{$fid}" />
				<input type="hidden" name="sortby" value="{$sortby}" />
				<input type="hidden" name="order" value="{$sortordernow}" />
				<input type="hidden" name="datecut" value="{$datecut}" />
			</form>
		</td>
</tr>

Ooohh leefish, you are my hero [Image: smiley-hug006.gif]

i use your code in additional forumdisplay template. was better for me than using searchforum inline.
language prefix will be added next week. all works perfect Biggrin BIG Thanks Yipi

[attachment=893]
one question:

i have add one prefix for the language (pref_lang). values are:
1.german
2.english
3.german & english
4.other

but if somebody select "german & english"-filter, the single languages "german" and "english" are not included. i know, that´s normaly correct. but is there any solution, that if you select "german & english", that the other 2 values are included in the search-result?
You can filter on multiple values for a single field, but I don't really know of a way like you described above.
Is there any way for dynamically generate the list for all available values for a certain thread field?

Thanks
Unfortunately there isn't.
(08-11-2012 09:45 PM)leefish Wrote: [ -> ]Yes. I do exactly this on leefish. I have three prefixes set up.

http://www.leefish.nl/mybb/forumdisplay....http://www.leefish.nl/mybb/forumdisplay.php?filtertf_prefix=Sims2&filtertf_pfcat=Buy&fid=7&filtertf_dld_ep_prefix=OFB&sortby=lastpost&order=desc

I will get the template for it.

xxx_forumdisplay_searchforum_inline

Code:
<tr><td class="trow1" align="center">
<br />
			<form action="forumdisplay.php" method="get">
				<label>prefix1</label><select name="filtertf_prefix1">
<option value="">All</option>
<option value="px1"{$GLOBALS['filters_set']['prefix1']['selected']['px1']}>px1</option>
<option value="px2"{$GLOBALS['filters_set']['prefix1']['selected']['px2']}>px2</option>
 </select>

				<label>prefix2</label><select name="filtertf_prefix2">
					<option value="">All</option>
<option value="apx1"{$GLOBALS['filters_set']['prefix2']['selected']['apx1']}>apx1</option>
<option value="apx2"{$GLOBALS['filters_set']['prefix2']['selected']['apx2']}>apx2</option>
				
				</select>
				<label>prefix3</label><select name="filtertf_prefix3">
					<option value="">All</option>
<option value="opx1"{$GLOBALS['filters_set']['prefix3']['selected']['opx1']}>opx1</option>
<option value="opx2"{$GLOBALS['filters_set']['prefix3']['selected']['opx2']}>opx2</option>
				
				</select>


<br /><br />
<label><input type="submit" class="button" value="go" /></label>
				<input type="hidden" name="fid" value="{$fid}" />
				<input type="hidden" name="sortby" value="{$sortby}" />
				<input type="hidden" name="order" value="{$sortordernow}" />
				<input type="hidden" name="datecut" value="{$datecut}" />
			</form>
		</td>
</tr>


first of all, thank for the code.

I have 2 problems

problem_1) i can't receive any data if one or two or three of the options set to "All"

problem_2) i really like the automatic way on your site http://www.leefish.nl/mybb/forumdisplay....http://www.leefish.nl/mybb/forumdisplay.php?filtertf_prefix=&filtertf_pfcat=&search=&fid=7&sortby=lastpost&order=desc
the filter is valid before the user push any button....
Where to add this code???
Reference URL's