/** * Adds a new node. * * @param mixed Array of field => value pairs which define the record. * @param array Array of options for the content being created. * Understands skipTransaction, skipFloodCheck, floodchecktime, skipDupCheck, skipNotification, nl2br, autoparselinks. * - nl2br: if TRUE, all \n will be converted to <br /> so that it's not removed by the html parser (e.g. comments). * - wysiwyg: if true convert html to bbcode. Defaults to true if not given. * * @return integer the new nodeid */ public function add($data, $options = array()) { vB_Api::instanceInternal('hv')->verifyToken($data['hvinput'], 'post'); if (vB_Api::instanceInternal('node')->fetchAlbumChannel() == $data['parentid'] and !vB::getUserContext()->hasPermission('albumpermissions', 'picturefollowforummoderation')) { $data['approved'] = 0; $data['showapproved'] = 0; } return parent::add($data, $options); }
/** * Adds a new node. * * @param array Array of field => value pairs which define the record. * @param array Array of options for the content being created * Understands skipTransaction, skipFloodCheck, floodchecktime, skipDupCheck, skipNotification, nl2br, autoparselinks. * - nl2br: if TRUE, all \n will be converted to <br /> so that it's not removed by the html parser (e.g. comments). * - wysiwyg: if true convert html to bbcode. Defaults to true if not given. * * @return int the new nodeid */ public function add($data, $options = array()) { vB_Api::instanceInternal('hv')->verifyToken($data['hvinput'], 'post'); $result = $this->validateGalleryData($data, $options['filedataid']); if (vB_Api::instanceInternal('node')->fetchAlbumChannel() == $data['parentid'] and !vB::getUserContext()->hasPermission('albumpermissions', 'picturefollowforummoderation')) { $data['approved'] = 0; $data['showapproved'] = 0; } //viewperms can only be 0, 1, or 2 if (!isset($data['viewperms']) or $data['viewperms'] > 2 or $data['viewperms'] < 0) { $data['viewperms'] = 2; } if ($result === true) { return parent::add($data, $options); } else { return $result; } }
/** * Adds a new node. * * @param mixed Array of field => value pairs which define the record. * @param array Array of options for the content being created * Understands skipTransaction, skipFloodCheck, floodchecktime, skipDupCheck, skipNotification, nl2br, autoparselinks. * - nl2br: if TRUE, all \n will be converted to <br /> so that it's not removed by the html parser (e.g. comments). * - wysiwyg: if true convert html to bbcode. Defaults to true if not given. * * @return int the new nodeid */ public function add($data, $options = array()) { vB_Api::instanceInternal('hv')->verifyToken($data['hvinput'], 'post'); return parent::add($data, $options); }