Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Showing a selected value
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #1
Showing a selected value
I am working on a setup which shows the selected filter for one of my forums using XThreads. I have a working system, but it seems a bit clunky and I would like to know if there is an alternative method. I wanted to use this in another forum, but there are a lot of options.

In ths current forum I have one filterable field - fcat3

This is the code I am using for the dropdown and display:

HTML Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<table border="0" cellspacing="{$GLOBALS['theme']['borderwidth']}" cellpadding="{$GLOBALS['theme']['tablespace']}" style="clear: both;">

	<tr>
		<td class="trow1" align="center">
			<form action="forumdisplay.php" method="get">
				<select name="filtertf_fcat3">
					<option value="">Select a Category</option>
					<option value="">All</option>
					<option value="Plugin">Plugin</option>
					<option value="Modification">Modification</option>
					<option value="ProPortalBlock">Pro Portal Block</option>
				</select>

<input type="text" class="textbox" name="search" size="35" value="{$searchval}" /> {$gobutton}
				<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>

<td class="trow1" align="center"> Your Current Filters: 
<if ($mybb->input['filtertf_fcat3']==Plugin) then><span class="tea"> Plugin</span>  [<a href="forumdisplay.php?fid={$fid}">Clear filter</a>]
<elseif 
($mybb->input['filtertf_fcat3']==ProPortalBlock) then><span class="tea">ProPortal Block </span> [<a href="forumdisplay.php?fid={$fid}">Clear filter</a>]
<elseif 
($mybb->input['filtertf_fcat3']==Modification) then><span class="tea">Modification</span> [<a href="forumdisplay.php?fid={$fid}">Clear filter</a>]
<else>
All 
</if>
</td>
</tr>
</table>


As I said, it does work, but that is a lot of ifs. I am also unsure how secure that filter is. Advice and suggestions to improve appreciated. In case it is not clear what I mean, here is a link to the forum I am testing this display on:   http://www.leefish.nl/mybb/forum-51.html



[Image: leelink.gif]
MYBB1.6 & XThreads
(This post was last modified: 03-30-2012 09:24 AM by leefish.)
03-30-2012 09:23 AM
Visit this user's website Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
Showing a selected value - leefish - 03-30-2012 09:23 AM
RE: Showing a selected value - ZiNgA BuRgA - 03-30-2012, 12:13 PM
RE: Showing a selected value - leefish - 03-30-2012, 12:27 PM
RE: Showing a selected value - ZiNgA BuRgA - 03-30-2012, 12:38 PM
RE: Showing a selected value - leefish - 03-30-2012, 12:48 PM

 Standard Tools
Forum Jump: