Bläddra i källkod

Merge branch 'develop' of zhengxifeng/tyqngp into master

zhengxifeng 2 månader sedan
förälder
incheckning
a46f294a7c

+ 4
- 0
apps/admin/controller/content/ContentController.php Visa fil

@@ -372,6 +372,10 @@ class ContentController extends Controller
372 372
                     $api = "http://data.zz.baidu.com/urls?site=$domain&token=$token&type=daily";
373 373
                     foreach ($list as $key => $value) {
374 374
                         $url = $domain . $urls[$value];
375
+
376
+                        //替换 .html 后缀
377
+                        $url = str_replace(".html","",$url);
378
+
375 379
                         $this->log('百度快速收录推送:' . $url);
376 380
                         $post_urls[] = $url;
377 381
                     }

+ 7
- 2
apps/admin/controller/content/SingleController.php Visa fil

@@ -94,10 +94,15 @@ class SingleController extends Controller
94 94
                 alert_back('链接类型不允许推送!');
95 95
             }
96 96
             if ($data->filename) {
97
-                $urls[] = $domain . homeurl('/home/Index/' . $data->filename, $url_rule_sort_suffix);
97
+                $url = $domain . homeurl('/home/Index/' . $data->filename, $url_rule_sort_suffix);
98
+                $url = str_replace(".html","",$url);
99
+                $urls[] = $url;
98 100
             } else {
99
-                $urls[] = $domain . homeurl('/home/Index/' . $data->urlname . $url_break_char . $data->scode, $url_rule_sort_suffix);
101
+                $url = $domain . homeurl('/home/Index/' . $data->urlname . $url_break_char . $data->scode, $url_rule_sort_suffix);
102
+                $url = str_replace(".html","",$url);
103
+                $urls[] = $url;
100 104
             }
105
+
101 106
             $result = post_baidu($api, $urls);
102 107
             if (isset($result->error)) {
103 108
                 $this->log('百度普通收录推送失败:' . $urls[0]);

+ 3
- 1
apps/admin/view/default/content/content.html Visa fil

@@ -104,7 +104,9 @@
104 104
 			                        	{/php}
105 105
 	
106 106
 			                        	<input type="hidden" name="urls[[value->id]]" value="{php}echo $link{/php}">
107
-			                        	<a href="{php}echo $link{/php}" class="layui-btn layui-btn-xs layui-btn-primary"  target="_blank">查看</a>
107
+			                        	<a href='{php}
108
+			                        	$link = str_replace(".html","",$link);
109
+			                        	echo $link;{/php}' class="layui-btn layui-btn-xs layui-btn-primary"  target="_blank">查看</a>
108 110
 		                        	{/if}
109 111
 		                            {fun=get_btn_del($value->id)}
110 112
 		                            {if(check_level('mod'))}

Loading…
Avbryt
Spara