OSDN Git Service

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