Joomla15 - 最新开源CMS

源代码在线查看: admin.checkin.php

软件大小: 4715 K
上传用户: feitiandy001
关键词: Joomla CMS 15 开源
下载地址: 免注册下载 普通下载 VIP

相关代码

								/**				* @version		$Id: admin.checkin.php 8004 2007-07-17 00:03:21Z friesengeist $				* @package		Joomla				* @subpackage	Checkin				* @copyright	Copyright (C) 2005 - 2007 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 access				defined( '_JEXEC' ) or die( 'Restricted access' );								/*				 * Make sure the user is authorized to view this page				 */				$user = & JFactory::getUser();				if (!$user->authorize( 'com_checkin', 'manage' )) {					$mainframe->redirect( 'index.php', JText::_('ALERTNOTAUTH') );				}				$db			=& JFactory::getDBO();				$nullDate	= $db->getNullDate();				?>																																																																																																		$tables = $db->getTableList();					$k = 0;					foreach ($tables as $tn) {						// make sure we get the right tables based on prefix						if (!preg_match( "/^".$mainframe->getCfg('dbprefix')."/i", $tn )) {							continue;						}						$fields = $db->getTableFields( array( $tn ) );										$foundCO = false;						$foundCOT = false;						$foundE = false;										$foundCO	= isset( $fields[$tn]['checked_out'] );						$foundCOT	= isset( $fields[$tn]['checked_out_time'] );						$foundE		= isset( $fields[$tn]['editor'] );										if ($foundCO && $foundCOT) {							if ($foundE) {								$query = 'SELECT checked_out, editor FROM '.$tn.' WHERE checked_out > 0';							} else {								$query = 'SELECT checked_out FROM '.$tn.' WHERE checked_out > 0';							}							$db->setQuery( $query );							$res = $db->query();							$num = $db->getNumRows( $res );											if ($foundE) {								$query = 'UPDATE '.$tn.' SET checked_out = 0, checked_out_time = '.$db->Quote($nullDate).', editor = NULL WHERE checked_out > 0';							} else {								$query = 'UPDATE '.$tn.' SET checked_out = 0, checked_out_time = '.$db->Quote($nullDate).' WHERE checked_out > 0';							}							$db->setQuery( $query );							$res = $db->query();											if ($res == 1) {								if ($num > 0) {									echo "";									echo "\n	". JText::_( 'Checking table' ) ." - ". $tn ."";									echo "\n	". JText::_( 'Checked-In' ) ." ". $num ." ". JText::_( 'items' ) ."";									echo "\n	";									echo "\n	 ";									echo "\n";								} else {									echo "";									echo "\n	". JText::_( 'Checking table' ) ." - ". $tn ."";									echo "\n	". JText::_( 'Checked-In' ) ." ". $num ." ". JText::_( 'items' ) ."";									echo "\n	 ";									echo "\n	 ";									echo "\n";								}								$k = 1 - $k;							}						}					}					?>																																																							

相关资源