⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 banner.php

📁 Joomla!是一套获得过多个奖项的内容管理系统(Content Management System, CMS)。Joomla!采用PHP+MySQL数据库开发
💻 PHP
📖 第 1 页 / 共 2 页
字号:
<?php/** * @version		$Id: banner.php 11655 2009-03-08 20:04:17Z willebil $ * @package		Joomla * @subpackage	Banners * @copyright	Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. * @license		GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * See COPYRIGHT.php for copyright notices and details. */// no direct accessdefined( '_JEXEC' ) or die( 'Restricted access' );/*** @package		Joomla* @subpackage	Banners*/class BannersViewBanner{	function setBannersToolbar()	{		JToolBarHelper::title( JText::_( 'Banner Manager' ), 'generic.png' );		JToolBarHelper::publishList();		JToolBarHelper::unpublishList();		JToolBarHelper::customX( 'copy', 'copy.png', 'copy_f2.png', 'Copy' );		JToolBarHelper::deleteList();		JToolBarHelper::editListX();		JToolBarHelper::addNewX();		JToolBarHelper::preferences('com_banners', '200');		JToolBarHelper::help( 'screen.banners' );	}	function banners( &$rows, &$pageNav, &$lists )	{		BannersViewBanner::setBannersToolbar();		$user =& JFactory::getUser();		$ordering = ($lists['order'] == 'b.ordering');		JHTML::_('behavior.tooltip');		?>		<form action="index.php?option=com_banners" method="post" name="adminForm">		<table>		<tr>			<td align="left" width="100%">				<?php echo JText::_( 'Filter' ); ?>:				<input type="text" name="search" id="search" value="<?php echo $lists['search'];?>" class="text_area" onchange="document.adminForm.submit();" />				<button onclick="this.form.submit();"><?php echo JText::_( 'Go' ); ?></button>				<button onclick="document.getElementById('search').value='';this.form.getElementById('filter_catid').value='0';this.form.getElementById('filter_state').value='';this.form.submit();"><?php echo JText::_( 'Filter Reset' ); ?></button>			</td>			<td nowrap="nowrap">				<?php				echo $lists['catid'];				echo $lists['state'];				?>			</td>		</tr>		</table>			<table class="adminlist">			<thead>				<tr>					<th width="20">						<?php echo JText::_( 'Num' ); ?>					</th>					<th width="20">						<input type="checkbox" name="toggle" value=""  onclick="checkAll(<?php echo count( $rows ); ?>);" />					</th>					<th nowrap="nowrap" class="title">						<?php echo JHTML::_('grid.sort',  'Name', 'b.name', @$lists['order_Dir'], @$lists['order'] ); ?>					</th>					<th width="10%" nowrap="nowrap">						<?php echo JHTML::_('grid.sort',   'Client', 'c.name', @$lists['order_Dir'], @$lists['order'] ); ?>					</th>					<th width="10%" nowrap="nowrap">						<?php echo JHTML::_('grid.sort',   'Category', 'cc.title', @$lists['order_Dir'], @$lists['order'] ); ?>					</th>					<th width="5%" nowrap="nowrap">						<?php echo JHTML::_('grid.sort',   'Published', 'b.showBanner', @$lists['order_Dir'], @$lists['order'] ); ?>					</th>					<th width="8%" nowrap="nowrap">						<?php echo JHTML::_('grid.sort',   'Order', 'b.ordering', @$lists['order_Dir'], @$lists['order'] ); ?>						<?php if ($ordering) echo JHTML::_('grid.order',  $rows ); ?>					</th>					<th width="5%" nowrap="nowrap">						<?php echo JHTML::_('grid.sort',   'Sticky', 'b.Sticky', @$lists['order_Dir'], @$lists['order'] ); ?>					</th>					<th width="5%" nowrap="nowrap">						<?php echo JHTML::_('grid.sort',   'Impressions', 'b.impmade', @$lists['order_Dir'], @$lists['order'] ); ?>					</th>					<th width="80">						<?php echo JHTML::_('grid.sort',   'Clicks', 'b.clicks', @$lists['order_Dir'], @$lists['order'] ); ?>					</th>					<th width="5%" nowrap="nowrap">						<?php echo JText::_( 'Tags' ); ?>					</th>					<th width="1%" nowrap="nowrap">						<?php echo JHTML::_('grid.sort',   'ID', 'b.bid', @$lists['order_Dir'], @$lists['order'] ); ?>					</th>				</tr>			</thead>			<tfoot>				<tr>					<td colspan="13">						<?php echo $pageNav->getListFooter(); ?>					</td>				</tr>			</tfoot>			<tbody>			<?php			$k = 0;			for ($i=0, $n=count( $rows ); $i < $n; $i++) {				$row = &$rows[$i];				$row->id	= $row->bid;				$link		= JRoute::_( 'index.php?option=com_banners&task=edit&cid[]='. $row->id );				if( $row->imptotal <= 0 ) {					$row->imptotal	=  JText::_('unlimited');				}				if ( $row->impmade != 0 ) {					$percentClicks = 100 * $row->clicks/$row->impmade;				} else {					$percentClicks = 0;				}				$row->published = $row->showBanner;				$published		= JHTML::_('grid.published', $row, $i );				$checked		= JHTML::_('grid.checkedout',   $row, $i );				?>				<tr class="<?php echo "row$k"; ?>">					<td align="center">						<?php echo $pageNav->getRowOffset($i); ?>					</td>					<td align="center">						<?php echo $checked; ?>					</td>					<td>					<span class="editlinktip hasTip" title="<?php echo JText::_( 'Edit' );?>::<?php echo $row->name; ?>">						<?php						if ( JTable::isCheckedOut($user->get ('id'), $row->checked_out ) ) {							echo $row->name;						} else {							?>							<a href="<?php echo $link; ?>">								<?php echo $row->name; ?></a>							<?php						}						?>						</span>					</td>					<td align="center">						<?php echo $row->client_name;?>					</td>					<td align="center">						<?php echo $row->category_name;?>					</td>					<td align="center">						<?php echo $published;?>					</td>					<td class="order">                    	<?php $disabled = $ordering ?  '' : 'disabled="disabled"'; ?>						<input type="text" name="order[]" size="5" value="<?php echo $row->ordering; ?>" <?php echo $disabled ?> class="text_area" style="text-align: center" />					</td>					<td align="center">						<?php echo $row->sticky ? JText::_( 'Yes' ) : JText::_( 'No' );?>					</td>					<td align="center">						<?php echo $row->impmade.' '.JText::_('of').' '.$row->imptotal?>					</td>					<td align="center">						<?php echo $row->clicks;?> -						<?php echo sprintf( '%.2f%%', $percentClicks );?>					</td>					<td>						<?php echo $row->tags; ?>					</td>					<td align="center">						<?php echo $row->id; ?>					</td>				</tr>				<?php				$k = 1 - $k;			}			?>			</tbody>			</table>		<input type="hidden" name="c" value="banner" />		<input type="hidden" name="option" value="com_banners" />		<input type="hidden" name="task" value="" />		<input type="hidden" name="boxchecked" value="0" />		<input type="hidden" name="filter_order" value="<?php echo $lists['order']; ?>" />		<input type="hidden" name="filter_order_Dir" value="<?php echo $lists['order_Dir']; ?>" />		<?php echo JHTML::_( 'form.token' ); ?>		</form>		<?php	}	function setBannerToolbar()	{		$task = JRequest::getVar( 'task', '', 'method', 'string');		JToolBarHelper::title( $task == 'add' ? JText::_( 'Banner' ) . ': <small><small>[ '. JText::_( 'New' ) .' ]</small></small>' : JText::_( 'Banner' ) . ': <small><small>[ '. JText::_( 'Edit' ) .' ]</small></small>', 'generic.png' );		JToolBarHelper::save( 'save' );		JToolBarHelper::apply('apply');		JToolBarHelper::cancel( 'cancel' );		JToolBarHelper::help( 'screen.banners.edit' );	}	function banner( &$row, &$lists )	{		BannersViewBanner::setBannerToolbar();		JRequest::setVar( 'hidemainmenu', 1 );		JFilterOutput::objectHTMLSafe( $row, ENT_QUOTES, 'custombannercode' );		?>		<script language="javascript" type="text/javascript">		<!--		function changeDisplayImage() {			if (document.adminForm.imageurl.value !='') {				document.adminForm.imagelib.src='../images/banners/' + document.adminForm.imageurl.value;			} else {				document.adminForm.imagelib.src='images/blank.png';			}		}		function submitbutton(pressbutton) {			var form = document.adminForm;			if (pressbutton == 'cancel') {				submitform( pressbutton );				return;			}			// do field validation			if (form.name.value == "") {

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -