OSDN Git Service

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