为了更好的查阅网站在后台数据在搜索引擎里面的收录情况,鉴于网站数据量过多后难以一条条查询,虽然可以通过【SITE:域名】直接在搜索引擎里面查询,但无奈不是每一个用户都知晓原由;故决定在后台列表里面添加一个栏目,实现一键查询当前文章/产品在搜索引擎里面的收录情况;效果如下:
需要达到的目的
1、通过后台列表实现一键点击查阅文章或产品在搜索引擎里面的收录;
2、自由增加目标需要查询的搜索引擎渠道;
效果实现流程
第一步、找到PbootCMS-v3.0.4\apps\admin\view\default\content\content.html页面,并打开;
第二步、找到第48行,在【<th>操作</th>】前方增加【<th>收录查询</th>】;
第三步、找到第100行—126行,如下:
-
<td>
-
{if(!$value->outlink)}
-
{php}
-
$sortfilename = $value->sortfilename;
-
$contentfilename = $value->filename;
-
$id = $value->id;
-
$urlname = $value->urlname?:’list’;
-
$scode = $value->scode;
-
$url_break_char= get_var(‘url_break_char’);
-
-
if ($sortfilename && $contentfilename) {
-
$link = homeurl(‘home/Index/’ . $sortfilename . ‘/’ . $contentfilename, true);
-
} elseif ($sortfilename) {
-
$link = homeurl(‘home/Index/’ . $sortfilename . ‘/’ . $id, true);
-
} elseif ($contentfilename) {
-
$link = homeurl(‘home/Index/’ . $urlname . $url_break_char . $scode . ‘/’ . $contentfilename, true);
-
} else {
-
$link = homeurl(‘home/Index/’ . $urlname . $url_break_char . $scode . ‘/’ . $id, true);
-
}
-
{/php}
-
-
<input type=“hidden” name=“urls[[value->id]]” value=”{php}echo $link{/php}”>
-
<a href=“{php}echo $link{/php}” class=“layui-btn layui-btn-xs layui-btn-primary” target=“_blank”>查看</a>
-
{/if}
-
{fun=get_btn_del($value->id)}
-
{if(check_level(‘mod’))}
-
<a href=“{url./admin/Content/mod/mcode/’.get(‘mcode’).’/id/’.$value->id.’}{$btnqs}” class=”layui-btn layui-btn-xs” >修改</a>
-
{/if}
-
</td>
替换为:
-
{if(!$value->outlink)}
-
{php}
-
$sortfilename = $value->sortfilename;
-
$contentfilename = $value->filename;
-
$id = $value->id;
-
$urlname = $value->urlname?:‘list’;
-
$scode = $value->scode;
-
$url_break_char= get_var(‘url_break_char’);
-
-
if ($sortfilename && $contentfilename) {
-
$link = homeurl(‘home/Index/’ . $sortfilename . ‘/’ . $contentfilename, true);
-
} elseif ($sortfilename) {
-
$link = homeurl(‘home/Index/’ . $sortfilename . ‘/’ . $id, true);
-
} elseif ($contentfilename) {
-
$link = homeurl(‘home/Index/’ . $urlname . $url_break_char . $scode . ‘/’ . $contentfilename, true);
-
} else {
-
$link = homeurl(‘home/Index/’ . $urlname . $url_break_char . $scode . ‘/’ . $id, true);
-
}
-
{/php}
-
<td>
-
<a href=“https://www.baidu.com/s?wd=http://localhost{php}echo $link{/php}” target=“_blank”><img src=“/images/baidu.jpg” width=“20”></a>
-
<a href=“https://www.sogou.com/web?query=http://localhost{php}echo $link{/php}” target=“_blank”><img src=“/images/sogou.jpg” width=“20”></a>
-
<a href=“https://www.so.com/s?q=http://localhost{php}echo $link{/php}” target=“_blank”><img src=“/images/360.jpg” width=“20”></a>
-
</td>
-
<td>
-
<input type=“hidden” name=“urls[[value->id]]” value=“{php}echo $link{/php}”>
-
<a href=“{php}echo $link{/php}” class=“layui-btn layui-btn-xs layui-btn-primary” target=“_blank”>查看</a>
-
{/if}
-
{fun=get_btn_del($value->id)}
-
{if(check_level(‘mod’))}
-
<a href=“{url./admin/Content/mod/mcode/’.get(‘mcode’).’/id/’.$value->id.’}{$btnqs}” class=“layui-btn layui-btn-xs” >修改</a>
-
{/if}
-
</td>
在以上代码中将其中的“http://localhost”替换为自己网站域名即可;




