OSDN Git Service

初回コミット(v2.6.17.1)
[magic3/magic3.git] / templates / art30_041_sample2 / html / com_content / category / blog.php
1 <?php
2 defined('_JEXEC') or die;
3 require_once dirname(__FILE__) . str_replace('/', DIRECTORY_SEPARATOR, '/../../../functions.php');
4 $version = new JVersion();
5 $view = ('1.5' == $version->RELEASE) ? new ArtxContent15($this, $this->params) : new ArtxContent16($this, $this->params);
6 ?>
7 <div class="blog<?php echo $view->pageClassSfx; ?>">
8 <?php ob_start(); ?>
9 <?php if (strlen($this->params->get('page_subheading'))) : ?>
10     <span class="page-subheading"><?php echo $this->escape($this->params->get('page_subheading')); ?></span>
11 <?php endif; ?>
12 <?php if ($this->params->get('show_category_title') && strlen($this->category->title)) : ?>
13     <span class="subheading-category"><?php echo $this->category->title;?></span>
14 <?php endif; ?>
15 <?php if ($this->params->def('show_description', 1) || $this->params->def('show_description_image', 1)) : ?>
16 <div class="category-desc">
17     <?php if ('1.5' == $version->RELEASE) : ?>
18         <?php if ($this->params->get('show_description_image') && $this->category->image) : ?>
19             <img src="<?php echo $this->baseurl . '/' . JComponentHelper::getParams('com_media')->get('image_path') . '/'. $this->category->image; ?>" align="<?php echo $this->category->image_position;?>" hspace="6" alt="" />
20         <?php endif; ?>
21         <?php if ($this->params->get('show_description') && $this->category->description) : ?>
22             <?php echo $this->category->description; ?>
23         <?php endif; ?>
24     <?php else : ?>
25         <?php if ($this->params->get('show_description_image') && $this->category->getParams()->get('image')) : ?>
26             <img src="<?php echo $this->category->getParams()->get('image'); ?>" alt="" />
27         <?php endif; ?>
28         <?php if ($this->params->get('show_description') && $this->category->description) : ?>
29             <?php echo JHtml::_('content.prepare', $this->category->description); ?>
30         <?php endif; ?>
31     <?php endif; ?>
32 </div>
33 <?php endif; ?>
34 <?php echo artxPost(array('header-text' => $view->pageHeading, 'content' => ob_get_clean())); ?>
35 <?php if ('1.5' != $version->RELEASE) : ?>
36     <?php $leadingcount=0 ; ?>
37     <?php if (!empty($this->lead_items)) : ?>
38     <div class="items-leading">
39         <?php foreach ($this->lead_items as &$item) : ?>
40             <div class="leading-<?php echo $leadingcount; ?><?php echo $item->state == 0 ? ' system-unpublished' : null; ?>">
41                 <?php
42                     $this->item = &$item;
43                     echo $this->loadTemplate('item');
44                 ?>
45             </div>
46             <?php $leadingcount++; ?>
47         <?php endforeach; ?>
48     </div>
49     <?php endif; ?>
50     <?php
51         $introcount = (count($this->intro_items));
52         $counter = 0;
53     ?>
54     <?php if (!empty($this->intro_items)) : ?>
55         <?php foreach ($this->intro_items as $key => &$item) : ?>
56         <?php
57             $key= ($key-$leadingcount)+1;
58             $rowcount=( ((int)$key-1) % (int) $this->columns) +1;
59             $row = $counter / $this->columns ;
60             if ($rowcount==1) : ?>
61                 <div class="items-row cols-<?php echo (int) $this->columns;?> <?php echo 'row-'.$row ; ?>">
62            <?php endif; ?>
63         <div class="item column-<?php echo $rowcount;?><?php echo $item->state == 0 ? ' system-unpublished' : null; ?>">
64         <?php
65             $this->item = &$item;
66             echo $this->loadTemplate('item');
67         ?>
68         </div>
69             <?php $counter++; ?>
70             <?php if (($rowcount == $this->columns) or ($counter ==$introcount)): ?>
71         <span class="row-separator"></span>
72     </div>
73             <?php endif; ?>
74         <?php endforeach; ?>
75     <?php endif; ?>
76     <?php if (!empty($this->link_items)) : ?>
77         <?php ob_start(); ?>
78         <div class="items-more">
79             <?php echo $this->loadTemplate('links'); ?>
80         </div>
81         <?php echo artxPost(ob_get_clean()); ?>
82     <?php endif; ?>
83     <?php if (!empty($this->children[$this->category->id])&& $this->maxLevel != 0) : ?>
84         <?php ob_start(); ?>
85         <div class="cat-children">
86             <h3><?php echo JTEXT::_('JGLOBAL_SUBCATEGORIES'); ?></h3>
87             <?php echo $this->loadTemplate('children'); ?>
88         </div>
89         <?php echo artxPost(ob_get_clean()); ?>
90     <?php endif; ?>
91     <?php if (($this->params->def('show_pagination', 1) == 1  || ($this->params->get('show_pagination') == 2)) && ($this->pagination->get('pages.total') > 1)) : ?>
92         <?php ob_start(); ?>
93         <div class="pagination">
94         <?php if ($this->params->def('show_pagination_results', 1)) : ?>
95             <p class="counter"><?php echo $this->pagination->getPagesCounter(); ?></p>
96         <?php endif; ?>
97         <?php echo $this->pagination->getPagesLinks(); ?>
98         </div>
99         <?php echo artxPost(ob_get_clean()); ?>
100     <?php endif; ?>
101 <?php else : ?>
102 <table class="blog<?php echo $view->pageClassSfx;?>" cellpadding="0" cellspacing="0" width="100%">
103 <?php if ($this->params->get('num_leading_articles')) : ?>
104 <tr>
105         <td valign="top">
106         <?php for ($i = $this->pagination->limitstart; $i < ($this->pagination->limitstart + $this->params->get('num_leading_articles')); $i++) : ?>
107                 <?php if ($i >= $this->total) : break; endif; ?>
108                 <div>
109                 <?php
110                         $this->item =& $this->getItem($i, $this->params);
111                         echo $this->loadTemplate('item');
112                 ?>
113                 </div>
114         <?php endfor; ?>
115         </td>
116 </tr>
117 <?php else : $i = $this->pagination->limitstart; endif; ?>
118
119 <?php
120 $startIntroArticles = $this->pagination->limitstart + $this->params->get('num_leading_articles');
121 $numIntroArticles = $startIntroArticles + $this->params->get('num_intro_articles');
122 if (($numIntroArticles != $startIntroArticles) && ($i < $this->total)) : ?>
123 <tr>
124         <td valign="top">
125                 <table width="100%" cellpadding="0" cellspacing="0">
126                 <tr>
127                 <?php
128                         $divider = '';
129                         if ($this->params->get('multi_column_order')) : // order across, like front page
130                                 for ($z = 0; $z < $this->params->def('num_columns', 2); $z ++) :
131                                         if ($z > 0) : $divider = " column_separator"; endif; ?>
132                                         <?php
133                                         $rows = (int) ($this->params->get('num_intro_articles', 4) / $this->params->get('num_columns'));
134                                         $cols = ($this->params->get('num_intro_articles', 4) % $this->params->get('num_columns'));
135                                         ?>
136                                         <td valign="top"
137                                                 width="<?php echo intval(100 / $this->params->get('num_columns')) ?>%"
138                                                 class="article_column<?php echo $divider ?>">
139                                                 <?php
140                                                 $loop = (($z < $cols)?1:0) + $rows;
141
142                                                 for ($y = 0; $y < $loop; $y ++) :
143                                                         $target = $i + ($y * $this->params->get('num_columns')) + $z;
144                                                         if ($target < $this->total && $target < ($numIntroArticles)) :
145                                                                 $this->item =& $this->getItem($target, $this->params);
146                                                                 echo $this->loadTemplate('item');
147                                                         endif;
148                                                 endfor;
149                                                 ?></td>
150                                 <?php endfor; 
151                                                 $i = $i + $this->params->get('num_intro_articles') ; 
152                         else : // otherwise, order down, same as before (default behaviour)
153                                 for ($z = 0; $z < $this->params->get('num_columns'); $z ++) :
154                                         if ($z > 0) : $divider = " column_separator"; endif; ?>
155                                         <td valign="top" width="<?php echo intval(100 / $this->params->get('num_columns')) ?>%" class="article_column<?php echo $divider ?>">
156                                         <?php for ($y = 0; $y < ($this->params->get('num_intro_articles') / $this->params->get('num_columns')); $y ++) :
157                                         if ($i < $this->total && $i < ($numIntroArticles)) :
158                                                 $this->item =& $this->getItem($i, $this->params);
159                                                 echo $this->loadTemplate('item');
160                                                 $i ++;
161                                         endif;
162                                 endfor; ?>
163                                 </td>
164                 <?php endfor; 
165                 endif; ?> 
166                 </tr>
167                 </table>
168         </td>
169 </tr>
170 <?php endif; ?>
171 </table>
172 <?php if ($this->params->get('num_links') && ($i < $this->total)) : ?>
173 <?php ob_start(); ?>
174 <?php
175         $this->links = array_splice($this->items, $i - $this->pagination->limitstart);
176         echo $this->loadTemplate('links');
177 ?>
178 <?php echo artxPost(ob_get_clean()); ?>
179 <?php endif; ?>
180 <?php
181 $paginationPagesLinks = $this->params->get('show_pagination')
182     ? $this->pagination->getPagesLinks() : '';
183 $paginationPagesCounter = $this->params->get('show_pagination_results')
184     ? $this->pagination->getPagesCounter() : '';
185 ?>
186 <?php if (strlen($paginationPagesLinks) > 0 && strlen($paginationPagesCounter) > 0) : ?>
187 <?php ob_start(); ?>
188 <div id="navigation">
189 <?php if (strlen($paginationPagesLinks) > 0) : ?>
190 <p><?php echo $paginationPagesLinks; ?></p>
191 <?php endif; ?>
192 <?php if (strlen($paginationPagesCounter) > 0) : ?>
193 <p><?php echo $paginationPagesCounter; ?></p>
194 <?php endif; ?>
195 </div>
196 <?php echo artxPost(ob_get_clean()); ?>
197 <?php endif; ?>
198 <?php endif; ?>
199 </div>