Files
5ducky/legacy/templates/inboxuser.tpl.php
kibiandClaude Opus 5.5 664d8c6117 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>
2026-10-17 02:15:05 +02:00

110 lines
3.4 KiB
PHP

<?php include( $templates.'header.tpl.php' ); ?>
<br/><br/>
<table class="duckytable" align="center" width="800px" border="0" cellspacing="0" cellpadding="0">
<caption>Conversation with:</caption>
<?php
if ($user->stylecolor == "black") {
$border="border:1px dotted #333;";
}else{
$border = ' border:1px solid #d2d9e7; ';
}
$userinformation = DB::getRow('SELECT * FROM pl_users WHERE name="'.$r[1].'"');
if (count($userinformation) == 0 ){ header( 'location: '.Config::$absolutePath); }
$messages = DB::query("SELECT * FROM pl_messages WHERE (to_m=:1 AND from_m=:2) OR (to_m=:2 AND from_m=:1) ORDER BY created DESC",$userinformation["id"],$user->id);
?>
<tr>
<td width="400px" style="border-bottom: 0;">
<div class="userInfo" style=" <?php echo $border; ?>">
<img class="avatar" width="60" height="60" src="<?php echo Config::$absolutePath.$userinformation['avatar']; ?>"/>
<div class="name">
<strong>
<a href="<?php echo Config::$absolutePath.'user/'.$userinformation['name']; ?>"><?php echo $userinformation['name']; ?></a>
</strong>
</div>
<div class="info">
ID: <strong><?php echo $userinformation['id']; ?></strong> /
Images: <strong><?php echo $userinformation['images']; ?></strong>
<?php if( !empty($userinformation['website'])) { ?>/
<strong><a href="<?php echo htmlspecialchars($userinformation['website']); ?>" target="_blank">
Website
</a></strong>
<?php } ?>
<br /><br />
</div>
</div>
</div>
</td>
</tr>
</table>
<div align="center">
<div class="comment" style=" <?php echo $border; ?>margin:5px; text-align:left;width:700px;color:#333">
<strong>Message to <?php echo $userinformation['name']; ?>:</strong>
<form method="post" class="addComment" action="<?php echo Config::$absolutePath.'inbox/'.$r[1]; ?>">
<div>
<textarea name="content" rows="6" cols="93"></textarea><br />
<input class="submit" type="submit" name="addComment" value="Submit Message"/>
</div>
</form>
</div>
<?php
if (count($messages) != 0){
foreach( $messages as $s ) {
$postedfrom = DB::getRow('SELECT * FROM pl_users WHERE id='.$s["from_m"]);
DB::updateRow("pl_messages",array("to_m" => $user->id, "created" => $s["created"]),array("read_m" => 1));
$bordercolor = $border;
if ($s["read_m"] == 0 && $s["to_m"] == $user->id){
$bordercolor = 'border:1px solid #FFD600';
}
?>
<div class="comment" style=" margin:5px; text-align:left;width:700px;<?php echo $bordercolor; ?>">
<div class="commentHead">
<a href="<?php echo Config::$absolutePath.'user/'.$postedfrom['name']; ?>"><?php echo $postedfrom['name']; ?></a>
at <?php echo date('d. M Y H:i',$s['created']); ?>
</div>
<?php
//$s['message_m'] = strip_tags($s['message_m']);
$s['message_m'] = preg_replace(
'#(?<!\w)((http://)|(www\.))([^\s<>]+)#i',
"<a href=\"http://$3$4\">$3$4</a>",
nl2br( htmlspecialchars($s['message_m'])));
?>
<hr style=" <?php echo $bordercolor; ?> width: 99%;">
<?php echo $s['message_m']; ?>
</div>
<?php }}else{ echo('No messages found. <hr style="background-color:#d2d9e7;">');} ?>
</div> <br/>
<?php include ("templates/footer.tpl.php"); ?>