Keyword

JomComment? Jomsocial too

More
15 years 5 days ago #68573 by Craig Berry
Replied by Craig Berry on topic JomComment? Jomsocial too
Hi Dave,
Thanks a ton for the the Affinity hack. Worked like a charm...jomcomment integration is working.

Do you know where I can pull out the 'be first to comment' line. Since it doesn't work with this workaround, I'd rather it not appear.

Thanks!
Craig

UPDATE: Found it! in item.php, I just removed the entire tag (which contains the php echo 'be the first to comment'). Of course, not before backing up the file!

Dave Marshall said:Hi Jennifer, As I stated above,
"There is one drawback to this, you will not be able to use the Comment Anchor for K2 and the K2 modules will not show the Latest Comments from Jom Comment but at least you will have one commenting system across your site. I am not a programmer so this will have to be left up to someone else. I have attached the file so that you may just upload it and overwrite the above mentioned files."

This means you will not be able to use the "be the first to comment anchor" you will need to disable these in the K2 Settings and Category Settings.

Did you add the code to the:
"components/com_k2/templates/default/item_comments_form.php"
or the
"templates/rt_affinity_j15/html/com_k2/templates/default/item_comments_form.php" ?
if you are using Affinity you need to use the later.


Have you set the K2 Parameters "Global setting for comments" to either:
"Enabled to Everyone"
or
"Enabled for rgistered users only"?

Have you cleared the Joomla and your Browser cache? If you are using the Joomla Cache take note that it is very agressive and any changes in K2 will not be shown unless you clear it.


Jennifer said:Hey, I did exactly what you said (I have affinity) and I can not see the commenting form at all. When I click on "be the first to comment" it takes me to the bottom of the screen and there is not commenting form. What could I be doing wrong?
Dave Marshall said:Hi again, The forum did not seem to accept the code I pasted but you can get it from the attached file.

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

More
14 years 10 months ago #68574 by Arnold Wender
Replied by Arnold Wender on topic JomComment? Jomsocial too
Dave Marshall said:Hi all, I have been doing some testing on this. The easiest way I have found to add Jom Comment to K2 is to edit: components/com_k2/templates/default/item_comments_form.php
For those of you using the Rocket Theme Affinity template you will need to edit the:
templates/rt_affinity_j15/html/com_k2/templates/default/item_comments_form.php

Now delete everything in the file and replace it with the following code:

[code]



[code]

There is one drawback to this, you will not be able to use the Comment Anchor for K2 and the K2 modules will not show the Latest Comments from Jom Comment but at least you will have one commenting system across your site. I am not a programmer so this will have to be left up to someone else. I have attached the file so that you may just upload it and overwrite the above mentioned files.
PLEASE MAKE A BACKUP FIRST!!!
Hope this helps you all.

Cheers
Dave


Hello Mr Marshall, It works for me, now I´m tryng to modify the file helper.php from the module mod_jomlatest... to show the latest comments, wish me luck :D

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

More
14 years 10 months ago #68575 by Arnold Wender
Replied by Arnold Wender on topic JomComment? Jomsocial too
Now I can show the latest comments using the default JomComment Module (mod_jomlatest) just add this code to helper.php

///Integramos K2

else if( $row->option == 'com_k2')
{
$query = "SELECT title FROM #__k2_items WHERE id='{$row->contentid}'";
$db->setQuery($query);
$title = $db->loadResult();
$link = JRoute::_( 'index.php?option=com_k2&view=item&id=' . $row->contentid );
}

///

Example: www.joomlamania.org/index.php?option=com_k2&view=item&id=94:ver-posici%C3%B3nes-de-modulos-en-tu-template-en-joomla

cheers

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

More
14 years 10 months ago #68576 by nano02
Replied by nano02 on topic JomComment? Jomsocial too
Sorry my stupidity but I can not integrate my programming skills are too low, you show me exactly where to place this code?, Thanks

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

More
14 years 10 months ago #68577 by Arnold Wender
Replied by Arnold Wender on topic JomComment? Jomsocial too
nano02 said:Sorry my stupidity but I can not integrate my programming skills are too low, you show me exactly where to place this code?, Thanks


Hello,

I placed that code snippet in the default JomComment module mod_jomlatest

I attach the modified file (helper.php) upload this to modules/mod_jomlatest/ and replace the existing one, backup your original file!

I hope this help you.

Arnold

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

More
14 years 10 months ago #68578 by nano02
Replied by nano02 on topic JomComment? Jomsocial too
THANK YOU, very much

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

  • Different Color
  • Different Color's Avatar
  • Offline
  • Premium Member
More
14 years 9 months ago #68579 by Different Color
Replied by Different Color on topic JomComment? Jomsocial too
I followed Dave's suggestions to replace the K2 comment template with the code he provided. However - when I fill in my comments and select ADD COMMENT, nothing happens... it just sits there! Do I need to change code somewhere else also?

ALSO - is it possible to 'migrate' my old Joomla Article comments to the new K2 Items that I converted? I'm thinking if I did it, it would have to manually... which sucks.

Martha

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

More
14 years 3 months ago #68580 by stavroch
Replied by stavroch on topic JomComment? Jomsocial too
I just upload the "item_comments_form.php" to the "components/com_k2/templates/default/item_comments_form.php" But on the K2 item I can't see the jomcomment component.

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

More
14 years 3 months ago #68581 by stavroch
Replied by stavroch on topic JomComment? Jomsocial too
Hy topmaniac,

I am using K2 v2.2 and I can't see the code that you describe on the view.html.php. How can I integrate JomComment with K2 v2.2?

topmaniac said:Hello i have found a "half solution"
i have edit the file:
/var/www/vhosts/cyber/web/components/com_k2/views/item/view.html.php

and i have comment out this section:
<br/>
//Comments<br/>
if ($item-&gt;params-&gt;get('itemComments')){<br/>
<br/>
$limit=$params-&gt;get('commentsLimit');<br/>
$comments=$model-&gt;getItemComments($item-&gt;id,$limitstart, $limit);<br/>
<br/>
for ($i=0; $i<br/>
<br/>
$comments[$i]-&gt;userImage='';<br/>
<br/>
if ($comments[$i]-&gt;userID &gt; 0){<br/>
<br/>
$profile=$model-&gt;getUserProfile($comments[$i]-&gt;userID);<br/>
<br/>
if ($profile-&gt;image){<br/>
$comments[$i]-&gt;userImage=JURI::root().'media/k2/users/'.$profile-&gt;image;<br/>
}<br/>
else{<br/>
if ($params-&gt;get('userImageDefault')){<br/>
$comments[$i]-&gt;userImage = JURI::root().'media/k2/users/default.jpg';<br/>
}<br/>
}<br/>
<br/>
}<br/>
else {<br/>
<br/>
if ($params-&gt;get('gravatar')){<br/>
$comments[$i]-&gt;userImage='http://www.gravatar.com/avatar/'.md5($comments[$i]-&gt;commentEmail).'?s='.$params-&gt;get('commenterImgWidth').'&amp;default='.urlencode(JURI::root().'media/k2/users/default.jpg');<br/>
}<br/>
<br/>
else {<br/>
if ($params-&gt;get('userImageDefault')){<br/>
$comments[$i]-&gt;userImage = JURI::root().'media/k2/users/default.jpg';<br/>
}<br/>
}<br/>
<br/>
}<br/>
<br/>
}<br/>
<br/>
$item-&gt;comments= $comments;<br/>
<br/>
jimport('joomla.html.pagination');<br/>
$total = $item-&gt;numOfComments;<br/>
$pagination = new JPagination($total, $limitstart, $limit);<br/>
<br/>
}<br/>
and have paste youre code ... but now i have to comments form :P
that means jomcomment can be integrated with no problem ... bzt my problem is.. i am not a php coder... maybe someone can help a bit ... !?

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

More
14 years 3 months ago #68582 by Simon Wells
Replied by Simon Wells on topic JomComment? Jomsocial too
Stavros,

Chances are, you wont see this as you would most likely be using a newer version.

Luckily, I have a JomComment plugin for K2, see the attached.

Simon
K2 Support


Stavros said:Hy topmaniac,
I am using K2 v2.2 and I can't see the code that you describe on the view.html.php. How can I integrate JomComment with K2 v2.2?

topmaniac said:Hello i have found a "half solution" i have edit the file:
/var/www/vhosts/cyber/web/components/com_k2/views/item/view.html.php

and i have comment out this section:
<br/>
//Comments<br/>
if ($item-&gt;params-&gt;get('itemComments')){<br/>
<br/>
$limit=$params-&gt;get('commentsLimit');<br/>
$comments=$model-&gt;getItemComments($item-&gt;id,$limitstart, $limit);<br/>
<br/>
for ($i=0; $i<br/>
<br/>
$comments[$i]-&gt;userImage='';<br/>
<br/>
if ($comments[$i]-&gt;userID &gt; 0){<br/>
<br/>
$profile=$model-&gt;getUserProfile($comments[$i]-&gt;userID);<br/>
<br/>
if ($profile-&gt;image){<br/>
$comments[$i]-&gt;userImage=JURI::root().'media/k2/users/'.$profile-&gt;image;<br/>
}<br/>
else{<br/>
if ($params-&gt;get('userImageDefault')){<br/>
$comments[$i]-&gt;userImage = JURI::root().'media/k2/users/default.jpg';<br/>
}<br/>
}<br/>
<br/>
}<br/>
else {<br/>
<br/>
if ($params-&gt;get('gravatar')){<br/>
$comments[$i]-&gt;userImage='http://www.gravatar.com/avatar/'.md5($comments[$i]-&gt;commentEmail).'?s='.$params-&gt;get('commenterImgWidth').'&amp;default='.urlencode(JURI::root().'media/k2/users/default.jpg');<br/>
}<br/>
<br/>
else {<br/>
if ($params-&gt;get('userImageDefault')){<br/>
$comments[$i]-&gt;userImage = JURI::root().'media/k2/users/default.jpg';<br/>
}<br/>
}<br/>
<br/>
}<br/>
<br/>
}<br/>
<br/>
$item-&gt;comments= $comments;<br/>
<br/>
jimport('joomla.html.pagination');<br/>
$total = $item-&gt;numOfComments;<br/>
$pagination = new JPagination($total, $limitstart, $limit);<br/>
<br/>
}<br/>
and have paste youre code ... but now i have to comments form :P
that means jomcomment can be integrated with no problem ... bzt my problem is.. i am not a php coder... maybe someone can help a bit ... !?
Attachments:

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


Powered by Kunena Forum