×

Error

Please login first

[SOLVED] jcomments for commenting user profile

12 years 9 months ago - 12 years 9 months ago #170402 by diogotu
i would like to visitors be able to comment using jcomments the user profiles, registred or not, i din't found a plugin in their web site for CB so looking the forum i saw this information, is possible to make a plugin with that, could you help me, i'm not a programmer yet... :)

www.joomlatune.com/forum/index.php/topic,116.0.html

code for com_comprofiler.plugin.php (components/com_jcomments/plugins)
class jc_com_comprofiler extends JCommentsPlugin
{
     function getTitles($ids)
	{
		$db = & JCommentsFactory::getDBO();
		$db->setQuery( "SELECT CONCAT(username,'\'s Profile') AS title FROM #__users WHERE id IN (' . implode(',', $ids) . ')" );
		return $db->loadObjectList('id');
	}
	function getObjectTitle($id)
	{
		$db = & JCommentsFactory::getDBO();
		$db->setQuery( "SELECT CONCAT(username,'\'s Profile') AS title FROM #__users WHERE id = $id" );
		return $db->loadResult();
	}
 
	function getObjectLink($id)
	{
		$_Itemid = JCommentsPlugin::getItemid( 'com_comprofiler' );
		$link = JRoute::_( 'index.php?option=com_comprofiler&task=viewprofile&user='.$id.'&Itemid='. $_Itemid );
		return $link;
	}
 
}

code for comprofile.html.php:
$uid = urldecode( stripslashes( cbGetParam( $_GET, 'user', '' ) ) );
	$comments = JPATH_SITE . DS .'components' . DS . 'com_jcomments' . DS . 'jcomments.php';
	if (file_exists($comments)) {
		require_once($comments);
		$cuser =& JFactory::getUser($uid);
		//echo $uid.'------'.$cuser->name.'<br/>'; //ok
		$title = $cuser->username."'s Profile.";
		echo JComments::showComments($uid, 'com_comprofiler', $title);
       }

Please Log in to join the conversation.

12 years 9 months ago #170435 by krileon
Replied by krileon on topic Re: jcomments for commenting user profile
Please review existing plugins on how to create a CB plugin. Below tutorial explains how to use CB triggers as well as provides an example installable plugin.

www.allmysocials.com/directory/tutorials/item/228-event-triggers

You can also find the API documentation at the below link in the free downloads section.

www.joomlapolis.com/downloads/cat_view/77-free-member-download-area

Don't understand the need for this however as the developers of JComments themselves wonderfully provide what you're wanting already. Please see the below downloads link and download CB JComments Tab v.1.6.

www.joomlatune.com/jcomments-downloads.html


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

12 years 9 months ago #170481 by diogotu
Replied by diogotu on topic Re: jcomments for commenting user profile
Hi Krileon,

Thanks for answer, i tried this Jcomments Tab v1.6. before posting here, but isn't what i want, it is a tab that shows what comments the profile owner did! It's called "My last comments"

I need something for site visitors comment about the user profile!

for example:

i have profiles that are companys! i would like to people comment about the company... like a feed back or marketing!

i will see the documentation... proposed, thanks!

Please Log in to join the conversation.

12 years 9 months ago - 12 years 9 months ago #170487 by diogotu
Replied by diogotu on topic Re: jcomments for commenting user profile
Hi, i tried using the code and i got working, but not perfect yet, i would like some help!

File 1

i uploaded to: components/com_jcomments/plugins
com_comprofiler.plugin.php ,


File 2

components/com_comprofiler/comprofiler.html.php

i put this code at the end, line 2127
<?php    $uid = urldecode( stripslashes( cbGetParam( $_GET, 'user', '' ) ) );
	$comments = JPATH_SITE . DS .'components' . DS . 'com_jcomments' . DS . 'jcomments.php';
	if (file_exists($comments)) {
		require_once($comments);
		$cuser =& JFactory::getUser($uid);
		//echo $uid.'------'.$cuser->name.'<br/>'; //ok
		$title = $cuser->username."'s Profile.";
		echo JComments::showComments($uid, 'com_comprofiler', $title);
       } ?>

Results: worked, but the jcomments is appearing first and the profiles second!

i would like to have the comments bellow the user profile, where i have to paste the code (line) to have first profile, after jcomments?

Please Log in to join the conversation.

12 years 9 months ago #170521 by krileon
Replied by krileon on topic Re: jcomments for commenting user profile
I can't help you edit core files, sorry. We do not support core edits. If task is too much I recommend locating a contract developer at sites like Joomlancers. The easiest approach is to just take the existing jComments plugin, remove all of it's tab rendering contents, then add your own so the tab renders what you want.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

12 years 9 months ago #170651 by diogotu
Replied by diogotu on topic Re: jcomments for commenting user profile
Thanks!

i'm going to try others comment components, maybe i find better ones!

Big Hug

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.219 seconds

Facebook Twitter LinkedIn