Просмотр файла library/index.php

Размер файла: 1.55Kb
<?php

require_once ( "../includes/start.php" );
require_once ( "../includes/functions.php" );
require_once ( "../includes/header.php" );
include_once ( "../themes/" . $config['themes'] . "/index.php" );

show_title( 'partners.gif', 'Библиотека' );

echo '<img src="../images/img/new_dir.gif" alt=""> <a href="new.php?' . SID .
		'">Новые статьи!</a><br>';
echo '<img src="../images/img/top20_dir.gif" alt=""> <a href="top.php?' . SID .
		'">Самые читаемые</a><br>';

$lib_array = array();
$dir = opendir( "." );
while ( $file = readdir( $dir ) )
{
		if ( is_dir( $file ) )
		{
				if ( $file == "." || $file == ".." )
						continue;
				$lib_array[] = $file;
		}
}
closedir( $dir );

sort( $lib_array );

$total = count( $lib_array );
for ( $i = 0; $i < $total; $i++ )
{

		if ( file_exists( "$lib_array[$i]/name.dat" ) )
		{
				$lib_name = file_get_contents( "$lib_array[$i]/name.dat" );
		}
		else
		{
				$lib_name = $lib_array[$i];
		}

		echo '<img src="../images/img/dir.gif" alt=""> <a href="lib.php?did=' . $lib_array[$i] .
				'&amp;' . SID . '">' . $lib_name . '</a> (' . count_libdir( $lib_array[$i] ) . ')<br>';
}

echo '<br><img src="../images/img/adddir.gif" alt=""> <a href="add.php?' . SID .
		'">Добавить статью</a><br>';

echo '<br>Всего категорий: ' . $total . '<br>';
echo '<img src="../images/img/homepage.gif" alt=""> <a href="../index.php?' . SID .
		'">На главную</a>';
include_once ( "../themes/" . $config['themes'] . "/foot.php" );

?>