Back to top

Autore Topic: Componente com_simplefilemanager-5.0.1  (Letto 1730 volte)

Offline gmarra7

  • Nuovo arrivato
  • *
  • Post: 15
    • Mostra profilo
Componente com_simplefilemanager-5.0.1
« il: 31 Ago 2015, 16:02:59 »
Mi servirebbe capire come poter integrare jcomments con il componente in questione.


Ho seguito la loro guida: http://www.joomlatune.com/jcomments-developers-manual.html


Dopo di che ho creato il seguente file nominadolo come suggeritomi "com_simplefilemanager.plugin.php" :



<?php
class jc_com_simplefilemanager extends JCommentsPlugin {
 
  function getObjectTitle( $id ) {
    // Data load from database by given id
    $db = & JFactory::getDBO();
    $db->setQuery( "SELECT title FROM #__simplefilemanager WHERE id='$id'");
    return $db->loadResult();
  }
 
  function getObjectLink( $id ) {
    // Itemid meaning of our component
    $_Itemid = JCommentsPlugin::getItemid( 'com_simplefilemanager' );
 
    // url link creation for given object by id
    $link = JRoute::_( 'index.php?option=com_simplefilemanager&task=view&id='. $id .'&Itemid='. $_Itemid );
    return $link;
  }
 
  function getObjectOwner( $id ) {
    $db = & JFactory::getDBO();
    $db->setQuery( 'SELECT created_by, id FROM #__simplefilemanager WHERE id = ' . $id );
    return $db->loadResult();
  }
}
?>


Poi come sempre suggeritomi dalla guida per mostrare i commenti, ho incollato alla riga 79 del seguente file components/com_simplefilemanager/views/simplefilemanager questo codice:



$comments = JPATH_SITE . DS .'components' . DS . 'com_jcomments' . DS . 'jcomments.php';
  if (file_exists($comments)) {
    require_once($comments);
    echo JComments::showComments($id, 'com_simplefilemanager', $title);






Purtroppo tale procedimento sembra non funzionare. Ecco chi può aiutarmi ad integrare Jcomments con com_simplefilemanager.
Grazie a coloro che vorranno aiutarmi.

Offline gmarra7

  • Nuovo arrivato
  • *
  • Post: 15
    • Mostra profilo
Re:Componente com_simplefilemanager-5.0.1
« Risposta #1 il: 31 Ago 2015, 16:31:57 »
Nonostante abbia modificato il codice così suggeritomi precedentemente in un'altra sezione del forum:



<?php $comments = JPATH_SITE. DIRECTORY_SEPARATOR .'components'. DIRECTORY_SEPARATOR .'com_jcomments'. DIRECTORY_SEPARATOR .'jcomments.php';
  if (file_exists($comments)) {
    require_once($comments);
    echo JComments::showComments($id, 'com_simplefilemanager', $title);
  }?>


Non vuol fungere. Chi ha la soluzione?....chi può aiutarmi....Grazie

Offline gmarra7

  • Nuovo arrivato
  • *
  • Post: 15
    • Mostra profilo
Re:Componente com_simplefilemanager-5.0.1
« Risposta #2 il: 31 Ago 2015, 17:32:52 »
Ho scritto questo codice è almeno per ora sembra fungere:



<?php
$comments = JPATH_BASE . '/components/com_jcomments/jcomments.php';
if (file_exists($comments)) {
require_once($comments);
echo JComments::showComments($_GET['id'], 'com_simplefilemanager', $title);
}
?>


Procedo con testare tale integrazione tra jcomments e com_simplefilemanager-5.0.1

 



Web Design Bolzano Kreatif