Topic-icon Comments for Registered Users Only

Active Subscriptions:

None
14 years 4 months ago #18730 by trawel
Greetings,

I spoke with Alex via email and he said one of you fine support folks might be able to provide me a code solution for the hurdle I'm facing.

I have version 1.7 and want to only display the comments plugin to users who have completed registration and are part of the core Joomla Registered users group. Would anybody have suggestions on which JFBConnect file to change and what would that code modification be?

Thanks in advance!
Tracy
The topic has been locked.
Support Specialist
14 years 4 months ago #18754 by alzander
Tracy,
This is Alex :) Thanks for posting here. It's much easier to show your question to the right developer when posted here.

From what you've described, here's the best/easiest solution. This will make it so that -any- comment box is for logged in user's only. If you need something more selective (some boxes for logged in, others for both), let us know.

In the /plugins/system/jfbcsystem/jfbcsystem.php file. Around line 671, you'll see:
return $commentString;
Change that to the following block:
See below post

The 2nd line there can be customized how you want (and I hope it's not too confusing. You can also set it to return "" to return nothing. Figured you'd like the output from the above though which will show the number of comments and try to solicit the user to login.

The above is untested, but pretty confident it should work. If you run into issues though, let us know!

Thanks,
Alex
The topic has been locked.
Support Specialist
14 years 4 months ago #18755 by alzander
Err.. code got a little stripped. Lets try that again:
$user =& JFactory::getUser(); 
if ($user->guest) 
  return "There are <fb:comments-count href=".$href."></fb:comments-count>. Please login to Comment"; 
else 
  return $commentString;
Alex
The topic has been locked.
Active Subscriptions:

None
14 years 4 months ago #18782 by trawel
That worked like a charm Alex! In case you do make this a future enhancement, I also placed a Login With Facebook button below that line so that the user didn't have to seek it out at the top of the page. I'm including a snapshot below.

Thanks again. This is how a product should truly be supported.

File Attachment:
The topic has been locked.
Support Specialist
14 years 4 months ago #18787 by alzander
We figured showing you how to put some text there was the next question.. so glad we got ahead of you. Excellent idea with adding the actual button :)

As mentioned (I think), you're the first user to ask for this, so it's not high on our priority list. We do like the idea, but implementing it in a really flexible way could be an issue. Please bookmark this page, as when you upgrade JFBConnect, you'll need to manually make this change for now.

Anyways, very happy we could help. And finally, please consider leaving a rating and review on the Joomla Extension Directory for JFBConnect, or our support. It's certainly not required, but very appreciated!
extensions.joomla.org/extensions/social-...ook-integration/7215

Thanks,
Alex
The topic has been locked.