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

Размер файла: 7.03Kb
<?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
--------------------------------------------------------------------------------------------*/

include './admin/conf.inc.php';

session_start();

$connect = mysql_connect($host,$login,$pass);
mysql_select_db($base, $connect);

if (empty($_SESSION['lang'])) {  $email_upload = 1; $_SESSION['lang'] = $lang_def; }
if (!empty($language)) { $_SESSION['lang'] = $language.'.php'; }

if (empty($_SESSION['level']) && !empty($private_pass))
{
$query = "SELECT level, date FROM mcgallery_members WHERE login ='$private_login' AND password='$private_pass'";
$result = mysql_query($query);

$ok = mysql_fetch_row($result);
if ($ok[0] != '')
{
$date = date("Y-m-d H:i:s");
$query = "UPDATE mcgallery_members SET visite=visite + 1, date='$date' WHERE login ='$private_login'";
mysql_query($query);

 $level = $ok[0];
  $_SESSION['level'] = $level;
  $_SESSION['private_login'] = $private_login;
  $_SESSION['private_pass'] = $private_pass;
}
}

if ($logout == 1)
{
  unset($_SESSION['level']);
  unset($_SESSION['private_login']) ;
  unset($_SESSION['private_pass'] );
}

if ($cat != '')
{
$_SESSION['tab'] = $tab;
$_SESSION['cat'] = $cat;
}
include './header.php';

if (!empty($_SESSION['private_login']) && $del != '')
{
  $private_login = $_SESSION['private_login'] ;
  $query = "DELETE FROM mcgallery_select WHERE login='$private_login' AND id='$del' AND type='$t'";
  mysql_query($query);
}

include './lang/'.$_SESSION['lang'];
?>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td align="left" valign="top" width="35%">
<table border="0" cellspacing="1" cellpadding="2" width="100%" class="td1">
<tr>
<td class="td0" colspan="3">
<font size="4"><?php echo stripslashes($page_title); ?></font>
</td>
</tr>

<?php

 echo '<tr><td class="td2" colspan="3" align="right"><font size="1">';
 echo '<a href="'.$homepage.'" class="lien1" onMouseOver="window.status=\'\';return true"><b>'.$l_Home.'</b></a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;';
 echo ' <a href="#" onclick="javascript:window.open(\'./mailto.php\',\'\',\'width=300,height=340,left=100, top=100\');" class="lien1" onMouseOver="window.status=\'\';return true"><b>'.$l_Contact.'</b></a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;';
 echo '<a href="index.php" class="lien1" onMouseOver="window.status=\'\';return true"><b>'.$l_News.'</b></a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;';
  if (!empty($_SESSION['level']))   //
  {
  echo '<a href="index.php?logout=1" class="lien1" onMouseOver="window.status=\'\';return true"><b> '.$l_logout.'</b></a><br>';
  echo $l_logged.': <b>'.$_SESSION['private_login'].'&nbsp;&nbsp;<a href="index.php?cp=1" class="lien1">['.$l_changepass1.']</a></b>';
  }
  else
  {
  echo '<a href="./index.php?log=x" class="lien1" onMouseOver="window.status=\'\';return true"><b>'.$l_Login.'</b></a>';
  }
 echo '</font></td></tr>';
 echo "\n";
 echo '<tr>';

//  Random Photo
if ($random > 0)
{ include './random.php'; }
// end
echo "\n";

if ($use_cat > 0)
{
include './category.php';
}
else
{
include './category_no.php';
}

 echo "\n";

 if (!empty($pop_width) && !empty($pop_height))
 {
 echo '<tr><td class="td0" align="center">';
 echo '<a href="#" onclick="javascript:window.open(\'mypage.php\',\'\',\'width='.$pop_width.',height='.$pop_height.', left=100, top=100\');" onMouseOver="window.status=\'\';return true">';
 echo '<img src="images/b_help.gif" border="0" alt="""></a>';
 echo '</td>';
 echo '<td class="td0" align="right" colspan="2" height="4">';
 }
 else  echo '<td class="td0" align="right" colspan="3" height="4">';
 echo "\n";
 if ($_SESSION['private_pass'] == $admin_pass)
 {
 echo '<font size="1"><a href="./admin/index.php" class="lien2" onMouseOver="window.status=\'\';return true" target="_blank"><b>'.$l_admin.'</b></a></font>';
 }
 else
 {
 include './lang_list.php';
 }
 echo '</td></tr>';
echo "\n";
?>
</table>
</td>
<td align="center" valign="top">
<?
if ($album =='' && !empty($_SESSION['private_login']) && $sel != '')
{
 include 'selectalbum.php';
 echo '</td></tr></table>';
 include './footer.php';
 exit();
}

if ($album =='' && !empty($_SESSION['private_login']) && $cp == 1)
{
 include 'changepass.php';
 echo '</td></tr></table>';
 include './footer.php';
 exit();
}

if (!empty($top))
{
include 'topten.php';
 echo '</td></tr></table>';
 include './footer.php';
 exit();
}

if ($album =='' && $log != 'x' && empty($top))
{
         if ($l == 1)
         {
         include './pass.php';
         include './footer.php';
         exit();
         }
         else
         {
         include './news_read.php';
		 }
         if ($r == 'ok')
         {
         echo '<br><br><br><font size="3"><b>'.$l_Perdu_ok.'</b></font>';
         }
         elseif ($r == 'err')
         {
         echo '<br><br><br><font size="3"><b>'.$l_Perdu_err.'</b>&nbsp;</font>';
		echo '<a href="index.php?l=1"><img src="images/b_go.gif" border="0" alt="Again"></a>';
		 }
 echo '</td></tr></table>';
 include './footer.php';
 exit();
}



///  start login
  elseif ($log == 'x')
  {
   echo '<form method="post" name="logform" action="index.php">';
   echo '<table border="0" cellspacing="1" cellpadding="2" width="200">';
   echo '<tr><td class="td0" align="center"><font size="2">'.$l_Restricted.'</font></td></tr>';
   echo '<tr><td class="td2" align="right"><font size="2">'.$l_Login.'</font>&nbsp;<input type="text" name ="private_login" size="10">&nbsp;</td></tr>';
   echo '<tr><td class="td2" align="right"><font size="2">'.$l_Pass.'</font>&nbsp;<input type="password" name ="private_pass" size="10">&nbsp;</td></tr>';
   echo '<tr><td class="td2" align="center"><font size="1"><a href="index.php?l=1" class="lien1" onMouseOver="window.status=\'\';return true"><b>'.$l_Perdu.' ?</b></a></font></td></tr>';
   echo '<tr><td class="td1" align="center"><input type="submit" value="OK" name="valid">';
   echo '<input type="hidden" name="album" value="'.$album.'"><input type="hidden" name="video" value="'.$video.'"><input type="hidden" name="cat" value="'.$cat.'"></td></tr>';
   echo '<tr><td class="td1" align="center"><font size="1">'.$l_log_restrict.' <a href="#" onclick="javascript:window.open(\'./mailto.php\',\'\',\'width=300,height=340,left=100, top=100\');" class="lien2" onMouseOver="window.status=\'\';return true">'.$l_contact.'</a></font></td></tr>';
   echo '<tr><td class="td0" height="3"></td></tr>';
   echo '</table></form>';

   echo '</td></tr></table>';
?>
<script language="JavaScript">
<!--
document.logform.private_login.focus()
// -->
</script>
<?php
   include './footer.php';
   exit();
  }
///  end login

include './thumbs.php';

echo '</td></tr></table>';
echo "\n";
include './footer.php';
?>