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

guclusat

Tanınmış Üye
Süper Moderatör
Download: Eki Görüntüle 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:
PHP:
// 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:
PHP:
// 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 
}
 
Geri
Yukarı