33 $this->
init(
'oxgbentries');
48 if (isset($this->oxgbentries__oxuserid) && $this->oxgbentries__oxuserid->value) {
50 $this->oxuser__oxfname =
new oxField($oDb->getOne(
"select oxfname from oxuser where oxid=" . $oDb->quote($this->oxgbentries__oxuserid->value)));
64 $this->oxgbentries__oxcreate =
new oxField(date(
'Y-m-d H:i:s',
oxRegistry::get(
"oxUtilsDate")->getTime()));
83 $sSelect =
'select oxgbentries.*, oxuser.oxfname,
84 `oxuser`.`oxusername` AS `author`, `oxgbentries`.`oxcreate` AS `date`
85 from oxgbentries left join oxuser on oxgbentries.oxuserid = oxuser.oxid ';
86 $sSelect .=
'where oxuser.oxid is not null and oxgbentries.oxshopid = "' .
$myConfig->getShopId() .
'" ';
89 if (
$myConfig->getConfigParam(
'blGBModerate')) {
91 $sSelect .=
" and ( oxgbentries.oxactive = '1' ";
92 $sSelect .= $oUser ?
" or oxgbentries.oxuserid = " .
oxDb::getDb()->quote($oUser->getId()) :
'';
98 $sSelect .=
"order by $sSortBy ";
102 $oEntries =
oxNew(
'oxlist');
103 $oEntries->init(
'oxgbentry');
105 $oEntries->setSqlLimit($iStart, $iNrofCatArticles);
106 $oEntries->selectString($sSelect);
122 $sSelect =
'select count(*) from oxgbentries left join oxuser on oxgbentries.oxuserid = oxuser.oxid ';
123 $sSelect .=
'where oxuser.oxid is not null and oxgbentries.oxshopid = "' .
$myConfig->getShopId() .
'" ';
126 if (
$myConfig->getConfigParam(
'blGBModerate')) {
128 $sSelect .=
" and ( oxgbentries.oxactive = '1' ";
129 $sSelect .= $oUser ?
" or oxgbentries.oxuserid = " . $oDb->quote($oUser->getId()) :
'';
134 $iRecCnt = (int) $oDb->getOne($sSelect);
152 if ($sUserId && $sShopid) {
154 $sToday = date(
'Y-m-d');
155 $sSelect =
"select count(*) from oxgbentries ";
156 $sSelect .=
"where oxgbentries.oxuserid = " . $oDb->quote($sUserId) .
" and oxgbentries.oxshopid = " . $oDb->quote($sShopid) .
" ";
157 $sSelect .=
"and oxgbentries.oxcreate >= '$sToday 00:00:00' and oxgbentries.oxcreate <= '$sToday 23:59:59' ";
158 $iCnt = $oDb->getOne($sSelect);
161 if ((!
$myConfig->getConfigParam(
'iMaxGBEntriesPerDay')) || ($iCnt < $myConfig->getConfigParam(
'iMaxGBEntriesPerDay'))) {