Keyword

K2 Login and Jcomments integration

  • Matt Payne
  • Matt Payne's Avatar Topic Author
  • Offline
  • New Member
More
13 years 6 months ago #95051 by Matt Payne
K2 Login and Jcomments integration was created by Matt Payne
If you're like me, you prefer the jcomments component over the K2 comments component. Unfortunately, using jcomments means that the K2 login module improperly displays the number of comments you have made on a site. At first I was going to just comment out ( <!-- code --> ) the code in the modules/mod_k2_login/tmpl/userblock.php file for the comment display. Instead, I figured out how that code was calling the database and made a few edits to this file: modules/mod_k2_login/helper.php

 

On line 70, I changed the php to use the _jcomments database in sql instead of the _k2_comments database.

 

$query = "SELECT COUNT(*) FROM #__jcomments WHERE userID=".(int)$userID." AND published=1";

 

I hope it works for you as well as it did me.

 

Now if only I could figure out on m own how to make it so that the k2 login module properly takes you to "my page" instead of just redirecting you to the homepage when you click it...

 

P.S. I know almost nothing about PHP, just went in and started looking at the code and figured out what it was doing and how.

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum