Re : Publier les commentaires Jcomments dans un autre module que le centre...
Oui c'est encore une bidouille.
Oui c'est encore une bidouille.
$MonId=JRequest::getVar('id', 0, 'get', 'int');
<?xml version="1.0" encoding="utf-8"?> <install type="module" version="1.5.0"> <name>JComments Module Vic</name> <author>Vic</author> <creationDate>12/09/2012</creationDate> <copyright>Copyright (C) 2012</copyright> <license>http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license> <authorEmail>ggg@sd.com</authorEmail> <authorUrl>www.kfdjkfjs.com</authorUrl> <version>1.0</version> <description>Module perso pour afficher les commentaires du composant JComments</description> <files> <filename module="mod_simplejcomments">mod_simplejcomments.php</filename> </files> <params> <param name="object_id" type="text" default="" label="Object Id" description="" /> <param name="object_group" type="text" default="" label="Object Group" description="" /> <param name="object_title" type="text" default="" label="Object Title" description="" /> </params> <params group="advanced"> <param name="cache" type="list" default="1" label="Caching" description="Select whether to cache the content of this module"> <option value="1">Use global</option> <option value="0">No caching</option> </param> </params> </install>
<?php
// ensure this file is being included by a parent file
defined('_JEXEC') or die('Restricted access');
// if component doesnt exists (may be already uninstalled) - return
if (!defined( 'JCOMMENTS_JVERSION' )) { return; }
$comments = JPATH_SITE . DS .'components' . DS . 'com_jcomments' . DS . 'jcomments.php';
if (file_exists($comments)) {
require_once($comments);
echo JComments::showComments($params->get('object_id'), $params->get('object_group'), $params->get('object_title'));
}
?>
<?xml version="1.0" encoding="utf-8"?> <install type="module" version="1.5.0"> <name>JComments Module Vic</name> <author>Vic</author> <creationDate>12/09/2012</creationDate> <copyright>Copyright (C) 2012</copyright> <license>http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license> <authorEmail>ggg@sd.com</authorEmail> <authorUrl>www.kfdjkfjs.com</authorUrl> <version>1.0</version> <description>Module perso pour afficher les commentaires du composant JComments</description> <files> <filename module="mod_simplejcomments">mod_simplejcomments.php</filename> </files> <params> <param name="object_id" type="text" default="" label="Object Id" description="" /> <param name="object_group" type="text" default="" label="Object Group" description="" /> <param name="object_title" type="text" default="" label="Object Title" description="" /> </params> <params group="advanced"> <param name="cache" type="list" default="1" label="Caching" description="Select whether to cache the content of this module"> <option value="1">Use global</option> <option value="0">No caching</option> </param> </params> </install>
<?php
// ensure this file is being included by a parent file
defined('_JEXEC') or die('Restricted access');
// if component doesnt exists (may be already uninstalled) - return
if (!defined( 'JCOMMENTS_JVERSION' )) { return; }
$comments = JPATH_SITE . DS .'components' . DS . 'com_jcomments' . DS . 'jcomments.php';
if (file_exists($comments)) {
require_once($comments);
echo JComments::showComments($params->get('object_id'), $params->get('object_group'), $params->get('object_title'));
}
?>
<?php
// ensure this file is being included by a parent file
defined('_JEXEC') or die('Restricted access');
// if component doesnt exists (may be already uninstalled) - return
if (!defined( 'JCOMMENTS_JVERSION' )) { return; }
$comments = JPATH_SITE . DS .'components' . DS . 'com_jcomments' . DS . 'jcomments.php';
if (file_exists($comments)) {
require_once($comments);
$MonId=JRequest::getVar('id', 0, 'get', 'int');
echo JComments::showComments($MonId, 'com_content', 'Laissez vos messages');
/*echo JComments::showComments($params->get('object_id'), $params->get('object_group'), $params->get('object_title'));*/
}
?>
Commentaire