Index: trunk/core/kernel/db/db_tag_processor.php =================================================================== diff -u -N -r3597 -r3635 --- trunk/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 3597) +++ trunk/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 3635) @@ -177,7 +177,7 @@ $names_mapping = $this->Application->GetVar('NamesToSpecialMapping'); - if( !getArrayValue($names_mapping,$list_name) ) + if( !getArrayValue($names_mapping, $this->Prefix, $list_name) ) { $list =& $this->GetList($params); } @@ -205,7 +205,7 @@ if ($list_name && !$requery){ $names_mapping = $this->Application->GetVar('NamesToSpecialMapping'); - $special = getArrayValue($names_mapping, $list_name); + $special = getArrayValue($names_mapping, $this->Prefix, $list_name); if(!$special) { $special = $this->BuildListSpecial($params); @@ -218,15 +218,15 @@ $prefix_special = rtrim($this->Prefix.'.'.$special, '.'); $params['skip_counting'] = true; - $list =& $this->Application->recallObject( $prefix_special, $this->Prefix.'_List',$params); + $list =& $this->Application->recallObject( $prefix_special, $this->Prefix.'_List', $params); if ($requery) { $this->Application->HandleEvent($an_event, $prefix_special.':OnListBuild', $params); } $list->Query($requery); $this->Special = $special; if ($list_name) { - $names_mapping[$list_name] = $special; + $names_mapping[$this->Prefix][$list_name] = $special; $this->Application->SetVar('NamesToSpecialMapping', $names_mapping); } Index: trunk/kernel/units/general/cat_event_handler.php =================================================================== diff -u -N -r3629 -r3635 --- trunk/kernel/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 3629) +++ trunk/kernel/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 3635) @@ -151,14 +151,151 @@ } /** - * Apply scope clause + * Return type clauses for list bulding on front * * @param kEvent $event + * @return Array */ + function getTypeClauses(&$event) + { + $types = $event->getEventParam('types'); + $except_types = $event->getEventParam('except'); + $type_clauses = Array(); + + $type_clauses['pick']['include'] = '%1$s.EditorsPick = 1 AND '.TABLE_PREFIX.'CategoryItems.PrimaryCat = 1'; + $type_clauses['pick']['except'] = '%1$s.EditorsPick! = 1 AND '.TABLE_PREFIX.'CategoryItems.PrimaryCat = 1'; + $type_clauses['pick']['having_filter'] = false; + + $type_clauses['hot']['include'] = '`IsHot` = 1 AND PrimaryCat = 1'; + $type_clauses['hot']['except'] = '`IsHot`! = 1 AND PrimaryCat = 1'; + $type_clauses['hot']['having_filter'] = true; + + $type_clauses['pop']['include'] = '`IsPop` = 1 AND PrimaryCat = 1'; + $type_clauses['pop']['except'] = '`IsPop`! = 1 AND PrimaryCat = 1'; + $type_clauses['pop']['having_filter'] = true; + + $type_clauses['new']['include'] = '`IsNew` = 1 AND PrimaryCat = 1'; + $type_clauses['new']['except'] = '`IsNew`! = 1 AND PrimaryCat = 1'; + $type_clauses['new']['having_filter'] = true; + + $type_clauses['displayed']['include'] = ''; + $displayed = $this->Application->GetVar($event->Prefix.'_displayed_ids'); + if ($displayed) { + $id_field = $this->Application->getUnitOption($event->Prefix, 'IDField'); + $type_clauses['displayed']['except'] = '%1$s.'.$id_field.' NOT IN ('.$displayed.')'; + } + else { + $type_clauses['displayed']['except'] = ''; + } + $type_clauses['displayed']['having_filter'] = false; + + if (strpos($types, 'search') !== false || strpos($except_types, 'search') !== false) { + $event_mapping = Array( + 'simple' => 'OnSimpleSearch', + 'subsearch' => 'OnSubSearch', + 'advanced' => 'OnAdvancedSearch'); + if($this->Application->GetVar('INPORTAL_ON') && $this->Application->GetVar('Action') == 'm_simple_subsearch') + { + $type = 'subsearch'; + } + else + { + $type = $this->Application->GetVar('search_type') ? $this->Application->GetVar('search_type') : 'simple'; + } + + if($keywords = $event->getEventParam('keyword_string')) // processing keyword_string param of ListProducts tag + { + $this->Application->SetVar('keywords', $keywords); + $type = 'simple'; + } + $search_event = $event_mapping[$type]; + $this->$search_event($event); + $search_table = TABLE_PREFIX.'ses_'.$this->Application->GetSID().'_'.TABLE_PREFIX.'Search'; + $sql = 'SHOW TABLES LIKE "'.$search_table.'"'; + if ( $this->Conn->Query($sql) ) { + $search_res_ids = $this->Conn->GetCol('SELECT ResourceId FROM '.$search_table); + } + + if ($search_res_ids) { + $type_clauses['search']['include'] = '%1$s.ResourceId IN ('.implode(',', $search_res_ids).') AND PrimaryCat = 1'; + $type_clauses['search']['except'] = '%1$s.ResourceId NOT IN ('.implode(',', $search_res_ids).') AND PrimaryCat = 1'; + } + else { + $type_clauses['search']['include'] = '0'; + $type_clauses['search']['except'] = '1'; + } + $type_clauses['search']['having_filter'] = false; + } + + if (strpos($types, 'related') !== false || strpos($except_types, 'related') !== false) { + + $related_to = $event->getEventParam('related_to'); + if (!$related_to) { + $related_prefix = $event->Prefix; + } + else { + $sql = 'SELECT Prefix + FROM '.TABLE_PREFIX.'ItemTypes + WHERE ItemName = '.$this->Conn->qstr($related_to); + $related_prefix = $this->Conn->GetOne($sql); + } + + $rel_table = $this->Application->getUnitOption('rel', 'TableName'); + $item_type = $this->Application->getUnitOption($event->Prefix, 'ItemType'); + + $p_item = $this->Application->recallObject($related_prefix.'.current', null, Array('skip_autoload' => true)); + $p_item->Load( $this->Application->GetVar($related_prefix.'_id') ); + + $p_resource_id = $p_item->GetDBField('ResourceId'); + + $sql = 'SELECT SourceId, TargetId FROM '.$rel_table.' + WHERE + (Enabled = 1) + AND ( + (Type = 0 AND SourceId = '.$p_resource_id.' AND TargetType = '.$item_type.') + OR + (Type = 1 + AND ( + (SourceId = '.$p_resource_id.' AND TargetType = '.$item_type.') + OR + (TargetId = '.$p_resource_id.' AND SourceType = '.$item_type.') + ) + ) + )'; + + $related_ids_array = $this->Conn->Query($sql); + $related_ids = Array(); + + foreach ($related_ids_array as $key => $record) { + $related_ids[] = $record[ $record['SourceId'] == $p_resource_id ? 'TargetId' : 'SourceId' ]; + } + + if (count($related_ids) > 0) { + $type_clauses['related']['include'] = '%1$s.ResourceId IN ('.implode(',', $related_ids).') AND PrimaryCat = 1'; + $type_clauses['related']['except'] = '%1$s.ResourceId NOT IN ('.implode(',', $related_ids).') AND PrimaryCat = 1'; + } + else { + $type_clauses['related']['include'] = '0'; + $type_clauses['related']['except'] = '1'; + } + $type_clauses['related']['having_filter'] = false; + } + + return $type_clauses; + } + + /** + * Apply filters to list + * + * @param kEvent $event + */ function SetCustomQuery(&$event) { + parent::SetCustomQuery($event); + $object =& $event->getObject(); + // add category filter if needed if ($event->Special != 'showall') { if ( $event->getEventParam('parent_cat_id') ) { $parent_cat_id = $event->getEventParam('parent_cat_id'); @@ -188,6 +325,7 @@ $object->addFilter('primary_filter', 'PrimaryCat = 1'); } + // add permission filter $view_perm = 1; $object->addFilter('perm_filter', 'perm.PermId = '.$view_perm); @@ -203,6 +341,61 @@ $object->addFilter('status_filter', $object->TableName.'.Status = 1'); } + $types = $event->getEventParam('types'); + $except_types = $event->getEventParam('except'); + $type_clauses = $this->getTypeClauses($event); + + // convert prepared type clauses into list filters + $includes_or_filter =& $this->Application->makeClass('kMultipleFilter'); + $includes_or_filter->setType(FLT_TYPE_OR); + + $excepts_and_filter =& $this->Application->makeClass('kMultipleFilter'); + $excepts_and_filter->setType(FLT_TYPE_AND); + + $includes_or_filter_h =& $this->Application->makeClass('kMultipleFilter'); + $includes_or_filter_h->setType(FLT_TYPE_OR); + + $excepts_and_filter_h =& $this->Application->makeClass('kMultipleFilter'); + $excepts_and_filter_h->setType(FLT_TYPE_AND); + + $except_types_array = explode(',', $types); + + if ($types) { + $types_array = explode(',', $types); + for ($i = 0; $i < sizeof($types_array); $i++) { + $type = trim($types_array[$i]); + if (isset($type_clauses[$type])) { + if ($type_clauses[$type]['having_filter']) { + $includes_or_filter_h->removeFilter('filter_'.$type); + $includes_or_filter_h->addFilter('filter_'.$type, $type_clauses[$type]['include']); + }else { + $includes_or_filter->removeFilter('filter_'.$type); + $includes_or_filter->addFilter('filter_'.$type, $type_clauses[$type]['include']); + } + } + } + } + + if ($except_types) { + $except_types_array = explode(',', $except_types); + for ($i = 0; $i < sizeof($except_types_array); $i++) { + $type = trim($except_types_array[$i]); + if (isset($type_clauses[$type])) { + if ($type_clauses[$type]['having_filter']) { + $excepts_and_filter_h->removeFilter('filter_'.$type); + $excepts_and_filter_h->addFilter('filter_'.$type, $type_clauses[$type]['except']); + }else { + $excepts_and_filter->removeFilter('filter_'.$type); + $excepts_and_filter->addFilter('filter_'.$type, $type_clauses[$type]['except']); + } + } + } + } + + /*if ( !$this->Application->IsAdmin() ) { + $object->addFilter('expire_filter', '%1$s.Expire IS NULL OR %1$s.Expire > UNIX_TIMESTAMP()'); + }*/ + /*$list_type = $event->getEventParam('ListType'); switch($list_type) { @@ -229,6 +422,12 @@ $object->addFilter('search_filter', '%1$s.`ResourceId` IN ('.implode(',',$ids).')'); break; } */ + + $object->addFilter('includes_filter', $includes_or_filter); + $object->addFilter('excepts_filter', $excepts_and_filter); + + $object->addFilter('includes_filter_h', $includes_or_filter_h, HAVING_FILTER); + $object->addFilter('excepts_filter_h', $excepts_and_filter_h, HAVING_FILTER); } /** @@ -1416,6 +1615,32 @@ /* === RELATED TO IMPORT/EXPORT: END === */ + function BuildListSpecial($params) + { + if ($this->Special != '') return $this->Special; + if ( isset($params['parent_cat_id']) ) { + $parent_cat_id = $params['parent_cat_id']; + } + else { + $parent_cat_id = $this->Application->GetVar('c_id'); + if (!$parent_cat_id) { + $parent_cat_id = $this->Application->GetVar('m_cat_id'); + } + } + + $recursive = isset($params['recursive']); + + $types = $this->SelectParam($params, 'types'); + $except = $this->SelectParam($params, 'except'); + + if ($types.$except.$recursive == '') { + return parent::BuildListSpecial($params); + } + + $special = crc32($parent_cat_id.$types.$except.$recursive.$manufacturer); + return $special; + } + } ?> \ No newline at end of file Index: trunk/core/units/general/cat_event_handler.php =================================================================== diff -u -N -r3629 -r3635 --- trunk/core/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 3629) +++ trunk/core/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 3635) @@ -151,14 +151,151 @@ } /** - * Apply scope clause + * Return type clauses for list bulding on front * * @param kEvent $event + * @return Array */ + function getTypeClauses(&$event) + { + $types = $event->getEventParam('types'); + $except_types = $event->getEventParam('except'); + $type_clauses = Array(); + + $type_clauses['pick']['include'] = '%1$s.EditorsPick = 1 AND '.TABLE_PREFIX.'CategoryItems.PrimaryCat = 1'; + $type_clauses['pick']['except'] = '%1$s.EditorsPick! = 1 AND '.TABLE_PREFIX.'CategoryItems.PrimaryCat = 1'; + $type_clauses['pick']['having_filter'] = false; + + $type_clauses['hot']['include'] = '`IsHot` = 1 AND PrimaryCat = 1'; + $type_clauses['hot']['except'] = '`IsHot`! = 1 AND PrimaryCat = 1'; + $type_clauses['hot']['having_filter'] = true; + + $type_clauses['pop']['include'] = '`IsPop` = 1 AND PrimaryCat = 1'; + $type_clauses['pop']['except'] = '`IsPop`! = 1 AND PrimaryCat = 1'; + $type_clauses['pop']['having_filter'] = true; + + $type_clauses['new']['include'] = '`IsNew` = 1 AND PrimaryCat = 1'; + $type_clauses['new']['except'] = '`IsNew`! = 1 AND PrimaryCat = 1'; + $type_clauses['new']['having_filter'] = true; + + $type_clauses['displayed']['include'] = ''; + $displayed = $this->Application->GetVar($event->Prefix.'_displayed_ids'); + if ($displayed) { + $id_field = $this->Application->getUnitOption($event->Prefix, 'IDField'); + $type_clauses['displayed']['except'] = '%1$s.'.$id_field.' NOT IN ('.$displayed.')'; + } + else { + $type_clauses['displayed']['except'] = ''; + } + $type_clauses['displayed']['having_filter'] = false; + + if (strpos($types, 'search') !== false || strpos($except_types, 'search') !== false) { + $event_mapping = Array( + 'simple' => 'OnSimpleSearch', + 'subsearch' => 'OnSubSearch', + 'advanced' => 'OnAdvancedSearch'); + if($this->Application->GetVar('INPORTAL_ON') && $this->Application->GetVar('Action') == 'm_simple_subsearch') + { + $type = 'subsearch'; + } + else + { + $type = $this->Application->GetVar('search_type') ? $this->Application->GetVar('search_type') : 'simple'; + } + + if($keywords = $event->getEventParam('keyword_string')) // processing keyword_string param of ListProducts tag + { + $this->Application->SetVar('keywords', $keywords); + $type = 'simple'; + } + $search_event = $event_mapping[$type]; + $this->$search_event($event); + $search_table = TABLE_PREFIX.'ses_'.$this->Application->GetSID().'_'.TABLE_PREFIX.'Search'; + $sql = 'SHOW TABLES LIKE "'.$search_table.'"'; + if ( $this->Conn->Query($sql) ) { + $search_res_ids = $this->Conn->GetCol('SELECT ResourceId FROM '.$search_table); + } + + if ($search_res_ids) { + $type_clauses['search']['include'] = '%1$s.ResourceId IN ('.implode(',', $search_res_ids).') AND PrimaryCat = 1'; + $type_clauses['search']['except'] = '%1$s.ResourceId NOT IN ('.implode(',', $search_res_ids).') AND PrimaryCat = 1'; + } + else { + $type_clauses['search']['include'] = '0'; + $type_clauses['search']['except'] = '1'; + } + $type_clauses['search']['having_filter'] = false; + } + + if (strpos($types, 'related') !== false || strpos($except_types, 'related') !== false) { + + $related_to = $event->getEventParam('related_to'); + if (!$related_to) { + $related_prefix = $event->Prefix; + } + else { + $sql = 'SELECT Prefix + FROM '.TABLE_PREFIX.'ItemTypes + WHERE ItemName = '.$this->Conn->qstr($related_to); + $related_prefix = $this->Conn->GetOne($sql); + } + + $rel_table = $this->Application->getUnitOption('rel', 'TableName'); + $item_type = $this->Application->getUnitOption($event->Prefix, 'ItemType'); + + $p_item = $this->Application->recallObject($related_prefix.'.current', null, Array('skip_autoload' => true)); + $p_item->Load( $this->Application->GetVar($related_prefix.'_id') ); + + $p_resource_id = $p_item->GetDBField('ResourceId'); + + $sql = 'SELECT SourceId, TargetId FROM '.$rel_table.' + WHERE + (Enabled = 1) + AND ( + (Type = 0 AND SourceId = '.$p_resource_id.' AND TargetType = '.$item_type.') + OR + (Type = 1 + AND ( + (SourceId = '.$p_resource_id.' AND TargetType = '.$item_type.') + OR + (TargetId = '.$p_resource_id.' AND SourceType = '.$item_type.') + ) + ) + )'; + + $related_ids_array = $this->Conn->Query($sql); + $related_ids = Array(); + + foreach ($related_ids_array as $key => $record) { + $related_ids[] = $record[ $record['SourceId'] == $p_resource_id ? 'TargetId' : 'SourceId' ]; + } + + if (count($related_ids) > 0) { + $type_clauses['related']['include'] = '%1$s.ResourceId IN ('.implode(',', $related_ids).') AND PrimaryCat = 1'; + $type_clauses['related']['except'] = '%1$s.ResourceId NOT IN ('.implode(',', $related_ids).') AND PrimaryCat = 1'; + } + else { + $type_clauses['related']['include'] = '0'; + $type_clauses['related']['except'] = '1'; + } + $type_clauses['related']['having_filter'] = false; + } + + return $type_clauses; + } + + /** + * Apply filters to list + * + * @param kEvent $event + */ function SetCustomQuery(&$event) { + parent::SetCustomQuery($event); + $object =& $event->getObject(); + // add category filter if needed if ($event->Special != 'showall') { if ( $event->getEventParam('parent_cat_id') ) { $parent_cat_id = $event->getEventParam('parent_cat_id'); @@ -188,6 +325,7 @@ $object->addFilter('primary_filter', 'PrimaryCat = 1'); } + // add permission filter $view_perm = 1; $object->addFilter('perm_filter', 'perm.PermId = '.$view_perm); @@ -203,6 +341,61 @@ $object->addFilter('status_filter', $object->TableName.'.Status = 1'); } + $types = $event->getEventParam('types'); + $except_types = $event->getEventParam('except'); + $type_clauses = $this->getTypeClauses($event); + + // convert prepared type clauses into list filters + $includes_or_filter =& $this->Application->makeClass('kMultipleFilter'); + $includes_or_filter->setType(FLT_TYPE_OR); + + $excepts_and_filter =& $this->Application->makeClass('kMultipleFilter'); + $excepts_and_filter->setType(FLT_TYPE_AND); + + $includes_or_filter_h =& $this->Application->makeClass('kMultipleFilter'); + $includes_or_filter_h->setType(FLT_TYPE_OR); + + $excepts_and_filter_h =& $this->Application->makeClass('kMultipleFilter'); + $excepts_and_filter_h->setType(FLT_TYPE_AND); + + $except_types_array = explode(',', $types); + + if ($types) { + $types_array = explode(',', $types); + for ($i = 0; $i < sizeof($types_array); $i++) { + $type = trim($types_array[$i]); + if (isset($type_clauses[$type])) { + if ($type_clauses[$type]['having_filter']) { + $includes_or_filter_h->removeFilter('filter_'.$type); + $includes_or_filter_h->addFilter('filter_'.$type, $type_clauses[$type]['include']); + }else { + $includes_or_filter->removeFilter('filter_'.$type); + $includes_or_filter->addFilter('filter_'.$type, $type_clauses[$type]['include']); + } + } + } + } + + if ($except_types) { + $except_types_array = explode(',', $except_types); + for ($i = 0; $i < sizeof($except_types_array); $i++) { + $type = trim($except_types_array[$i]); + if (isset($type_clauses[$type])) { + if ($type_clauses[$type]['having_filter']) { + $excepts_and_filter_h->removeFilter('filter_'.$type); + $excepts_and_filter_h->addFilter('filter_'.$type, $type_clauses[$type]['except']); + }else { + $excepts_and_filter->removeFilter('filter_'.$type); + $excepts_and_filter->addFilter('filter_'.$type, $type_clauses[$type]['except']); + } + } + } + } + + /*if ( !$this->Application->IsAdmin() ) { + $object->addFilter('expire_filter', '%1$s.Expire IS NULL OR %1$s.Expire > UNIX_TIMESTAMP()'); + }*/ + /*$list_type = $event->getEventParam('ListType'); switch($list_type) { @@ -229,6 +422,12 @@ $object->addFilter('search_filter', '%1$s.`ResourceId` IN ('.implode(',',$ids).')'); break; } */ + + $object->addFilter('includes_filter', $includes_or_filter); + $object->addFilter('excepts_filter', $excepts_and_filter); + + $object->addFilter('includes_filter_h', $includes_or_filter_h, HAVING_FILTER); + $object->addFilter('excepts_filter_h', $excepts_and_filter_h, HAVING_FILTER); } /** @@ -1416,6 +1615,32 @@ /* === RELATED TO IMPORT/EXPORT: END === */ + function BuildListSpecial($params) + { + if ($this->Special != '') return $this->Special; + if ( isset($params['parent_cat_id']) ) { + $parent_cat_id = $params['parent_cat_id']; + } + else { + $parent_cat_id = $this->Application->GetVar('c_id'); + if (!$parent_cat_id) { + $parent_cat_id = $this->Application->GetVar('m_cat_id'); + } + } + + $recursive = isset($params['recursive']); + + $types = $this->SelectParam($params, 'types'); + $except = $this->SelectParam($params, 'except'); + + if ($types.$except.$recursive == '') { + return parent::BuildListSpecial($params); + } + + $special = crc32($parent_cat_id.$types.$except.$recursive.$manufacturer); + return $special; + } + } ?> \ No newline at end of file Index: trunk/admin/install/inportal_schema.sql =================================================================== diff -u -N -r3549 -r3635 --- trunk/admin/install/inportal_schema.sql (.../inportal_schema.sql) (revision 3549) +++ trunk/admin/install/inportal_schema.sql (.../inportal_schema.sql) (revision 3635) @@ -245,6 +245,7 @@ CREATE TABLE ItemTypes ( ItemType int(11) NOT NULL default '0', Module varchar(50) NOT NULL default '', + Prefix varchar(20) NOT NULL default '', SourceTable varchar(100) NOT NULL default '', TitleField varchar(50) default NULL, CreatorField varchar(255) NOT NULL default '', Index: trunk/admin/install/upgrades/inportal_upgrade_v1.1.6.sql =================================================================== diff -u -N -r3549 -r3635 --- trunk/admin/install/upgrades/inportal_upgrade_v1.1.6.sql (.../inportal_upgrade_v1.1.6.sql) (revision 3549) +++ trunk/admin/install/upgrades/inportal_upgrade_v1.1.6.sql (.../inportal_upgrade_v1.1.6.sql) (revision 3635) @@ -3,4 +3,8 @@ INSERT INTO ConfigurationAdmin VALUES ('MaxImportCategoryLevels', 'la_Text_General', 'la_prompt_max_import_category_levels', 'text', '', '', 9, 1); INSERT INTO ConfigurationValues VALUES ('MaxImportCategoryLevels', '10', 'In-Portal', 'in-portal:configure_categories'); +ALTER TABLE ItemTypes ADD Prefix VARCHAR(20) NOT NULL AFTER Module; +UPDATE ItemTypes SET Prefix = 'c' WHERE SourceTable = 'Category'; +UPDATE ItemTypes SET Prefix = 'u' WHERE SourceTable = 'PortalUser'; + UPDATE Modules SET Version = '1.1.6' WHERE Name = 'In-Portal'; \ No newline at end of file Index: trunk/kernel/units/visits/visits_tag_processor.php =================================================================== diff -u -N -r2759 -r3635 --- trunk/kernel/units/visits/visits_tag_processor.php (.../visits_tag_processor.php) (revision 2759) +++ trunk/kernel/units/visits/visits_tag_processor.php (.../visits_tag_processor.php) (revision 3635) @@ -157,7 +157,7 @@ if ($types=='myvisitororders' || $types=='myvisitors'){ $special = 'incommerce'; $names_mapping = $this->Application->GetVar('NamesToSpecialMapping'); - $names_mapping[$list_name] = $special; + $names_mapping[$this->Prefix][$list_name] = $special; $this->Application->SetVar('NamesToSpecialMapping', $names_mapping); } Index: trunk/core/units/visits/visits_tag_processor.php =================================================================== diff -u -N -r2759 -r3635 --- trunk/core/units/visits/visits_tag_processor.php (.../visits_tag_processor.php) (revision 2759) +++ trunk/core/units/visits/visits_tag_processor.php (.../visits_tag_processor.php) (revision 3635) @@ -157,7 +157,7 @@ if ($types=='myvisitororders' || $types=='myvisitors'){ $special = 'incommerce'; $names_mapping = $this->Application->GetVar('NamesToSpecialMapping'); - $names_mapping[$list_name] = $special; + $names_mapping[$this->Prefix][$list_name] = $special; $this->Application->SetVar('NamesToSpecialMapping', $names_mapping); } Index: trunk/core/kernel/processors/main_processor.php =================================================================== diff -u -N -r3591 -r3635 --- trunk/core/kernel/processors/main_processor.php (.../main_processor.php) (revision 3591) +++ trunk/core/kernel/processors/main_processor.php (.../main_processor.php) (revision 3635) @@ -476,11 +476,11 @@ $t = $this->SelectParam($params, 't,template,block,name'); $t = eregi_replace("\.tpl$", '', $t); - + $templates_cache =& $this->Application->recallObject('TemplatesCache'); - + $res = $BlockParser->Parse( $templates_cache->GetTemplateBody($t), $t ); - + if ( !$BlockParser->DataExists && (isset($params['data_exists']) || isset($params['block_no_data'])) ) { if ($block_no_data = getArrayValue($params, 'block_no_data')) { $res = $BlockParser->Parse( Index: trunk/admin/install/inportal_data.sql =================================================================== diff -u -N -r3549 -r3635 --- trunk/admin/install/inportal_data.sql (.../inportal_data.sql) (revision 3549) +++ trunk/admin/install/inportal_data.sql (.../inportal_data.sql) (revision 3635) @@ -221,8 +221,8 @@ INSERT INTO IdGenerator VALUES ('100'); -INSERT INTO ItemTypes VALUES (1, 'In-Portal', 'Category', 'Name', 'CreatedById', NULL, NULL, 'la_ItemTab_Categories', 1, 'admin/category/addcategory.php', 'clsCategory', 'Category'); -INSERT INTO ItemTypes VALUES (6, 'In-Portal', 'PortalUser', 'Login', 'PortalUserId', NULL, NULL, '', 0, '', 'clsPortalUser', 'User'); +INSERT INTO ItemTypes VALUES (1, 'In-Portal', 'c', 'Category', 'Name', 'CreatedById', NULL, NULL, 'la_ItemTab_Categories', 1, 'admin/category/addcategory.php', 'clsCategory', 'Category'); +INSERT INTO ItemTypes VALUES (6, 'In-Portal', 'u', 'PortalUser', 'Login', 'PortalUserId', NULL, NULL, '', 0, '', 'clsPortalUser', 'User'); INSERT INTO Modules (Name, Path, Var, Version, Loaded, LoadOrder, TemplatePath, RootCat, BuildDate) VALUES ('In-Portal', 'kernel/', 'm', '1.1.6', 1, 0, '', 0, '1054738405');