Hacked the search component to specify section/category for search!

Your code modifications and patches you want to share with others.
User avatar
bijan
Joomla! Intern
Joomla! Intern
Posts: 51
Joined: Mon Aug 22, 2005 4:40 am
Contact:

Hacked the search component to specify section/category for search!

Postby bijan » Wed Sep 28, 2005 8:19 pm

Hi everybody, how're ya?!

one of my friends asked me to do a little hack on the search component to give the searchers the ability to select which section/category they'd like to search in, not just simply searching the whole site! So, I made this which does the job perfectly for Joomla 1 and Manbo4.5.2

I just wanted to share and know your idea about it!

User avatar
guilliam
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4181
Joined: Thu Aug 18, 2005 10:27 am
Location: Sunny City Cebu, Philippines!
Contact:

Re: Hacked the search component to specify section/category for search!

Postby guilliam » Sun Oct 02, 2005 2:21 am

hello bijan!

its nice to hear you made this! already posted a wishlist/request of this function to be incorporated with the core it self.. but the core mentioned that this would be integrated in future joomla release. this hack is very good for someone who needs this specific function while this is not yet available in the core.

i already downloaded the file and see how it runs.. any bugs i find... i'll le t you know via pm. if i run without a glitch.. i'll post it here on this thread. by the way,..

btw.. i'll be asking fellow global mods to transfer this thread to the the 3PD section of the forums which it is more appropriate than to be here in the custom development. NOT unless youre planning to release this under common creative licsense or commercial liscense.

-guilliam
Last edited by guilliam on Sun Oct 02, 2005 4:49 am, edited 1 time in total.
"I was one of those who wondered why people would pay so much $$$$ to do something that was so much fun!" -R. Harkrider, Fortran Code Engr.

http://www.joomlaconsultancy.net

User avatar
bijan
Joomla! Intern
Joomla! Intern
Posts: 51
Joined: Mon Aug 22, 2005 4:40 am
Contact:

Re: Hacked the search component to specify section/category for search!

Postby bijan » Mon Oct 03, 2005 7:35 pm

hey guilliam, how're ya doin'?

I noticed you changed your avatar, it's nice & beautiful ;)

Thanks for testing my sort of modification and I'm looking forward for any bug or ... No, I don't wana make it CC or Comercial, after all I only added some few lines, which would be nothing in comparision with the whole Joomla!

Cheers,
bijan

User avatar
guilliam
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4181
Joined: Thu Aug 18, 2005 10:27 am
Location: Sunny City Cebu, Philippines!
Contact:

Re: Hacked the search component to specify section/category for search!

Postby guilliam » Mon Oct 03, 2005 7:40 pm

ehehehe.. yup i did chaned my avatar.. but still side view effect.. i took the search hack for a spin.. and its great! on my local.. been trying to see what and which lines did you added. .ahihihi.. im making a compare actually.

btw.. this thread have been transfered in the "3PD custom dev" category of the forum. since its best suied here. good luck!
"I was one of those who wondered why people would pay so much $$$$ to do something that was so much fun!" -R. Harkrider, Fortran Code Engr.

http://www.joomlaconsultancy.net

User avatar
bijan
Joomla! Intern
Joomla! Intern
Posts: 51
Joined: Mon Aug 22, 2005 4:40 am
Contact:

Re: Hacked the search component to specify section/category for search!

Postby bijan » Tue Oct 04, 2005 11:15 am

Well, if this is your picture, then you really do not need any effect my dear, you're WAAAAAAAAAAY beautiful!

I didn't make much changes, just putting those 2 relative combo boxes (selecting section/category) was a little bit hard at the beginning coz I had to find out how they actually made it and where's the JS and blah blah, but now that I figured it out it's very easy! I also added some WHERE conditions to the SQL queries which was very easy. And then I disabled all the mambots except the Contents mambot if the user is searching in a special section/category, coz he/she's interested in the contents not the user contacts and ... So, I only added one "if" condition at the beginning of all the mambots to return NULL if my user selected a section or category.

That's all, BTW I know this post was moved, thanks, I don't know why I didn't see this part of the forums while posting!

PS: I really didn't think anybody would read what I wrote, even though I tried to be clear, but sometimes I don't use some good language in my comments, so, forgive me for them if I forgot to delete anything!
Last edited by bijan on Tue Oct 04, 2005 11:24 am, edited 1 time in total.

User avatar
PBST
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 221
Joined: Thu Aug 18, 2005 7:16 am
Location: Copenhagen - Denmark
Contact:

Re: Hacked the search component to specify section/category for search!

Postby PBST » Thu Oct 06, 2005 8:49 pm

Hi bijan,

I really appreciate your effort and I am glad you took the time to implement this feature.

For at no so technical person as myself, can you explain what to do if I want to have this feature shown on the frontpage together with the searchbox?

Like this - |All Sections|  |All Categorys|  |Search...|

Peter
------------------------------------------------------------
Powered by Joomla - Supported by the Community
------------------------------------------------------------

User avatar
bijan
Joomla! Intern
Joomla! Intern
Posts: 51
Joined: Mon Aug 22, 2005 4:40 am
Contact:

Re: Hacked the search component to specify section/category for search!

Postby bijan » Fri Oct 07, 2005 7:15 am

Hey Peter, how're ya doin'?

I'm glad that you liked it. I don't quite seem to understand the situation, are you telling me that you wana have the 2 Sections/Category combo boxes shown in your front page below the search box? If this is the question that I should tell ya that you have to modify the Search module to show these stuff. And again if this is what you want tell me to take a look at it and see if I can be of any help. I'm not a Joomla developer myself, I mean I only know some basic stuff about how to make comonents and ... But I never actually wrote anything complete! If you know what I mean ;)

User avatar
PBST
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 221
Joined: Thu Aug 18, 2005 7:16 am
Location: Copenhagen - Denmark
Contact:

Re: Hacked the search component to specify section/category for search!

Postby PBST » Fri Oct 07, 2005 9:45 pm

bijan wrote:Hey Peter, how're ya doin'?

I'm glad that you liked it. I don't quite seem to understand the situation, are you telling me that you wana have the 2 Sections/Category combo boxes shown in your front page below the search box?


Well, not quite. I need to show the section/category options next to (as right in front of horizontally) the search box on the frontpage. Sure I have to modify the following code so that drop down boxes call the functions from the component but this is what I don't know how to do. If you got anny idea please let me know otherwise thanks for adding the feature to the Joomla! component.

Code: Select all

<td><form action="index.php" method="post">
  <div align="center">
    <input class="inputbox" type="text" name="searchword" size="15" value="<?php echo _SEARCH_BOX; ?>"  onblur="if(this.value=='') this.value='<?php echo _SEARCH_BOX; ?>';" onfocus="if(this.value=='<?php echo _SEARCH_BOX; ?>') this.value='';" />
    <input type="hidden" name="option" value="search" />
  </div>
</form>
</td>
------------------------------------------------------------
Powered by Joomla - Supported by the Community
------------------------------------------------------------

emeyer
Joomla! Explorer
Joomla! Explorer
Posts: 352
Joined: Thu Sep 29, 2005 2:37 am

Re: Hacked the search component to specify section/category for search!

Postby emeyer » Tue Oct 18, 2005 9:38 am

Hi guys

While were around this one, what do you think of a new weighted search that attempts to provide the most likely sought matches----for example, by displaying text from titles and heading tags first (I guess in order of menu level and heading level). As far as I can fathom no one is doing this yet, not even the fancy 3pds. Took me a little by surprise, that one.

User avatar
bijan
Joomla! Intern
Joomla! Intern
Posts: 51
Joined: Mon Aug 22, 2005 4:40 am
Contact:

Re: Hacked the search component to specify section/category for search!

Postby bijan » Tue Oct 18, 2005 12:15 pm

yes, it could be a good one. You can even write something to do match..against sort of search in mysql, which gives the most probable result, I think using match..against gonna be more elegant due to its algorithem

emeyer
Joomla! Explorer
Joomla! Explorer
Posts: 352
Joined: Thu Sep 29, 2005 2:37 am

Re: Hacked the search component to specify section/category for search!

Postby emeyer » Mon Oct 31, 2005 9:10 am

...a more immediate issue for this implementation, as far as I can tell it bypasses permissions, so guests for example can access sections which are meant to be restricted to registered users...unless I am doing something wrong?

User avatar
guilliam
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4181
Joined: Thu Aug 18, 2005 10:27 am
Location: Sunny City Cebu, Philippines!
Contact:

Re: Hacked the search component to specify section/category for search!

Postby guilliam » Sat Nov 05, 2005 6:44 am

@bijan,

pls check this thread in case you need any guidance to make this hack of yours to be polished and be made into a full component.

http://forum.joomla.org/index.php/topic,652.0.html

thanks. kudos!

- guilliam
"I was one of those who wondered why people would pay so much $$$$ to do something that was so much fun!" -R. Harkrider, Fortran Code Engr.

http://www.joomlaconsultancy.net

emeyer
Joomla! Explorer
Joomla! Explorer
Posts: 352
Joined: Thu Sep 29, 2005 2:37 am

Re: Hacked the search component to specify section/category for search!

Postby emeyer » Sat Nov 05, 2005 3:23 pm

..should be clearer: it only checks security on the items, not the access permission on the categories and sections. Pr maybe its the other way round.

User avatar
millarch
Joomla! Apprentice
Joomla! Apprentice
Posts: 21
Joined: Thu Aug 18, 2005 7:02 pm
Location: Brazil
Contact:

Re: Hacked the search component to specify section/category for search!

Postby millarch » Thu Jun 08, 2006 6:38 pm

Hi Guys !

The link in the first post no longer works? Does anyone know the new location?

Thanks !
altermedia - interactive communications
www.altermedia.com.br

davo1
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Wed Nov 01, 2006 12:34 pm

Re: Hacked the search component to specify section/category for search!

Postby davo1 » Tue Nov 14, 2006 3:45 am

Hi,
I am also looking to modify the search function so it can be refined by section, or category, or both.
Is this file mentioned above available, or does anyone know of something I could use?
Regards
Dave

tvds
Joomla! Intern
Joomla! Intern
Posts: 55
Joined: Thu Oct 20, 2005 8:37 am
Location: Wolphaartsdijk / Zeeland / Netherlands
Contact:

Re: Hacked the search component to specify section/category for search!

Postby tvds » Wed Nov 22, 2006 9:58 am

I also would like to search in a certain category only, any word on this ?
To boldly go........ where no man has gone before http://www.vandersluijs.nl

libby
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 213
Joined: Mon Oct 31, 2005 1:01 pm

Re: Hacked the search component to specify section/category for search!

Postby libby » Tue Dec 12, 2006 1:09 pm

Hi
I tried to download the search hack but it's no longer available at this url. Does anyone have the code?
Many thanks
Libby

User avatar
trichnosis
Joomla! Explorer
Joomla! Explorer
Posts: 315
Joined: Wed May 17, 2006 4:15 pm

Re: Hacked the search component to specify section/category for search!

Postby trichnosis » Fri Jan 12, 2007 10:30 pm

download url does not work . can some upload it as an attachment? thanks

User avatar
pianojibbs
Joomla! Apprentice
Joomla! Apprentice
Posts: 32
Joined: Mon Aug 21, 2006 9:32 pm
Location: Pullman, Washington, USA
Contact:

Re: Hacked the search component to specify section/category for search!

Postby pianojibbs » Wed Jan 24, 2007 6:06 pm

Whew, I finally found it on this post.

http://forum.joomla.org/index.php/topic,38626.0.html

dannygsam
Joomla! Intern
Joomla! Intern
Posts: 69
Joined: Wed Sep 17, 2008 4:37 am

Re: Hacked the search component to specify section/category for

Postby dannygsam » Mon Apr 06, 2009 9:42 am

anyone knows a simple if condition to detect a particular section or category on a joomla template? I need to exclude some modules..which i am unable to using the Menu Assignment option..

emeyer
Joomla! Explorer
Joomla! Explorer
Posts: 352
Joined: Thu Sep 29, 2005 2:37 am

Re: Hacked the search component to specify section/category

Postby emeyer » Fri Mar 04, 2011 2:34 pm

ACLs change in 1.6...Not sure If simple condition would work for both versions. Might need to be more complex.


Return to “Core Hacks and Patches”

Who is online

Users browsing this forum: No registered users and 2 guests