Thanks for your reply
Here is the error message
Parse error: syntax error, unexpected 'key' (T_STRING) in /var/www/clients/client0/web18/web/components/com_competition/views/competition/view.html.php on line 429
{JFBCComments key=1234} is on the last line
<?php
/**
* @package Norr_Competition
* @author Dmitry Rekun <This email address is being protected from spambots. You need JavaScript enabled to view it.>
* @copyright Copyright (C) 2015 - 2016 NorrNext. All rights reserved.
* @license GNU General Public License version 3 or later; see license.txt
*/
defined('_JEXEC') or die;
/**
* View class for the category
*
* @since 1.0
*/
class CompetitionViewCompetition extends CompetitionView
{
/**
* The participants
*
* @var array
* @since 1.0
*/
protected $items;
/**
* The pagination
*
* @var JPagination
* @since 1.0
*/
protected $pagination;
/**
* The state of model
*
* @var object
* @since 1.0
*/
protected $state;
/**
* The competition
*
* @var object
* @since 1.0
*/
protected $competition;
/**
* The custom fields
*
* @var CompetitionFields
* @since 1.0
*/
protected $fields;
/**
* The grand prix participant
*
* @var object
* @since 1.0
*/
protected $grandPrixParticipant;
/**
* The participants with highest rating
*
* @var array
* @since 1.0
*/
protected $highestRatingItems;
/**
* The voting is allowed or not
*
* @var boolean
* @since 1.0
*/
protected $votingAllowed;
/**
* Display the view
*
* @param string $tpl The name of the template file to parse
*
* @return void
*
* @since 1.0
*/
public function display($tpl = null)
{
$app = JFactory::getApplication();
$model = $this->getModel();
try
{
$this->competition = $model->getCompetition();
$this->state = $model->getState();
$this->items = $model->getItems();
$this->pagination = $model->getPagination();
// Check for errors (legacy method)
if (count($errors = $this->get('Errors')))
{
$app->enqueueMessage(
JText::_('COM_COMPETITION_ERROR_OCCURRED'),
'error'
);
JLog::add(implode("\n", $errors), JLog::ERROR, 'com_competition');
return;
}
// Active competition
if ($this->competition->status == 1)
{
// Rating is enabled and allowed
$this->votingAllowed = $model->isVotingAllowed();
}
// Closed competition
if ($this->competition->status == 0)
{
$this->grandPrixParticipant = $model->getGrandPrixParticipant();
$this->highestRatingItems = $model->getHighestRatingParticipants();
$this->fields = new CompetitionFields;
$this->setLayout($this->getName() . '_result');
}
$this->prepareDocument($this->competition->title, $this->competition);
JPluginHelper::importPlugin('competition');
$app->triggerEvent('onCompetitionDisplay', array('com_competition.competition', $this->competition));
parent::display($tpl);
}
catch (Exception $e)
{
$app->enqueueMessage(
JText::_('COM_COMPETITION_ERROR_OCCURRED'),
'error'
);
JLog::add($e->getMessage(), JLog::ERROR, 'com_competition');
return;
}
}
/**
* Method to prepare the document
*
* @param string $defPageTitle The default page title
* @param object $item The item with metadata
*
* @return void
*
* @since 1.0
*/
protected function prepareDocument($defPageTitle = '', $item = null)
{
// Set breadcrumbs and titles
$app = JFactory::getApplication();
$menu = $app->getMenu()->getActive();
$id = (int) @$menu->query;
// If no menu item or the menu item does not concern this competition
if (!$menu || ($menu
&& $menu->query != 'com_competition'
|| $menu->query != 'competition'
|| $id != $this->competition->id))
{
$app->getPathway()->addItem(
$this->competition->title,
CompetitionHelperRoute::getCompetitionRoute($this->competition->id . ':' . $this->competition->alias)
);
}
parent::prepareDocument($defPageTitle, $item);
$this->setOpenGraphData();
}
/**
* Method to set the Open Graph data to the page
*
* @param object $ogObject The object with og data
* @param array $options The array of additional options like Twitter card types
*
* @return void
*
* @since 1.1
* @throws InvalidArgumentException
*/
protected function setOpenGraphData($ogObject = null, array $options = array())
{
$image = $this->competition->getParams()->get('competition_image', '');
$ogObject = new stdClass;
$ogObject->title = $this->competition->title;
$ogObject->image = !empty($image) ? JUri::base() . $image : '';
$ogObject->description = !empty($this->competition->metadesc) ? $this->competition->metadesc : $this->competition->description;
parent::setOpenGraphData($ogObject);
}
}
{
JPluginHelper::importPlugin('content');
$share = plgContentBt_socialshare::socialButtons();
echo $share; // Required
echo $share; // Social button
echo $share; // Recommendation bar
echo $share; // facebook comment box
}
{JFBCComments key=1234}