Index: branches/unlabeled/unlabeled-1.1.2/themes/default/common/right_banners.tpl =================================================================== diff -u --- branches/unlabeled/unlabeled-1.1.2/themes/default/common/right_banners.tpl (revision 0) +++ branches/unlabeled/unlabeled-1.1.2/themes/default/common/right_banners.tpl (revision 4500) @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file Index: branches/unlabeled/unlabeled-1.5.20/admin/category/permcacheupdate.php =================================================================== diff -u -r3331 -r4500 --- branches/unlabeled/unlabeled-1.5.20/admin/category/permcacheupdate.php (.../permcacheupdate.php) (revision 3331) +++ branches/unlabeled/unlabeled-1.5.20/admin/category/permcacheupdate.php (.../permcacheupdate.php) (revision 4500) @@ -135,8 +135,30 @@ var $doneCats; var $table; + var $root_prefixes = Array(); + + /** + * Kernel Application + * + * @var kApplication + */ + var $Application = null; + /** + * Enter description here... + * + * @var kDBConnection + */ + var $Conn = null; + function clsCacheUpdater($continuing=false) { + $this->Application =& kApplication::Instance(); + $this->Conn =& $this->Application->GetADODBConnection(); + + foreach ($this->Application->ModuleInfo as $module_name => $module_info) { + $this->root_prefixes[ $module_info['RootCat'] ] = $module_info['Var']; + } + $this->conn =& GetADODBConnection(); $this->iteration = 0; $this->table=$GLOBALS['objSession']->GetEditTable('permCacheUpdate'); @@ -209,6 +231,12 @@ $data['current_id'] = 0; $data['title'] = Array(); $data['named_path'] = Array(); + + $i = 0; + while ($i < ZONE_COUNT) { + $data['zone'.++$i] = ''; + } + $this->Stack->Push($data); } @@ -236,6 +264,13 @@ $next_data = Array(); $next_data['title'] = $data['title']; $next_data['named_path'] = $data['named_path']; + + $i = 1; + while ($i <= ZONE_COUNT) { + $next_data['zone'.$i] = $data['zone'.$i]; + $i++; + } + $next_data['current_id'] = $data['children'][$data['current_child']]; //next iteration should process child $next_data['perms'] = $data['perms']; //we should copy our permissions to child - inheritance $next_data['perms']->SetCatId($next_data['current_id']); @@ -251,26 +286,69 @@ return $this->Stack->Count() > 0; } } + function UpdateCachedPath(&$data) { - $sql = 'UPDATE '.GetTablePrefix().'Category SET CachedNavbar="'.addslashes(join('>',$data['title'])) .'" WHERE CategoryId = '.$data['current_id']; - $this->conn->Execute($sql); + $fields_hash = Array( + 'CachedNavbar' => implode('>', $data['title']), + 'NamedParentPath' => implode('/', $data['named_path'] ), + ); + + $i = 1; + while($i <= ZONE_COUNT) { + $fields_hash['CachedZone'.$i] = $data['zone'.$i]; + $i++; + } - $path = implode('/', $data['named_path'] ); - $sql = 'UPDATE '.GetTablePrefix().'Category SET NamedParentPath = "'.addslashes($path).'" WHERE CategoryId = '.$data['current_id']; - $this->conn->Execute($sql); + $this->Conn->doUpdate($fields_hash, TABLE_PREFIX.'Category', 'CategoryId = '.$data['current_id']); } function QueryTitle(&$data) { - $sql = sprintf('SELECT Name, Filename FROM '.GetTablePrefix().'Category WHERE CategoryId = %s', - $data['current_id']); + $category_id = $data['current_id']; + + $select_fields = Array('Name', 'Filename'); + $i = 1; + while ($i <= ZONE_COUNT) { + $select_fields[] = 'Zone'.$i; + $i++; + } + + $sql = 'SELECT '.implode(',', $select_fields).' + FROM '.GetTablePrefix().'Category + WHERE CategoryId = '.$category_id; $rs = $this->conn->Execute($sql); if ($rs && !$rs->EOF) { $data['title'][] = $rs->fields['Name']; $data['named_path'][] = $rs->fields['Filename']; + + // it is one of the modules root category + $root_prefix = isset($this->root_prefixes[$category_id]) ? $this->root_prefixes[$category_id] : false; + if ($root_prefix) { + $fields_hash = Array(); + + $i = 1; + while ($i <= ZONE_COUNT) { + if (!$rs->fields['Zone'.$i]) { + $rs->fields['Zone'.$i] = $this->Application->ConfigValue('Banner'.$i); + $fields_hash['Zone'.$i] = $rs->fields['Zone'.$i]; + } + $i++; + } + + $this->Conn->doUpdate($fields_hash, TABLE_PREFIX.'Category', 'CategoryId = '.$category_id); + } + + // if explicitly set, then use it; use parent category zone otherwise + $i = 1; + while ($i <= ZONE_COUNT) { + if ($rs->fields['Zone'.$i]) { + $data['zone'.$i] = $rs->fields['Zone'.$i]; + } + $i++; + } } } Index: branches/unlabeled/unlabeled-1.1.2/themes/default/common/rss_feeds.tpl =================================================================== diff -u --- branches/unlabeled/unlabeled-1.1.2/themes/default/common/rss_feeds.tpl (revision 0) +++ branches/unlabeled/unlabeled-1.1.2/themes/default/common/rss_feeds.tpl (revision 4500) @@ -0,0 +1,48 @@ + +
  • " target="_blank">
    + + + + + + + + + + + + + + + + + + + + + + +
    News HeadlinesHip Hop Discussion
    +
      + +
    +
    +
      + +
    +
    Hip Hop DiscussionNews Headlines
    +
      + +
    +
    +
      + +
    +
    \ No newline at end of file Index: branches/unlabeled/unlabeled-1.7.2/core/kernel/db/db_connection.php =================================================================== diff -u -r4255 -r4500 --- branches/unlabeled/unlabeled-1.7.2/core/kernel/db/db_connection.php (.../db_connection.php) (revision 4255) +++ branches/unlabeled/unlabeled-1.7.2/core/kernel/db/db_connection.php (.../db_connection.php) (revision 4500) @@ -68,6 +68,13 @@ var $debugMode=false; /** + * Last query to database + * + * @var string + */ + var $lastQuery = ''; + + /** * Initializes connection class with * db type to used in future * @@ -332,6 +339,7 @@ */ function Query($sql,$key_field = null) { + $this->lastQuery = $sql; if($this->debugMode) return $this->debugQuery($sql,$key_field); $query_func = $this->getMetaFunction('query'); $this->queryID = $query_func($sql,$this->connectionID); @@ -557,6 +565,8 @@ function doUpdate($fields_hash, $table, $key_clause) { + if (!$fields_hash) return true; + $fields_sql = ''; foreach ($fields_hash as $field_name => $field_value) { $fields_sql .= '`'.$field_name.'` = '.$this->qstr($field_value).',';