网站有一个小问题

2014-12-21 11:42:38 +08:00
 xiaolvmu
https://techllage.com/index.php/
点击最下面的View More,页面里面什么东西都没有了。再刷新一下,都出来了。这是什么原因呢?
在Esotalk论坛系统中,下一页对应的搜索是#limit:250。但是搜索这个也不行。还是需要刷新一下内容才可以出来。根据测试,#limit一个6以上的数,回车,就出不来链接,需要刷新才行。
这是为什么呢?想搜索又不知道怎么简短地表达。
2849 次点击
所在节点    问与答
6 条回复
aaaa007cn
2014-12-21 16:56:25 +08:00
点击 View More 后只有 POST 请求
返回的是 json
应该有相关处理
比如填充内容或者继续请求页面内容或者 30x 到 GET
但是没有?

刷新的话则是 GET
所以有内容

不了解 Esotalk
不知道这是本来就有的问题还是你的设置、修改有问题
xiaolvmu
2014-12-21 19:09:06 +08:00
@aaaa007cn 这个应该不是原有的问题。官方搭建的技术支持论坛就没有这个问题~
谢谢你,我继续研究下
aaaa007cn
2014-12-21 20:22:03 +08:00
对比了一下官方支持论坛和这个论坛
这个论坛的 /?p=conversations/index.ajax/all 看起来是返回了空白的内容,只有 600 字节
而在官方论坛 POST 这个地址后会返回包含帖子列表的 json,有 200k+
xiaolvmu
2014-12-22 00:05:13 +08:00
@aaaa007cn 谢谢你!!可能是post请求出了问题!我第二次段考完就修复下#^_^#
xiaolvmu
2014-12-22 00:06:57 +08:00
@aaaa007cn 我从模板文件找起,看一看它到底调用了什么
xiaolvmu
2014-12-23 12:04:14 +08:00
实在不会弄了,求解答~
/core/views/conversations/results.php:
<?php
// Copyright 2011 Toby Zerner, Simon Zerner
// This file is part of esoTalk. Please see the included license file for usage information.

if (!defined("IN_ESOTALK")) exit;

/**
* Conversation results. Displays a message if there are no results, or a conversation list and
* footer if there are.
*
* @package esoTalk
*/

// If there are no conversations, show a message.
if (!$data["results"]): ?>
<div class='area noResults help'>
<h4><?php echo T("message.noSearchResults"); ?></h4>
<ul>
<li><?php echo T("message.reduceNumberOfGambits"); ?></li>
<?php if (!ET::$session->user): ?><li><?php echo T("message.logInToSeeAllConversations"); ?></li><?php endif; ?>
<li><?php echo T("message.fulltextKeywordWarning"); ?></li>
</ul>
</div>

<?php
// If there are conversations, however, show them!
else:
?>
<?php $this->renderView("conversations/list", $data); ?>
<?php endif; ?>

/core/views/conversations/results.php:
<?php
// Copyright 2011 Toby Zerner, Simon Zerner
// This file is part of esoTalk. Please see the included license file for usage information.

if (!defined("IN_ESOTALK")) exit;

/**
* Displays the conversation list - a table with each conversation as a row.
*
* @package esoTalk
*/
?>
<ul class='list conversationList'>

<?php
// Loop through the conversations and output a table row for each one.
foreach ($data["results"] as $conversation):
$this->renderView("conversations/conversation", $data + array("conversation" => $conversation));
endforeach;

?>

<?php if ($data["showViewMoreLink"]): ?>
<li class='viewMore'>
<a href='<?php
$searchWithoutLimit = ET::searchModel()->removeGambit($data["searchString"], 'return strpos($term, strtolower(T("gambit.limit:"))) === 0;');
echo URL("conversations/".$data["channelSlug"]."?search=".urlencode($searchWithoutLimit.($searchWithoutLimit ? " + " : "")."#".T("gambit.limit:").($data["limit"] + C("esoTalk.search.limitIncrement")))); ?>'><?php echo T("View more"); ?></a>
</li>
<?php endif; ?>

</ul>

貌似没什么错......

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/155464

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX