Readme - Login Box for phpATM

These files are made for the unmodified, official phpATM v1.30! If you use a modified version (like the Mr.Scripto mod), then see below how to add the changes manually.

What it does:

This mod will add a "Login Box" (like the one from phpBB 2) under the "[Last uploads] - [Top downloads]" table.

How to install:

Unpack/upload the index.php to your phpATM folder (replace the existing file with my one). If you prefer to use the version with the Login: table header, then rename the index_tableheader.php to index.php and use this one instead.

Feedback:

Comments? Problems? Bugs? Or just some nice words? Contact me in the phpATM Forum or send me an email.

Alternate Installation:

For the login box, we have to add some code to the index.php

First we need to make $user_status global, to check if already logged in or not.

line 704 (function list_dir($directory))
the line to edit is actually 708
add there $user_status, the line should then look like this:

   global $headerfontcolor, $normalfontcolor, $phpExt, $user_status;

and then we need - of course - the login box.
I would add it, after the "[Last uploads] - [Top downloads]" box (table).

line 796 should have only the }.
replace this line with the following code:

// added by Flava Clown 26.02.2007 - login box, like the one from phpBB
   if ($user_status == ANONYMOUS)
   {
?>
<br>
<table border="0" width="90%" bgcolor="<?php echo $bordercolor ?>" cellpadding="4" cellspacing="1">
<tr>
<th align="left" bgcolor="<?php echo $headercolor ?>" valign="middle"><font size="2" face="<?php echo $font ?>" color="<?php echo $headerfontcolor ?>"><?php echo $mess[71] ?></font></th>
</tr>
<tr>
<td align="left" bgcolor="<?php echo $tablecolor ?>" valign="middle">

<form method="post" name="userlogin" action="<?php echo "login.$phpExt?".SID; ?>" style="margin: 0;">
<input type="hidden" name="action" value="userlogin">
  <table border="0" width="100%" cellpadding="4">
   <tr>
     <td align="center" valign="middle"><font size="1" face="<?php echo $font ?>" color="<?php echo $normalfontcolor ?>"><?php echo $mess[57] ?></font>:
      <input class="vform" type="text" name="user_name" size="10">
      &nbsp;&nbsp;&nbsp;<font size="1" face="<?php echo $font ?>" color="<?php echo $normalfontcolor ?>"><?php echo $mess[83] ?>:</font>
      <input class="vform" type="password" name="user_pass" size="10" maxlength="32">
      &nbsp;&nbsp; &nbsp;&nbsp;<font size="1" face="<?php echo $font ?>" color="<?php echo $normalfontcolor ?>"><?php echo $mess[205] ?></font>
      <input type="checkbox" name="user_always_logged">
      &nbsp;&nbsp;&nbsp;
      <input type="submit" class="vform" name="Submit" value="<?php echo $mess[73] ?>">
    </td>
   </tr>
  </table>
</form>

</td>
</tr>
</table>

<?php
   }
// end FC
}

note the } after "// end FC" is the one which was before on line 796

btw. I like it more if we don't have the table header "Login", the code without it would look like this:

// added by Flava Clown 26.02.2007 - login box, like the one from phpBB
   if ($user_status == ANONYMOUS)
   {
?>
<br>
<table border="0" width="90%" bgcolor="<?php echo $bordercolor ?>" cellpadding="4" cellspacing="1">
<tr>
<td align="left" bgcolor="<?php echo $tablecolor ?>" valign="middle">

<form method="post" name="userlogin" action="<?php echo "login.$phpExt?".SID; ?>" style="margin: 0;">
<input type="hidden" name="action" value="userlogin">
  <table border="0" width="100%" cellpadding="4">
   <tr>
     <td align="center" valign="middle"><font size="1" face="<?php echo $font ?>" color="<?php echo $normalfontcolor ?>"><?php echo $mess[57] ?></font>:
      <input class="vform" type="text" name="user_name" size="10">
      &nbsp;&nbsp;&nbsp;<font size="1" face="<?php echo $font ?>" color="<?php echo $normalfontcolor ?>"><?php echo $mess[83] ?>:</font>
      <input class="vform" type="password" name="user_pass" size="10" maxlength="32">
      &nbsp;&nbsp; &nbsp;&nbsp;<font size="1" face="<?php echo $font ?>" color="<?php echo $normalfontcolor ?>"><?php echo $mess[205] ?></font>
      <input type="checkbox" name="user_always_logged">
      &nbsp;&nbsp;&nbsp;
      <input type="submit" class="vform" name="Submit" value="<?php echo $mess[73] ?>">
    </td>
   </tr>
  </table>
</form>

</td>
</tr>
</table>

<?php
   }
// end FC
}

final note: the line numbers are from the unmodified, official phpATM v1.30! if you use a mod or just have changed the index.php a little bit on your own, then the line numbers may differ. That's why I wrote the name from the function (see above "line 704")