Login Box (index.php) for phpATM v1.30

Updated: 04.04.2008 · Base: Andrea Bugada · Made: Flava Clown · URL: flavaclown.de

These files are made for the unmodified, official phpATM v1.30! If you use a modified version (like the MrScripto 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.

Download:

mod_index_php_-_login_box.zip (28kb - 04.04.2008)

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 - changed 19.04.2007
   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" id="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"><label for="user_name"><font size="1" face="<?php echo $font ?>" color="<?php echo $normalfontcolor ?>"><?php echo $mess[57] ?></font></label>:
      <input type="text" name="user_name" id="user_name" size="10" class="vform">
      &nbsp;&nbsp;&nbsp;<label for="user_pass"><font size="1" face="<?php echo $font ?>" color="<?php echo $normalfontcolor ?>"><?php echo $mess[83] ?></font></label>:
      <input type="password" name="user_pass" id="user_pass" size="10" maxlength="32" class="vform">
      &nbsp;&nbsp; &nbsp;&nbsp;<label for="user_always_logged"><font size="1" face="<?php echo $font ?>" color="<?php echo $normalfontcolor ?>"><?php echo $mess[205] ?></font></label>
      <input type="checkbox" name="user_always_logged" id="user_always_logged" value="user_always_logged" class="vform">
      &nbsp;&nbsp;&nbsp;<input type="submit" name="Submit" value="<?php echo $mess[73] ?>" class="vform">
    </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 - changed 19.04.2007
   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" id="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"><label for="user_name"><font size="1" face="<?php echo $font ?>" color="<?php echo $normalfontcolor ?>"><?php echo $mess[57] ?></font></label>:
      <input type="text" name="user_name" id="user_name" size="10" class="vform">
      &nbsp;&nbsp;&nbsp;<label for="user_pass"><font size="1" face="<?php echo $font ?>" color="<?php echo $normalfontcolor ?>"><?php echo $mess[83] ?></font></label>:
      <input type="password" name="user_pass" id="user_pass" size="10" maxlength="32" class="vform">
      &nbsp;&nbsp; &nbsp;&nbsp;<label for="user_always_logged"><font size="1" face="<?php echo $font ?>" color="<?php echo $normalfontcolor ?>"><?php echo $mess[205] ?></font></label>
      <input type="checkbox" name="user_always_logged" id="user_always_logged" value="user_always_logged" class="vform">
      &nbsp;&nbsp;&nbsp;<input type="submit" name="Submit" value="<?php echo $mess[73] ?>" class="vform">
    </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")