Постраничная навигация по элементам

#
Постраничная навигация по элементам
Попытались сделать навигацию между элементами в виде "Предыдущий элемент" и "Следующий элемент". Для этого добавили в Типовую динамическую страницу вот этот код:


      $DataBase = & singleton('DataBase');

      $prev = false;
      $next = false;

      $current_date = date('Y-m-d H:i:s');

      $current_group = intval($result['group']);

     $query = "SELECT SQL_CALC_FOUND_ROWS DISTINCT information_items_table.information_items_id
      FROM information_items_table
      LEFT JOIN information_groups_table
         ON information_items_table.information_groups_id = information_groups_table.information_groups_id
         AND information_groups_table.information_groups_access IN (0,6,7,-1)
      WHERE 1 AND information_items_table.information_systems_id = '$InformationSystem_id'
      AND information_items_table.information_items_status = '1'
      AND (information_items_table.information_items_putend_date >= '$current_date'
      OR information_items_table.information_items_putend_date ='0000-00-00 00:00:00')
      AND information_items_table.information_items_putoff_date <= '$current_date'
      AND information_items_table.information_items_access IN (0,6,7,-1)
      AND (information_items_table.information_groups_id = '$current_group')
      ORDER BY $name_field $order_field LIMIT 0, 9999";

      $result = $DataBase->select($query);

      while ($row = mysql_fetch_assoc($result))
      {
         if ($row['information_items_id'] == $item_id)
         {
            $next_row = mysql_fetch_assoc($result);
            $next = $next_row['information_items_id'];
            break;
         }
        
         $prev = $row['information_items_id'];
      }

      $item_info = $GLOBALS['LA_InformationSystem']->GetInformationSystemItem($prev);
      $item_path = $GLOBALS['LA_InformationSystem']->GetPathItem($prev, '');
      
      if($item_path != '')
      {
         $external_propertys['PrevName'] = $item_info['information_items_name'];
         $external_propertys['PrevLink'] = $item_path;
      }

      $item_info = $GLOBALS['LA_InformationSystem']->GetInformationSystemItem($next);
      $item_path = $GLOBALS['LA_InformationSystem']->GetPathItem($next, '');
      
      if($item_path != '')
      {
         $external_propertys['NextName'] = $item_info['information_items_name'];
         $external_propertys['NextLink'] = $item_path;
      }


и в XSL-шаблон добавили вот это:

            

<xsl:if test="/document/PrevName/node()">
               <a href="{/document/information_system/url}{/document/PrevLink}" style="color: #ffffff">Предыдущая коллекция</a>
            </xsl:if>
            &#xA0;&#xA0;&#xA0;&#xA0;
            <xsl:if test="/document/NextName/node()">
               <a href="{/document/information_system/url}{/document/NextLink}" style="color: #ffffff">Следующая коллекция</a>
            </xsl:if>


не работает. Подскажите, как должен выглядеть код?
Нужна реклама в интернете? - http://www.2wind.ru/
Модератор
#
Re: Постраничная навигация по элементам
Вы пример с форума смотрели? Делали все в соответствии с инструкцией из него?
#
Re: Постраничная навигация по элементам
HostCMS писал(а):
Вы пример с форума смотрели?
Господа модераторы! Если Вас не затруднит пишите ссылки, читаешь сообщение и совершенно не понятно о каком примере идет речь, о какой инструкции.
Авторизация