Здравствуйте, помогите пожалуйста разобраться с проблемой которая возникла после обновления шаблона с Joomla 1,5 на Joomla 2,5 Меню и категории отображаются нормально но не отображается материал в категориях! вот index.php Код (CODE): <?php defined('_JEXEC') or die('Restricted access'); // no direct access /* The following line loads the MooTools JavaScript Library */ JHtml::_('behavior.framework', true); require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'functions.php'; $document = null; if (isset($this)) $document = & $this; $baseUrl = $this->baseurl; $templateUrl = $this->baseurl . '/templates/' . $this->template; artxComponentWrapper($document); ?> <!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> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> <jdoc:include type="head" /> <link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/system/css/system.css" type="text/css" /> <link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/system/css/general.css" type="text/css" /> <link rel="stylesheet" type="text/css" href="<?php echo $templateUrl; ?>/css/template.css" /> <!--[if IE 6]><link rel="stylesheet" href="<?php echo $templateUrl; ?>/css/template.ie6.css" type="text/css" media="screen" /><![endif]--> <!--[if IE 7]><link rel="stylesheet" href="<?php echo $templateUrl; ?>/css/template.ie7.css" type="text/css" media="screen" /><![endif]--> <script type="text/javascript" src="<?php echo $templateUrl; ?>/script.js"></script> </head> <body> <div id="art-page-background-gradient"></div> <div id="art-main"> <div class="art-Sheet"> <div class="art-Sheet-tl"></div> <div class="art-Sheet-tr"></div> <div class="art-Sheet-bl"></div> <div class="art-Sheet-br"></div> <div class="art-Sheet-tc"></div> <div class="art-Sheet-bc"></div> <div class="art-Sheet-cl"></div> <div class="art-Sheet-cr"></div> <div class="art-Sheet-cc"></div> <div class="art-Sheet-body"> <jdoc:include type="modules" name="user3" /> <div class="art-Header"> <div class="art-Header-jpeg"></div> <div class="art-Logo"> <h1 id="name-text" class="art-Logo-name"><a href="<?php echo $baseUrl; ?>/">Шаблоны Joomla</a></h1> <div id="slogan-text" class="art-Logo-text">www.joomla.vasava.ru</div> </div> </div> <jdoc:include type="modules" name="banner1" style="artstyle" artstyle="art-nostyle" /> <?php echo artxPositions($document, array('top1', 'top2', 'top3'), 'art-block'); ?> <div class="art-contentLayout"> <?php if (artxCountModules($document, 'left')) : ?> <div class="art-sidebar1"><?php echo artxModules($document, 'left', 'art-block'); ?> </div> <?php endif; ?> <div class="art-<?php echo artxCountModules($document, 'left') ? 'content' : 'content-wide'; ?>"> <?php echo artxModules($document, 'banner2', 'art-nostyle'); if (artxCountModules($document, 'breadcrumb')) echo artxPost(null, artxModules($document, 'breadcrumb')); echo artxPositions($document, array('user1', 'user2'), 'art-article'); echo artxModules($document, 'banner3', 'art-nostyle'); ?> <?php if (artxHasMessages()) : ?><div class="art-Post"> <div class="art-Post-body"> <div class="art-Post-inner"> <div class="art-PostContent"> <jdoc:include type="message" /> </div> <div class="cleared"></div> </div> </div> </div> <?php endif; ?> <jdoc:include type="component" /> <?php echo artxModules($document, 'banner4', 'art-nostyle'); ?> <?php echo artxPositions($document, array('user4', 'user5'), 'art-article'); ?> <?php echo artxModules($document, 'banner5', 'art-nostyle'); ?> </div> </div> <div class="cleared"></div> <?php echo artxPositions($document, array('bottom1', 'bottom2', 'bottom3'), 'art-block'); ?> <jdoc:include type="modules" name="banner6" style="artstyle" artstyle="art-nostyle" /> <div class="art-Footer"> <div class="art-Footer-inner"> <?php echo artxModules($document, 'syndicate'); ?> <div class="art-Footer-text"> <?php if (artxCountModules($document, 'copyright') == 0): ?> <p>Copyright © 2009 ---.<br/> All Rights Reserved.</p> <?php else: ?> <?php echo artxModules($document, 'copyright', 'art-nostyle'); ?> <?php endif; ?> </div> </div> <div class="art-Footer-background"></div> </div> </div> </div> <div class="cleared"></div> <p class="art-page-footer"><a href="/?p=joomla_templates">Joomla template</a> created with Artisteer.</p> </div> </body> </html> и functions.php Код (CODE): <?php defined('_JEXEC') or die('Restricted access'); // no direct access if (!defined('_ARTX_FUNCTIONS')) { define('_ARTX_FUNCTIONS', 1); function artxHasMessages() { global $mainframe; //$messages = $mainframe->getMessageQueue(); JFactory::getApplication()->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 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): ?> <div class="art-PostMetadataHeader"> <h1 class="art-PostHeaderIcon-wrapper"> <span class="art-PostHeader"> <?php echo $caption; ?> </span> </h1> </div> <?php endif; ?> <?php if ($hasContent): ?> <div class="art-PostContent"> <?php echo $content; ?> </div> <div class="cleared"></div> <?php endif; ?> </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-tl"></div> <div class="art-BlockContent-tr"></div> <div class="art-BlockContent-bl"></div> <div class="art-BlockContent-br"></div> <div class="art-BlockContent-tc"></div> <div class="art-BlockContent-bc"></div> <div class="art-BlockContent-cl"></div> <div class="art-BlockContent-cr"></div> <div class="art-BlockContent-cc"></div> <div class="art-BlockContent-body"> <?php echo $content; ?> </div> </div> <?php endif; ?> </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); } } если кто разбирается подскажите что исправить нужно пожалуйста
Почему не на Joomla 3.3? А что вместо них? Включи отображение ошибок, да посмотри, что выводит. А вообще, надо переписывать все файлы под использование API Joomla 2.5 (лучше 3.3).
вместо материала не чего не отображается, Notice: Undefined variable: messages inThome\sevarenda.ru\www\templates\rhuk_milkyway25\functions.php on line13 Notice: Undefined property: ContentViewCategory::$total inThome\sevarenda.ru\www\templates\rhuk_milkyway25\html\com_content\category\blog.phpon line 44 Notice: Undefined property: ContentViewCategory::$total inThome\sevarenda.ru\www\templates\rhuk_milkyway25\html\com_content\category\blog.phpon line 29 Notice: Undefined property: ContentViewCategory::$total inThome\sevarenda.ru\www\templates\rhuk_milkyway25\html\com_content\category\blog.phpon line 94
Notice: Undefined variable: messages inThome\sevarenda.ru\www\templates\rhuk_milkyway25\functions.php on line13 Notice: Undefined property: ContentViewCategory::$total inThome\sevarenda.ru\www\templates\rhuk_milkyway25\html\com_content\category\blog.phpon line 44 Notice: Undefined property: ContentViewCategory::$total inThome\sevarenda.ru\www\templates\rhuk_milkyway25\html\com_content\category\blog.phpon line 29 Notice: Undefined property: ContentViewCategory::$total inThome\sevarenda.ru\www\templates\rhuk_milkyway25\html\com_content\category\blog.phpon line 94
Код (PHP): JFactory::getApplication()->getMessageQueue(); замени на Код (PHP): $messages = JFactory::getApplication()->getMessageQueue();
большое спасибо, остается Notice: Undefined property: ContentViewCategory::$total inThome\sevarenda.ru\www\templates\rhuk_milkyway25\html\com_content\category\blog.phpon line 44 Notice: Undefined property: ContentViewCategory::$total inThome\sevarenda.ru\www\templates\rhuk_milkyway25\html\com_content\category\blog.phpon line 29 Notice: Undefined property: ContentViewCategory::$total inThome\sevarenda.ru\www\templates\rhuk_milkyway25\html\com_content\category\blog.phpon line 94 может сможете помочь --- добавлено: May 12, 2014 --- blog.php Код (CODE): <?php defined('_JEXEC') or die('Restricted access'); // no direct access require_once dirname(__FILE__) . str_replace('/', DIRECTORY_SEPARATOR, '/../../../functions.php'); ?> <?php $cparams =& JComponentHelper::getParams('com_media'); ?> <?php ob_start(); ?> <?php if ($this->params->def('show_description', 1) || $this->params->def('show_description_image', 1)) :?> <table class="blog<?php echo $this->params->get('pageclass_sfx');?>" cellpadding="0" cellspacing="0" width="100%"> <tr> <td valign="top"> <?php if ($this->params->get('show_description_image') && $this->category->image) : ?> <img src="<?php echo $this->baseurl . '/' . $cparams->get('image_path') . '/'. $this->category->image;?>" align="<?php echo $this->category->image_position;?>" hspace="6" alt="" /> <?php endif; ?> <?php if ($this->params->get('show_description') && $this->category->description) : ?> <?php echo $this->category->description; ?> <?php endif; ?> </td> </tr> </table> <?php endif; ?> <?php echo artxPost(artxPageTitle($this), ob_get_clean()); ?> <table class="blog<?php echo $this->params->get('pageclass_sfx');?>" cellpadding="0" cellspacing="0" width="100%"> <?php if ($this->params->get('num_leading_articles')) : ?> <tr> <td valign="top"> <?php for ($i = $this->pagination->limitstart; $i < ($this->pagination->limitstart + $this->params->get('num_leading_articles')); $i++) : ?> <?php if ($i >= $this->total) : break; endif; ?> <div> <?php $this->item =& $this->getItem($i, $this->params); echo $this->loadTemplate('item'); ?> </div> <?php endfor; ?> </td> </tr> <?php else : $i = $this->pagination->limitstart; endif; ?> <?php $startIntroArticles = $this->pagination->limitstart + $this->params->get('num_leading_articles'); $numIntroArticles = $startIntroArticles + $this->params->get('num_intro_articles'); if (($numIntroArticles != $startIntroArticles) && ($i < $this->total)) : ?> <tr> <td valign="top"> <table width="100%" cellpadding="0" cellspacing="0"> <tr> <?php $divider = ''; if ($this->params->get('multi_column_order')) : // order across, like front page for ($z = 0; $z < $this->params->def('num_columns', 2); $z ++) : if ($z > 0) : $divider = " column_separator"; endif; ?> <?php $rows = (int) ($this->params->get('num_intro_articles', 4) / $this->params->get('num_columns')); $cols = ($this->params->get('num_intro_articles', 4) % $this->params->get('num_columns')); ?> <td valign="top" width="<?php echo intval(100 / $this->params->get('num_columns')) ?>%" class="article_column<?php echo $divider ?>"> <?php $loop = (($z < $cols)?1:0) + $rows; for ($y = 0; $y < $loop; $y ++) : $target = $i + ($y * $this->params->get('num_columns')) + $z; if ($target < $this->total && $target < ($numIntroArticles)) : $this->item =& $this->getItem($target, $this->params); echo $this->loadTemplate('item'); endif; endfor; ?></td> <?php endfor; $i = $i + $this->params->get('num_intro_articles') ; else : // otherwise, order down, same as before (default behaviour) for ($z = 0; $z < $this->params->get('num_columns'); $z ++) : if ($z > 0) : $divider = " column_separator"; endif; ?> <td valign="top" width="<?php echo intval(100 / $this->params->get('num_columns')) ?>%" class="article_column<?php echo $divider ?>"> <?php for ($y = 0; $y < ($this->params->get('num_intro_articles') / $this->params->get('num_columns')); $y ++) : if ($i < $this->total && $i < ($numIntroArticles)) : $this->item =& $this->getItem($i, $this->params); echo $this->loadTemplate('item'); $i ++; endif; endfor; ?> </td> <?php endfor; endif; ?> </tr> </table> </td> </tr> <?php endif; ?> </table> <?php if ($this->params->get('num_links') && ($i < $this->total)) : ?> <?php ob_start(); ?> <?php $this->links = array_splice($this->items, $i - $this->pagination->limitstart); echo $this->loadTemplate('links'); ?> <?php echo artxPost(null, ob_get_clean()); ?> <?php endif; ?> <?php $paginationPagesLinks = $this->params->get('show_pagination') ? $this->pagination->getPagesLinks() : ''; $paginationPagesCounter = $this->params->get('show_pagination_results') ? $this->pagination->getPagesCounter() : ''; ?> <?php if (strlen($paginationPagesLinks) > 0 && strlen($paginationPagesCounter) > 0) : ?> <?php ob_start(); ?> <div id="navigation"> <?php if (strlen($paginationPagesLinks) > 0) : ?> <p><?php echo $paginationPagesLinks; ?></p> <?php endif; ?> <?php if (strlen($paginationPagesCounter) > 0) : ?> <p><?php echo $paginationPagesCounter; ?></p> <?php endif; ?> </div> <?php echo artxPost(null, ob_get_clean()); ?> <?php endif; ?>
Теоретически могу конечно, а практически... надо переписывать весь шаблон blog.php. Проще взять стандартный шаблон из Joomla и сделать по образу и подобию.
А вы не подскажите не какого курса по переделу шаблона --- добавлено: May 12, 2014, первое сообщение размещено: May 12, 2014 --- или ответьте пожалуйста сколько будет стоить довести до ума этот шаблон
Ну, бателька... Ты уж определись чего хочешь! Хочешь, чтобы тебе дали рыбу или хочешь научиться её ловить?