Jump to content

Database Search Block+


Nuclear General

Recommended Posts

%7Boption%7D



File Name: Database Search Block+

File Submitter: Nuclear General

File Submitted: 10 May 2011

File Category: Content Management



Place a working search box for any IPContent Database on any page or into any IPB template.
Demo using default media demo database here:
http://www.marchertech.com/media.html
board index non ipc page sidebar demo:
http://www.marchertech.com/board
Enjoy %7Boption%7D
3.2 Database Search Template Now included!
Documentation updated to reflect this.
Demo:
http://www.marchertech.com/test.php
3.2 file is Clearly Labeled db_search32.zip
I have decided the template bit should be a part of the new "filterbar" on top rather than a separate, duplicative bar.



here to download this file

Link to comment
Share on other sites

I've added this and am performing a test, but it doesn't work for me.

http://www.talkford.com/index.php?app=ccs&module=pages&section=pages&folder=&id=66

Search for "truro" which is the location of one of the ford dealerships, and it won't return any results.

The database I'm searching is this one:

http://www.talkford.com/index.php?app=ccs&module=pages&section=pages&folder=&id=20

What should this block be searching? Can it search fields? (thats what the Truro is)

Link to comment
Share on other sites


I've added this and am performing a test, but it doesn't work for me.





Search for "truro" which is the location of one of the ford dealerships, and it won't return any results.



The database I'm searching is this one:





What should this block be searching? Can it search fields? (thats what the Truro is)



thats odd, supposed to be searching the database specified in the code... ill look into why this isnt returning a result.
Did you follow the readme?, specifying the database in feed source, categories as content?
EDIT: Did some Testing, will update the download shortly with fix for non db page use with updated readme
Link to comment
Share on other sites

File updated, additional demo link http://www.marchertech.com/board/ 2 of them searching 2 separate databases functionally outside ipc
not absolutely certain how this would run with IPB external parse block js tags, but the revamp in methodology might work... again, not sure how that translates.
i'll go test on my neverused for squat WP install

Link to comment
Share on other sites

Mate, it works fine on IP pages. This is the dogs bollox, I can setup a little search page for all my custom databases :D :D :D

Thanks a lot for this Marcher :thumbsup:



I'll test it out on some non-ip.content pages with the iframe and JS, see if it works that way (will be very handy for me if it does ;) )

Link to comment
Share on other sites

  • 4 weeks later...

Is there any way this can search in the same manner as the main search function, ie boolean operators, keywords and so on? Also, is it possible to edit the template to be able to specify a particular field to search from a dropdown list of available fields?

Having installed this block, if I search for one word, eg springs, it will bring up all records with that word in any of the fields. However if I search for springs shocks it will only find records with that exact phrase rather than the two keywords individually, as if I had wrapped it in quotation marks.

Ideally, I would like members to be able to search in the manner they are accustomed to, and the ability to search a specific field, eg the record title.

Any help would be appreciated.

Link to comment
Share on other sites


Is there any way this can search in the same manner as the main search function, ie boolean operators, keywords and so on? Also, is it possible to edit the template to be able to specify a particular field to search from a dropdown list of available fields?



Having installed this block, if I search for one word, eg springs, it will bring up all records with that word in any of the fields. However if I search for springs shocks it will only find records with that exact phrase rather than the two keywords individually, as if I had wrapped it in quotation marks.



Ideally, I would like members to be able to search in the manner they are accustomed to, and the ability to search a specific field, eg the record title.



Any help would be appreciated.




try spring+shocks
I'm going to have to develop an advanced search block to do this at this time... but am loath to do so with 3.2 changes to how this works on the horizon already, seeing how this has changed the search methods completely.
To wit, i'm more focused on the 3.2 update for THIS block, which may include such capabilities.
Link to comment
Share on other sites

Nope, that didn't work. So multiple word searching is pretty much dead in the water.

At the very least, is there anything I can add to the template to specify a field within the database to search, rather than within all fields? Doesn't have to be selectable, just so I can specify that this search box searches the title rather than bring up every record with the particular word in the entire body text.

Link to comment
Share on other sites

i think.. i think i've figured a methodology to select a field, and multiple word searching... updating file/readme shortly.
Can at least do this for you right here as its not a difficult thing... multiple word searching is being... evil.
In the Block, at the Block Filters stage on these:
Custom Filter X
Filter based on custom field. Leave blank to ignore.
Select the field(s) you want searchable placing
?
as the filter.
or Not... Wow, Agreeing this shouldnt be This Supremely difficult... throwing refunds/removing price on this as thats just unfair.

Link to comment
Share on other sites

Tell me about it! :laugh:

I was setting the database up as a "neater" and more presentable alternative to having our tutorials as a list of topics in the forum. I'm now having second thoughts about that, as it seems that just leaving each one as a separate topic would be a whole lot less faffing about!

Link to comment
Share on other sites

  • 2 months later...

typo in updated 3.2 Readme, will patch shortly:
Step 5(optional, but included for 3.2 as IPS axed it):
Visit your ACP > My Apps > IP.Content > Database Templates and browse / upload the supplied template-export.xml

Step 6: Apply it to any database you wish or copy the code within the ipsFilterBar div tag into your custom template.

Link to comment
Share on other sites

  • 10 months later...

I love this block - many, many thanks!

However I have a slight problem.......

If I am on the first page of a listing and search (for example) carters, I get:

"Your search for the term carters returned 9 results" and the nine entries are listed.

If I am on the last page of the listing and do the same search I get

"Your search for the term carters returned 9 results" BUT instead of the nine entries I get "No records found"

Any idea what I am doing wrong??

Thanks again

Bill

Link to comment
Share on other sites

  • 3 weeks later...

I love this block - many, many thanks!



However I have a slight problem.......



If I am on the first page of a listing and search (for example) carters, I get:



"Your search for the term carters returned 9 results" and the nine entries are listed.



If I am on the last page of the listing and do the same search I get



"Your search for the term carters returned 9 results" BUT instead of the nine entries I get "No records found"



Any idea what I am doing wrong??



Thanks again



Bill




I haven't changed anything, but there is still an issue with searching, although slightly different from above.

The search ONLY works if you are on page one, if you are on any other page you get an error.

Any help please??

Cheers

Bill
Link to comment
Share on other sites

  • 1 month later...

Hi



Did you ever have a chance to look into this at all?



Cheers



Bill



Yes, and what i found is not truly helpful... basically the search thinks... somehow, you are on page 2 of the results screen.
if there is no page 2 of results, ipb itself throws a page not found.
the only fix i can think of really is a hidden form element forcing it to page 1.


<input type="hidden" value="0" name="st" />


Should resolve the issue I think.... testing this now.

Link to comment
Share on other sites


Yes, and what i found is not truly helpful... basically the search thinks... somehow, you are on page 2 of the results screen.


if there is no page 2 of results, ipb itself throws a page not found.


the only fix i can think of really is a hidden form element forcing it to page 1.



<input type="hidden" value="0" name="st" />


Should resolve the issue I think.... testing this now.


which worked beautifully... also updated the templates to reflect 2.3.2 IPC standards.... db_search33.zip file has these changes.
Link to comment
Share on other sites

  • 1 year later...

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...