Kunena 7.0.4 Released

The Kunena team has announce the arrival of Kunena 7.0.4 [K 7.0.4] in stable which is now available for download as a native Joomla extension for J! 5.4.x/6.0.x. This version addresses most of the issues that were discovered in K 6.2 / K 6.3 / K 6.4 and issues discovered during the last development stages of K 7.0

Topics that are moved into this category are generally considered to be closed. Users may want to add additional information but these topics should not be resurrected in order to discuss new problems or unrelated matters.

Idea K 1.6.1: Cannot use search plugin designed for K 1.5

  • lev
  • lev's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Lorem Ipsum...
More
15 years 4 months ago - 15 years 4 months ago #77223 by lev
Search - Kunena search 1.0 07-03-2009 R.T.Nawaz :woohoo:

Notice: Undefined offset: 0 in /home/f/fotosru/public_html/plugins/search/plug_kunenasearch.php on line 229

Notice: Trying to get property of non-object in /home/f/fotosru/public_html/plugins/search/plug_kunenasearch.php on line 229

Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/f/fotosru/public_html/plugins/search/plug_kunenasearch.php on line 359

Warning: array_merge() [function.array-merge]: Argument #3 is not an array in /home/f/fotosru/public_html/plugins/search/plug_kunenasearch.php on line 359

Code:
$Itemid = $com_id[0]->ItemId;

Code:
<?php /***************************************************************** ************ Kunena Search Plugin For Joomla 1.5 ************ * @version-- plug_kunenasearch.php--- version 1.0--- March 7th, 2009 * @copyright (c) 2008 Miniola * @license GNU GPL (http://www.gnu.org/licenses/gpl.txt) * @Author R.T. Nawaz *@Author Email: [email protected] *@Website http://Opensource.Miniola.com *@Website http://kunena.aide-joomla.com/ ******************************************************************/ // no direct access defined( '_JEXEC' ) or die( 'Restricted access' ); //Define registerEvents and language $mainframe->registerEvent( 'onSearch', 'plgSearchplug_kunenasearch' ); $mainframe->registerEvent( 'onSearchAreas', 'plgSearchplug_kunenasearchAreas' ); //Still Need to Make Language File for Backend //JPlugin::loadLanguage( 'plg_search_plug_kunenasearch' ); //Array of search area function &plgSearchplug_kunenasearchAreas() { static $areas = array( 'plug_kunenasearch' => 'Форум' ); return $areas; } //Data base conection has to be made function plgSearchplug_kunenasearch( $text, $phrase='', $ordering='', $areas=null ) { $db =& JFactory::getDBO(); $user =& JFactory::getUser(); //Kunena's database tables $kunena_categories_dbtable = "#__fb_categories"; $kunena_messages_dbtable = "#__fb_messages"; $kunena_messages_text_dbtable = "#__fb_messages_text"; //If the array is not correct, return it: if (is_array( $areas )) { if (!array_intersect( $areas, array_keys( plgSearchplug_kunenasearchAreas() ) )) { return array(); } } //Get the plugin $plugin =& JPluginHelper::getPlugin('search', 'plug_kunenasearch'); //load parameters $pluginParams = new JParameter( $plugin->params ); //Define parameters $forum_name = $pluginParams->def( 'forum_name', 'Forum' ); $search_limit = $pluginParams->def( 'search_limit', 50 ); $cat_search = $pluginParams->def( 'cat_search', 1 ); $allow_bbc = $pluginParams->def( 'allow_bbc', 1 ); $credit = $pluginParams->def( 'credit', 2 ); $c_result = $pluginParams->def( 'c_result', 0 ); $c_title = $pluginParams->def( 'c_title', 'Title' ); $c_section = $pluginParams->def( 'c_section', 'Section' ); $c_text = $pluginParams->def( 'c_text', 'This is where you will put the information to show at search results' ); $c_href = $pluginParams->def( 'c_href', 'http://www.anysite.com' ); $c_keywords = $pluginParams->def( 'c_keywords', 'Keyword1,Keword2,Keword3' ); $c_reset = $pluginParams->def( 'c_reset', 0 ); $c_browsernav = 1; $c_created = ""; $a_title = "Miniola!"; $a_text = "We are proud to support Miniola! which is a small project to develop and revitalize Open Source and Free Software. Visit the Miniola! website to join and participate in the new opensource and free software community"; $a_section = "Free Open Source Software"; $a_href = "http://www.miniola.com/"; $a_created = ""; $a_keywords = "open source, free software, extension, plugin, joomla, software, mambots, template, module, "; $a_browsernav = 1; //Setup databases if($c_reset == 1){ $db->setQuery('TRUNCATE TABLE #__kunena_searchplgc'); $db->query(); } //Have to do these for functions-- for now just use it here if( $c_result > 0 ) { $db->setQuery('CREATE TABLE IF NOT EXISTS `#__kunena_searchplgc` (' . ' `title` text NOT NULL,' . ' `text` text NOT NULL,' . ' `section` text NOT NULL,' . ' `href` text NOT NULL,' . ' `created` text NOT NULL,' . ' `keywords` text NOT NULL,' . ' `browsernav` tinyint(4) NOT NULL default \'0\',' . ' UNIQUE KEY `key` (`title`(10))' . ' ) TYPE=MyISAM' . ' '); $db->query(); $db->setQuery( "INSERT IGNORE INTO `#__kunena_searchplgc` (" . "\n `title`," . "\n `text`," . "\n `section`," . "\n `href`," . "\n `created`," . "\n `keywords`," . "\n `browsernav`" . "\n ) VALUES (" . "\n '$c_title'," . "\n '$c_text'," . "\n '$c_section'," . "\n '$c_href'," . "\n '$c_created'," . "\n '$c_keywords'," . "\n '$c_browsernav'" . "\n ) "); $db->query(); } if($credit > 0 ) { $db->setQuery('CREATE TABLE IF NOT EXISTS `#__kunena_searchplga` (' . ' `title` text NOT NULL,' . ' `text` text NOT NULL,' . ' `section` text NOT NULL,' . ' `href` text NOT NULL,' . ' `created` text NOT NULL,' . ' `keywords` text NOT NULL,' . ' `browsernav` tinyint(4) NOT NULL default \'0\',' . ' UNIQUE KEY `key` (`title`(10))' . ' ) TYPE=MyISAM' . ' '); $db->query(); $db->setQuery( "INSERT IGNORE INTO `#__kunena_searchplga` (" . "\n `title`," . "\n `text`," . "\n `section`," . "\n `href`," . "\n `created`," . "\n `keywords`," . "\n `browsernav`" . "\n ) VALUES (" . "\n '$a_title'," . "\n '$a_text'," . "\n '$a_section'," . "\n '$a_href'," . "\n '$a_created'," . "\n '$a_keywords'," . "\n '$a_browsernav'" . "\n ) "); $db->query(); } //Use the function trim to delete spaces in front of or at the back of the searching terms $text = trim( $text ); //Return Array when nothing was filled in if ($text == '') { return array(); } //Datebase results $whereAs = array(); $whereBs = array(); switch ($phrase) { case 'exact': $whereAs2 = array(); $whereAs2[] = "LOWER(c.name) LIKE '%$text%'"; $whereAs2[] = "LOWER(c.description) LIKE '%$text%'"; $whereA = '(' . implode( ") \n OR (", $whereAs2 ) . ')'; $whereBs2 = array(); $whereBs2[] = "LOWER(b.subject) LIKE '%$text%'"; $whereBs2[] = "LOWER(a.message) LIKE '%$text%'"; $whereBs2[] = "LOWER(b.name) LIKE '%$text%'"; $whereB = '(' . implode( ") \n OR (", $whereBs2 ) . ')'; break; case 'all': case 'any': default: $words = explode( ' ', $text ); $whereAs = array(); $whereBs = array(); foreach ($words as $word) { $whereAs2 = array(); $whereAs2[] = "LOWER(c.name) LIKE '%$word%'"; $whereAs2[] = "LOWER(c.description) LIKE '%$word%'"; $whereAs[] = implode( ' OR ', $whereAs2 ); $whereBs2 = array(); $whereBs2[] = "LOWER(b.subject) LIKE '%$word%'"; $whereBs2[] = "LOWER(a.message) LIKE '%$word%'"; $whereBs2[] = "LOWER(b.name) LIKE '%$word%'"; $whereBs[] = implode( ' OR ', $whereBs2 ); } $whereA = '(' . implode( ($phrase == 'all' ? ") \n AND (" : ") \n OR ("), $whereAs ) . ')'; $whereB = '(' . implode( ($phrase == 'all' ? ") \n AND (" : ") \n OR ("), $whereBs ) . ')'; break; } switch ( $ordering ) { case 'alpha': $orderA = 'c.name ASC'; $orderB = 'b.subject ASC'; break; case 'category': $orderA = 'c.name ASC'; $orderB = 'c.name ASC, b.subject ASC'; break; case 'popular': $orderA = 'c.hits DESC'; $orderB = 'b.hits DESC'; break; case 'newest': $orderA = 'created DESC'; $orderB = 'b.time DESC'; break; case 'oldest': $orderA = 'created ASC'; $orderB = 'b.time ASC'; break; default: $orderA = 'c.name DESC'; $orderB = 'b.subject DESC'; break; } $searchplug_kunenasearch = JText::_( 'Plug_kunenasearch' ); // Get Kunena Item ID taken from previous searchbot $query = "SELECT id AS ItemId" . "\n FROM #__menu" . "\n WHERE link = 'index.php?option=com_kunena'" ; $db->setQuery( $query ); $com_id = $db->loadObjectList(); $Itemid = $com_id[0]->ItemId; //Get lists for for results if($c_result > 0){ if($c_result == 1){ $query = "SELECT a.title AS title," . "\n a.text AS text," . "\n a.created AS created," . "\n a.section AS section," . "\n a.browsernav AS browsernav," . "\n a.href AS href" . "\n FROM #__kunena_searchplgc AS a" ; } else{ $query = "SELECT a.title AS title," . "\n a.text AS text," . "\n a.created AS created," . "\n a.section AS section," . "\n a.browsernav AS browsernav," . "\n a.href AS href" . "\n FROM #__kunena_searchplgc AS a" . "\n WHERE a.title LIKE '%$text%'" . "\n OR a.text LIKE '%$text%'" . "\n OR a.section LIKE '%$text%'" . "\n OR a.keywords LIKE '%$text%'" ; } $db->setQuery( $query, 0, $search_limit ); $list1 = $db->loadObjectList(); } if($credit > 0){ if($credit == 1){ $query = "SELECT a.title AS title," . "\n a.text AS text," . "\n a.created AS created," . "\n a.section AS section," . "\n a.browsernav AS browsernav," . "\n a.href AS href" . "\n FROM #__kunena_searchplga AS a" ; } else{ $query = "SELECT a.title AS title," . "\n a.text AS text," . "\n a.created AS created," . "\n a.section AS section," . "\n a.browsernav AS browsernav," . "\n a.href AS href" . "\n FROM #__kunena_searchplga AS a" . "\n WHERE a.title LIKE '%$text%'" . "\n OR a.text LIKE '%$text%'" . "\n OR a.section LIKE '%$text%'" . "\n OR a.keywords LIKE '%$text%'" ; } $db->setQuery( $query, 0, $search_limit ); $list2 = $db->loadObjectList(); } //Forum Categories $query = "SELECT c.name AS title," . "\n c.description AS text," . "\n c.hits," . "\n c.pub_access," . "\n c.published," . "\n '' AS created," . "\n '$forum_name' AS section," . "\n '2' AS browsernav," . "\n CONCAT('index.php?option=com_kunena&Itemid=', '$Itemid', '&func=showcat&catid=',c.id) AS href" . "\n FROM $kunena_categories_dbtable AS c" . "\n WHERE ( $whereA )" . "\n AND c.published = 1" . "\n AND c.pub_access <= ". (int) $user->get( 'aid' ) . "\n ORDER BY $orderA" ; $db->setQuery( $query, 0, $search_limit ); $list3 = $db->loadObjectList(); //Forum Posts Query $query2 = "SELECT b.subject AS title," . "\n a.message AS text," . "\n b.hits," . "\n c.pub_access," . "\n c.published," . "\n c.description," . "\n FROM_UNIXTIME(b.time) AS created," . "\n CONCAT('$forum_name','/', c.name) AS section," . "\n '2' AS browsernav," . "\n CONCAT('index.php?option=com_kunena&Itemid=', '$Itemid', '&func=view&catid=',b.catid,'&id=',b.thread) AS href" . "\n FROM $kunena_messages_text_dbtable AS a" . "\n INNER JOIN $kunena_messages_dbtable AS b ON b.id = a.mesid" . "\n INNER JOIN $kunena_categories_dbtable AS c ON c.id = b.catid" . "\n WHERE ( $whereB )" . "\n AND c.published = 1" . "\n AND c.pub_access <= ". (int) $user->get( 'aid' ) . "\n ORDER BY $orderB" ; $db->setQuery( $query2, 0, $search_limit ); $list4 = $db->loadObjectList(); //Setting the Result Orders if($credit > 0 and $c_result > 0){ switch ($cat_search) { case 1: $rows = array_merge($list1, $list2, $list3, $list4); break; case 2: $rows = array_merge($list1, $list2, $list4, $list3); break; default: $rows = array_merge($list1, $list2, $list4); break; } } elseif($credit == 0 and $c_result > 0){ switch ($cat_search) { case 1: $rows = array_merge($list1, $list3, $list4); break; case 2: $rows = array_merge($list1, $list4, $list3); break; default: $rows = array_merge($list1, $list4); break; } } elseif($c_result == 0 and $credit > 0){ switch ($cat_search) { case 1: $rows = array_merge($list2, $list3, $list4); break; case 2: $rows = array_merge($list2, $list4, $list3); break; default: $rows = array_merge($list2, $list4); break; } } elseif($c_result == 0 and $credit == 0){ switch ($cat_search) { case 1: $rows = array_merge($list3, $list4); break; case 2: $rows = array_merge($list4, $list3); break; default: $rows = $list4 ; break; } } // Remove BBC from the search results from old searchbot if($allow_bbc == 0){ $BBC = '[:space:]'; $replace = ' '; } else{ $BBC = array( // - Convert to PLAIN TEXT '@(\[url)([^\]]*?)(\])(.*?)(\[/url\])@si', '@(\[img)([^\]]*?)(\])(.*?)(\[/img\])@si', '@(\[code[^\]]*?\])(.*?)(\[/code\])@si', '@(\[code:[0-9][^\]]*?\])(.*?)(\[/code:[0-9]\])@si', '@(\[quote[^\]]*?\])(.*?)(\[/quote\])@si', '@(\[b[^\]]*?\])(.*?)(\[/b\])@si', '@(\[u[^\]]*?\])(.*?)(\[/u\])@si', '@(\[i[^\]]*?\])(.*?)(\[/i\])@si', '@(\[size[^\]]*?\])(.*?)(\[/size\])@si', '@(\[color[^\]]*?\])(.*?)(\[/color\])@si', '@(\[ol[^\]]*?\])(.*?)(\[/ol\])@si', '@(\[ul[^\]]*?\])(.*?)(\[/ul\])@si', '@(\[li[^\]]*?\])(.*?)(\[/li\])@si', '@(\[video)([^\]]*?)(\])(.*?)(\[/video\])@si' ); $replace = array( '${4}', // URL '[USER POSTED IMAGE]', //IMG '${2}', // CODE '${2}', // CODE '${2}', // QUOTE '${2}', // BOLD '${2}', // UNDERLINE '${2}', // ITALIC '${2}', // SIZE '${2}', // COLOR '', // ORDERED LIST '', // UNORDERED LIST '${2}', // LIST ITEM '[USER POSTED VIDEO]'//VIDEO ); } $rows_count = count($rows); for($xi = 0; $xi <= $rows_count-1; $xi++){ $rows[$xi]->text = preg_replace($BBC, $replace, $rows[$xi]->text); $rows[$xi]->text = stripslashes($rows[$xi]->text); $rows[$xi]->title = stripslashes($rows[$xi]->title); } // Send the results in an array return $rows; }
Code:
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE install PUBLIC "-//Joomla! 1.5//DTD plugin 1.0//EN" "http://dev.joomla.org/xml/1.5/plugin-install.dtd"> <install version="1.5" type="plugin" group="search"> <name>Search - Kunena</name> <creationDate>07-03-2009</creationDate> <author>R.T.Nawaz</author> <authorEmail>[email protected]</authorEmail> <authorUrl>http://Opensource.Miniola.com</authorUrl> <copyright>(C) 2008 Miniola All rights reserved.</copyright> <license>http://www.gnu.org/copyleft/gpl.html - GNU/GPL</license> <version>1.0</version> <description>Joomla 1.5 Native Plugin --- To Search Kunena Forum Component. If you like the plugin please remember to vote for the plugin at --- http://extensions.joomla.org --- also please consider a small donation to further develop the plugin and other open source projects. You are invited to join our Mini Miniola! Project at --- M I N I O L A . C O M --- We just started so we need as much help from the users and the community as possible. THANK YOU! for trying the plugin we hope you like it! Your feedback would be greatly appreciated. </description> <files> <filename plugin="plug_kunenasearch">plug_kunenasearch.php</filename> </files> <params> <param name="forum_name" type="text" default="Forum" label="Title of Search Results" description="Could be any name you want to show at search results. Usually it is your Forum's name" size="30" /> <param name="search_limit" type="text" size="5" default="50" label="Search Limit" description="Number of search items to show."/> <param name="cat_search" type="list" default="1" label="Show Category Results" description="Show matching categories in the search results"> <option value="0">No, Do Not Show</option> <option value="1">Yes, Before Posts</option> <option value="2">Yes, But After Posts</option> </param> <param name="allow_bbc" type="list" default="1" label="Allow BBC" description="Should Bulletin Board Code in raw format be allowed in the search results? Default is Remove"> <option value="0">Yes, Keep BBC Code In Raw Form</option> <option value="1">No, Remove All BBC Code and Keep Text Only</option> </param> <param name="credit" type="radio" default="2" label="Help Miniola" description="Allow a search result to be shown for Miniola? Either always or only when related searches are made. Default is at only when related"> <option value="1">Always</option> <option value="2">When Related</option> <option value="0">I Will Donate</option> </param> <param type="spacer" /> <param name="c_result" type="list" default="0" label="Show Custom Result" description="This is an option to show your custom result on search result page. You need to fill the rest of the information to get the result. You can choose to show always or when the search maches your keywords. Experimental -- For Updates check --- OPENSOURCE.MINIOLA.COM ---"> <option value="0">No, Don't Show (Disable)</option> <option value="1">Yes, Show Always on Top</option> <option value="2">Yes, But Only When Relevant</option> </param> <param name="c_title" type="text" default="Title" label="Title of Search Results" description="Could be any name you want to show at search results" size="30" /> <param name="c_section" type="text" default="Section" label="Section of Search Results" description="Could be any name you want to show at search results" size="30" /> <param name="c_text" type="textarea" default="This is where you will put the information to show at search results" label="Description Text at Search Results (Use Only Plane Text!)" description="Whatever description you wan't to show at search results. WARNING !! Use Only Plain Simple Text, Do Not Use quotes like '' or ' or Apostophe ! For Example If you want to use Don't instead use Do Not. If you use symbol like ' it will not work. For Updates check at --- Opensource.Miniola.Com ---." rows="10" cols="35"/> <param name="c_href" type="text" default="http://www.anysite.com" label="Link To Go To" description="Could be any link you want to send to" size="30" /> <param name="c_keywords" type="textarea" default="Keyword1,Keword2,Keword3" label="Search Keywords" description="Add keywords seperated by comas, that when someone searches will get your Custom Result" rows="7" cols="35"/> <param name="c_reset" type="radio" default="0" label="Delete All Previous Custom Results" description="By Default everytime you add in Custom Result field and Apply or Save it is kept forever. So this option lets you delete all previous custom entries" > <option value="0">Keep Previous</option> <option value="1">Delete All Previous</option> </param> <param type="spacer" /> </params> </install>

Sorry for my English.
Last edit: 15 years 4 months ago by lev.

Please Log in or Create an account to join the conversation.

More
15 years 4 months ago #77364 by xillibit
Hello,

This is not the official search plugin from kunena team. Why are you using this version designed for k1.5 ?

I don't provide support by PM, because this can be useful for someone else.

Please Log in or Create an account to join the conversation.

More
15 years 4 months ago #77405 by sozzled
That's right. You cannot use add-ons designed for older versions of Kunena in K 1.6. This fact is clearly stated in the release notes .

Please Log in or Create an account to join the conversation.

  • lev
  • lev's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Lorem Ipsum...
More
15 years 4 months ago #77661 by lev
Hi,
This plug-in I have long been, so I do not remember where and when it found and installed ...
Forgive ....:unsure:
It worked and everything, and then look at the error and saw that stands ...:whistle:
And as official or not, I did not know himself, the main script worked ...
Okay, remove the plug from the site ...:woohoo:

Sorry for my English.

Please Log in or Create an account to join the conversation.

Time to create page: 0.265 seconds