Joomla 3.x Ошибка после обновления до joomla 3

Тема в разделе "Установка и обновление Joomla!", создана пользователем piter_piter, 23.03.2014.

  1. Offline

    piter_piter Пользователь

    Регистрация:
    20.01.2012
    Сообщения:
    76
    Симпатии:
    0
    Пол:
    Мужской
    Обновил сайт до Joomla 3.
    Появилась ошибка:
    Вот кусок кода из 5 строчки файла default.php :

    Код (CODE):
    1. <?php
    2. defined('_JEXEC') or die('Restricted access'); // no direct access
    3. require_once dirname(__FILE__) . str_replace('/', DIRECTORY_SEPARATOR, '/../../../functions.php');
    4.  
    5. $canEdit = ($this->user->authorize('com_content', 'edit', 'content', 'all') || $this->user->authorize('com_content', 'edit', 'content', 'own'));
    6.  
    7. echo artxPost(artxPageTitle($this, $this->params->get('show_page_title', 1) && $this->params->get('page_title') != $this->article->title), null);
    8. ?>
     
  2.  
  3. OlegK
    Offline

    OlegK Russian Joomla! Team Команда форума ⇒ Профи ⇐

    Регистрация:
    17.01.2011
    Сообщения:
    7 813
    Симпатии:
    771
    Пол:
    Мужской
    закоментируй строку 5

     
  4. woojin
    Offline

    woojin Местный Команда форума => Cпециалист <=

    Регистрация:
    31.05.2009
    Сообщения:
    3 206
    Симпатии:
    334
    Пол:
    Мужской
    @piter_piter, переведи эту ошибку и найди в каком файле находится получение необходимого класса
    затем используй подсказку отсюда

    P.S. в общем начинай функционал J3.x
    чтобы не задавать таких вопросов
     
  5. Offline

    piter_piter Пользователь

    Регистрация:
    20.01.2012
    Сообщения:
    76
    Симпатии:
    0
    Пол:
    Мужской
    Это как в предыдущем случае получается.
    Только там была Joomla 2.5, а теперь Joomla 3.
    И вылазят те же самые ошибки, но они же уже были исправлены... Сайт тот же самый.
    То-есть когда надо было дописать код в строчки, то с 2.5- это сработало, а теперь джумла 3 и там уже эти строчки прописаны, а ошибка все равно вылазит.

    Вот еще ошибка вылезла после того, как решил закоментить 5 строку(так как старое решение проблемы уже не актуально, так как оно уже присутствует):

     
    Последнее редактирование: 24.03.2014
  6. woojin
    Offline

    woojin Местный Команда форума => Cпециалист <=

    Регистрация:
    31.05.2009
    Сообщения:
    3 206
    Симпатии:
    334
    Пол:
    Мужской
    от версии к версии ядро системы изменяется и в J3.x нет класса JParameter как такового, т.е. сейчас используется JRegistry
    чтобы решить такого рода проблему надо делать или так
    Код (PHP):
    1. // -------------------------------------- Basic Registry
    2.  
    3. $params = new JRegistry( array('key' => 'val') );
    4. $params->get('key');
    5.  
    6. // -------------------------------------- XML Parameters
    7.  
    8. // Parameters
    9. $params = new JForm('params');
    10. $params->loadFile( JPATH_ADMINISTRATOR.DS.'path-to-xml' );
    11. $params->bind( (array)$row['params'] );
    12.  
    13. $fields = $params->getFieldset('params');
    14. foreach( $fields AS $field => $obj ){
    15.   echo $params->getLabel( $field, null );
    16.   echo $params->getInput( $field, null, null );
    17. }

    или так
    добавьте строкой выше
    Код (PHP):
    1. jimport('joomla.html.parameter');
     
  7. Offline

    piter_piter Пользователь

    Регистрация:
    20.01.2012
    Сообщения:
    76
    Симпатии:
    0
    Пол:
    Мужской
    А в какой файл это добавлять? И в какой строке?

    а это же уже прописано...
     
  8. woojin
    Offline

    woojin Местный Команда форума => Cпециалист <=

    Регистрация:
    31.05.2009
    Сообщения:
    3 206
    Симпатии:
    334
    Пол:
    Мужской
    это я для пример дал
    у тебя переменная $this это JFactory
    из которой можно получить JUser (он же user)
    из которого уже получает проверку на авторизованность данного вошедшего/открывшего эту страницу
     
  9. Offline

    piter_piter Пользователь

    Регистрация:
    20.01.2012
    Сообщения:
    76
    Симпатии:
    0
    Пол:
    Мужской
    ок. а как ошибки этим исправить?
    это совсем не понятная информация, так как PHP- не известен
     
  10. woojin
    Offline

    woojin Местный Команда форума => Cпециалист <=

    Регистрация:
    31.05.2009
    Сообщения:
    3 206
    Симпатии:
    334
    Пол:
    Мужской
    какие ЭТИ?
    я тебе уже по каждой ошибке написал как и что сделать, сопоставь и всё получится
     
  11. Offline

    piter_piter Пользователь

    Регистрация:
    20.01.2012
    Сообщения:
    76
    Симпатии:
    0
    Пол:
    Мужской

    Вот эта ошибка:
    Код (CODE):
    1. Fatal error: Class 'JParameter' not found in templates/new/functions.php on line 167


    Я так и не понял про 'JParameter' как исправить ошибку?
    То, что джумла 3 не использует 'JParameter' понятно, но как тогда заставить шаблон работать?
    Вот этот код куда-то вставить?

    Код (CODE):
    1. // -------------------------------------- Basic Registry
    2. $params = new JRegistry( array('key' => 'val') );
    3. $params->get('key');
    4. // -------------------------------------- XML Parameters
    5. // Parameters
    6. $params = new JForm('params');
    7. $params->loadFile( JPATH_ADMINISTRATOR.DS.'path-to-xml' );
    8. $params->bind( (array)$row['params'] );
    9. $fields = $params->getFieldset('params');
    10. foreach( $fields AS $field => $obj ){
    11.   echo $params->getLabel( $field, null );
    12.   echo $params->getInput( $field, null, null );
    13. }


    если да, то куда?
     
  12. woojin
    Offline

    woojin Местный Команда форума => Cпециалист <=

    Регистрация:
    31.05.2009
    Сообщения:
    3 206
    Симпатии:
    334
    Пол:
    Мужской
    ни куда - это пример использования, т.е. как это используется в J3
    тебе больше подойдёт второй вариант
     
  13. Offline

    piter_piter Пользователь

    Регистрация:
    20.01.2012
    Сообщения:
    76
    Симпатии:
    0
    Пол:
    Мужской
    Это нужно в functions.php после строк
    написать

    так?
    уже есть такое... но все равно ошибка осталась.
     
  14. woojin
    Offline

    woojin Местный Команда форума => Cпециалист <=

    Регистрация:
    31.05.2009
    Сообщения:
    3 206
    Симпатии:
    334
    Пол:
    Мужской
    давай от строки где это уже написано
    до строки с ошибкой
     
  15. Offline

    piter_piter Пользователь

    Регистрация:
    20.01.2012
    Сообщения:
    76
    Симпатии:
    0
    Пол:
    Мужской
    Вот весь файл functions.php
    Ошибка в строчке 167 пишет.

    Код (CODE):
    1. <?php
    2. defined('_JEXEC') or die('Restricted access'); // no direct access
    3.  
    4. if (!defined('_ARTX_FUNCTIONS')) {
    5.  
    6.     define('_ARTX_FUNCTIONS', 1);
    7.  
    8.     $GLOBALS['artx_settings'] = array(
    9.         'block' => array('has_header' => true),
    10.         'menu' => array('show_submenus' => true),
    11.         'vmenu' => array('show_submenus' => false, 'simple' => false)
    12.     );
    13.  
    14.     function artxHasMessages()
    15.     {
    16.         $mainframe = JFactory::getApplication();
    17.         $messages = $mainframe->getMessageQueue();
    18.         if (is_array($messages) && count($messages))
    19.             foreach ($messages as $msg)
    20.                 if (isset($msg['type']) && isset($msg['message']))
    21.                     return true;
    22.         return false;
    23.     }
    24.  
    25.     function artxPost($caption, $content)
    26.     {
    27.         $hasCaption = (null !== $caption && strlen(trim($caption)) > 0);
    28.         $hasContent = (null !== $content && strlen(trim($content)) > 0);
    29.  
    30.         if (!$hasCaption && !$hasContent)
    31.             return '';
    32.  
    33.         ob_start();
    34. ?>
    35. <div class="art-post">
    36.             <div class="art-post-body">
    37.         <div class="art-post-inner">
    38.      
    39.         <?php if ($hasCaption): ?>
    40. <h2 class="art-postheader">
    41.         <?php echo $caption; ?>
    42.  
    43.         </h2>
    44.      
    45.         <?php endif; ?>
    46.         <?php if ($hasContent): ?>
    47. <div class="art-postcontent">
    48.             <!-- article-content -->
    49.      
    50.         <?php echo artxReplaceButtons($content); ?>
    51.  
    52.             <!-- /article-content -->
    53.         </div>
    54.         <div class="cleared"></div>
    55.      
    56.         <?php endif; ?>
    57.  
    58.         </div>
    59.      
    60.                 <div class="cleared"></div>
    61.             </div>
    62.         </div>
    63.      
    64. <?php
    65.         return ob_get_clean();
    66.     }
    67.  
    68.     function artxBlock($caption, $content)
    69.     {
    70.         $hasCaption = ($GLOBALS['artx_settings']['block']['has_header']
    71.             && null !== $caption && strlen(trim($caption)) > 0);
    72.         $hasContent = (null !== $content && strlen(trim($content)) > 0);
    73.  
    74.         if (!$hasCaption && !$hasContent)
    75.             return '';
    76.  
    77.         ob_start();
    78. ?>
    79. <div class="art-block">
    80.             <div class="art-block-body">
    81.      
    82.         <?php if ($hasCaption): ?>
    83. <div class="art-blockheader">
    84.             <div class="l"></div>
    85.             <div class="r"></div>
    86.              <div class="t">
    87.         <?php echo $caption; ?>
    88. </div>
    89.         </div>
    90.      
    91.         <?php endif; ?>
    92.         <?php if ($hasContent): ?>
    93. <div class="art-blockcontent">
    94.             <div class="art-blockcontent-body">
    95.         <!-- block-content -->
    96.      
    97.         <?php echo artxReplaceButtons($content); ?>
    98.  
    99.         <!-- /block-content -->
    100.      
    101.                 <div class="cleared"></div>
    102.             </div>
    103.         </div>
    104.      
    105.         <?php endif; ?>
    106.  
    107.                 <div class="cleared"></div>
    108.             </div>
    109.         </div>
    110.      
    111. <?php
    112.         return ob_get_clean();
    113.     }
    114.  
    115.  
    116.     function artxVMenuBlock($caption, $content)
    117.     {
    118.         $hasCaption = (null !== $caption && strlen(trim($caption)) > 0);
    119.         $hasContent = (null !== $content && strlen(trim($content)) > 0);
    120.  
    121.         if (!$hasCaption && !$hasContent)
    122.             return '';
    123.  
    124.         ob_start();
    125. ?><div class="art-vmenublock">
    126.     <div class="art-vmenublock-body">
    127.  
    128.         <?php if ($hasCaption): ?><div class="art-vmenublockheader">
    129.     <div class="l"></div>
    130.     <div class="r"></div>
    131.      <div class="t">
    132.         <?php echo $caption; ?></div>
    133. </div>
    134.  
    135.         <?php endif; ?>
    136.         <?php if ($hasContent): ?><div class="art-vmenublockcontent">
    137.     <div class="art-vmenublockcontent-tl"></div>
    138.     <div class="art-vmenublockcontent-tr"></div>
    139.     <div class="art-vmenublockcontent-bl"></div>
    140.     <div class="art-vmenublockcontent-br"></div>
    141.     <div class="art-vmenublockcontent-tc"></div>
    142.     <div class="art-vmenublockcontent-bc"></div>
    143.     <div class="art-vmenublockcontent-cl"></div>
    144.     <div class="art-vmenublockcontent-cr"></div>
    145.     <div class="art-vmenublockcontent-cc"></div>
    146.     <div class="art-vmenublockcontent-body">
    147. <!-- block-content -->
    148.  
    149.         <?php echo $content; ?>
    150. <!-- /block-content -->
    151.  
    152.         <div class="cleared"></div>
    153.     </div>
    154. </div>
    155.  
    156.         <?php endif; ?>
    157.         <div class="cleared"></div>
    158.     </div>
    159. </div>
    160.  
    161. <?php
    162.         return ob_get_clean();
    163.     }
    164.  
    165.     function artxPageTitle($page, $criteria = null, $key = null){
    166.     jimport( 'joomla.html.parameter' );
    167.     $params = new JParameter($page->get('params'));
    168.  
    169.     if ($criteria === null)
    170.         $criteria = $params->def('show_page_title', 1);
    171.     return $criteria
    172.         ? ('<span class="componentheading' . $params->get('pageclass_sfx') . '">'
    173.             . $page->escape($params->get($key === null ? 'page_title' : $key)) . '</span>')
    174.         : '';
    175. }
    176.  
    177.     function artxCountModules(&$document, $position)
    178.     {
    179.         return $document->countModules($position);
    180.     }
    181.  
    182.     function artxPositions(&$document, $positions, $style)
    183.     {
    184.         ob_start();
    185.         if (count($positions) == 3) {
    186.             if (artxCountModules($document, $positions[0])
    187.                 && artxCountModules($document, $positions[1])
    188.                 && artxCountModules($document, $positions[2]))
    189.             {
    190.                 ?>
    191. <table class="position" cellpadding="0" cellspacing="0" border="0">
    192. <tr valign="top">
    193.   <td width="33%"><?php echo artxModules($document, $positions[0], $style); ?></td>
    194.   <td width="33%"><?php echo artxModules($document, $positions[1], $style); ?></td>
    195.   <td><?php echo artxModules($document, $positions[2], $style); ?></td>
    196. </tr>
    197. </table>
    198. <?php
    199.             } elseif (artxCountModules($document, $positions[0]) && artxCountModules($document, $positions[1])) {
    200. ?>
    201. <table class="position" cellpadding="0" cellspacing="0" border="0">
    202. <tr valign="top">
    203.   <td width="33%"><?php echo artxModules($document, $positions[0], $style); ?></td>
    204.   <td><?php echo artxModules($document, $positions[1], $style); ?></td>
    205. </tr>
    206. </table>
    207. <?php
    208.             } elseif (artxCountModules($document, $positions[1]) && artxCountModules($document, $positions[2])) {
    209. ?>
    210. <table class="position" cellpadding="0" cellspacing="0" border="0">
    211. <tr valign="top">
    212.   <td width="67%"><?php echo artxModules($document, $positions[1], $style); ?></td>
    213.   <td><?php echo artxModules($document, $positions[2], $style); ?></td>
    214. </tr>
    215. </table>
    216. <?php
    217.             } elseif (artxCountModules($document, $positions[0]) && artxCountModules($document, $positions[2])) {
    218. ?>
    219. <table class="position" cellpadding="0" cellspacing="0" border="0">
    220. <tr valign="top">
    221.   <td width="50%"><?php echo artxModules($document, $positions[0], $style); ?></td>
    222.   <td><?php echo artxModules($document, $positions[2], $style); ?></td>
    223. </tr>
    224. </table>
    225. <?php
    226.             } else {
    227.                 echo artxModules($document, $positions[0], $style);
    228.                 echo artxModules($document, $positions[1], $style);
    229.                 echo artxModules($document, $positions[2], $style);
    230.             }
    231.         } elseif (count($positions) == 2) {
    232.             if (artxCountModules($document, $positions[0]) && artxCountModules($document, $positions[1])) {
    233. ?>
    234. <table class="position" cellpadding="0" cellspacing="0" border="0">
    235. <tr valign="top">
    236. <td width="50%"><?php echo artxModules($document, $positions[0], $style); ?></td>
    237. <td><?php echo artxModules($document, $positions[1], $style); ?></td>
    238. </tr>
    239. </table>
    240. <?php
    241.             } else {
    242.                 echo artxModules($document, $positions[0], $style);
    243.                 echo artxModules($document, $positions[1], $style);
    244.             }
    245.         } // count($positions)
    246.         return ob_get_clean();
    247.     }
    248.  
    249.     function artxGetContentCellStyle(&$document)
    250.     {
    251.         $leftCnt = artxCountModules($document, 'left');
    252.         $rightCnt = artxCountModules($document, 'right');
    253.         if ($leftCnt > 0 && $rightCnt > 0)
    254.             return 'content';
    255.         if ($rightCnt > 0)
    256.             return 'content-sidebar1';
    257.         if ($leftCnt > 0)
    258.             return 'content-sidebar2';
    259.         return 'content-wide';
    260.     }
    261.  
    262.     function artxHtmlFixMoveScriptToHead($re, $content)
    263.     {
    264.         if (preg_match($re, $content, $matches, PREG_OFFSET_CAPTURE)) {
    265.             $content = substr($content, 0, $matches[0][1])
    266.                 . substr($content, $matches[0][1] + strlen($matches[0][0]));
    267.             $document =& JFactory::getDocument();
    268.             $document->addScriptDeclaration($matches[1][0]);
    269.         }
    270.         return $content;
    271.     }
    272.  
    273.     function artxHtmlFixRemove($re, $content)
    274.     {
    275.         if (preg_match($re, $content, $matches, PREG_OFFSET_CAPTURE)) {
    276.             $content = substr($content, 0, $matches[0][1])
    277.                 . substr($content, $matches[0][1] + strlen($matches[0][0]));
    278.         }
    279.         return $content;
    280.     }
    281.  
    282.     function artxComponentWrapper(&$document)
    283.     {
    284.         if ($document->getType() != 'html')
    285.             return;
    286.         $option = JRequest::getCmd('option');
    287.         $view = JRequest::getCmd('view');
    288.         $layout = JRequest::getCmd('layout');
    289.         $content = $document->getBuffer('component');
    290.         // fixes for w3.org validation
    291.         if ('com_contact' == $option) {
    292.             if ('category' == $view) {
    293.                 $content = artxHtmlFixFormAction($content);
    294.             } elseif ('contact' == $view) {
    295.                 $content = artxHtmlFixMoveScriptToHead('~<script [^>]+>\s*(<!--[^>]*-->)\s*</script>~', $content);
    296.             }
    297.         } elseif ('com_content' == $option) {
    298.             if ('category' == $view) {
    299.                 if ('' == $layout) {
    300.                     $content = artxHtmlFixMoveScriptToHead('~<script [^>]+>([^<]*)</script>~', $content);
    301.                     $content = artxHtmlFixFormAction($content);
    302.                 }
    303.             } elseif ('archive' == $view) {
    304.                 $content = artxHtmlFixRemove('~<ul id="archive-list" style="list-style: none;">\s*</ul>~', $content);
    305.             }
    306.         } elseif ('com_user' == $option) {
    307.             if ('user' == $view) {
    308.                 if ('form' == $layout) {
    309.                     $content = artxHtmlFixRemove('~autocomplete="off"~', $content);
    310.                 }
    311.             }
    312.         }
    313.         if (false === strpos($content, '<div class="art-post">')) {
    314.             $title = null;
    315.             if (preg_match('~<div\s+class="(componentheading[^"]*)"([^>]*)>([^<]+)</div>~', $content, $matches, PREG_OFFSET_CAPTURE)) {
    316.                 $content = substr($content, 0, $matches[0][1]) . substr($content, $matches[0][1] + strlen($matches[0][0]));
    317.                 $title = '<span class="' . $matches[1][0] . '"' . $matches[2][0] . '>' . $matches[3][0] . '</span>';
    318.             }
    319.             $document->setBuffer(artxPost($title, $content), 'component');
    320.         }
    321.     }
    322.  
    323.     function artxModules(&$document, $position, $style = null)
    324.     {
    325.         return '<jdoc:include type="modules" name="' . $position . '"' . (null != $style ? ' style="artstyle" artstyle="' . $style . '"' : '') . ' />';
    326.     }
    327.  
    328.  
    329.         function artxUrlToHref($url)
    330.         {
    331.             $result = '';
    332.             $p = parse_url($url);
    333.             if (isset($p['scheme']) && isset($p['host'])) {
    334.                 $result = $p['scheme'] . '://';
    335.                 if (isset($p['user'])) {
    336.                     $result .= $p['user'];
    337.                     if (isset($p['pass']))
    338.                         $result .= ':' . $p['pass'];
    339.                     $result .= '@';
    340.                 }
    341.                 $result .= $p['host'];
    342.                 if (isset($p['port']))
    343.                     $result .= ':' . $p['port'];
    344.                 if (!isset($p['path']))
    345.                     $result .= '/';
    346.             }
    347.             if (isset($p['path']))
    348.                 $result .= $p['path'];
    349.             if (isset($p['query'])) {
    350.                 $result .= '?' . str_replace('&', '&amp;', $p['query']);
    351.             }
    352.             if (isset($p['fragment']))
    353.                 $result .= '#' . $p['fragment'];
    354.             return $result;
    355.         }
    356.  
    357.         function artxReplaceButtonsRegex() {
    358.             return '' .
    359.                 '~<input\b[^>]*'
    360.                     . '(?:'
    361.                         . '[^>]*\bclass=(?:"(?:[^"]*\s)?button(?:\s[^"]*)?"|\'(?:[^\']*\s)?button(?:\s[^\']*)?\'|button\b)[^>]*'
    362.                         . '(?:\bvalue=(?:"[^"]*"|\'[^\']*\'|[^>\s]*))'
    363.                     . '|'
    364.                         . '(?:\bvalue=(?:"[^"]*"|\'[^\']*\'|[^>\s]*))'
    365.                         . '[^>]*\bclass=(?:"(?:[^"]*\s)?button(?:\s[^"]*)?"|\'(?:[^\']*\s)?button(?:\s[^\']*)?\'|button\b)[^>]*'
    366.                     . '|'
    367.                         . '[^>]*\bclass=(?:"(?:[^"]*\s)?button(?:\s[^"]*)?"|\'(?:[^\']*\s)?button(?:\s[^\']*)?\'|button\b)[^>]*'
    368.                     . ')'
    369.                 . '[^>]*/?\s*>~i';
    370.         }
    371.  
    372.         function artxReplaceButtons($content)
    373.         {
    374.             $re = artxReplaceButtonsRegex();
    375.             if (!preg_match_all($re, $content, $matches, PREG_OFFSET_CAPTURE))
    376.                 return $content;
    377.  
    378.             $result = '';
    379.             $position = 0;
    380.             foreach ($matches[0] as $match) {
    381.                 $result .= substr($content, $position, $match[1] - $position);
    382.                 $position = $match[1] + strlen($match[0]);
    383.                 $result .= '<span class="art-button-wrapper"><span class="l"> </span><span class="r"> </span>'
    384.                     . preg_replace('~\bclass=(?:"([^"]*\s)?button(\s[^"]*)?"|\'([^\']*\s)?button(\s[^\']*)?\'|button\b)~i',
    385.                         'class="\1\3button art-button\2\4"', $match[0]) . '</span>';
    386.             }
    387.             $result .= substr($content, $position);
    388.             return $result;
    389.         }
    390.  
    391.         function artxHtmlFixFormAction($content)
    392.         {
    393.             if (preg_match('~ action="([^"]+)" ~', $content, $matches, PREG_OFFSET_CAPTURE)) {
    394.                 $content = substr($content, 0, $matches[0][1])
    395.                     . ' action="' . artxUrlToHref($matches[1][0]) . '" '
    396.                     . substr($content, $matches[0][1] + strlen($matches[0][0]));
    397.             }
    398.             return $content;
    399.         }
    400.  
    401.         $artxFragments = array();
    402.  
    403.         function artxFragmentBegin($head = '')
    404.         {
    405.             global $artxFragments;
    406.             $artxFragments[] = array('head' => $head, 'content' => '', 'tail' => '');
    407.         }
    408.  
    409.         function artxFragmentContent($content = '')
    410.         {
    411.             global $artxFragments;
    412.             $artxFragments[count($artxFragments) - 1]['content'] = $content;
    413.         }
    414.  
    415.         function artxFragmentEnd($tail = '', $separator = '')
    416.         {
    417.             global $artxFragments;
    418.             $fragment = array_pop($artxFragments);
    419.             $fragment['tail'] = $tail;
    420.             $content = trim($fragment['content']);
    421.             if (count($artxFragments) == 0) {
    422.                 echo (trim($content) == '') ? '' : ($fragment['head'] . $content . $fragment['tail']);
    423.             } else {
    424.                 $result = (trim($content) == '') ? '' : ($fragment['head'] . $content . $fragment['tail']);
    425.                 $fragment =& $artxFragments[count($artxFragments) - 1];
    426.                 $fragment['content'] .= (trim($fragment['content']) == '' ? '' : $separator) . $result;
    427.             }
    428.         }
    429.  
    430.         function artxFragment($head = '', $content = '', $tail = '', $separator = '')
    431.         {
    432.             global $artxFragments;
    433.             if ($head != '' && $content == '' && $tail == '' && $separator == '') {
    434.                 $content = $head;
    435.                 $head = '';
    436.             } elseif ($head != '' && $content != '' && $tail == '' && $separator == '') {
    437.                 $separator = $content;
    438.                 $content = $head;
    439.                 $head = '';
    440.             }
    441.             artxFragmentBegin($head);
    442.             artxFragmentContent($content);
    443.             artxFragmentEnd($tail, $separator);
    444.         }
    445.  
    446.  
    447. }



    А вот кусок кода, который нужно исправить, но он уже исправлен был:
    Код (CODE):
    1. function artxPageTitle($page, $criteria = null, $key = null){
    2.     jimport( 'joomla.html.parameter' );
    3.     $params = new JParameter($page->get('params'));
     
  16. woojin
    Offline

    woojin Местный Команда форума => Cпециалист <=

    Регистрация:
    31.05.2009
    Сообщения:
    3 206
    Симпатии:
    334
    Пол:
    Мужской
    Код (PHP):
    1. $params = new JRegistry( array('key' => 'val') );
    2. $params->get($page->get('params'));

    разве так сложно подумать!?
     
    piter_piter нравится это.
  17. Offline

    piter_piter Пользователь

    Регистрация:
    20.01.2012
    Сообщения:
    76
    Симпатии:
    0
    Пол:
    Мужской
    Супер! Спасибо)
    Этот вопрос решен)
    А насчет подумать- уже и не знаю как объяснить, что если человек не знает PHP, то там и думать нечего! Все фразы и весь код для него- набор хаотичных букв... Как он там логику найдет?
     
  18. woojin
    Offline

    woojin Местный Команда форума => Cпециалист <=

    Регистрация:
    31.05.2009
    Сообщения:
    3 206
    Симпатии:
    334
    Пол:
    Мужской
    а документация на что?
    честно скажу, что ассемблер сложный язык, как минимум из-за того что там большинство команд/операторов состоит всего из трёх букв
    а тут то чего сложного!?
    ладно - это всё лирика - продолжать без мысленно
     

Поделиться этой страницей

Загрузка...