joomla k2学习及布局修改(一)

今天对joomla k2的功能及布局做了一个小小的研究与更改,在这边记录一下,以备后用。原来的k2内容展示页的显示顺序大概是这个样子的:1、标题;2、按钮之类;3、介绍;4、全文;5、额外字段;(不做一一列举)........最后才是图库展示。但似乎不符合我们接受的一般规律,我这次建的是一家短租公寓网站:3c-home.com.希望能直观的先显示图库,再显示额外字段,然后显示其他的,然后我找k
摘要由CSDN通过智能技术生成


今天对joomla k2的功能及布局做了一个小小的研究与更改,在这边记录一下,以备后用。

原来的k2内容展示页的显示顺序大概是这个样子的:1、标题;2、按钮之类;3、介绍;4、全文;5、额外字段;(不做一一列举)........最后才是图库展示。但似乎不符合我们接受的一般规律,我这次建的是一家短租公寓网站:3c-home.com.希望能直观的先显示图库,再显示额外字段,然后显示其他的,然后我找k2的源代码做个修改。

一、item.php文件的修改

既然是文章显示,应该就是修改\components\com_k2\templates\default\item.php这个文件喽,来看一下部分源代码:

 

<!-- Start K2 Item Layout -->
<span id="startOfPageId<?php echo JRequest::getInt('id'); ?>"></span>

<div id="k2Container" class="itemView<?php echo ($this->item->featured) ? ' itemIsFeatured' : ''; ?><?php if($this->item->params->get('pageclass_sfx')) echo ' '.$this->item->params->get('pageclass_sfx'); ?>">

	<!-- Plugins: BeforeDisplay -->
	<?php echo $this->item->event->BeforeDisplay; ?>

	<!-- K2 Plugins: K2BeforeDisplay -->
	<?php echo $this->item->event->K2BeforeDisplay; ?>

	<div class="itemHeader">

		<?php if($this->item->params->get('itemDateCreated')): ?>
		<!-- Date created -->
		<span class="itemDateCreated">
			<?php echo JHTML::_('date', $this->item->created , JText::_('K2_DATE_FORMAT_LC2')); ?>
		</span>
		<?php endif; ?>

	  <?php if($this->item->params->get('itemTitle')): ?>
	  <!-- Item title -->
	  <h2 class="itemTitle">
			<?php if(isset($this->item->editLink)): ?>
			<!-- Item edit link -->
			<span class="itemEditLink">
				<a class="modal" rel="{handler:'iframe',size:{x:990,y:550}}" href="<?php echo $this->item->editLink; ?>">
					<?php echo JText::_('K2_EDIT_ITEM'); ?>
				</a>
			</span>
			<?php endif; ?>

	  	<?php echo $this->item->title; ?>

	  	<?php if($this->item->params->get('itemFeaturedNotice') && $this->item->featured): ?>
	  	<!-- Featured flag -->
	  	<span>
		  	<sup>
		  		<?php echo JText::_('K2_FEATURED'); ?>
		  	</sup>
	  	</span>
	  	<?php endif; ?>

	  </h2>
	  <?php endif; ?>

		<?php if($this->item->params->get('itemAuthor')): ?>
		<!-- Item Author -->
		<span class="itemAuthor">
			<?php echo K2HelperUtilities::writtenBy($this->item->author->profile->gender); ?> 
			<?php if(empty($this->item->created_by_alias)): ?>
			<a rel="author" href="<?php echo $this->item->author->link; ?>"><?php echo $this->item->author->name; ?></a>
			<?php else: ?>
			<?php echo $this->item->author->name; ?>
			<?php endif; ?>
		</span>
		<?php endif; ?>

  </div>

  <!-- Plugins: AfterDisplayTitle -->
  <?php echo $this->item->event->AfterDisplayTitle; ?>

  <!-- K2 Plugins: K2AfterDisplayTitle -->
  <?php echo $this->item->event->K2AfterDisplayTitle; ?>

	<?php if(
		$this->item->params->get('itemFontResizer') ||
		$this->item->params->get('itemPrintButton') ||
		$this->item->params->get('itemEmailButton') ||
		$this->item->params->get('itemSocialButton') ||
		$this->item->params->get('itemVideoAnchor') ||
		$this->item->params->get('itemImageGalleryAnchor') ||
		$this->item->params->get('itemCommentsAnchor')
	): ?>
  <div class="itemToolbar">
		<ul>
			<?php if($this->item->params->get('itemFontResizer')): ?>
			<!-- Font Resizer -->
			<li>
				<span class="itemTextResizerTitle"><?php echo JText::_('K2_FONT_SIZE'); ?></span>
				<a href="#" id="fontDecrease">
					<span><?php echo JText::_('K2_DECREASE_FONT_SIZE'); ?></span>
					<img src="<?php echo JURI::root(true); ?>/components/com_k2/images/system/blank.gif" alt="<?php echo JText::_('K2_DECREASE_FONT_SIZE'); ?>" />
				</a>
				<a href="#" id="fontIncrease">
					<span><?php echo JText::_('K2_INCREASE_FONT_SIZE'); ?></span>
					<img src="<?php echo JURI::root(true); ?>/components/com_k2/images/system/blank.gif" alt="<?php echo JText::_('K2_INCREASE_FONT_SIZE'); ?>" />
				</a>
			</li>
			<?php endif; ?>

			<?php if($this->item->params->get('itemPrintButton') && !JRequest::getInt('print')): ?>
			<!-- Print Button -->
			<li>
				<a class="itemPrintLink" rel="nofollow" href="<?php echo $this->item->printLink; ?>" οnclick="window.open(this.href,'printWindow','width=900,height=600,location=no,menubar=no,resizable=yes,scrollbars=yes'); return false;">
					<span><?php echo JText::_('K2_PRINT'); ?></span>
				</a>
			</li>
			<?php endif; ?>

			<?php if($this->item->params->get('itemEmailButton') && !JRequest::getInt('print')): ?>
			<!-- Email Button -->
			<li>
				<a class="itemEmailLink" rel="nofollow" href="<?php echo $this->item->emailLink; ?>" οnclick="window.open(this.href,'emailWindow','width=400,height=350,location=no,menubar=no,resizable=no,scrollbars=no'); return false;">
					<span><?php echo JText::_('K2_EMAIL'); ?></span>
				</a>
			</li>
			<?php endif; ?>

			<?php if($this->item->params->get('itemSocialButton') && !is_null($this->item->params->get('socialButtonCode', NULL))): ?>
			<!-- Item Social Button -->
			<li>
				<?php echo $this->item->params->get('socialButtonCode'); ?>
			</li>
			<?php endif; ?>

			<?php if($this->item->params->get('itemVideoAnchor') && !empty($this->item->video)): ?>
			<!-- Anchor link to item video below - if it exists -->
			<li>
				<a class="itemVideoLink k2Anchor" href="<?php echo $this->item->link; ?>#itemVideoAnchor"><?php echo JText::_('K2_MEDIA'); ?></a>
			</li>
			<?php endif; ?>

			<?php if($this->item->params->get('itemImageGalleryAnchor') && !empty($this->item->gallery)): ?>
			<!-- Anchor link to item image gallery below - if it exists -->
			<li>
				<a class="itemImageGalleryLink k2
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Joomla是一个流行的内容管理系统(CMS),用于建立和管理网站。在进行渗透测试和加固时,以下是一些步骤和建议可以帮助保护基于Joomla的网站: 渗透测试: 1. 信息收集:了解目标网站的架构、版本和插件信息。可以使用工具如Wappalyzer、Joomscan等来获取这些信息。 2. 漏洞扫描:使用漏洞扫描工具如Nikto、OpenVAS等对网站进行扫描,检查是否存在已知的漏洞。 3. 基于Web的漏洞测试:进行常见的Web漏洞测试,如SQL注入、跨站脚本攻击(XSS)、跨站请求伪造(CSRF)等。使用工具如Burp Suite、OWASP ZAP等进行测试。 4. 弱密码检测:通过使用弱密码字典或爆破工具对Joomla后台登录进行测试,以确保管理员账户和其他用户账户设置了足够强度的密码。 5. 文件上传漏洞:检查是否存在不受限制的文件上传功能,并尝试上传可执行文件或恶意脚本来验证是否存在文件上传漏洞。 加固措施: 1. 更新和升级:确保Joomla及其插件、模板和扩展程序保持最新版本,以消除已知漏洞并修复安全问题。 2. 强密码策略:要求管理员和用户设置强密码,并定期更改密码。使用密码管理工具来生成和保存密码。 3. 访问控制:限制对Joomla后台的访问,并只授予必要的权限给用户。使用强大的身份验证方式,如双因素认证。 4. 安全插件:安装和配置安全插件,如Joomla Security Scanner、RSFirewall等,以提供额外的安全保护和监控。 5. 文件权限设置:确保文件和目录的权限设置正确,以防止未经授权的访问和修改。 6. 数据库安全:使用强密码保护数据库,并限制数据库用户的权限,只给予必要的访问权限。 7. 定期备份:定期备份Joomla网站和相关数据,以便在发生安全事件时进行恢复。 这些是一些基本的渗透测试和加固措施,但请注意,安全是一个持续的过程。建议进行定期的安全审查和更新,以保持网站的安全性。同时,如果你不是专业的渗透测试人员,请务必在进行任何测试之前取得网站所有者的明确授权。希望这些信息对你有所帮助!如有其他问题,请随时提问。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值