OSDN Git Service

初回コミット(v2.6.17.1)
[magic3/magic3.git] / templates / art30rc1_sample1 / html / com_content / frontpage / default.php
1 <?php
2 defined('_JEXEC') or die;
3
4 require_once dirname(__FILE__) . str_replace('/', DIRECTORY_SEPARATOR, '/../../../functions.php');
5
6 $view = new ArtxContent15($this, $this->params);
7
8 echo $view->beginPageContainer('blog-featured');
9 if ($view->showPageHeading)
10     echo $view->pageHeading();
11
12 if ($this->params->def('num_leading_articles', 1)) :
13         $leadingcount = 0;
14 ?>
15 <div class="items-leading">
16 <?php
17         for ($i = $this->pagination->limitstart; $i < ($this->pagination->limitstart + $this->params->get('num_leading_articles')); $i++) :
18                 if ($i >= $this->total) : break; endif;
19 ?>
20 <div class="leading-<?php echo $leadingcount; ?>">
21 <?php
22                 $this->item =& $this->getItem($i, $this->params);
23                 echo $this->loadTemplate('item');
24 ?>
25 </div>
26 <?php
27                 $leadingcount++;
28         endfor;
29 ?>
30 </div>
31 <?php
32 else :
33         $i = $this->pagination->limitstart;
34 endif;
35
36 $startIntroArticles = $this->pagination->limitstart + $this->params->get('num_leading_articles');
37 $numIntroArticles = $startIntroArticles + $this->params->get('num_intro_articles', 4);
38 if (($numIntroArticles != $startIntroArticles) && ($i < $this->total)) : ?>
39                 <table width="100%" cellpadding="0" cellspacing="0">
40                 <tr>
41                 <?php
42                         $divider = '';
43                         if ($this->params->def('multi_column_order', 1)) : // order across as before
44                         for ($z = 0; $z < $this->params->def('num_columns', 2); $z ++) :
45                                 if ($z > 0) : $divider = " column_separator"; endif; ?>
46                                 <?php
47                                         $rows = (int) ($this->params->get('num_intro_articles', 4) / $this->params->get('num_columns'));
48                                         $cols = ($this->params->get('num_intro_articles', 4) % $this->params->get('num_columns'));
49                                 ?>
50                                 <td valign="top" width="<?php echo intval(100 / $this->params->get('num_columns')) ?>%" class="article_column<?php echo $divider ?>">
51                                 <?php
52                                 $loop = (($z < $cols)?1:0) + $rows;
53
54                                 for ($y = 0; $y < $loop; $y ++) :
55                                         $target = $i + ($y * $this->params->get('num_columns')) + $z;
56                                         if ($target < $this->total && $target < ($numIntroArticles)) :
57                                                 $this->item =& $this->getItem($target, $this->params);
58                                                 echo $this->loadTemplate('item');
59                                         endif;
60                                 endfor;
61                                                 ?></td>
62                                                 <?php endfor; 
63                                                 $i = $i + $this->params->get('num_intro_articles') ; 
64                         else : // otherwise, order down columns, like old category blog
65                                 for ($z = 0; $z < $this->params->get('num_columns'); $z ++) :
66                                         if ($z > 0) : $divider = " column_separator"; endif; ?>
67                                         <td valign="top" width="<?php echo intval(100 / $this->params->get('num_columns')) ?>%" class="article_column<?php echo $divider ?>">
68                                         <?php for ($y = 0; $y < ($this->params->get('num_intro_articles') / $this->params->get('num_columns')); $y ++) :
69                                         if ($i < $this->total && $i < ($numIntroArticles)) :
70                                                 $this->item =& $this->getItem($i, $this->params);
71                                                 echo $this->loadTemplate('item');
72                                                 $i ++;
73                                         endif;
74                                 endfor; ?>
75                                 </td>
76                 <?php endfor;
77                 endif;?>
78                 </tr>
79                 </table>
80 <?php endif; ?>
81 <?php
82 if ($this->params->def('num_links', 4) && ($i < $this->total)) :
83         $this->links = array_splice($this->items, $i - $this->pagination->limitstart);
84         if (count($this->links) > 0) :
85                 ob_start();
86 ?>
87 <div class="items-more">
88 <?php echo $this->loadTemplate('links'); ?>
89 </div>
90 <?php
91                 echo artxPost(ob_get_clean());
92         endif;
93 endif;
94
95 if ($this->params->def('show_pagination', 2) == 1  || ($this->params->get('show_pagination') == 2 && $this->pagination->get('pages.total') > 1)) :
96         ob_start();
97 ?>
98 <div id="navigation">
99 <?php if ($this->params->def('show_pagination_results', 1)) : ?>
100         <p><?php echo $this->pagination->getPagesCounter(); ?></p>
101 <?php endif; ?>
102         <p><?php echo $this->pagination->getPagesLinks(); ?></p>
103 </div>
104 <?php
105         echo artxPost(ob_get_clean());
106 endif;
107 echo $view->endPageContainer();