wwwab 发表于 2025-3-14 20:28:51

论坛大师・Discuz! 修改版 (2024-2025 update by wwwab)

当前版本(1.4.8)全局配置:
```// Global Settings · Start
    const GLOBAL_CONFIG = {

      // Posts' sortord: 'unlocked', 'lastpost', 'threadcreate'(author dateline)
      // 主题帖排序方式: 'unlocked, 'lastpost', 'threadcreate'(author dateline)
      // 主題帖排序方式: 'unlocked, 'lastpost', 'threadcreate'(author dateline)
      thread_sortord: 'unlocked',

      // Lock the skin style: true/false
      // 固定皮肤样式: true/false
      // 固定皮膚樣式: true/false
      lock_skin: false,

      // Clean posts' format: true/false
      // 清除帖子格式: true/false
      // 清除帖子格式: true/false
      clean_post: false,

      // Display the users' online status: 'None', 'Standard', 'Advanced'
      // 显示用户的在线状态: 'None', 'Standard', 'Advanced'
      // 顯示用戶的在線狀態: 'None', 'Standard', 'Advanced'
      detection_mode: 'Advanced',

      // 小圆点(Small Dot): 'mode1'
      // Emoji or 文本(Text): 'mode2'
      standard_mode_detection_display_style: 'mode1',
      advanced_mode_detection_display_style: 'mode2',

      // Text Beautification: true/false
      // 文本字體美化: true/false
      // 文字字体美化: true/false
      text_beautification: true,

      // Code Beautification: true/false
      // 代码美化:true/false
      // 程式碼美化:true/false
      code_beautification: true,

      // text_size_linespacing_adjust in posts: true/false
      // 帖子文字大小行距优化: true/false
      // 帖子文本大小行距優化: true/false
      textsize_linespacing_adjust: true,
      line_height: '30px',
      font_size: '18px',

      // Block Baidu_tongji code: true/false
      // 屏蔽百度统计: true/false
      // 屏蔽百度統計: true/false
      block_baidu_hm: true,

      // Turn the avatar to high definition (Apply big size avatar): true/false
      // 头像转为高清晰度: true/false
      // 頭像轉為高清晰度: true/false
      big_size_avatar: true,

      // Picture Optimization (Overwrite the thumb picture into big size picture): true/false
      // 图片优化(将预览图覆盖为大图): true/false
      // 圖片優化(將預覽圖覆蓋為大圖): true/false
      picture_optimization: true,

      // Theme beautification: true/false
      // 主题美化: true/false
      // 主題美化: true/false
      theme_beautification: false,

      // Warning record query button: true/false
      // 警告记录查询按钮: true/false
      // 警告記錄查詢按鈕: true/false
      show_warning_record_button: false,

      // Scene Mode: 'Standard', 'Family', 'Office'
      // 场景模式: 'Standard', 'Family', 'Office'
      // 場景模式: 'Standard', 'Family', 'Office'
      scene_mode: 'Standard',

      // Automatically refresh after modifying settings on webpage: true/false,
      // 在网页上修改设置后自动刷新: true/false,
      // 在網頁上修改設置後自動刷新: true/false,
      auto_reload: true,

      // Display Eomji: true/false
      // 显示Emoji: true/false
      // 顯示Emoji: true/false
      display_emoji: true,

    }
    // Global Settings · End


    // Message Edit Settings · Start
    const Message_Edit_CONFIG = {

      // Bypass the word limit of reply: true/false
      // 回帖字数限制绕过: true/false
      // 回帖字數限制繞過: true/false
      word_count_limit_bypass: true,

      // Add a tail automatically at the end of the reply: true/false; Tail content: Text
      // 回帖小尾巴: true/false;回帖小尾巴内容: Text
      // 回帖小尾巴: true/false;回帖小尾巴內容: Text
      reply_tail: false,
      reply_tail_content: '喵~',

      // Add a prefix automatically at the end of the reply: true/false; Prefix content: Text
      // 回帖小前缀: true/false;回帖小前缀内容: Text
      // 回帖小前綴: true/false;回帖小前綴内容: Text
      reply_prefix: false,
      reply_prefix_content: '',

      // Enable in the private messages post: true/false
      // 在私信中启用: true/false
      // 在私信中啟用: true/false
      private_messages_Enable: false,

      // Enable in the comment messages post: true/false
      // 在点评中启用: true/false
      // 在點評中啟用: true/false
      comment_messages_Enable: false,

    }
    // Message Edit Settings · End
```
说明:
1. 此项目基于mxdh的[论坛大师・Discuz!修改版Main](https://greasyfork.org/zh-CN/scripts/400489-forum-master-discuz-revision)]和[论坛大师・Discuz!修改版Full](https://greasyfork.org/zh-CN/scripts/401307-forum-master-discuz-revision)维护和优化。
2. 此项目基于hostname的[论坛大师・Discuz! 界面美化、移除广告、功能增强、回帖强显……](https://greasyfork.org/zh-CN/scripts/400250-forum-master-discuz),遵照GPL-3.0开放源代码。

yhzc2023 发表于 2025-3-14 20:58:05

const url = new URL(href);
      const orderby = url.searchParams.get('orderby');
      if (!orderby) {
            url.searchParams.set('orderby', 'dateline');
            return unsafeWindow.document.location.href = url.toString();
      }


排序的话,直接修改网页url,重新加载网页,这种方式我觉得更加合适。这种方式,用户感知不到,并且不会有任何因为修改而导致的bug。非常简单粗暴。你上面的方式我也用过

yhzc2023 发表于 2025-3-14 20:58:35

const url = new URL(href);
      const orderby = url.searchParams.get('orderby');
      if (!orderby) {
            url.searchParams.set('orderby', 'dateline');
            return unsafeWindow.document.location.href = url.toString();
      }


排序的话,直接修改网页url,重新加载网页,这种方式我觉得更加合适。这种方式,用户感知不到,并且不会有任何因为修改而导致的bug。非常简单粗暴。你上面的方式我也用过

wwwab 发表于 2025-3-14 21:07:57

yhzc2023 发表于 2025-3-14 20:58
const url = new URL(href);
      const orderby = url.searchParams.get('orderby');
      if (!ord ...

目前就是你说的那种方式(修改网页URL跳转),见代码`switch (thread_sortord)`部分。
页: [1]
查看完整版本: 论坛大师・Discuz! 修改版 (2024-2025 update by wwwab)