forked from Kunena/Kunena-Forum
-
Notifications
You must be signed in to change notification settings - Fork 2
/
list_embed.php
156 lines (148 loc) · 5.98 KB
/
list_embed.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
<?php
/**
* Kunena Component
* @package Kunena.Template.Default
* @subpackage Category
*
* @copyright (C) 2008 - 2011 Kunena Team. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* @link http://www.kunena.org
**/
defined ( '_JEXEC' ) or die ();
require_once(KPATH_SITE.'/lib/kunena.link.class.php');
$tabclass = array ("row1", "row2" );
$mmm=0;
foreach ( $this->sections as $section ) :
$htmlClassBlockTable = !empty ( $section->class_sfx ) ? ' kblocktable' . $this->escape($section->class_sfx) : '';
$htmlClassTitleCover = !empty ( $section->class_sfx ) ? ' ktitle-cover' . $this->escape($section->class_sfx) : '';
?>
<div class="kblock kcategories-<?php echo intval($section->id) ?>">
<div class="kheader">
<?php if (count($this->sections) > 1) : ?>
<span class="ktoggler"><a class="ktoggler close" title="<?php echo JText::_('COM_KUNENA_TOGGLER_COLLAPSE') ?>" rel="catid_<?php echo intval($section->id) ?>"></a></span>
<?php endif; ?>
<h2><span><?php echo $this->GetCategoryLink ( $section, $this->escape($section->name) ); ?></span></h2>
<?php if (!empty($section->description)) : ?>
<div class="ktitle-desc km">
<?php echo KunenaHtmlParser::parseBBCode ( $section->description ); ?>
</div>
<?php endif; ?>
</div>
<div class="kcontainer" id="catid_<?php echo intval($section->id) ?>">
<div class="kbody">
<table class="kblocktable<?php echo $htmlClassBlockTable ?>" id="kcat<?php echo intval($section->id) ?>">
<?php if (empty ( $this->categories [$section->id] )) { echo JText::_('COM_KUNENA_GEN_NOFORUMS');
} else {
$k = 0;
foreach ( $this->categories [$section->id] as $category ) {
?>
<tr class="k<?php echo $tabclass [$k ^= 1], isset ( $category->class_sfx ) ? ' k' . $this->escape($tabclass [$k]) . $this->escape($category->class_sfx) : '' ?>"
id="kcat<?php echo intval($category->id) ?>">
<td class="kcol-first kcol-category-icon">
<?php echo $this->getCategoryLink($category, $this->getCategoryIcon($category), '') ?>
</td>
<td class="kcol-mid kcol-kcattitle">
<div class="kthead-title kl">
<?php
// Show new posts, locked, review
echo $this->getCategoryLink($category);
if ($category->getNewCount()) {
echo '<sup class="knewchar">(' . $category->getNewCount() . ' ' . JText::_('COM_KUNENA_A_GEN_NEWCHAR') . ")</sup>";
}
if ($category->locked) {
echo $this->getIcon ( 'kforumlocked', JText::_('COM_KUNENA_GEN_LOCKED_FORUM') );
}
if ($category->review) {
echo $this->getIcon ( 'kforummoderated', JText::_('COM_KUNENA_GEN_MODERATED') );
}
?>
</div>
<?php if (!empty($category->description)) : ?>
<div class="kthead-desc km"><?php echo KunenaHtmlParser::parseBBCode ($category->description) ?> </div>
<?php endif; ?>
<?php
// Display subcategories
if (! empty ( $this->categories [$category->id] )) :
?>
<div class="kthead-child">
<div class="kcc-table">
<?php foreach ( $this->categories [$category->id] as $childforum ) : ?>
<div class="kcc-subcat km">
<?php
echo $this->getCategoryIcon($childforum, true);
echo $this->getCategoryLink($childforum);
echo '<span class="kchildcount ks">(' . $childforum->getTopics() . "/" . $childforum->getReplies() . ')</span>';
?>
</div>
<?php endforeach; ?>
</div>
</div>
<?php endif; ?>
<?php if (! empty ( $category->moderators )) : ?>
<div class="kthead-moderators ks">
<?php
// get the Moderator list for display
$modslist = array();
foreach ( $category->moderators as $moderator ) {
$modslist[] = KunenaFactory::getUser($moderator)->getLink();
}
echo JText::_('COM_KUNENA_GEN_MODERATORS') . ': ' . implode(', ', $modslist);
?>
</div>
<?php endif; ?>
<?php if (! empty ( $this->pending [$category->id] )) : ?>
<div class="ks kalert">
<?php echo CKunenaLink::GetCategoryReviewListLink ( intval($category->id), intval($this->pending [$category->id]) . ' ' . JText::_('COM_KUNENA_SHOWCAT_PENDING'), 'nofollow' ); ?>
</div>
<?php endif; ?>
</td>
<td class="kcol-mid kcol-kcattopics">
<!-- Number of Topics -->
<span class="kcat-topics-number"><?php echo $this->formatLargeNumber ( $category->getTopics() ) ?></span>
<span class="kcat-topics"><?php echo JText::_('COM_KUNENA_GEN_TOPICS');?></span>
<!-- /Number of Topics -->
</td>
<td class="kcol-mid kcol-kcatreplies">
<!-- Number of Replies -->
<span class="kcat-replies-number"><?php echo $this->formatLargeNumber ( $category->getReplies() ) ?></span>
<span class="kcat-replies"><?php echo JText::_('COM_KUNENA_GEN_REPLIES');?> </span>
<!-- /Number of Replies -->
</td>
<?php $last = $category->getLastTopic();
if ($last->exists()) { ?>
<td class="kcol-mid kcol-kcatlastpost">
<?php if ($this->config->avataroncat > 0) : ?>
<!-- Avatar -->
<?php
$profile = KunenaFactory::getUser((int)$last->last_post_userid);
$useravatar = $profile->getAvatarImage('klist-avatar', 'list');
if ($useravatar) : ?>
<span class="klatest-avatar"> <?php echo $last->getLastPostAuthor()->getLink( $useravatar ); ?></span>
<?php endif; ?>
<!-- /Avatar -->
<?php endif; ?>
<div class="klatest-subject ks">
<?php echo JText::_('COM_KUNENA_GEN_LAST_POST') . ': '. $this->getLastPostLink($category) ?>
</div>
<div class="klatest-subject-by ks">
<?php
echo JText::_('COM_KUNENA_BY') . ' ';
echo $last->getLastPostAuthor()->getLink();
echo '<br /><span class="nowrap" title="' . KunenaDate::getInstance($last->last_post_time)->toKunena('config_post_dateformat_hover') . '">' . KunenaDate::getInstance($last->last_post_time)->toKunena('config_post_dateformat') . '</span>';
?>
</div>
</td>
<?php } else { ?>
<td class="kcol-mid kcol-knoposts"><?php echo JText::_('COM_KUNENA_NO_POSTS'); ?></td>
<?php } ?>
</tr>
<?php } } ?>
</table>
</div>
</div>
</div>
<!-- F: List Cat -->
<!-- Begin: Category Module Position -->
<?php $this->getModulePosition('kunena_section_' . $mmm) ?>
<!-- Finish: Category Module Position -->
<?php endforeach; ?>