Disable Bags from being searchable?

Theme, template, layout, or image issues

Disable Bags from being searchable?

Postby ouberlord » Wed Oct 10, 2007 6:54 am

Is there any way to limit the Search functionality to make it so it doesn't search bags? Many members want to keep their items in bags private, and while I have it set to not show bags or bank in the settings the search function will still pull up results. For instance, I can search for "iron" and pull up the three stacks of Fel Iron Ore I have in my bags right now.

Any ideas?
ouberlord
WR.net Apprentice
WR.net Apprentice
 
Posts: 3
Joined: Tue Oct 09, 2007 6:40 am

Disable Bags from being searchable?

Postby zanix » Wed Oct 10, 2007 7:03 am

You could edit the SQL string in search.php to only select members that have their bags shown

Replace
Code: Select all
$query="SELECT players.name,players.server,items.* FROM `".ROSTER_ITEMSTABLE."` items,`".ROSTER_PLAYERSTABLE."` players WHERE items.member_id = players.member_id AND items.item_name LIKE '%$search%' ORDER BY players.name ASC";


With
Code: Select all
$query="SELECT `players`.`name`, `players`.`server`, `items`.* FROM `".ROSTER_ITEMSTABLE."` AS items, `".ROSTER_PLAYERSTABLE."` AS players, `".ROSTER_MEMBERSTABLE."` AS members WHERE `items`.`member_id` = `players`.`member_id`AND  `items`.`member_id` = `members`.`member_id` AND `members`.`inv` = '3'  AND `members`.`bank` = '3' AND `items`.`item_name` LIKE '%$search%' ORDER BY `players`.`name` ASC";


I'm not gonna guarantee this will work as I do not have a running install of 1.7.3
Last edited by zanix on Wed Oct 10, 2007 7:04 am, edited 2 times in total.
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5543
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Re: Disable Bags from being searchable?

Postby ouberlord » Thu Oct 11, 2007 9:59 am

I tested that code out and it didn't seem to affect the search results at all. Any other ideas?
ouberlord
WR.net Apprentice
WR.net Apprentice
 
Posts: 3
Joined: Tue Oct 09, 2007 6:40 am

Disable Bags from being searchable?

Postby zanix » Thu Oct 11, 2007 10:26 am

Not at the moment
Perhaps my sql isn't quite right
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5543
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Re: Disable Bags from being searchable?

Postby tuigii » Thu Oct 11, 2007 5:02 pm

zanix wrote:Not at the moment


And don't look for one - I'll have one already.

Somewhat, this question is already present here, with the answer : Help needed with setting up Rooster seach (Yup, this is the thread title :wink: - look at the last post)

But : looking back at it, it's far form complete.

I'll post back here a modified QSL sequence that:
Takes in account the global setting (All ON, All OFF, USER) about viewing sacs and banks. Viewing means also searchable, right ?!
Meaning "All ON" (for sacs and/or banks) - go head, search them, global enable.
Meaning All OFF (for sacs and/or banks) - no search in for sacs and/or banks.
USER : goto the per-character page, and put ON or OFF for each user individually (for sacs and/or banks).

That will cover your needs.

(This will be a huge statement :wink: )

[edit]

DONE.

Instead of this line (in file search.php) : 68:
Code: Select all
$query="SELECT players.name,players.server,items.* FROM `".ROSTER_ITEMSTABLE."` items,`".ROSTER_PLAYERSTABLE."` players  WHERE items.member_id = players.member_id AND items.item_name LIKE '%$search%' ORDER BY players.name ASC";

Put this multi line:
Code: Select all
   $query = "SELECT players.name, players.server, items.* ".
   "FROM `".ROSTER_CONFIGTABLE."` config, `".ROSTER_ITEMSTABLE."` items, `".ROSTER_PLAYERSTABLE."` players, `".ROSTER_MEMBERSTABLE."` members ".
   "WHERE ".
    "( ".
        "(players.member_id = items.member_id) " .
       "AND ".
        "(players.member_id = members.member_id) ".
    ") ".   
    "AND ".
     "( ".
       "(config.id = '7040' AND config.config_value = '1' AND items.item_parent LIKE 'Bag%' AND items.item_name LIKE '%$search%') ".
       "OR ".
       "(config.id = '7060' AND config.config_value = '1' AND items.item_parent LIKE 'Bank Bag%' AND items.item_name LIKE '%$search%') ".
      "OR ".
       "(config.id = '7040' AND config.config_value = '2' AND members.inv = '3' AND items.item_parent LIKE 'Bag%' AND items.item_name LIKE '%$search%') ".
       "OR ".
       "(config.id = '7060' AND config.config_value = '2' AND members.bank = '3' AND items.item_parent LIKE 'Bank Bag%' AND items.item_name LIKE '%$search%') ".
      ") ".
    "ORDER BY players.name ASC;";


This does what you want.

With the help of the Admin->Character Page and Admin->Per-Character Display you can set an 'All' (On), Nothing (Off) or Per character (User) permission for searching.
You can do so for Bank Bag' (='7060') and Character bags (='7040').

A nice (extension) idea would be : permit Roster Admins to search everywhere no matter these rules/settings :D

Recipes, also searched with the given search-word, are not limited by these settings/rules.

If one or both of these extensions are needed, just ask :wink:

Please understand : !! This post concerns 1.7.3 Rosters only !!!
(but the technic could/should be used in Beta V2 also...)
Last edited by tuigii on Fri Oct 12, 2007 2:24 am, edited 2 times in total.
User avatar
tuigii
WR.net Master
WR.net Master
 
Posts: 891
Joined: Wed Dec 27, 2006 12:57 pm
Location: Somewhere in the South Ouest of France

Disable Bags from being searchable?

Postby tuigii » Fri Oct 12, 2007 2:50 am

Bump because edited above with the answer.
User avatar
tuigii
WR.net Master
WR.net Master
 
Posts: 891
Joined: Wed Dec 27, 2006 12:57 pm
Location: Somewhere in the South Ouest of France

Re: Disable Bags from being searchable?

Postby ouberlord » Fri Oct 12, 2007 6:20 am

Wow. My pitiful SQL knowledge cries at how seemingly easy you made that look :) Thanks, it works flawlessly. The roster admin search-all functionality would be nice, but mainly we just wanted to filter out members who didn't want items to show and the easiest way I figured would be to disable the searching of items entirely. Having it configurable is awesome as we can allow bank characters to be searchable, so thanks for going above and beyond on that :)

Thanks again.
ouberlord
WR.net Apprentice
WR.net Apprentice
 
Posts: 3
Joined: Tue Oct 09, 2007 6:40 am


Return to Appearance

Who is online

Users browsing this forum: No registered users and 0 guests

cron