Members: 16,996
Threads: 38,846
Posts: 159,391
Online: 42

Newest Member: Kl_broka@rediffmail.com


Odoo.tv - Outdoor Television


Sedo - Domains kaufen und verkaufen das Projekt mambers.com steht zum Verkauf Besucherstatistiken von mambers.com etracker® Web-Controlling statt Logfile-Analyse
Old 05.12.2004, 03:42   #1 (permalink)
Baby Mamber
 
Join Date: Sep 2004
Posts: 6
sandboxl33t is on a distinguished road
Default AKOStaff Search Mambot

Hello all,

I thought I'd post this here, as I know from looking that there's a bit of interest in this functionality. Essentially I just took the AKOBook Mambot search function and modified it to search the AKOStaff tables. I can take very little credit for this, as its based on the akobook search mambot by Arthur Konze. However, just so he doesn't get support requests for this, I've added my own information. If I'm in the wrong, could somebody please let me know? I'm a designer, not a lawyer.

This is a very quick and dirty hack, with absolutely no extra logic built in, but I'm new at this so bear with me.

Download the AKOBook component, unzip it and look at the files in there. Essentially I just changed the akobook.searchbot files and renamed them to akostaff.searchbot. The XML file looks something like this:

Code:
<?xml version="1.0" encoding="iso-8859-1"?>
<mosinstall version="4.5.1" type="mambot" group="pat">
  <name>AkoStaff Searchbot</name>
  <documentElement>akostaff.searchbot</documentElement>
  <creationDate>03.12.2004</creationDate>
  <copyright>AKOStaff search hack by Andrew Hankinson</copyright>
   <author>Andrew Hankinson</author>
 <authorEmail>N/A</authorEmail>
  <authorUrl>adc.acadiau.ca</authorUrl>
  <version>1.0</version>
  <description>AkoStaff Searchbot lets you search through your AkoStaff items</description>
  <files>
    <filename mambot="akostaff.searchbot">akostaff.searchbot.php</filename>
  </files>
  <params />
</mosinstall>
Then, the akostaff.searchbot.php looks like this: (only relevant portions have been left in.)


PHP Code:
<?php

/** Register search function inside Mambo's API */
$_MAMBOTS->registerFunction'onSearch''botSearchAkoStaff' );

/**
* AkoStaff Search Engine
* @param array Named 'text' element is the search term
*/
function botSearchAkoStaff$text ) {
  global 
$database;
  
$text trim$text );
  if (
$text == '') {
    return array();
  }
  
$database->setQuery"SELECT name AS title,"
    
"\n biography AS text,"
    
"\n staff_in AS created,"
    
"\n 'Staff' AS section,"
    
"\n CONCAT('index.php?option=com_akostaff&Itemid=100&func=fullview&staffid=',id) AS href,"
    
"\n '2' AS browsernav"
    
"\n FROM #__akostaff"
    
"\n WHERE biography LIKE '%$text%' OR name like '%$text%' or position LIKE '%$text%'"
    
"\n AND published='1'"
    
"\n ORDER BY id"
  
);
  return 
$database->loadObjectList();
}

?>
As you can see, I've made some concessions - it's using the "staff_in" as the published date, which is probably bad, and uses a hard-coded "Staff" for the section.
After that, simply zip those two files up, install it on your site, publish the bot, and voila!
sandboxl33t is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Old 03.11.2005, 19:18   #2 (permalink)
Baby Mamber
 
Join Date: Aug 2005
Posts: 3
terryit3 is on a distinguished road
Default Re: AKOStaff Search Mambot

Thanks for the mambot...

but I can't seem to get it to work..

If I search a term that I know is applicable, it still brings up 0 results.

Any ideas? I'm using Mambo 4.5.2.3 and AkoStaff 1.0 beta 6.

Thanks for any help..

If I figure out what is wrong, I will post my results..
terryit3 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create a Firefox search plugin for your Mambo site! :) idigital Development Announcements 1 10.04.2005 21:56
Help, Help !! - Search, Search !! paulpa Mambo 4.5.1 'How Do I' Questions 0 19.10.2004 03:47
Akostaff Mambot - Did I Dream It? tamper Mambots 4 05.09.2004 00:10
extended search engine in akogallery? Aaron Mambo 4.5 'How Do I' Questions 0 07.08.2004 08:39
Register Components to be searchable with Mambo Search funciton... ccdog Mambo 5.0 Wishlist 3 14.06.2004 01:04


All times are GMT +2. The time now is 15:18.

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0
A vBSkinworks Design
© Copyright 2004-2008 by Arthur Konze Webdesign.