background
Furry在文章标题右边添加编辑按钮
# VPS

编辑/usr/themes/Furry/inc/center/navbar.php
找到

    <div class="flex justify-start items-center">
        <span class="text-xl"><?php $this->title() ?></span>
    </div>

将其替换为:

<div class="flex justify-between items-center w-full">
    <span class="text-xl"><?php $this->title() ?></span>

    <?php
    // 准备 admin 基址和目标编辑页
    $adminBase = rtrim($this->options->adminUrl, '/') . '/'; // 确保最后有斜线
    $editUrl   = $adminBase . 'write-post.php?cid=' . intval($this->cid);

    // 如果已登录就直接跳编辑页;未登录就跳登录页并带上 referer 参数
    if ($this->user->hasLogin()) {
        $href = $editUrl;
    } else {
        $href = $adminBase . 'login.php?referer=' . urlencode($editUrl);
    }
    ?>

    <!-- 小号编辑按钮 -->
    <a href="<?= htmlspecialchars($href) ?>"
       class="ml-3 inline-flex items-center gap-x-1 py-1 px-2 rounded border border-slate-200 bg-white text-slate-600 hover:bg-slate-50 text-xs leading-none"
       title="编辑文章" aria-label="编辑文章">
        <svg class="flex-shrink-0 w-3 h-3" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" width="12" height="12" aria-hidden="true">
            <path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04a1.003 1.003 0 0 0 0-1.42l-2.34-2.34a1.003 1.003 0 0 0-1.42 0l-1.83 1.83 3.75 3.75 1.84-1.82z"/>
        </svg>
    </a>
</div>