Integration of JComments to standard Poll component
|
The given integration allows visitors leave the comments to poll results reviewed by standard poll component com_poll.
Poll extension for Joomla 1.5.x
- Copy files from /components/com_poll/views/poll/tmpl/ into /template/{TEMPLATENAME}/html/com_poll/poll/ folder (there {TEMPLATENAME} is the your Joomla's template folder name).
- Open file /template/{TEMPLATENAME}/html/com_poll/poll/default.php
- Add to the end of the file
<?php
$comments = JPATH_SITE.DS.'components'.DS.'com_jcomments'.DS.'jcomments.php';
if (file_exists($comments)) {
require_once($comments);
echo JComments::showComments($this->poll->id, 'com_poll', $this->poll->title);
}
?>
Poll extension for Joomla 1.0.x
- Open file /components/com_poll/poll.html.php
- Find the following lines:
<?php
// displays back button
mosHTML::BackButton ( $params );
?>
</form>
and insert after:
<?php
global $mosConfig_absolute_path;
$comments = $mosConfig_absolute_path . '/components/com_jcomments/jcomments.php';
if (file_exists($comments)) {
require_once($comments);
echo JComments::showComments($poll->id, 'com_poll', $poll->title);
}
?>
See also:
|