15 array(
'oxtitle',
'oxcategories', 1, 1, 0),
16 array(
'oxdesc',
'oxcategories', 1, 1, 0),
17 array(
'oxid',
'oxcategories', 0, 0, 0),
18 array(
'oxid',
'oxcategories', 0, 0, 1)
20 'container2' => array(
21 array(
'oxtitle',
'oxcategories', 1, 1, 0),
22 array(
'oxdesc',
'oxcategories', 1, 1, 0),
23 array(
'oxid',
'oxcategories', 0, 0, 0),
24 array(
'oxid',
'oxobject2category', 0, 0, 1),
25 array(
'oxtime',
'oxobject2category', 0, 0, 1),
26 array(
'oxid',
'oxcategories', 0, 0, 1)
46 $sQAdd =
" from $sO2CView left join $sCategoriesTable on $sCategoriesTable.oxid=$sO2CView.oxcatnid ";
47 $sQAdd .=
" where $sO2CView.oxobjectid = " . $oDb->quote($sOxid)
48 .
" and $sCategoriesTable.oxid is not null ";
50 $sQAdd =
" from $sCategoriesTable where $sCategoriesTable.oxid not in ( ";
51 $sQAdd .=
" select $sCategoriesTable.oxid from $sO2CView "
52 .
"left join $sCategoriesTable on $sCategoriesTable.oxid=$sO2CView.oxcatnid ";
53 $sQAdd .=
" where $sO2CView.oxobjectid = " . $oDb->quote($sSynchOxid)
54 .
" and $sCategoriesTable.oxid is not null ) and $sCategoriesTable.oxpriceto = '0'";
70 if (
oxRegistry::getConfig()->getRequestParameter(
'oxid') && is_array($aDataFields) && count($aDataFields)) {
76 while (list($iPos, $aField) = each($aDataFields)) {
79 if ($aField[
'_3'] ==
'0') {
85 $iMinVal = $aField[
'_3'];
87 } elseif ($iMinVal > $aField[
'_3']) {
93 if (isset($iMinPos)) {
94 $aDataFields[$iMinPos][
'_3'] =
'0';
115 $sCategoriesTable = $this->
_getViewName(
'oxcategories');
120 if (is_array($aRemoveCat) && count($aRemoveCat)) {
122 $sQ =
"delete from oxobject2category where oxobject2category.oxobjectid= "
124 $sQ .=
" oxcatnid in (" . implode(
', ',
oxDb::getInstance()->quoteArray($aRemoveCat)) .
')';
150 $sCategoriesTable = $this->
_getViewName(
'oxcategories');
154 if (isset($aAddCat) && is_array($aAddCat)) {
158 $oNew =
oxNew(
'oxobject2category');
161 foreach ($aAddCat as $sAdd) {
163 $sSelect =
"select 1 from " . $sO2CView .
" as oxobject2category where oxobject2category.oxcatnid= "
164 . $oDb->quote($sAdd) .
" and oxobject2category.oxobjectid = " . $oDb->quote($soxId) .
" ";
165 if ($oDb->getOne($sSelect,
false,
false)) {
169 $oNew->setId(md5($soxId . $sAdd . $sShopID));
170 $oNew->oxobject2category__oxobjectid =
new oxField($soxId);
171 $oNew->oxobject2category__oxcatnid =
new oxField($sAdd);
172 $oNew->oxobject2category__oxtime =
new oxField(time());
194 $soxId = $oDb->quote($soxId);
195 $sSqlShopFilter =
"";
197 $sQ =
"update oxobject2category set oxtime = 0 where oxobjectid = {$soxId} {$sSqlShopFilter} and oxid = (
199 select oxid from {$sO2CView} where oxobjectid = {$soxId} {$sSqlShopFilter}
200 order by oxtime limit 1
215 $sQuotedOxId = $oDb->quote($soxId);
216 $sQuotedDefCat = $oDb->quote($sDefCat);
218 $sSqlShopFilter =
"";
221 $sQ =
"update oxobject2category set oxtime = oxtime + 10 where oxobjectid = {$sQuotedOxId} {$sSqlShopFilter}";
225 $sQ =
"update oxobject2category set oxtime = 0 where oxobjectid = {$sQuotedOxId} " .
226 "and oxcatnid = {$sQuotedDefCat} {$sSqlShopFilter}";
231 oxRegistry::get(
"oxSeoEncoder")->markAsExpired($soxId, null, 1, null,
"oxtype='oxarticle'");