34 $this->
init(
'oxgbentries');
49 if (isset($this->oxgbentries__oxuserid) && $this->oxgbentries__oxuserid->value) {
51 $this->oxuser__oxfname =
new oxField($oDb->getOne(
"select oxfname from oxuser where oxid=" . $oDb->quote($this->oxgbentries__oxuserid->value)));
65 $this->oxgbentries__oxcreate =
new oxField(date(
'Y-m-d H:i:s',
oxRegistry::get(
"oxUtilsDate")->getTime()));
84 $sSelect =
'select oxgbentries.*, oxuser.oxfname,
85 `oxuser`.`oxusername` AS `author`, `oxgbentries`.`oxcreate` AS `date`
86 from oxgbentries left join oxuser on oxgbentries.oxuserid = oxuser.oxid ';
87 $sSelect .=
'where oxuser.oxid is not null and oxgbentries.oxshopid = "' .
$myConfig->getShopId() .
'" ';
90 if (
$myConfig->getConfigParam(
'blGBModerate')) {
92 $sSelect .=
" and ( oxgbentries.oxactive = '1' ";
93 $sSelect .= $oUser ?
" or oxgbentries.oxuserid = " .
oxDb::getDb()->quote($oUser->getId()) :
'';
99 $sSelect .=
"order by $sSortBy ";
103 $oEntries =
oxNew(
'oxlist');
104 $oEntries->init(
'oxgbentry');
106 $oEntries->setSqlLimit($iStart, $iNrofCatArticles);
107 $oEntries->selectString($sSelect);
123 $sSelect =
'select count(*) from oxgbentries left join oxuser on oxgbentries.oxuserid = oxuser.oxid ';
124 $sSelect .=
'where oxuser.oxid is not null and oxgbentries.oxshopid = "' .
$myConfig->getShopId() .
'" ';
127 if (
$myConfig->getConfigParam(
'blGBModerate')) {
129 $sSelect .=
" and ( oxgbentries.oxactive = '1' ";
130 $sSelect .= $oUser ?
" or oxgbentries.oxuserid = " . $oDb->quote($oUser->getId()) :
'';
135 $iRecCnt = (int) $oDb->getOne($sSelect);
153 if ($sUserId && $sShopid) {
155 $sToday = date(
'Y-m-d');
156 $sSelect =
"select count(*) from oxgbentries ";
157 $sSelect .=
"where oxgbentries.oxuserid = " . $oDb->quote($sUserId) .
" and oxgbentries.oxshopid = " . $oDb->quote($sShopid) .
" ";
158 $sSelect .=
"and oxgbentries.oxcreate >= '$sToday 00:00:00' and oxgbentries.oxcreate <= '$sToday 23:59:59' ";
159 $iCnt = $oDb->getOne($sSelect);
162 if ((!
$myConfig->getConfigParam(
'iMaxGBEntriesPerDay')) || ($iCnt < $myConfig->getConfigParam(
'iMaxGBEntriesPerDay'))) {