Просмотр файла script/admin/add_album.php

Размер файла: 1.89Kb
<?php
/*-----------------------------------------------------------------------------------------
mcGalleryPRO
All code is © 2003 Marc Cagninacci.
No files may be redistributed in whole or significant part.
----------------- mcgalleryPRO IS NOT FREE SOFTWARE -------------------
You should have receive a file called license.txt in this package
--------------------------------------------------------------------------------------------*/

session_start();
if (empty($_SESSION['private_login']))
{
include "./sess.php";
exit;
}

if ($addalb == 'OK' && $alb_n != '')
{
 if (ereg("^[0-9]+$", $alb_n))
 {
  if (file_exists('../'.$type.'/'.$alb_n))
  {
  $error = '<center><font face="verdana" size="2" color="red"><b>'.strtolower($type).'/'.$alb_n.'</b>: '.$l_addalb_err1.'</font></center>';
  }
  else
  {
   mkdir('../'.$type.'/'.$alb_n, 0777);
   mkdir('../'.$type.'/'.$alb_n.'/small', 0777);
    if ($type == 'photos')
    {
    mkdir('../'.$type.'/'.$alb_n.'/big', 0777);
    }
  }
 }
 else
 {
  $error = '<center><font face="verdana" size="2" color="red"><b>'.$l_addalb_err2.'</font></center>';
 }
}
echo $error;

if (ereg('index.php', $PHP_SELF) == TRUE) { $type = 'photos'; }
if (ereg('video.php', $PHP_SELF) == TRUE) { $type = 'videos'; }
if (ereg('flash.php', $PHP_SELF) == TRUE) { $type = 'flash'; }

?>

<form method="post" action="<?php echo $PHP_SELF; ?>">
<table border="0" align="center" bgcolor="#000000" cellspacing="1" cellpadding="2">
<tr>
<td bgcolor="#DDDDDD"><font face="verdana" size="2" color="black">
<?php echo $l_addalb; ?> <b><?php echo $type; ?></b> :</font>
</td>
<td bgcolor="#000000">
&nbsp;<input type="text" name="alb_n" size="4" value="<?php echo $alb_n; ?>">
</td>
<td bgcolor="#000000">
&nbsp;<input type="hidden" name="type" value="<?php echo $type; ?>">
&nbsp;<input type="submit" name="addalb" value="OK">
</td></tr></table>
</form>