30 public function loadNews($iFrom = 0, $iLimit = 10)
36 $sNewsViewName = getViewName(
'oxnews');
38 $sSelectFields = $oBaseObject->getSelectFields();
40 if ($oUser = $this->
getUser()) {
42 $sSelect =
"select $sSelectFields from $sNewsViewName ";
43 $sSelect .=
"left join oxobject2group on oxobject2group.oxobjectid=$sNewsViewName.oxid where ";
44 $sSelect .=
"oxobject2group.oxgroupsid in ( select oxgroupsid from oxobject2group where oxobjectid='" . $oUser->getId() .
"' ) or ";
45 $sSelect .=
"( oxobject2group.oxgroupsid is null ) ";
47 $sSelect =
"select $sSelectFields, oxobject2group.oxgroupsid from $sNewsViewName ";
48 $sSelect .=
"left join oxobject2group on oxobject2group.oxobjectid=$sNewsViewName.oxid where oxobject2group.oxgroupsid is null ";
51 $sSelect .=
" and " . $oBaseObject->getSqlActiveSnippet();
52 $sSelect .=
" and $sNewsViewName.oxshortdesc <> '' ";
53 $sSelect .=
" group by $sNewsViewName.oxid order by $sNewsViewName.oxdate desc ";
68 $sNewsViewName = getViewName(
'oxnews');
72 if ($oUser = $this->
getUser()) {
74 $sSelect =
"select COUNT($sNewsViewName.`oxid`) from $sNewsViewName ";
75 $sSelect .=
"left join oxobject2group on oxobject2group.oxobjectid=$sNewsViewName.oxid where ";
76 $sSelect .=
"oxobject2group.oxgroupsid in ( select oxgroupsid from oxobject2group where oxobjectid='" . $oUser->getId() .
"' ) or ";
77 $sSelect .=
"( oxobject2group.oxgroupsid is null ) ";
79 $sSelect =
"select COUNT($sNewsViewName.`oxid`) from $sNewsViewName ";
80 $sSelect .=
"left join oxobject2group on oxobject2group.oxobjectid=$sNewsViewName.oxid where oxobject2group.oxgroupsid is null ";
83 $sSelect .=
" and " . $oBaseObject->getSqlActiveSnippet();
86 $iRecCnt = (int) $oDb->getOne($sSelect);
98 $this->_oUser = $oUser;
108 if ($this->_oUser == null) {