Explorar o código

添加多说,disqus评论插件,评论插件切换,统计脚本设置

Moell %!s(int64=9) %!d(string=hai) anos
pai
achega
6afd01a348

+ 1 - 1
app/Presenters/SystemPresenter.php

@@ -42,7 +42,7 @@ class SystemPresenter extends FractalPresenter
      */
     public function getKeyValue($key)
     {
-        return $this->list[$key];
+        return isset($this->list[$key]) ? $this->list[$key] : '';
     }
 
     /**

+ 26 - 3
app/Repositories/SystemRepositoryEloquent.php

@@ -6,7 +6,7 @@ use Prettus\Repository\Eloquent\BaseRepository;
 use Prettus\Repository\Criteria\RequestCriteria;
 use App\Repositories\SystemRepository;
 use App\Models\System;
-use App\Validators\SystemValidator;
+use Illuminate\Container\Container as Application;
 
 /**
  * Class SystemRepositoryEloquent
@@ -14,6 +14,14 @@ use App\Validators\SystemValidator;
  */
 class SystemRepositoryEloquent extends BaseRepository implements SystemRepository
 {
+    private $config;
+
+    public function __construct(Application $app)
+    {
+        parent::__construct($app);
+        $this->config = config('blog.system_key');
+    }
+
     /**
      * Specify Model class name
      *
@@ -48,7 +56,9 @@ class SystemRepositoryEloquent extends BaseRepository implements SystemRepositor
 
         unset($data['_token']);
         foreach ($data as $key => $value) {
-            $this->model->where('key', $key)->update(['value' => $value]);
+            if (in_array($key, $this->config)) {
+                $this->updateOrCreate(['key' => $key], ['value' => $value]);
+            }
         }
 
         return true;
@@ -62,11 +72,24 @@ class SystemRepositoryEloquent extends BaseRepository implements SystemRepositor
     public function optionList()
     {
         $all = $this->all(['key', 'value']);
-        $system = [];
+        $system = $this->initSystemKey();
         foreach ($all as $a) {
             $system[$a['key']]  = $a['value'];
         }
 
         return $system;
     }
+
+    /**
+     * @return array
+     */
+    private function initSystemKey()
+    {
+        $init = [];
+        $config = array_flip($this->config);
+        foreach ($config as $key => $value) {
+            $init[$key] = '';
+        }
+        return $init;
+    }
 }

+ 5 - 4
composer.json

@@ -1,7 +1,7 @@
 {
-    "name": "laravel/laravel",
-    "description": "The Laravel Framework.",
-    "keywords": ["framework", "laravel"],
+    "name": "moell/moell-blog",
+    "description": "The Moell Blog.",
+    "keywords": ["blog", "laravel", "markdown blog", "php blog", "moell blog"],
     "license": "MIT",
     "type": "project",
     "require": {
@@ -11,7 +11,8 @@
         "baum/baum": "~1.1",
         "prettus/l5-repository": "^2.6",
         "league/fractal": "^0.13.0",
-        "dflydev/apache-mime-types": "^1.0"
+        "dflydev/apache-mime-types": "^1.0",
+        "doctrine/dbal": "^2.5"
     },
     "require-dev": {
         "fzaninotto/faker": "~1.4",

+ 407 - 5
composer.lock

@@ -4,8 +4,8 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
         "This file is @generated automatically"
     ],
-    "hash": "6720fcc792838321dfb72b49cb0315d7",
-    "content-hash": "d6422d757565203c19ab6f0a4e06905b",
+    "hash": "c69a0db62d08b7a6f3e3644b3423c904",
+    "content-hash": "c594ebfaf3b6d07fc5f7b830bd451a6a",
     "packages": [
         {
             "name": "barryvdh/laravel-debugbar",
@@ -258,6 +258,354 @@
             "description": "implementation of xdg base directory specification for php",
             "time": "2014-10-24 07:27:01"
         },
+        {
+            "name": "doctrine/annotations",
+            "version": "v1.3.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/doctrine/annotations.git",
+                "reference": "30e07cf03edc3cd3ef579d0dd4dd8c58250799a5"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://packagist.phpcomposer.com/files/doctrine/annotations/30e07cf03edc3cd3ef579d0dd4dd8c58250799a5.zip",
+                "reference": "30e07cf03edc3cd3ef579d0dd4dd8c58250799a5",
+                "shasum": ""
+            },
+            "require": {
+                "doctrine/lexer": "1.*",
+                "php": "^5.6 || ^7.0"
+            },
+            "require-dev": {
+                "doctrine/cache": "1.*",
+                "phpunit/phpunit": "^5.6.1"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.4.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Roman Borschel",
+                    "email": "roman@code-factory.org"
+                },
+                {
+                    "name": "Benjamin Eberlei",
+                    "email": "kontakt@beberlei.de"
+                },
+                {
+                    "name": "Guilherme Blanco",
+                    "email": "guilhermeblanco@gmail.com"
+                },
+                {
+                    "name": "Jonathan Wage",
+                    "email": "jonwage@gmail.com"
+                },
+                {
+                    "name": "Johannes Schmitt",
+                    "email": "schmittjoh@gmail.com"
+                }
+            ],
+            "description": "Docblock Annotations Parser",
+            "homepage": "http://www.doctrine-project.org",
+            "keywords": [
+                "annotations",
+                "docblock",
+                "parser"
+            ],
+            "time": "2016-10-24 11:45:47"
+        },
+        {
+            "name": "doctrine/cache",
+            "version": "v1.6.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/doctrine/cache.git",
+                "reference": "b6f544a20f4807e81f7044d31e679ccbb1866dc3"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://packagist.phpcomposer.com/files/doctrine/cache/b6f544a20f4807e81f7044d31e679ccbb1866dc3.zip",
+                "reference": "b6f544a20f4807e81f7044d31e679ccbb1866dc3",
+                "shasum": ""
+            },
+            "require": {
+                "php": "~5.5|~7.0"
+            },
+            "conflict": {
+                "doctrine/common": ">2.2,<2.4"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "~4.8|~5.0",
+                "predis/predis": "~1.0",
+                "satooshi/php-coveralls": "~0.6"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.6.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Roman Borschel",
+                    "email": "roman@code-factory.org"
+                },
+                {
+                    "name": "Benjamin Eberlei",
+                    "email": "kontakt@beberlei.de"
+                },
+                {
+                    "name": "Guilherme Blanco",
+                    "email": "guilhermeblanco@gmail.com"
+                },
+                {
+                    "name": "Jonathan Wage",
+                    "email": "jonwage@gmail.com"
+                },
+                {
+                    "name": "Johannes Schmitt",
+                    "email": "schmittjoh@gmail.com"
+                }
+            ],
+            "description": "Caching library offering an object-oriented API for many cache backends",
+            "homepage": "http://www.doctrine-project.org",
+            "keywords": [
+                "cache",
+                "caching"
+            ],
+            "time": "2016-10-29 11:16:17"
+        },
+        {
+            "name": "doctrine/collections",
+            "version": "v1.3.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/doctrine/collections.git",
+                "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://packagist.phpcomposer.com/files/doctrine/collections/6c1e4eef75f310ea1b3e30945e9f06e652128b8a.zip",
+                "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.2"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "~4.0"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.2.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-0": {
+                    "Doctrine\\Common\\Collections\\": "lib/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Roman Borschel",
+                    "email": "roman@code-factory.org"
+                },
+                {
+                    "name": "Benjamin Eberlei",
+                    "email": "kontakt@beberlei.de"
+                },
+                {
+                    "name": "Guilherme Blanco",
+                    "email": "guilhermeblanco@gmail.com"
+                },
+                {
+                    "name": "Jonathan Wage",
+                    "email": "jonwage@gmail.com"
+                },
+                {
+                    "name": "Johannes Schmitt",
+                    "email": "schmittjoh@gmail.com"
+                }
+            ],
+            "description": "Collections Abstraction library",
+            "homepage": "http://www.doctrine-project.org",
+            "keywords": [
+                "array",
+                "collections",
+                "iterator"
+            ],
+            "time": "2015-04-14 22:21:58"
+        },
+        {
+            "name": "doctrine/common",
+            "version": "v2.6.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/doctrine/common.git",
+                "reference": "a579557bc689580c19fee4e27487a67fe60defc0"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://packagist.phpcomposer.com/files/doctrine/common/a579557bc689580c19fee4e27487a67fe60defc0.zip",
+                "reference": "a579557bc689580c19fee4e27487a67fe60defc0",
+                "shasum": ""
+            },
+            "require": {
+                "doctrine/annotations": "1.*",
+                "doctrine/cache": "1.*",
+                "doctrine/collections": "1.*",
+                "doctrine/inflector": "1.*",
+                "doctrine/lexer": "1.*",
+                "php": "~5.5|~7.0"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "~4.8|~5.0"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "2.7.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Doctrine\\Common\\": "lib/Doctrine/Common"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Roman Borschel",
+                    "email": "roman@code-factory.org"
+                },
+                {
+                    "name": "Benjamin Eberlei",
+                    "email": "kontakt@beberlei.de"
+                },
+                {
+                    "name": "Guilherme Blanco",
+                    "email": "guilhermeblanco@gmail.com"
+                },
+                {
+                    "name": "Jonathan Wage",
+                    "email": "jonwage@gmail.com"
+                },
+                {
+                    "name": "Johannes Schmitt",
+                    "email": "schmittjoh@gmail.com"
+                }
+            ],
+            "description": "Common Library for Doctrine projects",
+            "homepage": "http://www.doctrine-project.org",
+            "keywords": [
+                "annotations",
+                "collections",
+                "eventmanager",
+                "persistence",
+                "spl"
+            ],
+            "time": "2015-12-25 13:18:31"
+        },
+        {
+            "name": "doctrine/dbal",
+            "version": "v2.5.5",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/doctrine/dbal.git",
+                "reference": "9f8c05cd5225a320d56d4bfdb4772f10d045a0c9"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://packagist.phpcomposer.com/files/doctrine/dbal/9f8c05cd5225a320d56d4bfdb4772f10d045a0c9.zip",
+                "reference": "9f8c05cd5225a320d56d4bfdb4772f10d045a0c9",
+                "shasum": ""
+            },
+            "require": {
+                "doctrine/common": ">=2.4,<2.7-dev",
+                "php": ">=5.3.2"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "4.*",
+                "symfony/console": "2.*||^3.0"
+            },
+            "suggest": {
+                "symfony/console": "For helpful console commands such as SQL execution and import of files."
+            },
+            "bin": [
+                "bin/doctrine-dbal"
+            ],
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "2.5.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-0": {
+                    "Doctrine\\DBAL\\": "lib/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Roman Borschel",
+                    "email": "roman@code-factory.org"
+                },
+                {
+                    "name": "Benjamin Eberlei",
+                    "email": "kontakt@beberlei.de"
+                },
+                {
+                    "name": "Guilherme Blanco",
+                    "email": "guilhermeblanco@gmail.com"
+                },
+                {
+                    "name": "Jonathan Wage",
+                    "email": "jonwage@gmail.com"
+                }
+            ],
+            "description": "Database Abstraction Layer",
+            "homepage": "http://www.doctrine-project.org",
+            "keywords": [
+                "database",
+                "dbal",
+                "persistence",
+                "queryobject"
+            ],
+            "time": "2016-09-09 19:13:33"
+        },
         {
             "name": "doctrine/inflector",
             "version": "v1.1.0",
@@ -325,6 +673,60 @@
             ],
             "time": "2015-11-06 14:35:42"
         },
+        {
+            "name": "doctrine/lexer",
+            "version": "v1.0.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/doctrine/lexer.git",
+                "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://packagist.phpcomposer.com/files/doctrine/lexer/83893c552fd2045dd78aef794c31e694c37c0b8c.zip",
+                "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.2"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.0.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-0": {
+                    "Doctrine\\Common\\Lexer\\": "lib/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Roman Borschel",
+                    "email": "roman@code-factory.org"
+                },
+                {
+                    "name": "Guilherme Blanco",
+                    "email": "guilhermeblanco@gmail.com"
+                },
+                {
+                    "name": "Johannes Schmitt",
+                    "email": "schmittjoh@gmail.com"
+                }
+            ],
+            "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.",
+            "homepage": "http://www.doctrine-project.org",
+            "keywords": [
+                "lexer",
+                "parser"
+            ],
+            "time": "2014-09-09 13:34:57"
+        },
         {
             "name": "jakub-onderka/php-console-color",
             "version": "0.1",
@@ -986,7 +1388,7 @@
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/47b254ea51f1d6d5dc04b9b299e88346bf2369e3",
+                "url": "https://packagist.phpcomposer.com/files/nikic/PHP-Parser/47b254ea51f1d6d5dc04b9b299e88346bf2369e3.zip",
                 "reference": "47b254ea51f1d6d5dc04b9b299e88346bf2369e3",
                 "shasum": ""
             },
@@ -1185,7 +1587,7 @@
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b",
+                "url": "https://packagist.phpcomposer.com/files/php-fig/log/fe0936ee26643249e916849d48e3a51d5f5e278b.zip",
                 "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b",
                 "shasum": ""
             },
@@ -3668,7 +4070,7 @@
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/4e8f0da10ac5802913afc151413bc8c53b6c2716",
+                "url": "https://packagist.phpcomposer.com/files/sebastianbergmann/environment/4e8f0da10ac5802913afc151413bc8c53b6c2716.zip",
                 "reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716",
                 "shasum": ""
             },

+ 14 - 0
config/blog.php

@@ -5,6 +5,20 @@ return [
         'storage' => 'upload',
         'webPath' => '/uploads'
     ],
+    'system_key' => [
+        'blog_name',
+        'motto',
+        'title',
+        'seo_keyword',
+        'seo_desc',
+        'icp',
+        'github_url',
+        'weibo_url',
+        'disqus_short_name',
+        'duoshuo_short_name',
+        'comment_plugin',
+        'statistics_script'
+    ],
     'menu' => [
         [
             'backend.home' => [

+ 31 - 0
database/migrations/2016_11_14_142731_change_valus_field_to_systems_table.php

@@ -0,0 +1,31 @@
+<?php
+
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class ChangeValusFieldToSystemsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('systems', function (Blueprint $table) {
+            $table->text('value')->change();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('systems', function (Blueprint $table) {
+            $table->string('value')->change();
+        });
+    }
+}

+ 2 - 8
database/seeds/SystemTableSeeder.php

@@ -12,14 +12,8 @@ class SystemTableSeeder extends Seeder
     public function run()
     {
         $systems = [
-            ['key' => 'blog_name'],
-            ['key' => 'motto'],
-            ['key' => 'title'],
-            ['key' => 'seo_keyword'],
-            ['key' => 'seo_desc'],
-            ['key' => 'icp'],
-            ['key' => 'github_url'],
-            ['key' => 'weibo_url']
+            ['key' => 'blog_name', 'value' => 'Moell Blog'],
+            ['key' => 'motto', '欢迎使用Moell Blog,欢迎Star。']
         ];
         DB::table('systems')->insert($systems);
     }

+ 1 - 0
readme.md

@@ -11,6 +11,7 @@ Moell Blog 是一个基于Laravel5.2开发并支持markdown语法开源的简易
 *  文件管理
 *  友情链接
 *  自定义页面
+*  评论插件多说,disqus自由选择
 *  使用Repository 辅助Model,处理数据逻辑
 *  使用Service 辅助Controller, 处理业务逻辑
 *  使用Presenter 辅助View,处理显示逻辑

+ 46 - 2
resources/views/backend/system/index.blade.php

@@ -72,15 +72,59 @@
                                 </div>
                             </div>
                         </div>
+
+                        <div class="form-group">
+                            <label for="comment_plugin">评论插件</label>
+                            <div class="row">
+                                <div class='col-md-6'>
+                                    <select class='form-control' name="comment_plugin" id="comment_plugin" >
+                                        <option value="">请选择</option>
+                                        <option value="duoshuo" {{ $system['comment_plugin'] == 'duoshuo' ? " selected " : "" }}>多说</option>
+                                        <option value="disqus" {{ $system['comment_plugin'] == 'disqus' ? " selected " : "" }}>disqus</option>
+                                    </select>
+                                </div>
+                            </div>
+                        </div>
+                        <div class="form-group">
+                            <label for="disqus_short_name">disqus评论short_name</label>
+                            <div class="row">
+                                <div class='col-md-6'>
+                                    <input type="text"  value="{{ $system['disqus_short_name'] }}"
+                                           class='form-control'
+                                           name="disqus_short_name"
+                                           id="disqus_short_name"
+                                           placeholder="请输入disqus评论short_name">
+                                </div>
+                            </div>
+                        </div>
                         <div class="form-group">
-                            <label for="seo_desc">ICP 备案号</label>
+                            <label for="duoshuo_short_name">多说评论short_name</label>
+                            <div class="row">
+                                <div class='col-md-6'>
+                                    <input type="text"  value="{{ $system['duoshuo_short_name'] }}"
+                                           class='form-control'
+                                           name="duoshuo_short_name"
+                                           id="duoshuo_short_name"
+                                           placeholder="请输入多说评论short_name">
+                                </div>
+                            </div>
+                        </div>
+                        <div class="form-group">
+                            <label for="icp">ICP 备案号</label>
                             <div class="row">
                                 <div class='col-md-6'>
                                     <input type="text"  value="{{ $system['icp'] }}" class='form-control' name="icp" id="icp" placeholder="请输入ICP 备案号">
                                 </div>
                             </div>
                         </div>
-
+                        <div class="form-group">
+                            <label for="statistics_script">统计脚本</label>
+                            <div class="row">
+                                <div class='col-md-6'>
+                                    <textarea class="form-control" name="statistics_script" rows="5" placeholder="请输入合法的javascript统计脚本">{{ $system['statistics_script'] }}</textarea>
+                                </div>
+                            </div>
+                        </div>
                     </div>
 
                     {{ csrf_field() }}

+ 15 - 0
resources/views/default/comment/disqus.blade.php

@@ -0,0 +1,15 @@
+<div id="disqus_thread"></div>
+<script>
+
+     var disqus_config = function () {
+     this.page.url = '{{ $commentUrl }}';  // Replace PAGE_URL with your page's canonical URL variable
+     this.page.identifier = '{{ $commentId }}'; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
+     };
+
+    (function() { // DON'T EDIT BELOW THIS LINE
+        var d = document, s = d.createElement('script');
+        s.src = '//{{ $shortName }}.disqus.com/embed.js';
+        s.setAttribute('data-timestamp', +new Date());
+        (d.head || d.body).appendChild(s);
+    })();
+</script>

+ 20 - 0
resources/views/default/comment/duoshuo.blade.php

@@ -0,0 +1,20 @@
+<!-- 多说评论框 start -->
+<div class="ds-thread"
+     data-thread-key="{{ $commentId }}"
+     data-title="{{ $commentTitle }}"
+     data-url="{{ $commentUrl }}">
+</div>
+<!-- 多说评论框 end -->
+<!-- 多说公共JS代码 start (一个网页只需插入一次) -->
+<script type="text/javascript">
+    var duoshuoQuery = {short_name:"{{ $shortName }}"};
+    (function() {
+        var ds = document.createElement('script');
+        ds.type = 'text/javascript';ds.async = true;
+        ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
+        ds.charset = 'UTF-8';
+        (document.getElementsByTagName('head')[0]
+        || document.getElementsByTagName('body')[0]).appendChild(ds);
+    })();
+</script>
+<!-- 多说公共JS代码 end -->

+ 12 - 0
resources/views/default/comment/index.blade.php

@@ -0,0 +1,12 @@
+
+<?php
+$commentPlugin = $systemPresenter->getKeyValue('comment_plugin');
+$shortName = $systemPresenter->getKeyValue($commentPlugin.'_short_name');
+?>
+@if($commentPlugin !='' && $shortName != '')
+    @if($commentPlugin == 'duoshuo')
+        @include('default.comment.duoshuo')
+    @elseif($commentPlugin == 'disqus')
+        @include('default.comment.disqus')
+    @endif
+@endif

+ 2 - 1
resources/views/default/footer.blade.php

@@ -12,4 +12,5 @@
             </div>
         </div>
     </div>
-</footer>
+</footer>
+{!! $systemPresenter->getKeyValue('statistics_script') !!}

+ 6 - 0
resources/views/default/show_article.blade.php

@@ -67,6 +67,12 @@
             @endif
         </div>
     </div>
+    <!-- 评论插件 -->
+    @include('default.comment.index', [
+        'commentId' => $article->id,
+        'commentTitle' => $article->title,
+        'commentUrl' => Request::getUri()
+    ])
 @endsection
 
 @section('script')

+ 6 - 0
resources/views/default/show_page.blade.php

@@ -37,6 +37,12 @@
     <div style="margin-top:20px;">
         <div id="share" class="social-share"></div>
     </div>
+    <!-- 评论插件 -->
+    @include('default.comment.index', [
+        'commentId' => "page-".$page->id,
+        'commentTitle' => $page->title,
+        'commentUrl' => Request::getUri()
+    ])
 @endsection
 
 @section('script')