Author Topic: jomcomment integration  (Read 20905 times)

0 Members and 1 Guest are viewing this topic.

Offline terrybritton

jomcomment integration
« on: 15. February 2008, 02:33:40 »
I'm getting closer to getting the latest version of jomcomment integrated. I found the code in another post to get it to show up on a sobi page. That part works great, but I really want to use the ability for users to add the page to their favorites and to monitor the article for new content. Right now when adding a sobi article to my favorites it just gives a link to the sobi component. Azrul gave me the following response, but I'm unsure what to replace jcGetContentLink($row->contentid,1) with. I presume it's the soibitemid that I need?

else{
	
    
// Other components or 3rd party components that we dont know what
	
    
// the url is supposed to be.
	
    
$row->task      'task=view';
	
    
$row->parentLink    jcGetContentLink($row->contentid1);
	
}


You will need to add another line before the code block above so that it looks like below,

else if($row->option == 'com_sobi2'){
	
    
$row->task      'task=view';
            
$row->parentLink    jcGetContentLink($row->contentid1);
	
}else{
	
    
// Other components or 3rd party components that we dont know what
	
    
// the url is supposed to be.
	
    
$row->task      'task=view';
	
    
$row->parentLink    jcGetContentLink($row->contentid1);
	
}


Replace jcGetContentLink($row->contentid,1); with the appropriate link to the specific sobi2 item.
Country: United States United States |  OS: Unknown Unknown Browser: Unknown Unknown | View Profile Castaways Club


Offline amadorj23

Re: jomcomment integration
« Reply #1 on: 15. February 2008, 05:08:38 »
Not sure if this will help, I use a component called MyLinks that allows you to store the current page URL into a "fav" list. Since the tool is URL based I have yet to find a component that does not work with it including Sobi. It does not update you to any changes but it at least gives you the "Fav" capability

http://extensions.joomla.org/component/option,com_mtree/task,viewlink/link_id,708/Itemid,35/
Country: United States United States |  OS: Unknown Unknown Browser: Unknown Unknown | View Profile

Do you want continued ongoing development, new features and active support?
Please write a review or just vote for SOBI on JED.

Offline terrybritton

Re: jomcomment integration
« Reply #2 on: 15. February 2008, 17:10:33 »
Thanks amadorj, I was using that component for favorites, another for email to a friend and another for social bookmarking. Since jomcomment now includes all of those capabilities I figured I'd rather have one component than three. Once I get it working anyways.
Country: United States United States |  OS: Unknown Unknown Browser: Unknown Unknown | View Profile Castaways Club

Offline kai920

Re: jomcomment integration
« Reply #3 on: 24. February 2008, 19:19:06 »
hi terry, please let us know if you have figured this out... thanks!
Useful Sobi2 links
1. Template Commands
2. F.A.Q.
   Other useful links
1. Firebug
2. Firebug
3. Firebug
Country: Hong Kong Hong Kong |  OS: Unknown Unknown Browser: Unknown Unknown | View Profile

Offline xilocex

Re: jomcomment integration
« Reply #4 on: 29. February 2008, 13:31:38 »
The code provided doesn't seem to work with the latest version of Jom Comment, version 2.2 Build 452, but I managed to get the desired behavior by replacing:

Code: [Select]
if($favorites){
global $mainframe;

$cms->table->clear();
$cms->table->set_heading('', 'Content Title', '');

foreach($favorites as $row){

#actions
$action = '[ <a href="javascript:void(0);" onclick="jax.call(\'jomcomment\',\'jcxRemoveFav\',\'' . $row->id . '\');">remove</a> ]';
$feed_link = cmsSefAmpReplace("index.php?option=com_jomcomment&amp;task=rss&amp;contentid=$row->contentid&amp;opt=$row->option");
$title_link = jcGetContentLink($row->contentid, $row->ItemId);

$title = ('com_content' == $row->option || 'com_myblog' == $row->option) ? jcContentTitle($row->contentid) : $row->option.' item';
$title = '<a href="'.$title_link.'" >'.$title.'</a>';

$feed = '<a href="' . $feed_link . '"><img src="'.JC_COM_LIVEPATH.'/images/feed.png" border="0" /></a>';

#Add the rows
$cms->table->add_row($feed , $title, $action);
}

with

Code: [Select]
if($favorites){
global $database, $mainframe;

$cms->table->clear();
$cms->table->set_heading('', 'Content Title', '');

foreach($favorites as $row){

#actions
$action = '[ <a href="javascript:void(0);" onclick="jax.call(\'jomcomment\',\'jcxRemoveFav\',\'' . $row->id . '\');">remove</a> ]';
$feed_link = cmsSefAmpReplace("index.php?option=com_jomcomment&amp;task=rss&amp;contentid=$row->contentid&amp;opt=$row->option");
       
        if($row->option == 'com_sobi2'){
       
            // Sobi2 title fetch
   
            $sql = "SELECT title"
            . "\n FROM #__sobi2_item"
            . "\n WHERE itemid = '{$row->contentid}'"
            . "\n AND published = 1";
            $database->setQuery( $sql );
            $sobi2_title = $database->loadResult();
       
            $title_link = $row->url;
            $title = $sobi2_title;
           
        } else{
    $title_link = jcGetContentLink($row->contentid, $row->ItemId);
            $title = ('com_content' == $row->option || 'com_myblog' == $row->option) ? jcContentTitle($row->contentid) : $row->option.' item';
        }
       
$title = '<a href="'.$title_link.'" >'.$title.'</a>';

$feed = '<a href="' . $feed_link . '"><img src="'.JC_COM_LIVEPATH.'/images/feed.png" border="0" /></a>';

#Add the rows
$cms->table->add_row($feed , $title, $action);
}

in JOOMLA/components/com_jomcomment/templates/admin/favorites.html


I hope this helps someone.  ;)
« Last Edit: 05. March 2008, 02:49:14 by xilocex »
Country: United States United States |  OS: Unknown Unknown Browser: Unknown Unknown | View Profile Purple Iris Design

Offline kai920

Re: jomcomment integration
« Reply #5 on: 03. March 2008, 09:02:17 »
[Removed my rough edits. Use xilocex's package instead]
« Last Edit: 05. March 2008, 14:38:48 by kai920 »
Useful Sobi2 links
1. Template Commands
2. F.A.Q.
   Other useful links
1. Firebug
2. Firebug
3. Firebug
Country: Hong Kong Hong Kong |  OS: Unknown Unknown Browser: Unknown Unknown | View Profile

Offline kai920

Re: jomcomment integration
« Reply #6 on: 03. March 2008, 10:43:23 »
At least one more fix (is it the last?) needs to be made to the My Comments section (comments.html). Blank comment excerpt...
Useful Sobi2 links
1. Template Commands
2. F.A.Q.
   Other useful links
1. Firebug
2. Firebug
3. Firebug
Country: Hong Kong Hong Kong |  OS: Unknown Unknown Browser: Unknown Unknown | View Profile

Offline xilocex

Re: jomcomment integration
« Reply #7 on: 05. March 2008, 02:17:46 »
See post below for patch package.
« Last Edit: 05. March 2008, 10:16:16 by xilocex »
Country: United States United States |  OS: Unknown Unknown Browser: Unknown Unknown | View Profile Purple Iris Design

Offline xilocex

Re: jomcomment integration
« Reply #8 on: 05. March 2008, 02:43:03 »
I further modified my code for favorites, your code for the subscriptions as well as I fixed a title issue with the Bookmarking functionality and wrote some installation instructions. You can download a .zip archive containing all of the fixes and the installation instructions here.

Also note that the code is now optimized and provides full Jom Comment Sobi2 integration enjoy and if you find anything that doesn't work right let me know.  ;)
« Last Edit: 18. April 2008, 07:25:48 by xilocex »
Country: United States United States |  OS: Unknown Unknown Browser: Unknown Unknown | View Profile Purple Iris Design

Offline kai920

Re: jomcomment integration
« Reply #9 on: 05. March 2008, 10:20:48 »
great work! will test when I get home, and delete my mods above so as to not cause confusion :P
Useful Sobi2 links
1. Template Commands
2. F.A.Q.
   Other useful links
1. Firebug
2. Firebug
3. Firebug
Country: Hong Kong Hong Kong |  OS: Unknown Unknown Browser: Unknown Unknown | View Profile

Tags: