Не знаю как тут включить спойлер, поэтому извиняюсь за такое количество текста. Но мне очень нужен совет!
Хочу подправить код Kunena Latest 1.6.2 под свои нужды... В этом вопросе полный чайник... Подскажите правильно ли я мыслю, боюсь как бы своими неграмотными действиями не испортить код модуля.
1. Нужно убрать значок "индикатор непрочитанного"
Предположение:
в файле www/modules/mod_kunenalatest/tmpl/default.php убираю строки 55-57
if ($item->unread) {
echo '<sup class="knewchar">(' . JText::_($this->params->get ( 'unreadindicator' )). ")</sup>";
}
2. Убрать значок прикреплено (отключение в настройках модуля позволяет выводить этот значок один, а не два раза)
Предположение:
в файле www/modules/mod_kunenalatest/tmpl/default.php в строках 36-73, предположительно надо удалить строки:
if ($item->ordering) {
echo '<img src="' . JURI::root (). 'modules/mod_kunenalatest/tmpl/sticky.png" alt="' . JText::_ ( 'MOD_KUNENALATEST_STICKY_TOPIC' ). '" title="' . JText::_ ( 'MOD_KUNENALATEST_STICKY_TOPIC' ). '" />';
}
3. Хочу, чтобы сначала выводилась дата и время, а затем автор и только потом название темы (всякие аватарки автора, иконки темы не включаю и мне они не интересны).
Предположение:
в файле www/modules/mod_kunenalatest/tmpl/default.php за вывод темы отвечают строки 36-73, а за дату 83-85, автор 80-82
Нужно просто строки 83-85 поставить перед строками 36-73 (хотя по логике лучше перед 28 строкой, т.к. вывод задан в последовательности аватар - иконка темы - тема - содержание сообщения - категория - автор - время?)
т.е. сделать так?
сначала время
<?php
defined ( '_JEXEC' ) or die ( '' );
?>
<div class="<?php echo $this->params->get ( 'moduleclass_sfx' )?> klatest <?php echo $this->params->get ( 'sh_moduleshowtype' )?>">
<ul class="klatest-items">
<?php
if (is_array ( $this->klistpost ) && !$this->kunena_config->board_offline) {
foreach ( $this->klistpost as $item ) {
$threadPages = ceil ( $item->msgcount / $this->kunena_config->messages_per_page );
?>
<li class="klatest-item">
<ul class="klatest-itemdetails">
<?php
if ( $this->params->get ( 'sh_topiciconoravatar' ) == 1) { ?>
<?php if ($this->params->get ( 'sh_time' )) : ?>
<li class="klatest-posttime"><?php $override = $this->params->get ( 'dateformat' ); echo CKunenaTimeformat::showDate($this->params->get( 'choosemodel' ) == 'latestposts' ? $item->time : $item->lasttime, $override ? $override : 'config_post_dateformat');?></li>
<?php endif; ?>
потом автор
<?php if ($this->params->get ( 'sh_author' )) : ?>
<li class="klatest-author"><?php echo JText::_ ( 'MOD_KUNENALATEST_LAST_POST_BY' ).' '. CKunenaLink::GetProfileLink ( $item->userid, $item->name ); ?></li>
<?php endif; ?>
потом тема
<li class="klatest-avatar">
<?php echo modKunenaLatestHelper::userAvatar( $item->userid, $this->params ); ?>
</li>
<?php } elseif( $this->params->get ( 'sh_topiciconoravatar' ) == 0) { ?>
<li class="klatest-topicicon">
<?php echo $this->ktemplate->getTopicIcon($item); ?>
</li>
<?php } ?>
<li class="klatest-subject">
<?php
if ($this->params->get ( 'sh_sticky' )) {
if ($item->ordering) {
echo '<img src="' . JURI::root (). 'modules/mod_kunenalatest/tmpl/sticky.png" alt="' . JText::_ ( 'MOD_KUNENALATEST_STICKY_TOPIC' ). '" title="' . JText::_ ( 'MOD_KUNENALATEST_STICKY_TOPIC' ). '" />';
}
}
if ($item->ordering) {
echo '<img src="' . JURI::root (). 'modules/mod_kunenalatest/tmpl/sticky.png" alt="' . JText::_ ( 'MOD_KUNENALATEST_STICKY_TOPIC' ). '" title="' . JText::_ ( 'MOD_KUNENALATEST_STICKY_TOPIC' ). '" />';
}
if ( $this->params->get ( 'choosemodel' )!= 'latestposts' && $this->params->get ( 'choosemodel' )!= 'latesttopics' ):
echo CKunenaLink::GetThreadLink ( 'view', $item->catid, $item->id, JString::substr ( htmlspecialchars ( $item->subject ), '0', $this->params->get ( 'titlelength' ) ), JString::substr ( htmlspecialchars ( KunenaParser::stripBBCode($item->message) ), '0', $this->params->get ( 'messagelength' ) ), 'follow' );
else :
if ($this->topic_ordering == 'ASC') :
echo CKunenaLink::GetThreadPageLink ( 'view', intval($item->catid), intval($item->thread), $threadPages, intval($this->kunena_config->messages_per_page), JString::substr ( htmlspecialchars ( $item->subject ), '0', $this->params->get ( 'titlelength' ) ), intval($item->id) );
else :
echo CKunenaLink::GetThreadPageLink ( 'view', intval($item->catid), intval($item->thread), 1, intval($this->kunena_config->messages_per_page), JString::substr ( htmlspecialchars ( $item->subject ), '0', $this->params->get ( 'titlelength' ) ), intval($item->id) );
endif;
endif;
if ($item->unread) {
echo '<sup class="knewchar">(' . JText::_($this->params->get ( 'unreadindicator' )). ")</sup>";
}
if ($this->params->get ( 'sh_favorite' )) {
if ($item->favcount) {
if ($item->myfavorite) {
echo '<img class="favoritestar" src="'.$this->ktemplate->getImagePath('icons/favoritestar.png').'" alt="' . JText::_ ( 'MOD_KUNENALATEST_FAVORITE' ). '" title="' . JText::_ ( 'MOD_KUNENALATEST_FAVORITE' ). '" />';
} else {
echo '<img class="favoritestar-grey" src="'.$this->ktemplate->getImagePath('icons/favoritestar-grey.png').'" alt="' . JText::_ ( 'MOD_KUNENALATEST_FAVORITE' ). '" title="' . JText::_ ( 'MOD_KUNENALATEST_FAVORITE' ). '" />';
}
}
}
if ($this->params->get ( 'sh_locked' )) {
if ($item->locked) {
echo '<img src="'.$this->ktemplate->getImagePath('icons/lock_sm.png').'" alt="' . JText::_ ( 'MOD_KUNENALATEST_LOCKED_TOPIC' ). '" title="' . JText::_ ( 'MOD_KUNENALATEST_LOCKED_TOPIC' ). '" />';
}
}
?>
</li>
потом остаток кода
<?php if ($this->params->get ( 'sh_firstcontentcharacter' )) : ?>
<li class="klatest-preview-content"><?php echo JString::substr(KunenaParser::stripBBCode($item->message), '0', $this->params->get ( 'lengthcontentcharacters' )); ?></li>
<?php endif; ?>
<?php if ($this->params->get ( 'sh_category' )) : ?>
<li class="klatest-cat"><?php echo JText::_ ( 'MOD_KUNENALATEST_IN_CATEGORY' ).' '.CKunenaLink::GetCategoryLink ( 'showcat', $item->catid, $item->catname ); ?></li>
<?php endif; ?>
</ul>
</li>
<?php
} //end foreach
?>
</ul>
<p class="klatest-more"><?php echo CKunenaLink::GetShowLatestLink ( JText::_ ( 'MOD_KUNENALATEST_MORE_LINK' ), $this->latestdo ); ?></p>
<?php
} else {
echo JText::_('MOD_KUNENALATEST_OFFLINE');
} ?>
</div>