Datafeedr Support Forums  

Go Back   Datafeedr Support Forums > Current Version (V3) Forum > Questions
Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Important - The support forums are now in "read-only" mode as we transition to an alternative help desk solution. Feel free to contact us here with any of your questions or search the forums for an existing solution.
 
 
Thread Tools Search this Thread Display Modes
  #1  
Old March 5th, 2011, 06:13 PM
feri feri is offline
 
Join Date: Oct 2010
Posts: 74
Default Dropdown Filters Code

Eric, I found this code in a post by Ayorofrance - thanks for him.

Code:
<?php
function search_price_value($word) {
    $word = strip_tags($word);
    return $word;
}
?>
<form method="get">
    <?php if (@$_GET['word']){ echo "<INPUT TYPE='HIDDEN' NAME='word' Value='".search_price_value($_GET['word'])."'"; } ?>
  <?php if (@$_GET['ppp']){ echo '<INPUT TYPE="HIDDEN" NAME="ppp" Value="'.search_price_value($_GET['ppp']).'"'; } ?>
  <?php if (@$_GET['sort']){ echo '<INPUT TYPE="HIDDEN" NAME="sort" Value="'.search_price_value($_GET['sort']).'"'; } ?>
  <select name="price" id='store_dropdown_box'>
<option value="1-50"<?php if (@$_GET['price']=='1-50') {echo ' selected="selected"';}?>>Moins de 50</option>
<option value="50-100"<?php if (@$_GET['price']=='50-100') {echo ' selected="selected"';}?>>50 ~ 100</option>
<option value="100-150"<?php if (@$_GET['price']=='100-150') {echo ' selected="selected"';}?>>100 ~ 150</option>
<option value="150-200"<?php if (@$_GET['price']=='150-200') {echo ' selected="selected"';}?>>150 ~ 200</option>
<option value="200-250"<?php if (@$_GET['price']=='200-250') {echo ' selected="selected"';}?>>200 ~ 250</option>
<option value="250-"<?php if (@$_GET['price']=='250-') {echo ' selected="selected"';}?>>Plus de 250</option>

    </select>
    <input type="submit" value="Go" class="dfsbmt" />
</form>
  
<?php if (@$_GET['price']) { ?>
  <p><a href="[server.url type='fullpage' query='-price']">[X] Remove Filter</a></p>
<?php } ?>
The question is, is this a good enough general code for making dropdown filters by price, word, merchant, brand, tags?

Can you provide the code snippets as it was in the Filtering Tutorial you made? I think it would be very welcomed by many of us.
  #2  
Old March 5th, 2011, 07:50 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

It looks good but there is no guarantee.
  #3  
Old March 6th, 2011, 02:57 AM
feri feri is offline
 
Join Date: Oct 2010
Posts: 74
Default

Thanks for the insight. Any chance that you write/provide a tutorial about dropdown filters with code snippets as it was in the Filtering Tutorial you made?
  #4  
Old March 6th, 2011, 09:26 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Here's a snippet I posted for drop downs by brand: http://www.datafeedr.com/forums/showthread.php?t=3987
  #5  
Old March 6th, 2011, 05:32 PM
feri feri is offline
 
Join Date: Oct 2010
Posts: 74
Default

Thanks!
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating filters that do the work of categories Eric Tips, Tricks & Tutorials 60 December 1st, 2011 02:57 PM
Remove ALL Filters feri Questions 4 March 6th, 2011 02:50 AM
Custom filters ccgmark Questions 1 February 25th, 2011 04:10 PM
Bulk edit subscriptions/filters for categories feri Feature Requests 1 February 19th, 2011 10:41 AM
Dropdown boxes behaving strangely on Chrome ayorofrance Problems 4 February 4th, 2011 07:50 PM


All times are GMT -5. The time now is 03:36 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.