Advertisement:

Author Topic: Search in mambo/smf-forums/coppermine-gallery  (Read 64561 times)

Offline bmwheaven

  • Semi-Newbie
  • *
  • Posts: 56
  • Gender: Male
  • Sh*t happens.... All the time
    • BMW Heaven - The Knowledge Base
Search in mambo/smf-forums/coppermine-gallery
« on: March 25, 2005, 03:46:38 PM »
Here it is, the search function combined for mambo, smf and coppermine (in the mambo-wrapper component).
You can put this code in your mambo template (index.php).
You'll get a search box, together with a selection box, where you can select which part of the site you want to search on.

code (for in index.php in your mambo template):
NOTE: you have to add a wrapper in your com_wrapper admin, point it to http://yoursite.com/gallery/thumbnails.php and call it cpg_search

Code: [Select]
//put this in between the <head></head> tags
<script language="JavaScript">
<!--
function processForm()
{
f = document.searchform;
switch (f.searcharea.selectedIndex)
{
// mambo
case 0: f.method='post';
f.action='index.php?option=search';
break;
//smf
case 1: f.method='post';
f.action='index.php?option=com_smf&Itemid=51&action=search2';
f.search.value=f.searchword.value;
f.option.value="";
break;
//coppermine
case 2: f.method='get';
f.action='index.php?option=com_wrapper&wrap=cpg_search&album=search&type=full';
f.search.value=f.searchword.value;
f.option.value = "com_wrapper";
f.wrap.value = "cpg_search";
break;
}
f.submit();
}
-->
</script>

//put this in the place you want the searchbox to display
<form name='searchform' action='javascript:processForm()' method='post'>
            <div class="searchblock" id="searchblock">
              <input size="15" class="inputbox" type="text" name="searchword" style="width:128px;" value="search..."  onblur="if(this.value=='') this.value='search...';" onfocus="if(this.value=='search...') this.value='';" />
              <input type="hidden" name="option" value="search" />
  <input type="hidden" name="wrap" value="cpg_search" />  
  <!--cpg-->
  <input type="hidden" name="album" value="search" />
  <input type="hidden" name="search" />
  <!--end cpg-->
 
  <!--smf-->
  <input type="hidden" name="advanced" value="0" />
  <!--end smf-->
 
              <select name="searcharea">
                <option value = 0>Articles</option>
                <option value = 1>Forum</option>
                <option value = 2>Image Gallery</option>
              </select>
              <br>
              <input type="submit" value="GO" class="button" style="width:35px;" />
            </div>
          </form>


Hope I've told everything, you can always ask!
Thanks to Orstio for helping :)

Ilir
Sh*t happens
All the time

Offline Janner

  • Semi-Newbie
  • *
  • Posts: 70
Re: Search in mambo/smf-forums/coppermine-gallery
« Reply #1 on: March 27, 2005, 02:58:39 AM »
Presumably this line has to be changed to reflect the itemid of your own installation:

Code: [Select]
f.action='index.php?option=com_smf&Itemid=51&action=search2';
White Cane Media: web hosting for the blind and visually impaired.

Offline bmwheaven

  • Semi-Newbie
  • *
  • Posts: 56
  • Gender: Male
  • Sh*t happens.... All the time
    • BMW Heaven - The Knowledge Base
Re: Search in mambo/smf-forums/coppermine-gallery
« Reply #2 on: March 27, 2005, 06:51:16 AM »
yep, sry... forgot that....
Sh*t happens
All the time

Offline deejayh

  • Jr. Member
  • **
  • Posts: 144
  • Gender: Male
    • Family History UK - Genealogy portal community for the UK
Re: Search in mambo/smf-forums/coppermine-gallery
« Reply #3 on: April 05, 2005, 05:30:21 AM »
Hi,

Does this only work in a wrapped SMF Forum and wrapped Coppermine -  On my site they are UN-WRAPPED,

Dave
Regards,
Dave
Family History UK  - http://www.familyhistory.uk.com

Offline jorgen

  • Jr. Member
  • **
  • Posts: 249
  • Gender: Male
    • Scandinavian Inventorforum
Re: Search in mambo/smf-forums/coppermine-gallery
« Reply #4 on: April 05, 2005, 10:56:50 AM »
Could this be made an a mambo-module for easier installation?

And can it easily be customized for Mambo-smf only?

Offline bmwheaven

  • Semi-Newbie
  • *
  • Posts: 56
  • Gender: Male
  • Sh*t happens.... All the time
    • BMW Heaven - The Knowledge Base
Re: Search in mambo/smf-forums/coppermine-gallery
« Reply #5 on: April 07, 2005, 12:22:13 PM »
Hi,

Does this only work in a wrapped SMF Forum and wrapped Coppermine -  On my site they are UN-WRAPPED,

Dave
You can modify them easily for an unwrapped coppermine, just change this line in case 2:
Code: [Select]
//coppermine
case 2: f.method='get';
f.action='index.php?option=com_wrapper&wrap=cpg_search&album=search&type=full';
f.search.value=f.searchword.value;
f.option.value = "com_wrapper";
f.wrap.value = "cpg_search";
break;
to
Code: [Select]
//coppermine
case 2: f.method='get';
f.action='/coppermine/thumbnails.php&album=search&type=full';
f.search.value=f.searchword.value;
f.option.value = "";
f.wrap.value = "cpg_search";
break;

for smf you have to search the values for the form, I don't know them...


Could this be made an a mambo-module for easier installation?

And can it easily be customized for Mambo-smf only?
customizing for mambo-smf only is easy, just delete (or comment out) the things you dont need, for example:
Code: [Select]
//put this in between the <head></head> tags
<script language="JavaScript">
<!--
function processForm()
{
f = document.searchform;
switch (f.searcharea.selectedIndex)
{
// mambo
case 0: f.method='post';
f.action='index.php?option=search';
break;
//smf
case 1: f.method='post';
f.action='index.php?option=com_smf&Itemid=51&action=search2';
f.search.value=f.searchword.value;
f.option.value="";
break;
}
f.submit();
}
-->
</script>

//put this in the place you want the searchbox to display
<form name='searchform' action='javascript:processForm()' method='post'>
            <div class="searchblock" id="searchblock">
              <input size="15" class="inputbox" type="text" name="searchword" style="width:128px;" value="search..."  onblur="if(this.value=='') this.value='search...';" onfocus="if(this.value=='search...') this.value='';" />
              <input type="hidden" name="option" value="search" />
  <!--smf-->
  <input type="hidden" name="advanced" value="0" />
  <!--end smf-->
 
              <select name="searcharea">
                <option value = 0>Articles</option>
                <option value = 1>Forum</option>
              </select>
              <br>
              <input type="submit" value="GO" class="button" style="width:35px;" />
            </div>
          </form>

This should work...
Didn't test it though, let me know

Owh, and to the question if this could be made a module, probably it could, but really don't know how exactly...
Sh*t happens
All the time

Offline deejayh

  • Jr. Member
  • **
  • Posts: 144
  • Gender: Male
    • Family History UK - Genealogy portal community for the UK
Re: Search in mambo/smf-forums/coppermine-gallery
« Reply #6 on: April 17, 2005, 11:58:51 AM »
Hi,

I have the normal Mambo search in my index.php.
I would like to add an "advanced Search" link to go to a "static page" where this code would go to search:
1)  Mambo
2) SMF
3) some other components (such as "classifieds") which do not yet have a mambot search!

Could this be achieved?

Regards,
Dave
Regards,
Dave
Family History UK  - http://www.familyhistory.uk.com

Offline bmwheaven

  • Semi-Newbie
  • *
  • Posts: 56
  • Gender: Male
  • Sh*t happens.... All the time
    • BMW Heaven - The Knowledge Base
Re: Search in mambo/smf-forums/coppermine-gallery
« Reply #7 on: April 19, 2005, 10:22:07 AM »
You can create a custom page in mambo, and put in the search code I used for the module...
You can use a static content page, and paste in the html/javascript code provided, shouldn't be too difficult.
Sh*t happens
All the time

Offline deejayh

  • Jr. Member
  • **
  • Posts: 144
  • Gender: Male
    • Family History UK - Genealogy portal community for the UK
Re: Search in mambo/smf-forums/coppermine-gallery
« Reply #8 on: April 19, 2005, 03:38:38 PM »
Hi bmwheaven,

Do you mean the module that is in the bridge files?

Dave
Regards,
Dave
Family History UK  - http://www.familyhistory.uk.com

Offline Kindred

  • Local Moderator
  • SMF Master
  • *
  • Posts: 31,359
  • Gender: Male
    • wagner999 on Facebook
    • @Kindred_999 on Twitter
Re: Search in mambo/smf-forums/coppermine-gallery
« Reply #9 on: April 19, 2005, 04:19:20 PM »
Actually, Adding your code into the search module does not work....

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support forums.  Thank you.

Offline bmwheaven

  • Semi-Newbie
  • *
  • Posts: 56
  • Gender: Male
  • Sh*t happens.... All the time
    • BMW Heaven - The Knowledge Base
Re: Search in mambo/smf-forums/coppermine-gallery
« Reply #10 on: April 19, 2005, 04:52:45 PM »
Nope, I meant adding the code into a seperate file, through your admin, select Content->Static Content Manager
Then add new, and put the code in there...
On the right side you can make a direct link (Link to Menu), so that the link to this search page will be displayed in the menu you choose.
Hope this helps, I really gotta get some sleep.
nn
Sh*t happens
All the time

Offline deejayh

  • Jr. Member
  • **
  • Posts: 144
  • Gender: Male
    • Family History UK - Genealogy portal community for the UK
Re: Search in mambo/smf-forums/coppermine-gallery
« Reply #11 on: April 28, 2005, 05:25:47 AM »
Sorry to trouble you again!

What about a SMF search Mambot?

So it would be a straight forward search.
It seems there are loads of people adding search mambots for their components.

I would not know where to start though! :)

Just a thought!
Dave
Regards,
Dave
Family History UK  - http://www.familyhistory.uk.com

Offline bmwheaven

  • Semi-Newbie
  • *
  • Posts: 56
  • Gender: Male
  • Sh*t happens.... All the time
    • BMW Heaven - The Knowledge Base
Re: Search in mambo/smf-forums/coppermine-gallery
« Reply #12 on: April 28, 2005, 05:49:07 AM »
Hey Dave,
it sounds really good, I know.. but I really don't have the time to build it, and don't know how to (yet)...
Maybe someone else would like to look into it?
Sh*t happens
All the time

Offline deejayh

  • Jr. Member
  • **
  • Posts: 144
  • Gender: Male
    • Family History UK - Genealogy portal community for the UK
Re: Search in mambo/smf-forums/coppermine-gallery
« Reply #13 on: April 28, 2005, 09:29:20 AM »



anyone willing to have a go at this?

Upto the challenge?
Regards,
Dave
Family History UK  - http://www.familyhistory.uk.com

Offline Radianation

  • Sophist Member
  • *****
  • Posts: 1,275
  • Gender: Male
  • Why not believe in me?
Re: Search in mambo/smf-forums/coppermine-gallery
« Reply #14 on: May 04, 2005, 05:53:32 AM »
I too am looking for integrated search in mambot form.

Offline d3v

  • Jr. Member
  • **
  • Posts: 209
Re: Search in mambo/smf-forums/coppermine-gallery
« Reply #15 on: May 21, 2005, 05:54:14 AM »
Did anyone ever pick this up?
SMF Searchbot for Mambo sounds soooo good  :P

Offline d3v

  • Jr. Member
  • **
  • Posts: 209
Re: Search in mambo/smf-forums/coppermine-gallery
« Reply #16 on: May 24, 2005, 12:33:39 AM »
I swear I saw something like that on one of the Mambo sites. Am I day dreaming or such a thing exists in nature? Thank you.

I refer to just Mambo-SMF search bot. not Coppermine

Offline bmwheaven

  • Semi-Newbie
  • *
  • Posts: 56
  • Gender: Male
  • Sh*t happens.... All the time
    • BMW Heaven - The Knowledge Base
Re: Search in mambo/smf-forums/coppermine-gallery
« Reply #17 on: May 24, 2005, 06:13:03 PM »
I haven't got a clue....
I just wrote it, because I didn't find anything that suited my needs....
Sh*t happens
All the time

Offline chadness

  • Sophist Member
  • *****
  • Posts: 1,025
  • Gender: Male
    • technoadvice.com
Re: Search in mambo/smf-forums/coppermine-gallery
« Reply #18 on: May 27, 2005, 11:53:02 AM »
Ideally it would be two different bots.  One for SMF, one for Coppermine.  No need to mix them - then people can just install what they need.

Offline d3v

  • Jr. Member
  • **
  • Posts: 209
Re: Search in mambo/smf-forums/coppermine-gallery
« Reply #19 on: May 30, 2005, 07:05:22 AM »
Is it possible to make this without the dropdown box (Articles/Forum) but rather just one search box that would search both and show results for both on the same page? Thank you.