Skip to content

Commit

Permalink
Updated extension for latest API
Browse files Browse the repository at this point in the history
  • Loading branch information
markseuffert committed Nov 5, 2022
1 parent 08e858a commit 46bc178
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Disqus 0.8.7
# Disqus 0.8.8

Show Disqus comments on blog.

Expand Down
8 changes: 6 additions & 2 deletions disqus.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Disqus extension, https://github.com/GiovanniSalmeri/yellow-disqus

class YellowDisqus {
const VERSION = "0.8.7";
const VERSION = "0.8.8";
public $yellow; // access to API

// Handle initialisation
Expand All @@ -16,7 +16,11 @@ public function onParseContentShortcut($page, $name, $text, $type) {
$output = null;
if ($name=="disqus" && ($type=="block" || $type=="inline") && !preg_match("/exclude/i", $page->get("comment"))) {
$shortname = $this->yellow->system->get("disqusShortname");
$url = $page->get("pageReadUrl");
$url = $this->yellow->lookup->normaliseUrl(
$this->yellow->system->get("coreServerScheme"),
$this->yellow->system->get("coreServerAddress"),
$this->yellow->system->get("coreServerBase"),
$page->location);
$language = $page->get("language");
$output = "<div id=\"disqus_thread\" data-shortname=\"".htmlspecialchars($shortname)."\" data-url=\"".htmlspecialchars($url)."\" data-language=\"$language\"></div>\n";
}
Expand Down
4 changes: 2 additions & 2 deletions extension.ini
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Datenstrom Yellow extension settings

Extension: Disqus
Version: 0.8.7
Version: 0.8.8
Description: Show Disqus comments on blog.
DocumentationUrl: https://github.com/GiovanniSalmeri/yellow-disqus
DownloadUrl: https://github.com/GiovanniSalmeri/yellow-disqus/archive/main.zip
Published: 2021-06-10 21:46:14
Published: 2022-11-05 11:59:42
Developer: Giovanni Salmeri
Tag: feature
system/extensions/disqus.php: disqus.php, create, update
Expand Down

0 comments on commit 46bc178

Please sign in to comment.