基本上我想将 Kunena 论坛部分链接设置为像HERE这样的标签。在首页显示特定部分的原始代码如下所示:
<?php
/**
* Kunena Component
* @package Kunena.Template.Blue_Eagle
* @subpackage Category
*
* @copyright (C) 2008 - 2013 Kunena Team. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* @link http://www.kunena.org
**/
defined ( '_JEXEC' ) or die ();
$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">
<h2><span><?php echo $this->GetCategoryLink ( $section, $this->escape($section->name) ); ?></span></h2>
<?php if (!empty($section->description)) : ?>
<div class="ktitle-desc km hidden-phone">
<?php echo KunenaHtmlParser::parseBBCode ( $section->description ); ?>
</div>
<?php endif; ?>
</div>
<div class="kcontainer" id="catid_<?php echo intval($section->id) ?>">
<!-- Here Comes Categories Displayed As Tab Content-->
<!-- Finish: Category Module Position -->
</div>
</div>
<?php endforeach; ?>
所以我把第一部分从
<div class="kheader">
<h2><span><?php echo $this->GetCategoryLink ( $section, $this->escape($section->name) ); ?></span></h2>
<?php if (!empty($section->description)) : ?>
<div class="ktitle-desc km hidden-phone">
<?php echo KunenaHtmlParser::parseBBCode ( $section->description ); ?>
</div>
<?php endif; ?>
</div
至
<div class="navbar">
<div class="navbar-inner">
<ul class="nav">
<ul id="sections-tab" class="nav nav-pills visible-desktop">
<li class="active">
<a id="sect<?php echo intval($section->id) ?>" href="#sect<?php echo intval($section->id) ?>" data-toggle="tab">
<span class="sectiontab<?php echo intval($section->id) ?>"><?php echo $this->GetCategoryLink ( $section, $this->escape($section->name) ); ?></span>
</a>
</li>
</ul>
</ul>
</div>
</div>
但它仍然正常显示部分。我知道我需要在导航栏类之间移动foreach ( $this->sections 作为 $section )但是......老实说,我卡在这里是因为不太了解 PHP。因此,任何帮助都非常有用。