Просмотр файла publs_v1_0/count.php

Размер файла: 904B
<?php
defined('_IN_JOHNCMS') or die('Restricted access');
$rew = mysql_query("SELECT * FROM `lib_settings`;");
$lib = array();
while ($re = mysql_fetch_row($rew))
	$lib[$re[0]] = $re[1];
mysql_free_result($rew);

$new_fil = $lib['new_fil'];

			$countb = 0;
			$countbnew = 0;
			$cou = '';
			$countb = mysql_result(
				mysql_query("
					SELECT COUNT(*) FROM `library` 
					WHERE `type` = 'file' 
					AND `path` LIKE '/%' 
					AND `moder` = '1'
				"),
			0);
			$countbnew = mysql_result(
				mysql_query("
					SELECT COUNT(*) FROM `library` 
					WHERE `type` = 'file' 
					AND `path` LIKE '/%' 
					AND `time` > '".($realtime -($new_fil * 24 * 3600))."' 
					AND `moder` = '1'
				"),
			0);
			$cou = '('.intval($countb);
			if ($countbnew !== "0") { 
				$cou .= '/<span class="red">+'.intval($countnew).'</span>)';
			} else {
				$cou .=  ')';
			}
?>