Forgot password
 Register account
View 433|Reply 27

删除中间的帖子时不改变后面的楼层数字

[Copy link]

673

Threads

110K

Posts

218

Reputation

Show all posts

original poster kuing posted 2025-3-21 01:54 |Read mode
刚才发了一个 7#,马上删掉,再发一个,看是 7# 还是 8#

看来还是 7#,那不错,符合我想要的

3208

Threads

7835

Posts

52

Reputation

Show all posts

hbghlyj posted 2025-3-21 05:10
爪机专用 发表于 2025-3-20 21:04
那可能是新回帖楼层数字只看最后一楼,加1
确实!table_forum_post.php
  1. // 从数据库中读取最大position + 1
  2. private function _next_pos_from_db($tablename, $tid) {
  3.         return DB::result_first("SELECT IFNULL(MAX(position), 0) + 1 FROM " . DB::table($tablename) . " WHERE tid = " . $tid);
  4. }
Copy the Code

673

Threads

110K

Posts

218

Reputation

Show all posts

original poster kuing posted 2025-3-21 15:03
移动版也改吧,应当保持一致

Comment

这个好像是在 template\default\touch\forum\viewthread_node.htm
不知如何修改🤔  posted 2025-3-21 18:50
哦,难改那就算了  posted 2025-3-21 20:29

673

Threads

110K

Posts

218

Reputation

Show all posts

original poster kuing posted 2025-3-21 17:38
Last edited by hbghlyj 2025-3-21 18:24另外,引用的时候能不能包含 #层数 ?@hbghlyj

在引用里加 #层数 可以更清晰地看到引用的是哪一层,而且既然现在楼层数基本固定,不会出现对不上号的情况,加 #层数 是个好选择。

效果如:

3208

Threads

7835

Posts

52

Reputation

Show all posts

hbghlyj posted 2025-3-21 18:26
Last edited by hbghlyj 2025-3-21 20:25
kuing 发表于 2025-3-21 09:38
而且既然现在楼层数基本固定,不会出现对不上号的情况
已加到 zdy3pc.js 的建目录的位置,不仅实现了在当前页的楼层在引用中显示楼层,还实现了点击链接后平滑滚动到当前页面上的位置😊(不再需要打开新页面);在当前页不存在的楼层(可能跨页或已删除)在引用中不显示楼层,不在目录中显示,点击链接后像原来一样在新页面打开。

Comment

差点忘了还有那目录😅其实有点鸡肋  posted 2025-3-21 18:30
这在模板里应该很容易改吧?  posted 2025-3-21 18:42
回复上一个点评:若在模板里改,无法区分是否该楼层已删除,不如在 JS 里改吧。  posted 2025-3-21 19:31
问题是,如果是21楼引用20楼,跨页了,那不就显示不了了吗?  posted 2025-3-21 20:17
是的,就像目录的处理中🤔只显示当前页面上的楼层,分为两种:
在当前页的楼层,不需打开新页面直接跳转,引用中的链接显示了楼层;
不在当前页的楼层,不在目录中显示,点击链接后需要打开新页面   posted 2025-3-21 20:22

3208

Threads

7835

Posts

52

Reputation

Show all posts

hbghlyj posted 2025-3-21 19:38

开始和结尾慢时, 中间快

当前平滑滚动的 ease 函数使用的是分段函数\begin{cases}2x^2&0\le x\le\frac12\\
(4-2x)x-1&\frac12\le x\le1\end{cases}这个函数可以缓入缓出吗

Comment

不懂,这跟本主题无关吧?  posted 2025-3-21 20:18
哦,才注意到 14# 更新了内容,点击平滑跳转……  posted 2025-3-21 20:24
是点击上面所说的链接跳转过程的美化  posted 2025-3-21 20:24

3208

Threads

7835

Posts

52

Reputation

Show all posts

hbghlyj posted 2025-3-22 01:10
kuing 发表于 2025-3-20 13:58
能不能考虑改成这样:删除中间的帖子时不改变后面的楼层数字。
但这造成一个问题:例如在本页面 1# 右上角的电梯直达输入 16,找不到第 16 楼!因为在source\module\forum\forum_redirect.php中是按照楼层编号来找

673

Threads

110K

Posts

218

Reputation

Show all posts

original poster kuing posted 2025-3-22 02:18
hbghlyj 发表于 2025-3-22 01:10
但这造成一个问题:例如在本页面 1# 右上角的电梯直达输入 16,找不到第 16 楼!因为在source\module\for ...
那咋办呢?🤔可以修改不?

Comment

😢暂时没看懂代码  posted 2025-3-22 02:25

673

Threads

110K

Posts

218

Reputation

Show all posts

original poster kuing posted 2025-3-22 02:19
hbghlyj 发表于 2025-3-22 01:10
但这造成一个问题:例如在本页面 1# 右上角的电梯直达输入 16,找不到第 16 楼!因为在source\module\for ...
咦?你是怎么引用 1# 的呢?手工输入吗?如果是,要不改一下,改成 1# 也可引用?

3208

Threads

7835

Posts

52

Reputation

Show all posts

hbghlyj posted 2025-3-22 02:48
kuing 发表于 2025-3-21 18:19
如果是,要不改一下,改成 1# 也可引用? ...
已设为回复数$\ge3$时 1# “回复”按钮也带引用,回复数$\lt3$时 1# “回复”按钮不带引用。

0

Threads

406

Posts

6

Reputation

Show all posts

爪机专用 posted 2025-3-22 04:12
来到21#了,看看会不会翻页先
I am majia of kuing

0

Threads

406

Posts

6

Reputation

Show all posts

爪机专用 posted 2025-3-22 05:33
啥不行?
I am majia of kuing

0

Threads

406

Posts

6

Reputation

Show all posts

爪机专用 posted 2025-3-22 09:58 from mobile
不翻页才合理呀,因为实际上不足20层嘛,再多回几个就会翻了

Comment

好的  posted 2025-3-22 10:28
I am majia of kuing

0

Threads

406

Posts

6

Reputation

Show all posts

爪机专用 posted 2025-3-22 11:36
切换到手机版就知道现在实际上到了几层
I am majia of kuing

0

Threads

406

Posts

6

Reputation

Show all posts

爪机专用 posted 2025-3-22 11:40 from mobile
Last edited by 爪机专用 2025-3-22 11:49说到切换到手机版,论坛底部“手机版”按钮只会跳转到手机版首页,而不是当前帖子,希望改进

而手机版的底部也没有切换到电脑版的按钮,只有首页才有
I am majia of kuing

3208

Threads

7835

Posts

52

Reputation

Show all posts

hbghlyj posted 2025-3-22 11:52
爪机专用 发表于 2025-3-22 03:40
说到切换到手机版,论坛底部“手机版”按钮只会跳转到手机版首页,而不是当前帖子.
这个 pre_common_nav 的页尾导航的链接,是固定的,怎么办
gitee.com/Discuz/DiscuzX/blob/v3.5/upload/ins … nstall_data.sql#L147
  1. INSERT INTO pre_common_nav VALUES ('', '0', '手机版', '', 'forum.php?showmobile=yes', 'mobile', 0, 0, 1, 3, 0, 0, 0, 0, '', '', '', 1, '');
Copy the Code

Quick Reply

Advanced Mode
B Color Image Link Quote Code Smilies
You have to log in before you can reply Login | Register account

$\LaTeX$ formula tutorial

Mobile version

2025-7-19 19:30 GMT+8

Powered by Discuz!

Processed in 0.017669 seconds, 33 queries