The vB Geek

Go Back   The vB Geek > vB Geek Products > Geek Article and Review System

Geek Article and Review System GARS is the mega popular system for turning forums into articles, tutorials, or even reviews.

Advertisement
  Learn how to remove ads

Reply
 
Thread Tools Display Modes
  #1  
Old 07-14-2009, 07:45 PM
Varsh Varsh is offline
Junior Member
 
Join Date: Jul 2009
Posts: 3
Geek Article and Review System License Holder 
Default Filter Problem

After using the filter with various criteria (I know it's not nested) I've come across a strange occurance. With each option list displayed the filter works fine but the problem doesn't come with the filtering but the labelling, instead of showing each label/title by the side of the options it only shows the last option title at the front of the filter set.

I've looked through the PHP file and noticed that the title setting is not within the loop for displaying the title by the options, any idea on how to do this?

Example: http://forums.nexusrealms.co.uk/forumdisplay.php?f=20
Reply With Quote
  #2  
Old 07-14-2009, 08:56 PM
Morgan's Avatar
Morgan Morgan is offline
Administrator
 
Join Date: Jul 2006
Posts: 2,255
Geek Article and Review System License Holder GeekMart License Holder Geek Auto-Linker Pro License Holder Geek Advertising Banner License Holder Geek Gazette License Holder 
Default

There is a how-to page here with instructions for adding a filter, but you can use only one filter on the page. If you want to change this behavior, one place to start is to look at the prep_filter function in the gars_class_list.php page.
__________________
Please use the forums for support, feature requests, and similar such things. Support does not include custom code, custom template edits, or third-party modifications. PMs and emails to me should be for private information only, such as login information. If you PM or email me a support question, chances are good that I'll ignore it. Thanks.
While the work or play is on, it is a lot of fun if while you are doing one you don't constantly feel that you ought to be doing the other. -- Franklin Pierce Adams
Reply With Quote
  #3  
Old 07-14-2009, 09:20 PM
Varsh Varsh is offline
Junior Member
 
Join Date: Jul 2009
Posts: 3
Geek Article and Review System License Holder 
Default

I think you've misunderstood what I'm asking. In fact let me show you what I mean. Currently I have this:
  1. Title 5 - option list
  2. option list
  3. option list
  4. option list
  5. option list
I am wanting to achieve this:
  1. Title 1 - option list
  2. Title 2 - option list
  3. Title 3 - option list
  4. Title 4 - option list
  5. Title 5 - option list
If I can find where the title is displayed in one of the files then I'll be able to edit it. Can you see what's happening though? All that is needed to be done is to display the title next to the option list when it is first selected before the records are added, I simply can't find this anywhere although the filter.php file seems to be the one to look at.

I get the feeling I need to place the following near where the option list is created but I'm struggling to find where you are echoing the options.
PHP Code:
echo $result['typeid']; 
Reply With Quote
  #4  
Old 07-14-2009, 09:29 PM
Morgan's Avatar
Morgan Morgan is offline
Administrator
 
Join Date: Jul 2006
Posts: 2,255
Geek Article and Review System License Holder GeekMart License Holder Geek Auto-Linker Pro License Holder Geek Advertising Banner License Holder Geek Gazette License Holder 
Default

Oh okay, that is in the filter.php file found inside the /geek/gars/mods/display directory. You might want to set $rowtitle to an array of titles instead of $rowtitle = $titles[$result['id']]; so then you could use the array variable with key name in the GARS_mod_filter template.
__________________
Please use the forums for support, feature requests, and similar such things. Support does not include custom code, custom template edits, or third-party modifications. PMs and emails to me should be for private information only, such as login information. If you PM or email me a support question, chances are good that I'll ignore it. Thanks.
While the work or play is on, it is a lot of fun if while you are doing one you don't constantly feel that you ought to be doing the other. -- Franklin Pierce Adams
Reply With Quote
  #5  
Old 07-14-2009, 10:47 PM
Varsh Varsh is offline
Junior Member
 
Join Date: Jul 2009
Posts: 3
Geek Article and Review System License Holder 
Default

Thanks for the pointers, I've now managed to do a fix however it does remove the point of selecting whether it's a vertical or horizontal layout. There's two ways to do this:

Original
filter.php
PHP Code:
$itemid intval($itemid);
    
$autojs " onchange=\"gars_filter_forum$itemid($result[id], this.value);\" ";
    
$optionlist "<SELECT name=\"filter[$result[id]]\" $autojs >$optionlist</SELECT>";

Horizontal Layout
filter.php
PHP Code:
$itemid intval($itemid);
    
$autojs " onchange=\"gars_filter_forum$itemid($result[id], this.value);\" ";
    
$optionlist " | " $titles[$result['id']] . " <SELECT name=\"filter[$result[id]]\" $autojs >$optionlist</SELECT> | ";

Vertical Layout
filter.php
PHP Code:
$itemid intval($itemid);
    
$autojs " onchange=\"gars_filter_forum$itemid($result[id], this.value);\" ";
    
$optionlist "<br />" $titles[$result['id']] . "<SELECT name=\"filter[$result[id]]\" $autojs >$optionlist</SELECT>";

What needs to be known however is that in both instances vertical alignment must be set to "no". In the template GARS_mod_filter you need to do the following by removing $rowtitle:

PHP Code:
<div class="smallfont" style="white-space:nowrap;">$rowtitle<if condition="$settings['vertical'] && $rowtitle"></div><else />&nbsp;</if>$bits<if condition="$settings['vertical']"></div><else />&nbsp;</if> 
And change it to

PHP Code:
<div class="smallfont" style="white-space:nowrap;"><if condition="$settings['vertical'] && $rowtitle"></div><else />&nbsp;</if>$bits<if condition="$settings['vertical']"></div><else />&nbsp;</if> 
Another way around this is to create another template called GARS_mod_filter_V (vertical) and save the filter.php file as filterV.php (vertical) with the vertical settings so that you can set them to the modules like what is currently there. All you would need to do then is make sure to keep vertical alignment "off" for both of them and making sure that you use the right module where needed.

The horizontal layout needs some tweaking to look right, I'll most likely use CSS to distinguish between the options, though you can see how they separate from eachother now. Hope this helps.

You can now see it working here: http://forums.nexusrealms.co.uk/forumdisplay.php?f=20
Reply With Quote
Reply

Thread Tools
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

BB 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
Filter Issues Billspaintball Geek Auto-Linker 1 01-26-2008 10:49 PM
Filter Damir Geek Article and Review System 5 06-28-2007 01:50 PM
Filter Module nymyth Geek Article and Review System 3 06-05-2007 04:44 PM
Filter This! The Geek Tutorials 19 01-20-2007 03:15 PM
GARS filter osirisjem Geek Article and Review System 1 01-09-2006 09:05 AM


All times are GMT. The time now is 10:51 AM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.