Browse Source

Fix for the previous

Visman 1 năm trước cách đây
mục cha
commit
acaad2db29
2 tập tin đã thay đổi với 16 bổ sung2 xóa
  1. 8 1
      app/Models/Pages/Forum.php
  2. 8 1
      app/Models/Pages/Topic.php

+ 8 - 1
app/Models/Pages/Forum.php

@@ -44,7 +44,14 @@ class Forum extends Page
 
         $this->nameTpl    = 'forum';
         $this->onlinePos  = 'forum-' . $args['id'];
-        $this->canonical  = $forum->link;
+        $this->canonical  = $this->c->Router->link(
+            'Forum',
+            [
+                'id'   => $args['id'],
+                'name' => $this->c->Func->friendly($forum->forum_name),
+                'page' => $forum->page,
+            ]
+        );
         $this->model      = $forum;
         $this->topics     = $forum->pageData();
         $this->crumbs     = $this->crumbs($forum);

+ 8 - 1
app/Models/Pages/Topic.php

@@ -136,7 +136,14 @@ class Topic extends Page
         $this->nameTpl      = 'topic';
         $this->onlinePos    = 'topic-' . $topic->id;
         $this->onlineDetail = true;
-        $this->canonical    = $topic->link;
+        $this->canonical    = $this->c->Router->link(
+            'Topic',
+            [
+                'id'   => $topic->id,
+                'name' => $this->c->Func->friendly($topic->name),
+                'page' => $topic->page,
+            ]
+        );
         $this->model        = $topic;
         $this->crumbs       = $this->crumbs($topic);
         $this->online       = $this->c->Online->calc($this)->info();