dbFields = array(
'myUtterancesRepo'=>'',
'enablePages'=>true,
'enableStatic'=>true,
'enableSticky'=>true,
'utterancesTheme'=>''
);
}
public function form()
{
global $L;
$html = '
';
$html .= $L->get('utterances-installation');
$html .= '
';
// Add your Utterances GitHub repository
$html .= '';
$html .= '';
$html .= '';
$html .= ''.$L->get('utterances-tip').'';
$html .= '
';
// Disable comments on static pages
$html .= '';
$html .= '';
$html .= '';
$html .= '
';
// Disable comments on static pages
$html .= '';
$html .= '';
$html .= '';
$html .= '
';
// Disable comments on sticky posts
$html .= '';
$html .= '';
$html .= '';
$html .= '
';
// Chose the GitHub theme for the comments
$html .= '';
$html .= '';
$html .= '';
$html .= '
';
return $html;
}
public function pageEnd()
{
global $url;
global $WHERE_AM_I;
// Do not shows Utterances 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;
}
// Utterances javascript
private function javascript()
{
global $page;
$pageURL = $page->permalink();
$pageID = $page->uuid();
$myUtterancesRepo = $this->getValue('myUtterancesRepo');
$utterancesTheme = $this->getValue('utterancesTheme');
$code = <<
EOF;
return $code;
}
}