Code Convention
How UNA 15 PHP names classes, variables, SQL placeholders, CSRF tokens, and singletons. <?php defined('BX_DOL') or die('hack attempt');
/**
* Copyright (c) UNA, Inc - https://una.io
* MIT License - https://opensource.org/licenses/MIT
*
* @defgroup Posts Posts
* @ingroup UnaModules
*
* @{
*/
public function serviceCheckAllowedCommentsPost($iContentId, $sObjectComments)
{
$CNF = &$this->_oConfig->CNF;
$aContentInfo = $this->_oDb->getContentInfoById($iContentId);
if ($aContentInfo && $aContentInfo[$CNF['FIELD_ALLOW_COMMENTS']] == 0)
return false;
return parent::serviceCheckAllowedCommentsPost($iContentId, $sObjectComments);
}
class BxDolDb extends BxDolFactory implements iBxDolSingleton
{
protected function __construct($aDbConf = false)
{
if (isset($GLOBALS['bxDolClasses'][get_class($this)]))
trigger_error ('Multiple instances are not allowed for the class: ' . get_class($this), E_USER_ERROR);
$aBindings = array(
'author' => $iAuthorId
);
$CNF = &$this->_oConfig->CNF;
return $this->getRow("SELECT COUNT(id) AS count, SUM(views) AS views, SUM(votes) AS votes, SUM(rvotes) AS rvotes FROM `" . $CNF['TABLE_ENTRIES'] . "` WHERE `author`=:author", $aBindings);
$sQuery = $this->prepare("SELECT `name` FROM `sys_options` WHERE `name` = ? LIMIT 1", $sKey);
return $this->getOne($sQuery) == $sKey;
$this->aInputs['csrf_token'] = array(
'type' => 'hidden',
'name' => 'csrf_token',
'value' => $mixedCsrfToken,
'db' => array ('pass' => 'Xss'),
'visible_for_levels' => PHP_INT_MAX,
);
class BxDolDb extends BxDolFactory implements iBxDolSingleton
{
public static function getInstance()
{
$null = null;
return self::getInstanceWithConf(false, $null);
}
}
18d