Joomla 1.5-博客循环

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Joomla 1.5-博客循环相关的知识,希望对你有一定的参考价值。

  1. <?php
  2. $divider = '';
  3. if ($this->params->def('multi_column_order', 0)) : // order across, like front page
  4. for ($z = 0; $z < $this->params->def('num_columns', 2); $z ++) :
  5. if ($z > 0) : $divider = " column_separator"; endif; ?>
  6. <?php
  7. $rows = (int) ($this->params->get('num_intro_articles', 4) / $this->params->get('num_columns'));
  8. $cols = ($this->params->get('num_intro_articles', 4) % $this->params->get('num_columns'));
  9. ?>
  10. <td valign="top"
  11. width="<?php echo intval(100 / $this->params->get('num_columns')) ?>%"
  12. class="article_column<?php echo $divider ?>">
  13. <?php
  14. $loop = (($z < $cols)?1:0) + $rows;
  15.  
  16. for ($y = 0; $y < $loop; $y ++) :
  17. $target = $i + ($y * $this->params->get('num_columns')) + $z;
  18. if ($target < $this->total && $target < ($numIntroArticles)) :
  19. $this->item =& $this->getItem($target, $this->params);
  20. echo $this->loadTemplate('item');
  21. endif;
  22. endfor;
  23. ?></td>
  24. <?php endfor;
  25. $i = $i + $this->params->get('num_intro_articles', 4) ;
  26. else : // otherwise, order down, same as before (default behaviour)
  27. for ($z = 0; $z < $this->params->get('num_columns'); $z ++) :
  28. if ($z > 0) : $divider = " column_separator"; endif; ?>
  29. <td valign="top" width="<?php echo intval(100 / $this->params->get('num_columns')) ?>%" class="article_column<?php echo $divider ?>">
  30. <?php for ($y = 0; $y < ($this->params->get('num_intro_articles', 4) / $this->params->get('num_columns')); $y ++) :
  31. if ($i < $this->total && $i < ($numIntroArticles)) :
  32. $this->item =& $this->getItem($i, $this->params);
  33. echo $this->loadTemplate('item');
  34. $i ++;
  35. endif;
  36. endfor; ?>
  37. </td>
  38. <?php
  39. endfor;
  40. endif; ?>

以上是关于Joomla 1.5-博客循环的主要内容,如果未能解决你的问题,请参考以下文章

Joomla 1.5 | Joomla 1.5教程的Suckrfish下拉菜单

joomla 组件 1.5 到 joomla 组件 1.6

在 Joomla 1.5 之外包含 Joomla 组件(Joomla FB Chat)

从 Joomla 1.5 到 Joomla 2.5 的组件

将 Joomla 1.5 组件更新为 Joomla 2.5 组件的步骤 [关闭]

使用外部表单登录到 Joomla 1.5(不在 joomla 文件夹内,但在同一服务器上)