|
lsk
|
 |
« : 06.01.2011, 00:44:06 » |
|
Что конкретно нужно сделать? Поделитесь опытом.
|
|
|
|
|
Записан
|
|
|
|
b2z
Support Team
   
Репутация: +325/-0
Offline
Пол: 
Сообщений: 4335
Contra Gaming Community
|
 |
« Ответ #1 : 06.01.2011, 11:53:55 » |
|
В принципе переделывать ничего не придется. Изменилось только то, что шаблон обязательно надо установить (нельзя просто скопировать), иначе он не будет работать. Можете посмотреть как изменился файл установки templateDetails.xml на примере шаблонов, которые идут в комплекте с Joomla. Вообщем у меня это все заняло 5 минут: - поменял templateDetails.xml; - собрал архив; - установил. В index.php шаблона я вообще ничего не менял - все работает. Вот пример моего templateDetails.xml <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE install PUBLIC "-//Joomla! 1.6//DTD template 1.0//EN" "http://www.joomla.org/xml/dtd/1.6/template-install.dtd"> <extension version="1.6" type="template"> <name>v1</name> <creationDate>22/12/10</creationDate> <author>b2z</author> <authorEmail>www.contra.lv</authorEmail> <authorUrl>www.contra.lv</authorUrl> <copyright></copyright> <license>GNU/GPL</license> <version>1.0.0</version> <description></description> <files> <folder>css</folder> <folder>html</folder> <folder>images</folder> <folder>js</folder> <filename>favicon.ico</filename> <filename>index.html</filename> <filename>index.php</filename> <filename>templateDetails.xml</filename> </files> <positions> <position>left</position> <position>right</position> <position>login</position> <position>top</position> <position>news</position> <position>menu</position> <position>spotlight</position> <position>user1</position> <position>user2</position> <position>user3</position> <position>user4</position> <position>footer</position> <position>debug</position> </positions> </extension>
|
|
|
|
« Последнее редактирование: 06.01.2011, 11:57:08 от bzzik »
|
Записан
|
|
|
|
|
lsk
|
 |
« Ответ #2 : 06.01.2011, 13:16:23 » |
|
bzzik, спасибо - совет работает. Шаблон сложный, клубный, поэтому придется повозиться, чтобы расставить все на свои позиции.
|
|
|
|
|
Записан
|
|
|
|
b2z
Support Team
   
Репутация: +325/-0
Offline
Пол: 
Сообщений: 4335
Contra Gaming Community
|
 |
« Ответ #3 : 06.01.2011, 13:19:09 » |
|
bzzik, спасибо - совет работает. Шаблон сложный, клубный, поэтому придется повозиться, чтобы расставить все на свои позиции.
Рад, что получилось.
|
|
|
|
|
Записан
|
|
|
|
N-Stor
Захожу иногда

Репутация: +3/-0
Offline
Сообщений: 24
|
 |
« Ответ #4 : 06.01.2011, 22:10:33 » |
|
Изменилось только то, что шаблон обязательно надо установить (нельзя просто скопировать)
Скопировали шаблон в папку шаблонов, идем в меню "Расширения" - "Менеджер расширений". Вкладка четвертая слева, у AndyR в новом переводе называется "Обнаружить" (administrator/index.php?option=com_installer&view=discover), копка "Обнаружить" (administrator/index.php?option=com_installer&view=discover#). Движок сам найдет в папках все, что скопировано туда, но не инсталлировано. После того, как шаблон будет найден, отметить его чекбокс и нажать кнопку "Установить". Он прекрасно встанет без инсталятора.  Текст справки гласит: Этот раздел поможет вам обнаружить расширения, которые не могут быть установлены путем обычной инсталляции. К примеру, некоторые расширения слишком велики по размеру для загрузки через WEB-интерфейс из-за ограничений хостинга. Для использования этой функции вам надо загрузить файлы любым способом, к примеру по FTP или SFTP, и поместить эти файлы в соответствующую папку на сервере. Вы должны использовать функцию обнаружения для поиска новых загруженных расширений и активации процесса их установки. Запуская функцию обнаружения вы можете заодно обнаружить и установить и другие расширения, закачанные на сервер ранее. Нажмите кнопку 'Обнаружить' для поиска новых расширений, которые могут быть доступны для установки.
|
|
|
|
« Последнее редактирование: 06.01.2011, 22:24:44 от N-Stor »
|
Записан
|
|
|
|
b2z
Support Team
   
Репутация: +325/-0
Offline
Пол: 
Сообщений: 4335
Contra Gaming Community
|
 |
« Ответ #5 : 07.01.2011, 00:14:11 » |
|
Интересная фишка.
|
|
|
|
|
Записан
|
|
|
|
ivankoby
Осваиваюсь на форуме
 
Репутация: +1/-0
Offline
Сообщений: 82
|
 |
« Ответ #6 : 10.01.2011, 22:10:23 » |
|
это функция обновлений как в Drupal, или просто ищет на хосте?
|
|
|
|
|
Записан
|
|
|
|
b2z
Support Team
   
Репутация: +325/-0
Offline
Пол: 
Сообщений: 4335
Contra Gaming Community
|
 |
« Ответ #7 : 11.01.2011, 01:01:22 » |
|
это функция обновлений как в Drupal, или просто ищет на хосте?
Данная функция ищет локально. Но есть и функия Обновления. Как она работает, пока ещё неизвестно...
|
|
|
|
|
Записан
|
|
|
|
b2z
Support Team
   
Репутация: +325/-0
Offline
Пол: 
Сообщений: 4335
Contra Gaming Community
|
 |
« Ответ #8 : 12.01.2011, 22:58:44 » |
|
Модераторы, открепите пожалуйста эту тему... Я её перенес из раздела J1.6, но перед переносом забыл открепить. Спасибо.
|
|
|
|
|
Записан
|
|
|
|
CyberMax
Новичок
Репутация: +0/-0
Offline
Сообщений: 5
|
 |
« Ответ #9 : 18.01.2011, 21:34:45 » |
|
bzzik, а можно посмотреть ваш templateDetails.xml который был до изменения? Для сравнения.
|
|
|
|
|
Записан
|
|
|
|
b2z
Support Team
   
Репутация: +325/-0
Offline
Пол: 
Сообщений: 4335
Contra Gaming Community
|
 |
« Ответ #10 : 19.01.2011, 00:12:39 » |
|
bzzik, а можно посмотреть ваш templateDetails.xml который был до изменения? Для сравнения.
Да нет проблем  "templateDetails.xml 1.5" <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE install PUBLIC "-//Joomla! 1.5//DTD template 1.0//EN" "http://www.joomla.org/xml/dtd/1.5/template-install.dtd"> <install version="1.5" type="template"> <name>v1</name> <creationDate>16/11/10</creationDate> <author>b2z</author> <authorEmail>www.contra.lv</authorEmail> <authorUrl>www.contra.lv</authorUrl> <copyright></copyright> <license>GNU/GPL</license> <version>1.0.0</version> <description></description> <files> <filename>index.html</filename> <filename>index.php</filename> <filename>params.ini</filename> <filename>templateDetails.xml</filename> <filename>css/index.html</filename> <filename>css/template.css</filename> <filename>html/index.html</filename> <filename>images/index.html</filename> <filename>js/index.html</filename> </files> <positions> <position>left</position> <position>right</position> <position>login</position> <position>top</position> <position>news</position> <position>menu</position> <position>spotlight</position> <position>user1</position> <position>user2</position> <position>user3</position> <position>user4</position> <position>footer</position> <position>debug</position> </positions> </install>
|
|
|
|
|
Записан
|
|
|
|
HighFlyer
Захожу иногда

Репутация: +1/-1
Offline
Пол: 
Сообщений: 19
|
 |
« Ответ #11 : 29.01.2011, 01:29:57 » |
|
в моем шаблоне Joomla 1.6 споткнулась в самом начале уже на <?php echo $mainframe->getCfg('sitename');?>если удалить, то еще где-то дальше спотыкается, но понять сложно, что не так.. в общем дело не только в templateDetails.xml разобрался вроде, была переработана структура параметров шаблона, добавились тэги <config><fields><fieldset>...
|
|
|
|
« Последнее редактирование: 29.01.2011, 01:46:03 от HighFlyer »
|
Записан
|
|
|
|
korkunov
Осваиваюсь на форуме
 
Репутация: +1/-0
Offline
Пол: 
Сообщений: 136
|
 |
« Ответ #12 : 10.02.2011, 14:01:36 » |
|
Интересная фишка.
Но, разумеется, не всегда работает то, что сделано под 1.5... Ну, допустим, шаблоны... в 1.6. нет mosshowlistmenu() и т.д.
|
|
|
|
|
Записан
|
|
|
|
talgautb
Осваиваюсь на форуме
 
Репутация: +8/-0
Offline
Пол: 
Сообщений: 104
|
 |
« Ответ #13 : 10.02.2011, 14:54:04 » |
|
а где руссик взял?может поделимся??
|
|
|
|
|
Записан
|
|
|
|
Joker
Давно я тут
  
Репутация: +3/-0
Offline
Пол: 
Сообщений: 220
|
 |
« Ответ #14 : 11.02.2011, 08:29:23 » |
|
Хелп из-за чего выдается сообщение Ошибка
* Шаблон для этого режиме не предусмотрен. Свяжитесь с администратором сайта.
после переделки шаблона выскочило данное сообщение на главной на белом фоне
|
|
|
|
|
Записан
|
|
|
|
Hnt
Новичок
Репутация: +0/-0
Offline
Сообщений: 2
|
 |
« Ответ #15 : 17.02.2011, 17:50:02 » |
|
Может кто взглянуть ,если все так просто ? Решил оставить старый шаблончик для J1.6 от Yoothemes ,получил фигу на постном масле. Fatal error: Call to a member function getCfg() on a non-object in ...\Joomla\templates\yoo_evolution_1.5.6\index.php on line 20 Собственно сам index.php и сам шаблончик index.txtАрхив с шаблоном [1.53МБ]Будьте добры :] ---------------------------------------- Подправьте по вашему мануалу пожалуйста 3 файла ,нашел через поиск у вас на форуме Как адаптировать шаблон от Joomla 1.5 в Joomla 1.6
|
|
|
|
« Последнее редактирование: 17.02.2011, 21:15:32 от Hnt »
|
Записан
|
|
|
|
HighFlyer
Захожу иногда

Репутация: +1/-1
Offline
Пол: 
Сообщений: 19
|
 |
« Ответ #16 : 17.02.2011, 21:35:51 » |
|
Проанализировал ваш шаблон, и пришел к выводу, что строка 20 там совершенно не нужна, удалите ее или закомментируйте. Объясняю, почему.. если исправить ее, заменив на $app = JFactory::getApplication(); $this->setTitle($app->getCfg('sitename'). ' - ' . $this->getTitle()); то получим Имя сайта - Имя сайта - Главная, а если убрать, то будет как нужно Имя сайта - Главнаяну а CSS и templateDetails.xml исправить проще простого, думаю справитесь по мануалу. я в первый раз вообще по образцу шаблонов из Joomla 1.6 самостоятельно сделал, заняло очень мало времени
|
|
|
|
|
Записан
|
|
|
|
Hnt
Новичок
Репутация: +0/-0
Offline
Сообщений: 2
|
 |
« Ответ #17 : 17.02.2011, 23:38:23 » |
|
HighFlyer "Да ошибка пропала" шаблон стал грузиться - но по мануалу мне не совсем ясно ,так как строчки отличаются....незатруднит ли вас помочь мне? Так как самостоятельно у меня не получилось. Надеюсь на вас. 1. index.txt2. templateDetails.txt3. template.css4. theme.css - нет в шаблоне 
|
|
|
|
« Последнее редактирование: 18.02.2011, 23:35:19 от Hnt »
|
Записан
|
|
|
|
|
shvager
Гость
|
 |
« Ответ #18 : 10.03.2011, 15:41:43 » |
|
Сделал при помощи Artisteer 3 шаблон. В программе все показывает отлично. А Вот Joomla 1.6 ни в какую не хочет. В архиве две маленькие картинки и сам шаблон. На первой как задуманно а на второй как показывает Joomla. Если кому не трудно - посмотрите. Спасибо!
|
|
|
|
|
Записан
|
|
|
|
Rinny
Новичок
Репутация: +0/-0
Offline
Сообщений: 6
|
 |
« Ответ #19 : 24.03.2011, 20:50:23 » |
|
Господа, а возможно ли мне тоже как-то помочь изменить шаблон под шестёрку. Вообщем-то он грузится. Но проблема такова - ни один опубликованный материал не отображается. На других шаблонах, заточенных под 1.6 всё нормально и это тоже...
У меня шаблон redxy-tg Если кто-то захочет помочь, пришлю нужные для диагностики файлы шаблона.
|
|
|
|
|
Записан
|
|
|
|
axl
Новичок
Репутация: +1/-0
Offline
Сообщений: 2
axl.spb.ru
|
 |
« Ответ #20 : 29.03.2011, 12:07:56 » |
|
|
|
|
|
|
Записан
|
|
|
|
Guslyar
Новичок
Репутация: +0/-0
Offline
Сообщений: 2
|
 |
« Ответ #21 : 31.03.2011, 20:39:22 » |
|
Проверил - удалось  Благодарю!
|
|
|
|
|
Записан
|
|
|
|
leshkoff
Осваиваюсь на форуме
 
Репутация: +0/-0
Offline
Пол: 
Сообщений: 83
|
 |
« Ответ #22 : 03.04.2011, 13:11:35 » |
|
Рад, что получилось.
Никак не могу понять, почему выдает ошибку в индексе шаблона. Ошибка: Notice: Undefined variable: app in /home/z/zonaconsul/perevodpro/public_html/templates/td_zanet/index.php on line 6
Fatal error: Call to a member function getCfg() on a non-object in /home/z/zonaconsul/perevodpro/public_html/templates/td_zanet/index.php on line 6 Вот код индекса: <?php // no direct access defined( '_JEXEC' ) or die( 'Restricted index access' ); define( 'YOURBASEPATH', dirname(__FILE__) );
$live_site = $app->getCfg('live_site'); $menu_name = $this->params->get("menuName", "mainmenu"); $menustyle = $this->params->get("menuType", "2"); $template_path = $this->baseurl . '/templates/' . $this->template; $show_flashheader = ($this->params->get("showFlashheader", 1) == 0)?"false":"true"; $show_logo = ($this->params->get("showLogo", 1) == 0)?"false":"true"; $show_date = ($this->params->get("showDate", 1) == 0)?"false":"true"; $show_breadcrumbs = ($this->params->get("showBreadcrumbs", 1) == 0)?"false":"true";
?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" > <head> <?php $app = JFactory::getApplication(); ?> <jdoc:include type="head" />
<link rel="shortcut icon" href="<?php echo $this->baseurl; ?>/images/favicon.ico" /> <link href="<?php echo $this->baseurl ?>/templates/system/css/system.css" rel="stylesheet" type="text/css" /> <link href="<?php echo $this->baseurl ?>/templates/system/css/general.css" rel="stylesheet" type="text/css" /> <link href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template?>/css/template_css.css" rel="stylesheet" type="text/css" />
<?php include ("templates/".$this->template ."/moomenu.php"); ?> <!--[if lte IE 6]> <script type="text/javascript" src="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template?>/scripts/iemoomenu.js"></script> <link rel="stylesheet" href="templates/<?php echo $this->template ?>/css/ie6.php" type="text/css" /> <![endif]-->
</head> <body class="body_bg"> <div id="bgr">
<div id="wrapper"> <div id="tophead"> <?php if($this->countModules('user4')) : ?> <div id="search"> <jdoc:include type="modules" name="user4" style="xhtml" /> </div> <?php endif; ?> <!-- BEGIN: LOGO --> Подскажите кто знает?
|
|
|
|
« Последнее редактирование: 03.04.2011, 13:15:25 от leshkoff »
|
Записан
|
|
|
|
kslabs
Новичок
Репутация: +0/-0
Offline
Сообщений: 5
|
 |
« Ответ #23 : 17.04.2011, 19:38:36 » |
|
Отлично получается найти и установить шаблон из 1.5 на 1.6. Но возникла проблема стиля по умолчанию. В 1.5 стиль по умолчанию устанавливается нормально, а 1.6 стиль не устанавливается пока вручную не назначишь нажиманием на выбор стиля. Где устанавливается стиль по умолчанию?
|
|
|
|
|
Записан
|
|
|
|
b2z
Support Team
   
Репутация: +325/-0
Offline
Пол: 
Сообщений: 4335
Contra Gaming Community
|
 |
« Ответ #24 : 18.04.2011, 10:27:59 » |
|
leshkoff - поставьте $app = JFactory::getApplication(); перед $live_site = $app->getCfg('live_site');
kslabs - что за стиль по умолчанию?
|
|
|
|
|
Записан
|
|
|
|
leshkoff
Осваиваюсь на форуме
 
Репутация: +0/-0
Offline
Пол: 
Сообщений: 83
|
 |
« Ответ #25 : 18.04.2011, 13:28:14 » |
|
leshkoff - поставьте $app = JFactory::getApplication(); перед $live_site = $app->getCfg('live_site');
kslabs - что за стиль по умолчанию?
Спасибо, заработало.
|
|
|
|
|
Записан
|
|
|
|
Neznajka
Осваиваюсь на форуме
 
Репутация: +0/-0
Offline
Сообщений: 27
|
 |
« Ответ #26 : 20.04.2011, 14:30:20 » |
|
О! Как раз нужная тема. Я всё сделал, как в здешних рекомендациях - шаблон заработал. Но только - в общем. При попытке перехода по большинству пунктов меню - ругается: Fatal error: Cannot access protected property ContentViewArticle::$params in /home/jr1.ru/erc/sites/www/templates/icons011_horizont/functions.php on line 171 Я пересмотрел файл functions.php - нет там в 171-й строке и намёка на такое свойство ContentViewArticle... А сам я ещё чайник во всех этих Тырнет-технологиях, без помощи не разберусь. Не знаю, как приложить сюда этот файл шаблона, поэтому поместил его в хранилище: http://rghost.ru/download/private/5259734/544ebe12be17b0804fb8579a0bea6929/f09a60cc0d504f6730d7cf29232a3879f5e24094/icons011_horizont.rarПомогите, пожалуйста, убрать вышеописанную ошибку.
|
|
|
|
|
Записан
|
|
|
|
b2z
Support Team
   
Репутация: +325/-0
Offline
Пол: 
Сообщений: 4335
Contra Gaming Community
|
 |
« Ответ #27 : 20.04.2011, 15:14:59 » |
|
Neznajka - все эти "навароченные" шаблоны тяжело переделывать, потому что они в себе несут ещё и часть фрейморка Joomla, что мне никогда и не нравилось в них. Врядли кто-то будет качать и специально смотреть, что там и как. Приведите лучше код functions.php, предварительно поместив его в тэг [spoiler][/spoiler]
|
|
|
|
|
Записан
|
|
|
|
Neznajka
Осваиваюсь на форуме
 
Репутация: +0/-0
Offline
Сообщений: 27
|
 |
« Ответ #28 : 20.04.2011, 17:20:58 » |
|
Да там слишком много строк. Ну, сейчас попробую, вот: <?php defined('_JEXEC') or die; // no direct access
if (!defined('_ARTX_FUNCTIONS')) {
define('_ARTX_FUNCTIONS', 1);
function artxHasMessages() { $app = JFactory::getApplication(); $messages = $app->getMessageQueue(); if (is_array($messages) && count($messages)) foreach ($messages as $msg) if (isset($msg['type']) && isset($msg['message'])) return true; return false; }
function artxUrlToHref($url) { $result = ''; $p = parse_url($url); if (isset($p['scheme']) && isset($p['host'])) { $result = $p['scheme'] . '://'; if (isset($p['user'])) { $result .= $p['user']; if (isset($p['pass'])) $result .= ':' . $p['pass']; $result .= '@'; } $result .= $p['host']; if (isset($p['port'])) $result .= ':' . $p['port']; if (!isset($p['path'])) $result .= '/'; } if (isset($p['path'])) $result .= $p['path']; if (isset($p['query'])) { $result .= '?' . str_replace('&', '&', $p['query']); } if (isset($p['fragment'])) $result .= '#' . $p['fragment']; return $result; }
function artxReplaceButtonsRegex() { return '' . '~<input\b[^>]*' . '(?:' . '[^>]*\bclass=(?:"(?:[^"]*\s)?button(?:\s[^"]*)?"|\'(?:[^\']*\s)?button(?:\s[^\']*)?\'|button\b)[^>]*' . '(?:\bvalue=(?:"[^"]*"|\'[^\']*\'|[^>\s]*))' . '|' . '(?:\bvalue=(?:"[^"]*"|\'[^\']*\'|[^>\s]*))' . '[^>]*\bclass=(?:"(?:[^"]*\s)?button(?:\s[^"]*)?"|\'(?:[^\']*\s)?button(?:\s[^\']*)?\'|button\b)[^>]*' . '|' . '[^>]*\bclass=(?:"(?:[^"]*\s)?button(?:\s[^"]*)?"|\'(?:[^\']*\s)?button(?:\s[^\']*)?\'|button\b)[^>]*' . ')' . '[^>]*/?\s*>~i'; }
function artxReplaceButtons($content) { $re = artxReplaceButtonsRegex(); if (!preg_match_all($re, $content, $matches, PREG_OFFSET_CAPTURE)) return $content;
$result = ''; $position = 0; foreach ($matches[0] as $match) { $result .= substr($content, $position, $match[1] - $position); $position = $match[1] + strlen($match[0]); $result .= '<span class="art-button-wrapper"><span class="l"> </span><span class="r"> </span>' . preg_replace('~\bclass=(?:"([^"]*\s)?button(\s[^"]*)?"|\'([^\']*\s)?button(\s[^\']*)?\'|button\b)~i', 'class="\1\3button art-button\2\4"', $match[0]). '</span>'; } $result .= substr($content, $position); return $result; }
function artxPost($caption, $content) { $hasCaption = (null !== $caption && strlen(trim($caption)) > 0); $hasContent = (null !== $content && strlen(trim($content)) > 0);
if (!$hasCaption && !$hasContent) return '';
ob_start(); ?> <div class="art-Post"> <div class="art-Post-body"> <div class="art-Post-inner"> <?php if ($hasCaption): ?> <h2 class="art-PostHeader"> <?php echo $caption; ?>
</h2> <?php endif; ?> <?php if ($hasContent): ?> <div class="art-PostContent"> <?php echo artxReplaceButtons($content); ?>
</div> <div class="cleared"></div> <?php endif; ?>
</div> <div class="cleared"></div> </div> </div> <?php return ob_get_clean(); }
function artxBlock($caption, $content) { $hasCaption = (null !== $caption && strlen(trim($caption)) > 0); $hasContent = (null !== $content && strlen(trim($content)) > 0);
if (!$hasCaption && !$hasContent) return '';
ob_start(); ?> <div class="art-Block"> <div class="art-Block-body"> <?php if ($hasCaption): ?> <div class="art-BlockHeader"> <div class="l"></div> <div class="r"></div> <div class="art-header-tag-icon"> <div class="t"> <?php echo $caption; ?> </div> </div> </div> <?php endif; ?> <?php if ($hasContent): ?> <div class="art-BlockContent"> <div class="art-BlockContent-body"> <?php echo artxReplaceButtons($content); ?>
<div class="cleared"></div> </div> </div> <?php endif; ?>
<div class="cleared"></div> </div> </div> <?php return ob_get_clean(); }
function artxPageTitle($page, $criteria = null, $key = null) { if ($criteria === null) $criteria = $page->params->def('show_page_title', 1); return $criteria ? ('<span class="componentheading' . $page->params->get('pageclass_sfx'). '">' . $page->escape($page->params->get($key === null ? 'page_title' : $key)). '</span>') : ''; } function artxCountModules(&$document, $position) { if (null === $document) // for Joomla 1.0 return mosCountModules($position); // for Joomla 1.5 return $document->countModules($position); } function artxPositions(&$document, $positions, $style) { ob_start(); if (count($positions) == 3) { if (artxCountModules($document, $positions[0]) && artxCountModules($document, $positions[1]) && artxCountModules($document, $positions[2])) { ?> <table class="position" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"> <td width="33%"><?php echo artxModules($document, $positions[0], $style); ?></td> <td width="33%"><?php echo artxModules($document, $positions[1], $style); ?></td> <td><?php echo artxModules($document, $positions[2], $style); ?></td> </tr> </table> <?php } elseif (artxCountModules($document, $positions[0]) && artxCountModules($document, $positions[1])) { ?> <table class="position" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"> <td width="33%"><?php echo artxModules($document, $positions[0], $style); ?></td> <td><?php echo artxModules($document, $positions[1], $style); ?></td> </tr> </table> <?php } elseif (artxCountModules($document, $positions[1]) && artxCountModules($document, $positions[2])) { ?> <table class="position" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"> <td width="67%"><?php echo artxModules($document, $positions[1], $style); ?></td> <td><?php echo artxModules($document, $positions[2], $style); ?></td> </tr> </table> <?php } elseif (artxCountModules($document, $positions[0]) && artxCountModules($document, $positions[2])) { ?> <table class="position" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"> <td width="50%"><?php echo artxModules($document, $positions[0], $style); ?></td> <td><?php echo artxModules($document, $positions[2], $style); ?></td> </tr> </table> <?php } else { echo artxModules($document, $positions[0], $style); echo artxModules($document, $positions[1], $style); echo artxModules($document, $positions[2], $style); } } elseif (count($positions) == 2) { if (artxCountModules($document, $positions[0]) && artxCountModules($document, $positions[1])) { ?> <table class="position" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"> <td width="50%"><?php echo artxModules($document, $positions[0], $style); ?></td> <td><?php echo artxModules($document, $positions[1], $style); ?></td> </tr> </table> <?php } else { echo artxModules($document, $positions[0], $style); echo artxModules($document, $positions[1], $style); } } // count($positions) return ob_get_clean(); } function artxGetContentCellStyle(&$document) { $leftCnt = artxCountModules($document, 'left'); $rightCnt = artxCountModules($document, 'right'); if ($leftCnt > 0 && $rightCnt > 0) return 'content'; if ($rightCnt > 0) return 'content-sidebar1'; if ($leftCnt > 0) return 'content-sidebar2'; return 'content-wide'; } function artxHtmlFixMoveScriptToHead($re, $content) { if (preg_match($re, $content, $matches, PREG_OFFSET_CAPTURE)) { $content = substr($content, 0, $matches[0][1]) . substr($content, $matches[0][1] + strlen($matches[0][0])); $document =& JFactory::getDocument(); $document->addScriptDeclaration($matches[1][0]); } return $content; }
function artxHtmlFixFormAction($content) { if (preg_match('~ action="([^"]+)" ~', $content, $matches, PREG_OFFSET_CAPTURE)) { $content = substr($content, 0, $matches[0][1]) . ' action="' . artxUrlToHref($matches[1][0]). '" ' . substr($content, $matches[0][1] + strlen($matches[0][0])); } return $content; }
function artxHtmlFixRemove($re, $content) { if (preg_match($re, $content, $matches, PREG_OFFSET_CAPTURE)) { $content = substr($content, 0, $matches[0][1]) . substr($content, $matches[0][1] + strlen($matches[0][0])); } return $content; }
function artxComponentWrapper(&$document) { if (null === $document) { // for Joomla 1.0 return; } // for Joomla 1.5 if ($document->getType()!= 'html') return; $option = JRequest::getCmd('option'); $view = JRequest::getCmd('view'); $layout = JRequest::getCmd('layout'); $content = $document->getBuffer('component'); // fixes for w3.org validation if ('com_contact' == $option) { if ('category' == $view) { $content = artxHtmlFixFormAction($content); } elseif ('contact' == $view) { $content = artxHtmlFixMoveScriptToHead('~<script [^>]+>\s*(<!--[^>]*-->)\s*</script>~', $content); } } elseif ('com_content' == $option) { if ('category' == $view) { if ('' == $layout) { $content = artxHtmlFixMoveScriptToHead('~<script [^>]+>([^<]*)</script>~', $content); $content = artxHtmlFixFormAction($content); } } elseif ('archive' == $view) { $content = artxHtmlFixRemove('~<ul id="archive-list" style="list-style: none;">\s*</ul>~', $content); } } elseif ('com_user' == $option) { if ('user' == $view) { if ('form' == $layout) { $content = artxHtmlFixRemove('~autocomplete="off"~', $content); } } } if (false === strpos($content, '<div class="art-Post">')) { $title = null; if (preg_match('~<div\s+class="(componentheading[^"]*)"([^>]*)>([^<]+)</div>~', $content, $matches, PREG_OFFSET_CAPTURE)) { $content = substr($content, 0, $matches[0][1]). substr($content, $matches[0][1] + strlen($matches[0][0])); $title = '<span class="' . $matches[1][0] . '"' . $matches[2][0] . '>' . $matches[3][0] . '</span>'; } $document->setBuffer(artxPost($title, $content), 'component'); } } function artxComponent() { // for Joomla 1.0 ob_start(); mosMainBody(); $content = ob_get_clean(); if (false === strpos($content, '<div class="art-Post">')) { $title = null; if (preg_match('~<div\s+class="(componentheading[^"]*)"([^>]*)>([^<]+)</div>~', $content, $matches, PREG_OFFSET_CAPTURE)) { $content = substr($content, 0, $matches[0][1]). substr($content, $matches[0][1] + strlen($matches[0][0])); $title = '<span class="' . $matches[1][0] . '"' . $matches[2][0] . '>' . $matches[3][0] . '</span>'; } return artxPost($title, $content); } return $content; } function artxModules(&$document, $position, $style = null) { if (null === $document) { // for Joomla 1.0 ob_start(); mosLoadModules($position, -2); $content = ob_get_clean(); if (null == $style || 'xhtml' == $style) return $content; $decorator = 'artblock' == $style ? 'artxBlock' : ('artpost' == $style ? 'artxPost' : null); $result = ''; $modules = preg_split('~</div>\s*<div class="moduletable">~', $content); $lastModule = count($modules) - 1; if ($lastModule > -1) { $modules[0] = preg_replace('~^\s*<div class="moduletable">~', '', $modules[0]); $modules[$lastModule] = preg_replace('~</div>\s*$~', '', $modules[$lastModule]); foreach ($modules as $module) { if (preg_match('~^\s*<h3>([^<]*)</h3>~', $module, $matches, PREG_OFFSET_CAPTURE)) { $result .= $decorator($matches[1][0], substr($module, 0, $matches[0][1]) . substr($module, $matches[0][1] + strlen($matches[0][0]))); } else { $result .= $decorator(null, $module); } } } return $result; } // for Joomla 1.5 return '<jdoc:include type="modules" name="' . $position . '"' . (null != $style ? ' style="artstyle" artstyle="' . $style . '"' : ''). ' />'; } $artxFragments = array();
function artxFragmentBegin($head = '') { global $artxFragments; $artxFragments[] = array('head' => $head, 'content' => '', 'tail' => ''); }
function artxFragmentContent($content = '') { global $artxFragments; $artxFragments[count($artxFragments) - 1]['content'] = $content; }
function artxFragmentEnd($tail = '', $separator = '') { global $artxFragments; $fragment = array_pop($artxFragments); $fragment['tail'] = $tail; $content = trim($fragment['content']); if (count($artxFragments) == 0) { echo (trim($content) == '')? '' : ($fragment['head'] . $content . $fragment['tail']); } else { $result = (trim($content) == '')? '' : ($fragment['head'] . $content . $fragment['tail']); $fragment =& $artxFragments[count($artxFragments) - 1]; $fragment['content'] .= (trim($fragment['content']) == '' ? '' : $separator). $result; } }
function artxFragment($head = '', $content = '', $tail = '', $separator = '') { global $artxFragments; if ($head != '' && $content == '' && $tail == '' && $separator == '') { $content = $head; $head = ''; } elseif ($head != '' && $content != '' && $tail == '' && $separator == '') { $separator = $content; $content = $head; $head = ''; } artxFragmentBegin($head); artxFragmentContent($content); artxFragmentEnd($tail, $separator); }
}
|
|
|
|
|
Записан
|
|
|
|
b2z
Support Team
   
Репутация: +325/-0
Offline
Пол: 
Сообщений: 4335
Contra Gaming Community
|
 |
« Ответ #29 : 20.04.2011, 18:21:44 » |
|
Да блин, убиться можно! И это все ради шаблона сделано, да ещё вижу там поддержку Joomla 1.0! Мой Вам совет, поменяйте шаблон... Не, ну может кто-то и поможет разобраться, но это жесткач 
|
|
|
|
|
Записан
|
|
|
|
|