From 484ef69dd3ebfa8713330b138b4f580d877cfe51 Mon Sep 17 00:00:00 2001 From: Moc Date: Mon, 20 Dec 2021 21:29:33 +0100 Subject: [PATCH] #3778 - Add SEF URL configuration to 'pages' in comment_menu (WIP) WIP - one URL configuration not working yet. See notes in issue #3778 --- e107_handlers/comment_class.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/e107_handlers/comment_class.php b/e107_handlers/comment_class.php index 9319b101d..b4d7c0e48 100644 --- a/e107_handlers/comment_class.php +++ b/e107_handlers/comment_class.php @@ -1562,10 +1562,17 @@ class comment } break; case 'page': // Custom Page - $ret['comment_type'] = COMLAN_TYPE_PAGE; - $ret['comment_title'] = $ret['comment_subject'] ? $ret['comment_subject']: - $ret['comment_comment']; - $ret['comment_url'] = e_HTTP."page.php?".$row['comment_item_id']; + if ($sql2->select("page", "*", "page_id='".$row['comment_item_id']."' AND page_class REGEXP '".e_CLASS_REGEXP."' ")) + { + $row2 = $sql2->fetch(); + + $route = ($row2['page_chapter'] == 0) ? "page/view/other" : "page/view/index"; // Determine if page belongs to book/chapter. + + $ret['comment_type'] = COMLAN_TYPE_PAGE; + $ret['comment_title'] = $ret['comment_subject'] ? $ret['comment_subject']: + $ret['comment_comment']; + $ret['comment_url'] = e107::getUrl()->create($route, $row2); // e_HTTP."page.php?".$row['comment_item_id']; + } break; default: if (isset($e_comment[$row['comment_type']]) && is_array($e_comment[$row['comment_type']]))