PDA

Zobacz pełną wersję : JoomD - druga instalacja



morphic
20-06-2011, 15:54
Witajcie,

Zainstalowałem sobie dodatek JoomD (bardzo dobry zresztą) i dokonałem wpisów z jednej dziedziny. Teraz potrzebowałbym zrobić wpisy dla drugiej z kategorii i zaczynają się schody.:podstep:

Pola stworzone dla pierwszej kategorii nie będą mi już potrzebne, a same pola mają możliwość zaznaczenia jedynie czy pole ma występować w liście wyników, w widoku szczegółowym oraz w wyszukiwarce.

Najprostszym chyba rozwiązaniem będzie druga instalacja JoomD.

Plik install wygąda tak:

<?php

if (!defined('_JEXEC')) die('Direct Access to this location is not allowed.');

$db =& JFactory::getDBO();

jimport('joomla.filesystem.folder');
jimport('joomla.filesystem.file');

$flag = true;

if(jfolder::create(JPATH_SITE.DS.'images'.DS.'dire ctory'))
jfile::copy(JPATH_SITE.DS.'components'.DS.'com_joo md'.DS.'index.html', JPATH_SITE.DS.'images'.DS.'directory'.DS.'index.ht ml');

if(jfolder::move(JPATH_ADMINISTRATOR.DS.'component s'.DS.'com_joomd'.DS.'files'.DS.'mod_latest_entry' , JPATH_SITE.DS.'modules'.DS.'mod_latest_entry')) {
$query = 'insert into #__modules (title, position, published, module, showtitle, params, iscore, client_id) values ("Latest Entries", "left", 1, "mod_latest_entry", 1, "limit=5", 1, 0)';
$db->setQuery( $query );
$db->query();

$moduleid = $db->insertid();

$query = 'insert into #__modules_menu (moduleid, menuid) values ('.$moduleid.', 0)';
$db->setQuery( $query );
$db->query();
}
else {
echo 'Latest Entry modules could not be installed. Please move the folder of Latest entry module from "'.JPATH_ADMINISTRATOR.DS.'components'.DS.'com_joom d'.DS.'files'.DS.'mod_latest_entry" to "'.JPATH_SITE.DS.'modules'.DS.'mod_latest_entry"';
$flag = false;
}

$error = false;

jfolder::create(JPATH_SITE.DS.'plugins'.DS.'system '.DS.'joomdcaptcha');

if(!jfile::exists(JPATH_SITE.DS.'plugins'.DS.'syst em'.DS.'joomdcaptcha.php'))
if(!jfile::move(JPATH_ADMINISTRATOR.DS.'components '.DS.'com_joomd'.DS.'files'.DS.'plugins'.DS.'joomd captcha.php', JPATH_SITE.DS.'plugins'.DS.'system'.DS.'joomdcaptc ha.php'))
$error = true;

if(!jfile::exists(JPATH_SITE.DS.'plugins'.DS.'syst em'.DS.'joomdcaptcha.xml'))
if(!jfile::move(JPATH_ADMINISTRATOR.DS.'components '.DS.'com_joomd'.DS.'files'.DS.'plugins'.DS.'joomd captcha.xml', JPATH_SITE.DS.'plugins'.DS.'system'.DS.'joomdcaptc ha.xml'))
$error = true;

if(!jfile::exists(JPATH_SITE.DS.'plugins'.DS.'syst em'.DS.'joomdcaptcha'.DS.'joomdcaptcha.class.php') )
if(!jfile::move(JPATH_ADMINISTRATOR.DS.'components '.DS.'com_joomd'.DS.'files'.DS.'plugins'.DS.'joomd captcha'.DS.'joomdcaptcha.class.php', JPATH_SITE.DS.'plugins'.DS.'system'.DS.'joomdcaptc ha'.DS.'joomdcaptcha.class.php'))
$error = true;

if(!jfile::exists(JPATH_SITE.DS.'plugins'.DS.'syst em'.DS.'joomdcaptcha'.DS.'index.html'))
if(!jfile::move(JPATH_ADMINISTRATOR.DS.'components '.DS.'com_joomd'.DS.'files'.DS.'plugins'.DS.'joomd captcha'.DS.'index.html', JPATH_SITE.DS.'plugins'.DS.'system'.DS.'joomdcaptc ha'.DS.'index.html'))
$error = true;

if(!jfile::exists(JPATH_SITE.DS.'plugins'.DS.'syst em'.DS.'joomdcaptcha'.DS.'monofont.ttf'))
if(!jfile::move(JPATH_ADMINISTRATOR.DS.'components '.DS.'com_joomd'.DS.'files'.DS.'plugins'.DS.'joomd captcha'.DS.'monofont.ttf', JPATH_SITE.DS.'plugins'.DS.'system'.DS.'joomdcaptc ha'.DS.'monofont.ttf'))
$error = true;


if($error) {

echo 'JoomD Captcha Plugin could not be installed please move the files from "'.JPATH_ADMINISTRATOR.DS.'components'.DS.'com_joom d'.DS.'files'.DS.'plugin'.DS.'" to '.JPATH_SITE.DS.'plugins'.DS.'system'.DS.'"';
$flag = false;

}

else {

$query = 'insert into #__plugins (name, element, folder, published, iscore) values ("JoomD Captcha", "joomdcaptcha", "system", 1, 1)';
$db->setQuery( $query );
$db->query();

if(jfolder::exists(JPATH_ADMINISTRATOR.DS.'compone nts'.DS.'com_joomd'.DS.'files'.DS.'plugins'))
jfolder::delete(JPATH_ADMINISTRATOR.DS.'components '.DS.'com_joomd'.DS.'files'.DS.'plugins');

}


if(jfolder::exists(JPATH_SITE.DS.'components'.DS.' com_sh404sef'.DS.'sef_ext')) {
if(!jfile::move(JPATH_ADMINISTRATOR.DS.'components '.DS.'com_joomd'.DS.'files'.DS.'com_joomd.php', JPATH_SITE.DS.'components'.DS.'com_sh404sef'.DS.'s ef_ext'.DS.'com_joomd.php'))
echo 'SEF plugin could not be installed. Please move the file from "'.JPATH_ADMINISTRATOR.DS.'components'.DS.'com_joom d'.DS.'files'.DS.'com_joomd.php" to "'.JPATH_SITE.DS.'components'.DS.'com_sh404sef'.DS. 'sef_ext'.DS.'com_joomd.php"';
$flag = false;
}
else {

echo 'Since you are not using sh404sef component, hence the joomd plugin for that could not be installed. Later if You install sh404sef, you can use it to make your site\'s URL Search Engine Friendly. The file exists in "'.JPATH_ADMINISTRATOR.DS.'components'.DS.'com_joom d'.DS.'files'.DS.'com_joomd.php". You need to move this file to "'.JPATH_SITE.DS.'components'.DS.'com_sh404sef'.DS. 'sef_ext'.DS.'com_joomd.php"';
$flag = false;

}

if($flag and jfolder::exists(JPATH_ADMINISTRATOR.DS.'components '.DS.'com_joomd'))
jfolder::delete(JPATH_ADMINISTRATOR.DS.'components '.DS.'com_joomd');


?>
i gdzieś tu coś musiałbym pozmieniać, ale nie wiem zbytnio co i gdzie. na stówkę wiem, że trzeba zmienić wszystkie wpisy com_joomd na np. com_joomd1. Nazwe bazy danych w pliku instalacyjnym sql juz zmienilem. Ale co jeszcze zmienic - pomocy, bo wysiadam.

Z gory dzieki.

Pozdrawiam