32 $this->
init(
'oxgbentries' );
47 if ( isset( $this->oxgbentries__oxuserid ) && $this->oxgbentries__oxuserid->value ) {
49 $this->oxuser__oxfname =
new oxField( $oDb->getOne(
"select oxfname from oxuser where oxid=".$oDb->quote( $this->oxgbentries__oxuserid->value ) ));
63 $this->oxgbentries__oxcreate =
new oxField( date(
'Y-m-d H:i:s',
oxRegistry::get(
"oxUtilsDate")->getTime() ));
81 $sSelect =
'select oxgbentries.*, oxuser.oxfname,
82 `oxuser`.`oxusername` AS `author`, `oxgbentries`.`oxcreate` AS `date`
83 from oxgbentries left join oxuser on oxgbentries.oxuserid = oxuser.oxid ';
84 $sSelect .=
'where oxuser.oxid is not null and oxgbentries.oxshopid = "'.$myConfig->getShopId().
'" ';
87 if (
$myConfig->getConfigParam(
'blGBModerate') ) {
89 $sSelect .=
" and ( oxgbentries.oxactive = '1' ";
90 $sSelect .= $oUser?
" or oxgbentries.oxuserid = " .
oxDb::getDb()->quote( $oUser->getId() ) :
'';
96 $sSelect .=
"order by $sSortBy ";
100 $oEntries =
oxNew(
'oxlist' );
101 $oEntries->init(
'oxgbentry' );
103 $oEntries->setSqlLimit( $iStart, $iNrofCatArticles );
104 $oEntries->selectString( $sSelect );
120 $sSelect =
'select count(*) from oxgbentries left join oxuser on oxgbentries.oxuserid = oxuser.oxid ';
121 $sSelect .=
'where oxuser.oxid is not null and oxgbentries.oxshopid = "'.$myConfig->getShopId().
'" ';
124 if (
$myConfig->getConfigParam(
'blGBModerate') ) {
126 $sSelect .=
" and ( oxgbentries.oxactive = '1' ";
127 $sSelect .= $oUser?
" or oxgbentries.oxuserid = ".$oDb->quote( $oUser->getId() ):
'';
132 $iRecCnt = (int) $oDb->getOne( $sSelect );
149 if ( $sUserId && $sShopid) {
151 $sToday = date(
'Y-m-d' );
152 $sSelect =
"select count(*) from oxgbentries ";
153 $sSelect .=
"where oxgbentries.oxuserid = " . $oDb->quote( $sUserId ) .
" and oxgbentries.oxshopid = " . $oDb->quote( $sShopid ) .
" ";
154 $sSelect .=
"and oxgbentries.oxcreate >= '$sToday 00:00:00' and oxgbentries.oxcreate <= '$sToday 23:59:59' ";
155 $iCnt = $oDb->getOne( $sSelect );
158 if ( ( !
$myConfig->getConfigParam(
'iMaxGBEntriesPerDay' ) ) || ( $iCnt < $myConfig->getConfigParam(
'iMaxGBEntriesPerDay' ) ) ) {