dbFields = array(
'shortname' => '',
'enablePages' => true,
'enableStatic' => true,
'enableSticky' => true
);
}
public function form()
{
global $L;
$html = '
';
$html .= $this->description();
$html .= '
';
$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 .= '
';
return $html;
}
public function pageEnd()
{
global $url;
global $WHERE_AM_I;
// Do not shows disqus on page not found
if ($url->notFound()) {
return false;
}
if ($WHERE_AM_I === 'page') {
global $page;
if ($page->published() && $this->getValue('enablePages')) {
return $this->javascript();
}
if ($page->isStatic() && $this->getValue('enableStatic')) {
return $this->javascript();
}
if ($page->sticky() && $this->getValue('enableSticky')) {
return $this->javascript();
}
}
return false;
}
private function javascript()
{
global $page;
$pageURL = $page->permalink();
$pageID = $page->uuid();
$shortname = $this->getValue('shortname');
$code = <<
EOF;
return $code;
}
}