By Guest on Thursday, 09 March 2017
Replies 10
Likes 0
Views 1.3K
Votes 0
Hi experts,

I'd like to put some php code to my icalevent.detail_body

...but I configured it with the layout-editor

where do I find the php file?

regards,
Berndi
Okay okay... I made a template override of the icalevent/detail_body.php

The only thing I am looking for is the code snippet for the jcomment_plugin.
·
Thursday, 09 March 2017 19:20
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello,

What PHP code exactly? You could use a plugin to insert PHP.

You can use:https://www.jevents.net/products-new/addons/free-addons/item/jcomments-plugin-2

Then the code snippet is shown in the layout editor.

Many thanks
Tony
·
Thursday, 09 March 2017 21:35
·
0 Likes
·
0 Votes
·
0 Comments
·
I dont think that I simple can put {{JComments:JEV_JCOMMENTS_ENABLE}} into my template override...

It isn't that easy.

This is the code I wrote to the icaevent/detail_body.php (override)

$user =& JFactory::getUser();
$user_ag = $user->getAuthorisedGroups();

$row=$this->data['row'];
$catid = $row->_catid;

$show_jcomments = (in_array('15', $user_ag) AND ($catid == "113" OR $catid == "119")) ? true : false;
$show_jcomments = (in_array('7', $user_ag) OR in_array('8', $user_ag)) ? true : false;

echo ($show_jcomments == true) ? "<div class='tgs_row jcomments'>" . $jcomments_code . "</div>" : "";


...and I'm lookicg for $jcomments_code.

regards, Berndi
·
Friday, 10 March 2017 01:59
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello,

So is the template override only used to have conditional php code to show jcomments?

Many thanks
Tony
·
Friday, 10 March 2017 07:07
·
0 Likes
·
0 Votes
·
0 Comments
·
Alternative approach.
1. Set the jcomments plugin access level to only allow the relevant groups
2. Use the JEvents layout editor to create category specific layouts to include the JComments code.

No need for any coding or template overrides.
·
Friday, 10 March 2017 08:56
·
0 Likes
·
0 Votes
·
0 Comments
·
The Problem is, that I want to handle the rights to comment events in a special way...

For example:
Usergroup 1 is able to comment category 1 and 2
Usergroup 2 is able to comment category 3 and 4
Usergroup 3 is able to comment all of them

...and so on ...

When I set the jcomments plugin access level to only allow one relevant group, they are able to comment all categories, where the JComments box appears.
·
Friday, 10 March 2017 12:12
·
0 Likes
·
0 Votes
·
0 Comments
·
Are these comments to be viewed by other users? We do have a special field type (user notes) in the custom fields addon that MAY be able to do what you need. But its not a full commenting system, more of a way for authorised users to add notes to an event.
·
Monday, 13 March 2017 09:27
·
0 Likes
·
0 Votes
·
0 Comments
·
Comments from Usergroup1 should be seen only by Usergroup 1, ...

and so on
·
Monday, 13 March 2017 11:08
·
0 Likes
·
0 Votes
·
0 Comments
·
just created a notes field but it won't appear in the custom fields list at the layout editor
·
Monday, 13 March 2017 12:19
·
0 Likes
·
0 Votes
·
0 Comments
·
The notes field is output during the event creation process - what you need is the updatable field which is visible to event editors and can be updated by them when viewing the event.

I could extend this to allow certain usergroups to update the field content.
·
Monday, 13 March 2017 14:41
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post