PDA

Zobacz pełną wersję : sobi2 search module wersja 1.0 na 1.5



czarny_85
04-03-2010, 17:36
Od dwóch dni przeszukuje forum, lecz takiego postu nie znalazłem. Ściągnąłem moduł do sobi2, "sobi2 search module. Problem jest tylko jeden, moduł nie integruje z moją wersją joomla. Używam wersji 1.5.15 a moduł jest napisany pod wersje 1.0. Moduł składa się tylko z dwóch plików php i xml:

php:

<?php
/**
* Sobi2Search
* @version 1.0
* @package Sobi2Search
* @authorName Pietro Gallo
* @authorEmail pietro.gallo@gmail.com
* @authorUrl joomla.pietrogallo.it
* @copyright (C) 2007 by Pietro Gallo
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL.
* Sobi2Search is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation.
* mod_searchcloud.php August 2007 Pietro Gallo
*/

defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

$moduleclass = $params->get('moduleclass_sfx', '');
$label_text = $params->get('label_text', 'Search for:');
$inputbox_text = $params->get('inputbox_text', 'search...');
$any_words = $params->get('any_words', 'Any words');
$all_words = $params->get('all_words', 'All words');
$exact = $params->get('exact', 'Exact phrase');
$button = $params->get('button', 'Search');
$itemid = intval( $params->get( 'itemid', '' ) ) ;
?>
<?php echo "\n<!-- Sobi2Search :: http://joomla.pietrogallo.it/ -->\n"; ?>
<form method="get" action="index.php" name="sobi2Search" id="sobi2Search">
<input type="hidden" name="option" value="com_sobi2" />
<input type="hidden" name="sobi2Task" value="search" />
<input type="hidden" name="Itemid" value="<?php echo $itemid ?>" />

<table class="<?php echo $moduleclass ?>" width="100%">
<tr>
<td>
<?php echo $label_text ?>
</td>
</tr>
<tr>
<td>
<input name="sobi2Search" maxlength="20" alt="search" class="inputbox" type="text" size="20" value="<?php echo $inputbox_text ?>" onblur="if(this.value=='') this.value='<?php echo $inputbox_text ?>';" onfocus="if(this.value=='<?php echo $inputbox_text ?>') this.value='';" />
</td>
</tr>
<tr>

<td>
<input type="radio" checked="checked" name="searchphrase" id="searchphraseany" value="any" />
<label for="searchphraseany"><?php echo $any_words ?></label>
<input type="radio" name="searchphrase" id="searchphraseall" value="all" />
<label for="searchphraseall"><?php echo $all_words ?></label>
<input type="radio" name="searchphrase" id="searchphraseexact" value="exact" />
<label for="searchphraseexact"><?php echo $exact ?></label>

</td>
</tr>
<tr>
<td>
<input type="submit" name="search" class="button" value="<?php echo $button ?>"/>
</td>
</tr>
</table>
</form>
<?php echo "\n<!-- Sobi2Search :: http://joomla.pietrogallo.it/ -->"; ?>
<?php echo "\n<div style=\"display:none;\">Powered by <a href=\"http://joomla.pietrogallo.it/\">Sobi2Search</a></div>\n\n" ; ?>xml:

<?xml version="1.0" encoding="iso-8859-1"?>
<mosinstall type="module">
<name>Sobi2Search</name>
<author>Pietro Gallo</author>
<creationDate>September 2007</creationDate>
<copyright>(C) Pietro Gallo. All rights reserved.</copyright>
<license>http://www.gnu.org/copyleft/gpl.html GNU/GPL</license>
<authorEmail>pietro.gallo@gmail.com</authorEmail>
<authorUrl>http://joomla.pietrogallo.it</authorUrl>
<version>1.0</version>
<description>This module allows to perform searches in Sobi2.<![CDATA[
<hr />
<p>Check for updates and report bugs on <a href="http://joomla.pietrogallo.it/" target="_blank">http://joomla.pietrogallo.it/</a>. If you like this module, vote, favour or review on <a href="http://extensions.joomla.org/component/option,com_mtree/task,viewowner/user_id,23609/Itemid,35/" target="_blank">Joomla! Extensions</a>.</p>
]]></description>
<files>
<filename module="mod_sobi2search">mod_sobi2search.php</filename>
</files>
<params>
<param name="moduleclass_sfx" type="text" default="" label="Module Class Suffix" description="A suffix to be applied to the css class of the module (table.moduletable), this allows individual module styling" />
<param name="@spacer" type="spacer" default="" label="" description="" />
<param name="itemid" type="text" default="" label="Sobi2 Itemid" description="Set Itemid for search results" />
<param name="label_text" type="text" default="Search for:" label="Label text" description="" />
<param name="inputbox_text" type="text" default="search..." label="Inputbox text" description="" />
<param name="any_words" type="text" default="Any words" label="Any words text" description="" />
<param name="all_words" type="text" default="All words" label="All words text" description="" />
<param name="exact" type="text" default="Exact phrase" label="Exact phrase text" description="" />
<param name="button" type="text" default="Search" label="Button value" description="" />
<param name="@spacer" type="spacer" default="" label="" description="" />
<param name="cache" type="radio" default="0" label="Enable Cache" description="Select whether to cache the content of this module">
<option value="0">No</option>
<option value="1">Yes</option>
</param>
</params>
</mosinstall>
W jaki sposób przerobić te pliki aby integrowały z wersją 1.5.15, przypuszczam iż należy tylko zmienić plik xml lecz nie wiem jak.

pavlic
26-06-2010, 02:48
musisz wejsc w dodadtki i aktywowac moduł legacy

alex51
26-06-2010, 08:15
Możesz też spróbować dokonać adaptacji tego modułu dla J!1.5, wykorzystując >>TEN<< (http://wiki.joomla.pl/index.php/Adaptacja_do_Joomla_1.5_rozszerze%C5%84_napisanych _dla_Joomla_1.0) nie do końca przetłumaczony poradnik. Istotą instalacji modułów w J!1.5 jest tworzenie dla nich odrębnych katalogów w folderze Modules, stad potrzeba dokonania zmian w pliku xml. Zwróć też uwagę, choćby porównując z innymi plikami xml z wersji dla J!1.5, na różnice, wśród których istotną jest nie stosowany obecnie wpis

<mosinstall type="module">