mirror of
https://github.com/Daichimarukana/uwuzu.git
synced 2026-06-04 19:14:41 +00:00
uwuzu version 1.2.26
This commit is contained in:
+15
-1
@@ -1,8 +1,22 @@
|
||||
<?php ?>
|
||||
<?php
|
||||
$serverlogofile = "../server/serverlogo.txt";
|
||||
$serverlogodata = file_get_contents($serverlogofile);
|
||||
$serverlogodata = explode( "\n", $serverlogodata );
|
||||
$cnt = count( $serverlogodata );
|
||||
for( $i=0;$i<$cnt;$i++ ){
|
||||
$serverlogo_link[$i] = ($serverlogodata[$i]);
|
||||
}
|
||||
?>
|
||||
<div class="userleftbox">
|
||||
<?php if(!empty($serverlogo_link[0])){ ?>
|
||||
<div class="logo">
|
||||
<img src=<?php echo htmlspecialchars($serverlogo_link[0], ENT_QUOTES, 'UTF-8');?>>
|
||||
</div>
|
||||
<?php }else{?>
|
||||
<div class="logo">
|
||||
<img src="../img/uwuzucolorlogo.svg">
|
||||
</div>
|
||||
<?php }?>
|
||||
<hr>
|
||||
<div class="lbtnzone">
|
||||
<a href="/home" class="leftbutton"><svg><use xlink:href="../img/sysimage/menuicon/home.svg#home"></use></svg>ホーム</a>
|
||||
|
||||
+25
-1
@@ -18,6 +18,30 @@
|
||||
for( $i=0;$i<$cnt;$i++ ){
|
||||
$uwuzuinfo[$i] = ($softwaredata[$i]);
|
||||
}
|
||||
function replaceURLsWithLinks_forRightbox($postText) {
|
||||
// URLを正規表現を使って検出
|
||||
$pattern = '/(https:\/\/[^\s<>\[\]\'"]+)/'; // 改良された正規表現
|
||||
preg_match_all($pattern, $postText, $matches);
|
||||
|
||||
// 検出したURLごとに処理を行う
|
||||
foreach ($matches[0] as $url) {
|
||||
// ドメイン部分を抽出
|
||||
$parsedUrl = parse_url($url);
|
||||
if (!isset($parsedUrl['path'])) {
|
||||
$parsedUrl['path'] = '';
|
||||
}
|
||||
$domain = $parsedUrl['host'].(strlen($parsedUrl['path']) > 24 ? substr($parsedUrl['path'], 0, 24) . '...' : $parsedUrl['path']);
|
||||
|
||||
// 不要な文字を削除してaタグを生成
|
||||
$urlWithoutSpaces = preg_replace('/\s+/', '', $url);
|
||||
$link = "<a href='$urlWithoutSpaces' target='_blank' title='$urlWithoutSpaces'>$domain</a>";
|
||||
|
||||
// URLをドメインのみを表示するaタグで置き換え
|
||||
$postText = preg_replace('/' . preg_quote($url, '/') . '/', $link, $postText);
|
||||
}
|
||||
|
||||
return $postText;
|
||||
}
|
||||
?>
|
||||
<div class="noticearea">
|
||||
<h1>お知らせ</h1>
|
||||
@@ -32,7 +56,7 @@
|
||||
<?php foreach ($notices as $value) {?>
|
||||
<div class="noticebox">
|
||||
<h4><?php echo $value['title'];?></h4>
|
||||
<p><?php echo nl2br($value['note']);?></p>
|
||||
<p><?php echo replaceURLsWithLinks_forRightbox(nl2br($value['note']));?></p>
|
||||
<div class="makeup"><p>編集者 : <a href="/@<?php echo $value['account'];?>">@<?php echo $value['account'];?></a></p></div>
|
||||
<div class="time"><p><?php echo date('Y年m月d日 H:i', strtotime($value['datetime']));?></p></div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user