OSDN Git Service

初回コミット(v2.6.17.1)
[magic3/magic3.git] / templates / magic3_demo3 / html / com_content / frontpage / default.php
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 <?php echo artxPost(artxPageTitle($this), null); ?>
6 <?php if ($this->params->def('num_leading_articles', 1)) : ?>
7 <?php for ($i = $this->pagination->limitstart; $i < ($this->pagination->limitstart + $this->params->get('num_leading_articles')); $i++) : ?>
8 <?php if ($i >= $this->total) : break; endif; ?>
9 <?php
10         $this->item =& $this->getItem($i, $this->params);
11         echo $this->loadTemplate('item');
12 ?>
13 <?php endfor; ?>
14 <?php else : $i = $this->pagination->limitstart; endif; ?>
15
16 <?php
17 $startIntroArticles = $this->pagination->limitstart + $this->params->get('num_leading_articles');
18 $numIntroArticles = $startIntroArticles + $this->params->get('num_intro_articles', 4);
19 if (($numIntroArticles != $startIntroArticles) && ($i < $this->total)) : ?>
20                 <table width="100%" cellpadding="0" cellspacing="0">
21                 <tr>
22                 <?php
23                         $divider = '';
24                         if ($this->params->get('multi_column_order')) : // order across as before
25                         for ($z = 0; $z < $this->params->def('num_columns', 2); $z ++) :
26                                 if ($z > 0) : $divider = " column_separator"; endif; ?>
27                                 <?php
28                                         $rows = (int) ($this->params->get('num_intro_articles', 4) / $this->params->get('num_columns'));
29                                         $cols = ($this->params->get('num_intro_articles', 4) % $this->params->get('num_columns'));
30                                 ?>
31                                 <td valign="top" width="<?php echo intval(100 / $this->params->get('num_columns')) ?>%" class="article_column<?php echo $divider ?>">
32                                 <?php
33                                 $loop = (($z < $cols)?1:0) + $rows;
34
35                                 for ($y = 0; $y < $loop; $y ++) :
36                                         $target = $i + ($y * $this->params->get('num_columns')) + $z;
37                                         if ($target < $this->total && $target < ($numIntroArticles)) :
38                                                 $this->item =& $this->getItem($target, $this->params);
39                                                 echo $this->loadTemplate('item');
40                                         endif;
41                                 endfor;
42                                                 ?></td>
43                                                 <?php endfor; 
44                                                 $i = $i + $this->params->get('num_intro_articles') ; 
45                         else : // otherwise, order down columns, like old category blog
46                                 for ($z = 0; $z < $this->params->get('num_columns'); $z ++) :
47                                         if ($z > 0) : $divider = " column_separator"; endif; ?>
48                                         <td valign="top" width="<?php echo intval(100 / $this->params->get('num_columns')) ?>%" class="article_column<?php echo $divider ?>">
49                                         <?php for ($y = 0; $y < ($this->params->get('num_intro_articles') / $this->params->get('num_columns')); $y ++) :
50                                         if ($i < $this->total && $i < ($numIntroArticles)) :
51                                                 $this->item =& $this->getItem($i, $this->params);
52                                                 echo $this->loadTemplate('item');
53                                                 $i ++;
54                                         endif;
55                                 endfor; ?>
56                                 </td>
57                 <?php endfor;
58                 endif;?>
59                 </tr>
60                 </table>
61 <?php endif; ?>
62 <?php if ($this->params->def('num_links', 4) && ($i < $this->total)) : ?>
63 <?php $this->links = array_splice($this->items, $i - $this->pagination->limitstart); ?>
64 <?php if (count($this->links) > 0) : ?>
65 <?php ob_start(); ?>
66 <div class="blog_more<?php echo $this->params->get('pageclass_sfx') ?>">
67 <?php echo $this->loadTemplate('links'); ?>
68 </div>
69 <?php echo artxPost(null, ob_get_clean()); ?>
70 <?php endif; ?>
71 <?php endif; ?>
72 <?php if ($this->params->def('show_pagination', 2) == 1  || ($this->params->get('show_pagination') == 2 && $this->pagination->get('pages.total') > 1)) : ?>
73 <?php ob_start(); ?>
74 <div id="navigation">
75         <p><?php echo $this->pagination->getPagesLinks(); ?></p>
76 <?php if ($this->params->def('show_pagination_results', 1)) : ?>
77         <p><?php echo $this->pagination->getPagesCounter(); ?></p>
78 <?php endif; ?>
79 </div>
80 <?php echo artxPost(null, ob_get_clean()); ?>
81 <?php endif; ?>
82