---
title: "joomla广告系统添加按时间下线"
author: "aiou"
date: "2009-06-02T13:09:53Z"
tags: ["PHP", "UP"]
categories: ["编程语言"]
slug: "joomla"
draft: false
lastmod: "2009-06-02T13:09:53Z"
id: 400257
url: "https://aiou.iteye.com/blog/400257"
---

在administrator/component/com\_banners/views/banner.php的banner函数中适当位置添加如下代码： \[code="php"] : : \[/code] 就可以添加、显示设置的上下线时间了 然后在前台组件中 Components/com\_banners/models/banner.php的impress方法将 \[code="php"]$expire = (($item-&gt;clicks &gt;= $item-&gt;imptotal) && ($item-&gt;imptotal != 0)) \[/code] 改为： \[code="php"]$expire=(($item-&gt;clicks&gt;=$item-&gt;imptotal)&&($item-&gt;imptotal!=0))||($item-&gt;publish\_down &lt; date("Y-m-d H:i:s")&&($item-&gt;publish\_down!= date("0000-00-00 00:00:00")));\[/code] 基本上就可以了