forked from 4ducky/4ducky
Move the original PHP site into legacy/
The PHP sources, templates and old jQuery-based scripts move unchanged into legacy/ for reference. Shared assets (media/, images/, favicon.ico, the default avatar) stay at the repository root. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,195 @@
|
||||
<?php include( $templates.'header.tpl.php' );
|
||||
|
||||
function color_inverse($color){
|
||||
$color = str_replace('#', '', $color);
|
||||
if (strlen($color) != 6){ return '000000'; }
|
||||
$rgb = '';
|
||||
for ($x=0;$x<3;$x++){
|
||||
$c = 255 - hexdec(substr($color,(2*$x),2));
|
||||
$c = ($c < 0) ? 0 : dechex($c);
|
||||
$rgb .= (strlen($c) < 2) ? '0'.$c : $c;
|
||||
}
|
||||
return '#'.$rgb;
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
<div align="center">
|
||||
|
||||
<form action="<?php echo Config::$absolutePath; ?>profile" enctype="multipart/form-data" method="post">
|
||||
<fieldset>
|
||||
<legend>Change Profile</legend>
|
||||
|
||||
<?php if( isset($messages['passToShort']) ) { ?>
|
||||
<div class="warn">Your password must be at least 6 characters long!</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if( isset($messages['passNotEqual']) ) { ?>
|
||||
<div class="warn">Your both passwords are not equal!</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if( isset($messages['avatarFailed']) ) { ?>
|
||||
<div class="warn">Your avatar Image could not be processed!</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if( isset($messages['colorFailed']) ) { ?>
|
||||
<div class="warn">Not a valid colorcode!</div>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="form">
|
||||
<dt>Passwort:</dt>
|
||||
<dd>
|
||||
<input type="password" name="cpass" /> (leave empty, if you don't want to change it)
|
||||
</dd>
|
||||
|
||||
<dt>(Repeat)</dt>
|
||||
<dd>
|
||||
<input type="password" name="cpass2" />
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
<?php if( empty($user->email) ) { ?>
|
||||
<dt>E-Mail:</dt>
|
||||
<dd>
|
||||
<input type="text" name="email" />
|
||||
</dd>
|
||||
<?php } ?>
|
||||
|
||||
<dt>Website:</dt>
|
||||
<dd>
|
||||
<input type="text" name="website" value="<?php echo htmlspecialchars( $user->website ); ?>"/>
|
||||
</dd>
|
||||
|
||||
<dt>Avatar:</dt>
|
||||
<dd>
|
||||
<input type="file" name="avatar" style="color: #000; background-color: #fff;"/><br/>
|
||||
</dd>
|
||||
<dt>Color:</dt>
|
||||
<dd>
|
||||
<input class="color" maxlength="6" type="text" name="color" value="<?php echo htmlspecialchars( $user->color ); ?>" style="width:100px;"/> (default:: 000000)
|
||||
<br/>
|
||||
</dd>
|
||||
|
||||
<dt>Style:</dt>
|
||||
<dd>
|
||||
<select name="stylecolor">
|
||||
<?php if ($user->stylecolor == "black"){echo('<option value="black">Black</option><option value="white">White</option>');}elseif ($user->stylecolor == "white"){echo('<option value="white">White</option><option value="black">Black</option>');} ?>
|
||||
</select>
|
||||
</dd>
|
||||
|
||||
<dt> </dt>
|
||||
<dd>
|
||||
<input type="submit" name="save" class="button" value="Save" />
|
||||
</dd>
|
||||
|
||||
|
||||
</dl>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
<form action="<?php echo Config::$absolutePath; ?>profile" enctype="multipart/form-data" method="post">
|
||||
<fieldset>
|
||||
<legend>Block user</legend>
|
||||
|
||||
<?php if( isset($messages['blocked']) ) { ?>
|
||||
<div class="success">User blocked!</div>
|
||||
<?php } ?>
|
||||
<?php if( isset($messages['blockFailed']) ) { ?>
|
||||
<div class="warn">Could not block user!</div>
|
||||
<?php } ?>
|
||||
<?php if( isset($messages['blockAlready']) ) { ?>
|
||||
<div class="warn">User already blocked!</div>
|
||||
<?php } ?>
|
||||
<?php if( isset($messages['userFailed']) ) { ?>
|
||||
<div class="warn">User not found!</div>
|
||||
<?php } ?>
|
||||
<?php if( isset($messages['unblocked']) ) { ?>
|
||||
<div class="success">User unblocked!</div>
|
||||
<?php } ?>
|
||||
<?php if( isset($messages['unblockFailed']) ) { ?>
|
||||
<div class="warn">Could not unblock user!</div>
|
||||
<?php } ?>
|
||||
<?php if( isset($messages['TEMP']) ) { ?>
|
||||
<div class="warn">WHAT?</div>
|
||||
<?php } ?>
|
||||
<?php if( isset($messages['notBlocked']) ) { ?>
|
||||
<div class="warn">User not blocked!</div>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<dl class="form">
|
||||
<?php
|
||||
|
||||
$blockedrow = DB::getRow("SELECT id,users FROM pl_blocked WHERE id=:1",$user->id);
|
||||
|
||||
if (!empty($blockedrow['users'])){
|
||||
$des = unserialize($blockedrow['users']);
|
||||
|
||||
foreach ( $des as $username){
|
||||
$userinfo = DB::query('SELECT id,name,images,avatar FROM pl_users WHERE name="'.$username.'"');
|
||||
?>
|
||||
<div style="text-align:left" class="userInfo">
|
||||
<img class="avatar" width="40" height="40" src="<?php echo Config::$absolutePath.$userinfo[0]['avatar']; ?>"/>
|
||||
<div class="name">
|
||||
<strong>
|
||||
<a href="<?php echo Config::$absolutePath.'user/'.$userinfo[0]['name']; ?>"><?php echo $userinfo[0]['name']; ?></a>
|
||||
</strong>
|
||||
</div>
|
||||
<div class="info">
|
||||
|
||||
Images: <strong><?php echo $userinfo[0]['images']; ?></strong>
|
||||
|
||||
</div>
|
||||
<div style="clear:both;"></div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
}else{ ?>
|
||||
|
||||
<div class="success">No users blocked!</div>
|
||||
|
||||
|
||||
<?php }?>
|
||||
|
||||
<dt>User:</dt>
|
||||
<dd>
|
||||
<input type="text" name="blockuser" />
|
||||
</dd>
|
||||
<dt> </dt>
|
||||
<dd>
|
||||
<input type="submit" name="block" class="button" value="Block" />
|
||||
</dd>
|
||||
|
||||
<dt>User:</dt>
|
||||
<dd>
|
||||
<?php
|
||||
|
||||
if (!empty($blockedrow['users'])){
|
||||
$des = unserialize($blockedrow['users']);
|
||||
echo('<select name="unblockuser">');
|
||||
echo('<option value="select">Select user</option>');
|
||||
foreach ( $des as $username){
|
||||
echo('<option value="'.$username.'">'.$username.'</option>');
|
||||
}
|
||||
echo('</select>');
|
||||
}else{ echo("No user blocked!");}
|
||||
|
||||
?>
|
||||
</dd>
|
||||
<dt> </dt>
|
||||
<dd>
|
||||
<input type="submit" name="unblock" class="button" value="Unblock" />
|
||||
</dd>
|
||||
</dl>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
<?php include( $templates.'footer.tpl.php' ); ?>
|
||||
Reference in New Issue
Block a user