Author Topic: MOD: Search Enhancements (Video, Audio, Groups)  (Read 3723 times)

sbcjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6237
    • PHPmotion Mods
MOD: Search Enhancements (Video, Audio, Groups)
« on: April 12, 2009, 10:47:22 PM »
This mod:
  • Displays number of search results returned (see screenshot below)
  • Displays "result(s)" as singular or plural, depending on the number of items returned
  • Includes group search that works
  • Returns better (and more) results (thanks frankie)
  • Modifies pagination to dim the page number that you're currently on

DISCLAIMER:  Please backup your files before installing this mod.  If you have made changes to your template (.htm) files, you'll need to follow the Manual Instructions below instead of using the supplied template files.


Simple Installation
1) Upload search.php from the "root" folder to the root directory of your PHPmotion installation, pagination.inc.php from the "classes" folder to your "classes" directory, and all files from the "templates-OPTIONAL" folder to your "templates" directory.

That's it!  :)


Manual Installation (For those who have edited their template files.)
1) Upload search.php from the "root" folder to the root directory of your PHPmotion installation, and pagination.inc.php from the "classes" folder to your "classes" directory.

2) In each of these files:
  • inner_search.htm
  • inner_search_audio.htm
  • inner_search_groups.htm

Replace this:
Code: [Select]
<div id="AllHeaderTitles"><span class="font4_16"><!--[var.see_more_title;comm]-->
</span><span class="font4_18">&nbsp;&nbsp;&nbsp;Search results:</span>
<!--[var.keyword;ope=max:70;comm]--></div>

With this:
Code: [Select]
<div id="AllHeaderTitles"><span class="font4_16"><!--[var.see_more_title;comm]-->
</span><span class="font4_18">&nbsp;&nbsp;&nbsp;[var.returned] [var.results] for "<!--[var.keyword;ope=max:70;comm]-->"</span></div>

Demo: http://trashcars.net/search/jump

NOTE: Since the demo is an already modified site, it will (obviously) look a little different than this mod applied to the default template.
« Last Edit: April 12, 2009, 11:04:03 PM by sbcjr »

chrisj

  • Jr. Member
  • **
  • Posts: 138
Re: MOD: Search Enhancements (Video, Audio, Groups)
« Reply #1 on: April 29, 2009, 05:27:39 PM »
Thanks for this Mod. However, I'm having an issue. Maybe you can tell me why this is happening and where I might be able to fix it. When I search, and see the results on the search page I see this:

2 results for "" 

Can you tell me why I'm seeing """"?

Thanks.

ouadie

  • Newbie
  • *
  • Posts: 72
Re: MOD: Search Enhancements (Video, Audio, Groups)
« Reply #2 on: April 29, 2009, 06:06:15 PM »
Hi,
Greate but i am searching How to Display Search result

Sort / order by:
Date

    * today
    * yesterday
    * last week
    * last year
    * anytime



order by

    * relevance
    * views
    * comments
    * rating

sbcjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6237
    • PHPmotion Mods
Re: MOD: Search Enhancements (Video, Audio, Groups)
« Reply #3 on: April 29, 2009, 09:32:43 PM »
Thanks for this Mod. However, I'm having an issue. Maybe you can tell me why this is happening and where I might be able to fix it. When I search, and see the results on the search page I see this:

2 results for "" 

Can you tell me why I'm seeing """"?

Thanks.

Hi Chris, thanks.  ;)

Did you use the manual installation, or the simple?

sbcjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6237
    • PHPmotion Mods
Re: MOD: Search Enhancements (Video, Audio, Groups)
« Reply #4 on: April 29, 2009, 09:35:35 PM »
Hi,
Greate but i am searching How to Display Search result

Sort / order by:
Date

    * today
    * yesterday
    * last week
    * last year
    * anytime



order by

    * relevance
    * views
    * comments
    * rating

I'm sorry, this mod doesn't really cover those... you can look at the existing cases, and maybe add your own for different sort methods... I've seen some search.php's that have that functionality, but I don't remember where.

chrisj

  • Jr. Member
  • **
  • Posts: 138
Re: MOD: Search Enhancements (Video, Audio, Groups)
« Reply #5 on: April 29, 2009, 11:32:55 PM »
Thanks for your reply.

I used the Simple Install

sbcjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6237
    • PHPmotion Mods
Re: MOD: Search Enhancements (Video, Audio, Groups)
« Reply #6 on: April 30, 2009, 07:29:55 AM »
Thanks for your reply.

I used the Simple Install

What's your url?  Thanks!

chrisj

  • Jr. Member
  • **
  • Posts: 138
Re: MOD: Search Enhancements (Video, Audio, Groups)
« Reply #7 on: April 30, 2009, 11:23:15 AM »
I've emailed it.

sbcjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6237
    • PHPmotion Mods
Re: MOD: Search Enhancements (Video, Audio, Groups)
« Reply #8 on: April 30, 2009, 11:57:47 AM »
It has to do with the modifications to your site, probably the search form in main_1.htm.

It works correctly if you go to it: yoursite.com/search.php?keyword=test

I love what you have going on!  Very nice.

chrisj

  • Jr. Member
  • **
  • Posts: 138
Re: MOD: Search Enhancements (Video, Audio, Groups)
« Reply #9 on: April 30, 2009, 12:35:24 PM »
Thanks for your reply.

Are you saying when I moved the search box from the header to the inner_index, it messed up the mod?
Can you help me fix this?

Thanks

sbcjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6237
    • PHPmotion Mods
Re: MOD: Search Enhancements (Video, Audio, Groups)
« Reply #10 on: April 30, 2009, 12:49:06 PM »
It didn't mess up the mod, really, the mod is working correctly- but I'm pretty sure that commenting out parts of the search form is what prevents it from functioning.

chrisj

  • Jr. Member
  • **
  • Posts: 138
Re: MOD: Search Enhancements (Video, Audio, Groups)
« Reply #11 on: April 30, 2009, 01:31:51 PM »
Thanks for your reply. Yes it was my modifications, of course....
Yes, it was this line that I commented out:

 <select size="1" name="type" class="FormSpecialInput_1">

Uncommented, it works. Commented it doesn't work.
However uncommented shows the drop down box.
Being that the only choice I'm offering is Videos, can this line be changed so whatever is searched is just for videos? So the drop-down box doesn't appear?

Thanks.

sbcjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6237
    • PHPmotion Mods
Re: MOD: Search Enhancements (Video, Audio, Groups)
« Reply #12 on: April 30, 2009, 01:55:11 PM »
You should be able to do something like this:
Code: [Select]
  <form class="FormSearch" method="POST" action="search.php">
     <input type="text" name="keyword" size="32" class="FormSpecialInput_1" />
     <input type="hidden" name="type" value="videos" />
     <input type="submit" value="Submit" name="B2" />
  </form>

chrisj

  • Jr. Member
  • **
  • Posts: 138
Re: MOD: Search Enhancements (Video, Audio, Groups)
« Reply #13 on: April 30, 2009, 02:53:12 PM »
Thanks. Perfect.

chrisj

  • Jr. Member
  • **
  • Posts: 138
Re: MOD: Search Enhancements (Video, Audio, Groups)
« Reply #14 on: April 30, 2009, 02:56:10 PM »
Can you please tell me where to change the font & font color of the text line  " 2 results for"

and also where would I change the font & font color of "No videos found, please....".


Thanks again.