Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

JoomlaTune Support Forum    JComments component    Suggestions, Wishlists & Feature Requests    Topic: jcoments in another component?
Pages: [1]   Go Down
  Print  
Author Topic: jcoments in another component?  (Read 2757 times)
0 Members and 1 Guest are viewing this topic.
account23
Newbie
*

Karma: 0
Offline Offline

Posts: 2


Email
« on: November 24, 2010, 00:11:42 »

Hi I would like to know whether there is any php code that can be inserted into the component if the component would then be given to post comments on jcomments?

or some way to get jcomment where do I need?

thank you and sorry my English is bad
Logged
era
Global Moderator
Newbie
*****

Karma: 9
Offline Offline

Gender: Male
Posts: 44


211194534
Email
« Reply #1 on: November 24, 2010, 01:06:59 »

How to ingetrate to anothe components
+
How to create a plugin for JComments - used by JComments admin back-end and JComments Lastes News module
Logged

English is not my native language - so I can write with mistakes Wink
account23
Newbie
*

Karma: 0
Offline Offline

Posts: 2


Email
« Reply #2 on: November 24, 2010, 21:35:59 »

I tried to make it work

but in each file with another id is the same comment I do not know what to do with it: (

in
Code:
/ index.php? option = com_channels & view = videos & vid = 100
is the same as well as in
Code:
/ index.php? com_channels option = & view = videos & vid = 500

I have added to this file

Code:
<?php

  $comments 
JPATH_SITE DS .'components' DS 'com_jcomments' DS 'jcomments.php';
  if (
file_exists($comments)) {
    require_once(
$comments);
    echo 
JComments::showComments($id'com_movi'$title);
  }
?>
I tried to add to jcomments / plugin file com_channels.plugin.php
This file does nothing


Code:
<?php

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

thank you
« Last Edit: November 24, 2010, 21:40:11 by account23 » Logged
Pages: [1]   Go Up
  Print  
JoomlaTune Support Forum    JComments component    Suggestions, Wishlists & Feature Requests    Topic: jcoments in another component?
 
Jump to: