DeutschEnglish

JComments with Gary's Cookbook

In case someone wants to run Gary's Cookbook with the outstanding free of charge Joomla! comments component JComments by Joomlatune and has not found out yet how to do that, here it is:

 

 

JComments comes already with the necessary plugin, so on that side we need to do nothing. Gary's Cookbook on the other hand only works as per default with the in-build comments system. It is, however, quite straight forward to implement JComments in Gary's Cookbook.

In file components/com_garyscookbook/views/category/tmpl/default.php insert at around line 90 right before "if ($ag_showcomment) {"

//Show JComments Count - Begin          
?>
<br />      
<?php
 $comments = JPATH_SITE . DS .'components' . DS . 'com_jcomments' . DS . 'jcomments.php';
 if (file_exists($comments)) {
 require_once($comments);
 $count = JComments::getCommentsCount($row1->id, 'com_garyscookbook');
 echo $count ? ('Comments('. $count . ')') : 'No comments yet';
 }
// JComments Count End

to show the comments count in category view. You may of course pimp that code according to your needs and with the help of other snippets providing for things like last comment author, time, etc.

To show the actual comments form in recipe details view insert in file components/com_garyscookbook/views/detail/viewdetails.php at around line 218 again right before "if ($ag_showcomment) {" the following:

$comments = JPATH_SITE . DS .'components' . DS . 'com_jcomments' . DS . 'jcomments.php';
 if (file_exists($comments)) {
 require_once($comments);
 echo JComments::showComments($id, 'com_garyscookbook', $title);
 }

 

You may send a trackback for this article by using the following Trackback link

Add comment


Security code
Refresh

Latest Comments

New Links

International Federation
Parliamentarians for Glob
Arutz Sheva - Israel Nati
Africa Check

More...  

Banner
Copyright © 2014 VAGGI.( DE | EU ). All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.
Template by RocketTheme Suchmaschinenoptimierung mit Ranking-Hits

This material is Open Content   Stop Spam Harvesters, Join Project Honey Pot   Creative Commons Attribution 3.0 Unported License   My-African-News.com   Jinja.eu - Home of the Source of River Nile - The East African Community Website   Vaggi.org_NGO-Directory/NRO-Verzeichnis_Sozialwissenschaftliche_OpenAccess_Zeitschriften/Social_Scientific_OpenAccess_e-Journals
Protected by Bot-Trap.de, Webseitenschutz
subdued