dbFields = array(
'shortname' => '',
'enableStandard' => true,
'enableStatic' => true,
'enableSticky' => true,
'enableUnlisted' => true
);
}
public function form() {
global $L;
$html = '
';
$html .= '
';
$html .= '
';
$html .= '
' . $L->get('Get the shortname from the Disqus general settings') . '
';
$html .= '
';
$html .= '';
$html .= '';
$html .= '';
$html .= '
';
$html .= '';
$html .= '';
$html .= '';
$html .= '
';
$html .= '';
$html .= '';
$html .= '';
$html .= '
';
$html .= '';
$html .= '';
$html .= '';
$html .= '
';
return $html;
}
public function pageEnd() {
global $url;
global $WHERE_AM_I;
// Do not display Disqus on page not found
if ($url->notFound()) {
return false;
}
if ($WHERE_AM_I === 'page') {
global $page;
if ($page->published() && $this->getValue('enableStandard')) {
return $this->javascript();
}
if ($page->isStatic() && $this->getValue('enableStatic')) {
return $this->javascript();
}
if ($page->sticky() && $this->getValue('enableSticky')) {
return $this->javascript();
}
if ($page->unlisted() && $this->getValue('enableUnlisted')) {
return $this->javascript();
}
}
return false;
}
private function javascript() {
global $page;
$pageURL = $page->permalink();
$pageID = $page->uuid();
$shortname = $this->getValue('shortname');
$code = <<
EOF;
return $code;
}
}