| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- <?php
- /**
- * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * CC-BY License - http://creativecommons.org/licenses/by/3.0/
- *
- * @defgroup DolphinCore Samples
- * @{
- */
- /**
- * @page samples
- * @section comments Comments
- */
- /**
- * DB Queries.
- INSERT INTO `sys_objects_cmts` (`ID`, `Name`, `TableCmts`, `TableTrack`, `CharsPostMin`, `CharsPostMax`, `CharsDisplayMax`, `Nl2br`, `PerView`, `PerViewReplies`, `BrowseType`, `IsBrowseSwitch`, `PostFormPosition`, `NumberOfLevels`, `IsDisplaySwitch`, `IsRatable`, `ViewingThreshold`, `IsOn`, `RootStylePrefix`, `BaseUrl`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldTitle`, `TriggerFieldComments`, `ClassName`, `ClassFile`) VALUES
- (1, 'sample', 'sample_cmts', 'sample_cmts_track', 1, 5000, 1000, 1, 5, 3, 'tail', 1, 'bottom', 1, 1, 1, -3, 1, 'cmt', 'samples/comments.php', 'sample_cmts_trigger', 'id', 'title', 'comments', '', '');
- CREATE TABLE IF NOT EXISTS `sample_cmts` (
- `cmt_id` int(11) NOT NULL AUTO_INCREMENT,
- `cmt_parent_id` int(11) NOT NULL DEFAULT '0',
- `cmt_vparent_id` int(11) NOT NULL DEFAULT '0',
- `cmt_object_id` int(11) NOT NULL DEFAULT '0',
- `cmt_author_id` int(10) unsigned NOT NULL DEFAULT '0',
- `cmt_level` int(11) NOT NULL DEFAULT '0',
- `cmt_text` text NOT NULL,
- `cmt_rate` int(11) NOT NULL DEFAULT '0',
- `cmt_rate_count` int(11) NOT NULL DEFAULT '0',
- `cmt_time` int(11) unsigned NOT NULL DEFAULT '0',
- `cmt_replies` int(11) NOT NULL DEFAULT '0',
- PRIMARY KEY (`cmt_id`),
- KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`)
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
- CREATE TABLE IF NOT EXISTS `sample_cmts_track` (
- `cmt_system_id` int(11) NOT NULL DEFAULT '0',
- `cmt_id` int(11) NOT NULL DEFAULT '0',
- `cmt_rate` tinyint(4) NOT NULL DEFAULT '0',
- `cmt_rate_author_id` int(10) unsigned NOT NULL DEFAULT '0',
- `cmt_rate_author_nip` int(11) unsigned NOT NULL DEFAULT '0',
- `cmt_rate_ts` int(11) NOT NULL DEFAULT '0',
- PRIMARY KEY (`cmt_system_id`,`cmt_id`,`cmt_rate_author_nip`)
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
- CREATE TABLE IF NOT EXISTS `sample_cmts_trigger` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `title` varchar(64) NOT NULL DEFAULT '0',
- `comments` int(11) NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
- INSERT INTO `sample_cmts_trigger` (`id`, `title`, `comments`) VALUES
- (1, 'Sample Comments', 0);
- */
- $aPathInfo = pathinfo(__FILE__);
- require_once ($aPathInfo['dirname'] . '/../inc/header.inc.php');
- require_once(BX_DIRECTORY_PATH_INC . "params.inc.php");
- require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");
- bx_import('BxDolAcl');
- bx_import('BxDolLanguages');
- bx_import('BxTemplFunctions');
- $oTemplate = BxDolTemplate::getInstance();
- $oTemplate->setPageNameIndex (BX_PAGE_DEFAULT);
- $oTemplate->setPageHeader ('Comments');
- $oTemplate->setPageContent ('page_main_code', PageCompMainCode());
- $oTemplate->getPageCode();
- /**
- * page code function
- */
- function PageCompMainCode() {
- $iObjectId = 1;
- bx_import('BxTemplCmtsView');
- $oCmts = new BxTemplCmtsView('sample', $iObjectId);
- if(!$oCmts->isEnabled())
- return '';
- return DesignBoxContent("Comments", $oCmts->getCommentsBlock(), BX_DB_PADDING_DEF);
- }
- /** @} */
|