Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Sun, Jul 20, 6:33 AM

in-portal

Index: branches/unlabeled/unlabeled-1.1.2/themes/default/common/right_banners.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.1.2/themes/default/common/right_banners.tpl (nonexistent)
+++ branches/unlabeled/unlabeled-1.1.2/themes/default/common/right_banners.tpl (revision 4500)
@@ -0,0 +1,14 @@
+<table width="100%" align="center" class="banner_table">
+ <tr>
+ <td><inp2:m_ShowBanner banner_num="2"/></td>
+ </tr>
+ <tr>
+ <td><inp2:m_ShowBanner banner_num="4"/></td>
+ </tr>
+ <tr>
+ <td><inp2:m_ShowBanner banner_num="5"/></td>
+ </tr>
+ <tr>
+ <td><inp2:m_ShowBanner banner_num="6"/></td>
+ </tr>
+</table>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.1.2/themes/default/common/right_banners.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1.2.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.1.2/themes/default/common/rss_feeds.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.1.2/themes/default/common/rss_feeds.tpl (nonexistent)
+++ branches/unlabeled/unlabeled-1.1.2/themes/default/common/rss_feeds.tpl (revision 4500)
@@ -0,0 +1,48 @@
+<inp2:m_DefineElement name="feed_element">
+ <li><a href="<inp2:m_param name="link"/>" target="_blank"><inp2:CutValue value="$title" cut_first="30"/></a><br>
+ <!--<inp2:CutValue value="$description"/><br><br>-->
+</inp2:m_DefineElement>
+
+<style type="text/css">
+ .rss_header td {
+ font-weight: bold;
+ text-align: center;
+ color: #FFFFFF;
+ }
+
+</style>
+
+<table width="100%" border="0" cellpadding="5" cellspacing="1">
+ <tr class="rss_header">
+ <td style="background-color: #3BB0B7;">News Headlines</td>
+ <td style="background-color: #B7A93C;">Hip Hop Discussion</td>
+ </tr>
+ <tr>
+ <td width="50%">
+ <ul>
+ <inp2:rss_ListFeed feed_url="http://rss.news.yahoo.com/rss/topstories" render_as="feed_element" limit="10"/>
+ </ul>
+ </td>
+ <td width="50%">
+ <ul>
+ <inp2:rss_ListFeed feed_url="http://rss.news.yahoo.com/rss/us" render_as="feed_element" limit="10"/>
+ </ul>
+ </td>
+ </tr>
+ <tr class="rss_header">
+ <td style="background-color: #B7A93C;">Hip Hop Discussion</td>
+ <td style="background-color: #3BB0B7;">News Headlines</td>
+ </tr>
+ <tr>
+ <td width="50%">
+ <ul>
+ <inp2:rss_ListFeed feed_url="http://rss.news.yahoo.com/rss/business" render_as="feed_element" limit="10"/>
+ </ul>
+ </td>
+ <td width="50%">
+ <ul>
+ <inp2:rss_ListFeed feed_url="http://rss.news.yahoo.com/rss/health" render_as="feed_element" limit="10"/>
+ </ul>
+ </td>
+ </tr>
+</table>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.1.2/themes/default/common/rss_feeds.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1.2.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.7.2/core/kernel/db/db_connection.php
===================================================================
--- branches/unlabeled/unlabeled-1.7.2/core/kernel/db/db_connection.php (revision 4499)
+++ branches/unlabeled/unlabeled-1.7.2/core/kernel/db/db_connection.php (revision 4500)
@@ -1,572 +1,582 @@
<?php
/**
* Multi database connection class
*
*/
class kDBConnection {
/**
* Current database type
*
* @var string
* @access private
*/
var $dbType = 'mysql';
/**
* Created connection handle
*
* @var resource
* @access private
*/
var $connectionID = null;
/**
* Handle of currenty processed recordset
*
* @var resource
* @access private
*/
var $queryID = null;
/**
* DB type specific function mappings
*
* @var Array
* @access private
*/
var $metaFunctions = Array();
/**
* Function to handle sql errors
*
* @var string
* @access private
*/
var $errorHandler = '';
/**
* Error code
*
* @var int
* @access private
*/
var $errorCode = 0;
/**
* Error message
*
* @var string
* @access private
*/
var $errorMessage = '';
/**
* Defines if database connection
* operations should generate debug
* information
*
* @var bool
*/
var $debugMode=false;
/**
+ * Last query to database
+ *
+ * @var string
+ */
+ var $lastQuery = '';
+
+ /**
* Initializes connection class with
* db type to used in future
*
* @param string $dbType
* @return DBConnection
* @access public
*/
function kDBConnection($dbType, $errorHandler = '')
{
$this->dbType = $dbType;
$this->initMetaFunctions();
if(!$errorHandler)
{
$this->errorHandler = Array(&$this,'handleError');
}
else
{
$this->errorHandler=$errorHandler;
}
}
/**
* Set's custom error
*
* @param int $code
* @param string $msg
* @access public
*/
function setError($code,$msg)
{
$this->errorCode=$code;
$this->errorMessage=$msg;
}
/**
* Checks if previous query execution
* raised an error.
*
* @return bool
* @access public
*/
function hasError()
{
return !($this->errorCode == 0);
}
/**
* Caches function specific to requested
* db type
*
* @access private
*/
function initMetaFunctions()
{
$ret = Array();
switch($this->dbType)
{
case 'mysql':
$ret = Array(); // only define functions, that name differs from "dbType_<meta_name>"
break;
}
$this->metaFunctions = $ret;
}
/**
* Get's function for specific db type
* based on it's meta name
*
* @param string $name
* @return string
* @access private
*/
function getMetaFunction($name)
{
if( !isset($this->metaFunctions[$name]) )
{
if(function_exists($this->dbType.'_'.$name)) return $this->dbType.'_'.$name;
}
else
{
return $this->dbType.$name;
}
return false;
}
/**
* Try to connect to database server
* using specified parameters and set
* database to $db if connection made
*
* @param string $host
* @param string $user
* @param string $pass
* @param string $db
* @access public
*/
function Connect($host,$user,$pass,$db,$force_new=false)
{
$func = $this->getMetaFunction('connect');
$this->connectionID = $func($host,$user,$pass,$force_new) or die('Can\'t connect to db');
if($this->connectionID)
{
$this->setDB($db);
$this->showError();
}
}
function ReConnect($host,$user,$pass,$db)
{
$func = $this->getMetaFunction('close');
$func($this->connectionID);
$this->Connect($host,$user,$pass,$db);
}
/**
* Shows error message from previous operation
* if it failed
*
* @access private
*/
function showError($sql='')
{
$this->setError(0,''); // reset error
if($this->connectionID)
{
$func = $this->getMetaFunction('errno'); $this->errorCode = $func($this->connectionID);
if($this->hasError())
{
$func = $this->getMetaFunction('error'); $this->errorMessage = $func($this->connectionID);
if(is_array($this->errorHandler))
{
$func = $this->errorHandler[1];
$ret = $this->errorHandler[0]->$func($this->errorCode,$this->errorMessage,$sql);
}
else
{
$func = $this->errorHandler;
$ret = $func($this->errorCode,$this->errorMessage,$sql);
}
if(!$ret) exit;
}
}
}
/**
* Default error handler for sql errors
*
* @param int $code
* @param string $msg
* @param string $sql
* @return bool
* @access private
*/
function handleError($code,$msg,$sql)
{
echo '<b>Processing SQL</b>: '.$sql.'<br>';
echo '<b>Error ('.$code.'):</b> '.$msg.'<br>';
return false;
}
/**
* Set's database name for connection
* to $new_name
*
* @param string $new_name
* @return bool
* @access public
*/
function setDB($new_name)
{
if(!$this->connectionID) return false;
$func = $this->getMetaFunction('select_db');
return $func($new_name);
}
/**
* Returns first field of first line
* of recordset if query ok or false
* otherwise
*
* @param string $sql
* @return string
* @access public
*/
function GetOne($sql)
{
$row = $this->GetRow($sql);
if(!$row) return false;
return array_shift($row);
}
/**
* Returns first row of recordset
* if query ok, false otherwise
*
* @param stirng $sql
* @return Array
* @access public
*/
function GetRow($sql)
{
$sql .= ' '.$this->getLimitClause(0,1);
$ret = $this->Query($sql);
if(!$ret) return false;
return array_shift($ret);
}
/**
* Returns 1st column of recordset as
* one-dimensional array or false otherwise
* Optional parameter $key_field can be used
* to set field name to be used as resulting
* array key
*
* @param string $sql
* @param string $key_field
* @return Array
* @access public
*/
function GetCol($sql, $key_field = null)
{
$rows = $this->Query($sql);
if(!$rows) return $rows;
$i = 0; $row_count = count($rows);
$ret = Array();
if(isset($key_field))
{
while ($i < $row_count)
{
$ret[$rows[$i][$key_field]] = array_shift($rows[$i]);
$i++;
}
}
else
{
while ($i < $row_count)
{
$ret[] = array_shift($rows[$i]);
$i++;
}
}
return $ret;
}
/**
* Queries db with $sql query supplied
* and returns rows selected if any, false
* otherwise. Optional parameter $key_field
* allows to set one of the query fields
* value as key in string array.
*
* @param string $sql
* @param string $key_field
* @return Array
*/
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);
if( is_resource($this->queryID) )
{
$ret = Array();
$fetch_func = $this->getMetaFunction('fetch_assoc');
if( isset($key_field) )
{
while( ($row = $fetch_func($this->queryID)) )
{
$ret[$row[$key_field]] = $row;
}
}
else
{
while( ($row = $fetch_func($this->queryID)) )
{
$ret[] = $row;
}
}
$this->Destroy();
return $ret;
}
$this->showError($sql);
return false;
}
function ChangeQuery($sql)
{
$this->Query($sql);
return $this->errorCode==0 ? true : false;
}
function debugQuery($sql, $key_field = null)
{
global $debugger;
$query_func = $this->getMetaFunction('query');
// set 1st checkpoint: begin
$isSkipTable=true;
$profileSQLs=defined('DBG_SQL_PROFILE')&&DBG_SQL_PROFILE;
if($profileSQLs)
{
$isSkipTable=isSkipTable($sql);
if(!$isSkipTable)
{
$queryID=$debugger->generateID();
$debugger->profileStart('sql_'.$queryID, $debugger->formatSQL($sql) );
}
}
// set 1st checkpoint: end
$this->queryID = $query_func($sql,$this->connectionID);
// set 2nd checkpoint: begin
if(!$isSkipTable) {
$debugger->profileFinish('sql_'.$queryID);
$debugger->profilerAddTotal('sql', 'sql_'.$queryID);
}
// set 2nd checkpoint: end
if( is_resource($this->queryID) )
{
$ret = Array();
$fetch_func = $this->getMetaFunction('fetch_assoc');
if( isset($key_field) )
{
while( ($row = $fetch_func($this->queryID)) )
{
$ret[$row[$key_field]] = $row;
}
}
else
{
while( ($row = $fetch_func($this->queryID)) )
{
$ret[] = $row;
}
}
$this->Destroy();
return $ret;
}
$this->showError($sql);
return false;
}
/**
* Free memory used to hold recordset handle
*
* @access private
*/
function Destroy()
{
if($this->queryID)
{
$free_func = $this->getMetaFunction('free_result');
$free_func($this->queryID);
$this->queryID = null;
}
}
/**
* Returns auto increment field value from
* insert like operation if any, zero otherwise
*
* @return int
* @access public
*/
function getInsertID()
{
$func = $this->getMetaFunction('insert_id');
return $func($this->connectionID);
}
/**
* Returns row count affected by last query
*
* @return int
* @access public
*/
function getAffectedRows()
{
$func = $this->getMetaFunction('affected_rows');
return $func($this->connectionID);
}
/**
* Returns LIMIT sql clause part for specific db
*
* @param int $offset
* @param int $rows
* @return string
* @access private
*/
function getLimitClause($offset, $rows)
{
if(!($rows > 0)) return '';
switch ($this->dbType) {
default:
return 'LIMIT '.$offset.','.$rows;
break;
}
}
/**
* Correctly quotes a string so that all strings are escaped. We prefix and append
* to the string single-quotes.
* An example is $db->qstr("Don't bother",magic_quotes_runtime());
*
* @param s the string to quote
* @param [magic_quotes] if $s is GET/POST var, set to get_magic_quotes_gpc().
* This undoes the stupidity of magic quotes for GPC.
*
* @return quoted string to be sent back to database
*/
function qstr($s,$magic_quotes=false)
{
$replaceQuote = "\\'";
if (!$magic_quotes)
{
if ($replaceQuote[0] == '\\')
{
// only since php 4.0.5
$s = str_replace(array('\\',"\0"),array('\\\\',"\\\0"),$s);
//$s = str_replace("\0","\\\0", str_replace('\\','\\\\',$s));
}
return "'".str_replace("'",$replaceQuote,$s)."'";
}
// undo magic quotes for "
$s = str_replace('\\"','"',$s);
if($replaceQuote == "\\'") // ' already quoted, no need to change anything
{
return "'$s'";
}
else // change \' to '' for sybase/mssql
{
$s = str_replace('\\\\','\\',$s);
return "'".str_replace("\\'",$replaceQuote,$s)."'";
}
}
/**
* Returns last error code occured
*
* @return int
*/
function getErrorCode()
{
return $this->errorCode;
}
/**
* Returns last error message
*
* @return string
* @access public
*/
function getErrorMsg()
{
return $this->errorMessage;
}
function doInsert($fields_hash, $table, $type = 'INSERT')
{
$fields_sql = '';
$values_sql = '';
foreach ($fields_hash as $field_name => $field_value) {
$fields_sql .= '`'.$field_name.'`,';
$values_sql .= $this->qstr($field_value).',';
}
$fields_sql = preg_replace('/(.*),$/', '\\1', $fields_sql);
$values_sql = preg_replace('/(.*),$/', '\\1', $values_sql);
$sql = strtoupper($type).' INTO `'.$table.'` ('.$fields_sql.') VALUES ('.$values_sql.')';
return $this->ChangeQuery($sql);
}
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).',';
}
$fields_sql = preg_replace('/(.*),$/', '\\1', $fields_sql);
$sql = 'UPDATE `'.$table.'` SET '.$fields_sql.' WHERE '.$key_clause;
return $this->ChangeQuery($sql);
}
}
?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.7.2/core/kernel/db/db_connection.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.7
\ No newline at end of property
+1.7.2.1
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.5.20/admin/category/permcacheupdate.php
===================================================================
--- branches/unlabeled/unlabeled-1.5.20/admin/category/permcacheupdate.php (revision 4499)
+++ branches/unlabeled/unlabeled-1.5.20/admin/category/permcacheupdate.php (revision 4500)
@@ -1,317 +1,395 @@
<?php
class clsRecursionStack
{
var $Stack;
function clsRecursionStack()
{
$this->Stack = Array();
}
function Push($values)
{
array_push($this->Stack, $values);
}
function Pop()
{
if ($this->Count() > 0) {
return array_pop($this->Stack);
}
else {
return false;
}
}
function Get()
{
if ($this->Count() > 0) {
// return end($this->Stack);
return $this->Stack[count($this->Stack)-1];
}
else {
return false;
}
}
function Update($values)
{
$this->Stack[count($this->Stack)-1] = $values;
}
function Count()
{
return count($this->Stack);
}
}
class clsCachedPermissions
{
var $Allow;
var $Deny;
var $CatId;
function clsCachedPermissions($CatId)
{
$this->CatId = $CatId;
}
function SetCatId($CatId)
{
$this->CatId = $CatId;
}
function CheckPermArray($Perm)
{
if (!isset($this->Allow[$Perm])) {
$this->Allow[$Perm] = array();
$this->Deny[$Perm] = array();
}
}
function AddAllow($Perm, $GroupId)
{
$this->CheckPermArray($Perm);
if (!in_array($GroupId, $this->Allow[$Perm])) {
array_push($this->Allow[$Perm], $GroupId);
$this->RemoveDeny($Perm, $GroupId);
}
}
function AddDeny($Perm, $GroupId)
{
$this->CheckPermArray($Perm);
if (!in_array($GroupId, $this->Deny[$Perm])) {
array_push($this->Deny[$Perm], $GroupId);
$this->RemoveAllow($Perm, $GroupId);
}
}
function RemoveDeny($Perm, $GroupId)
{
if (in_array($GroupId, $this->Deny[$Perm])) {
array_splice($this->Deny[$Perm], array_search($GroupId, $this->Deny[$Perm]), 1);
}
}
function RemoveAllow($Perm, $GroupId)
{
if (in_array($GroupId, $this->Allow[$Perm])) {
array_splice($this->Allow[$Perm], array_search($GroupId, $this->Allow[$Perm]), 1);
}
}
function GetInsertSQL()
{
$values = array();
$has_deny = array();
foreach ($this->Deny as $perm => $groups) {
if (count($groups) > 0) {
$values[] = '('.$this->CatId.', '.$perm.', "", "'.join(',', $groups).'")';
$has_deny[] = $perm;
}
}
foreach ($this->Allow as $perm => $groups) {
if (in_array($perm, $has_deny)) continue;
if (count($groups) > 0) {
$values[] = '(' .$this->CatId. ', ' .$perm. ', "' .join(',', $groups). '", "")';
}
}
if (!$values) return '';
$sql = 'INSERT INTO '.GetTablePrefix().'PermCache (CategoryId, PermId, ACL, DACL) VALUES '.join(',', $values);
return $sql;
}
}
class clsCacheUpdater
{
var $Stack;
var $iteration;
var $totalCats;
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');
if (!$continuing) {
$this->Stack =& new clsRecursionStack();
$sql = 'DELETE FROM '.GetTablePrefix().'PermCache';
$this->conn->Execute($sql);
$this->initData();
}
else {
$this->getData();
// $this->SetStack($data);
}
}
function getDonePercent()
{
if(!$this->totalCats)return 0;
return intval( round( $this->doneCats / $this->totalCats * 100 ) );
}
function getData()
{
$sql='SELECT data FROM '.$this->table;
if( $rs = $this->conn->Execute($sql) )
$tmp = unserialize($rs->fields['data']);
$this->totalCats = isset($tmp['totalCats']) ? $tmp['totalCats'] : 0;
$this->doneCats = isset($tmp['doneCats']) ? $tmp['doneCats'] : 0;
if(isset($tmp['stack']))
$this->Stack = $tmp['stack'];
else
$this->Stack = & new clsRecursionStack();
}
function setData()
{
$tmp=Array
(
'totalCats' =>$this->totalCats,
'doneCats' =>$this->doneCats,
'stack' =>$this->Stack,
);
$sql='DELETE FROM '.$this->table;
$this->conn->Execute($sql);
$sql='INSERT '.$this->table.' SET data="'.addslashes(serialize($tmp)).'"';
$this->conn->Execute($sql);
}
function initData()
{
$sql='CREATE TABLE '.$this->table.'(data LONGTEXT)';
$this->conn->Execute($sql);
$sql='SELECT COUNT(*) as count FROM '.GetTablePrefix().'Category';
if( $rs = $this->conn->Execute($sql) )
$this->totalCats=$rs->fields['count'];
$this->doneCats=0;
}
function clearData()
{
$sql='DROP TABLE IF EXISTS '.$this->table;
$this->conn->Execute($sql);
}
function DoTheJob()
{
$data = $this->Stack->Get();
if ($data === false) { //If Stack is empty
$data['current_id'] = 0;
$data['title'] = Array();
$data['named_path'] = Array();
+
+ $i = 0;
+ while ($i < ZONE_COUNT) {
+ $data['zone'.++$i] = '';
+ }
+
$this->Stack->Push($data);
}
if (!isset($data['queried'])) {
$this->QueryTitle($data);
$this->QueryChildren($data);
$this->QueryPermissions($data);
$data['queried'] = 1;
if($sql = $data['perms']->GetInsertSQL())
{
$this->conn->Execute($sql);
$this->doneCats++;
}
$this->iteration++;
}
// start with first child if we haven't started yet
if (!isset($data['current_child'])) $data['current_child'] = 0;
// if we have more children
if (isset($data['children'][$data['current_child']]))
{
$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']);
$data['current_child']++;
$this->Stack->Update($data); //we need to update ourself for the iteration after the next (or further) return to next child
$this->Stack->Push($next_data); //next iteration should process this child
return true;
}
else {
$this->UpdateCachedPath($data);
$this->Stack->Pop(); //remove ourself from stack if we have finished all the childs (or there are none)
// we are getting here if we finished with current level, so check if it's first level - then bail out.
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++;
+ }
}
}
function QueryChildren(&$data)
{
$sql = sprintf('SELECT CategoryId FROM '.GetTablePrefix().'Category WHERE ParentId = %s',
$data['current_id']);
$rs = $this->conn->Execute($sql);
$data['children'] = Array();
while ($rs && !$rs->EOF)
{
$data['children'][] = $rs->fields['CategoryId'];
$rs->MoveNext();
}
}
function QueryPermissions(&$data)
{
$sql = sprintf('SELECT ipc.PermissionConfigId, ip.GroupId, ip.PermissionValue FROM '.GetTablePrefix().'Permissions AS ip
LEFT JOIN '.GetTablePrefix().'PermissionConfig AS ipc
ON ipc.PermissionName = ip.Permission
WHERE CatId = %s AND Permission LIKE "%%.VIEW"',
$data['current_id']);
$rs = $this->conn->Execute($sql);
//create permissions array only if we don't have it yet (set by parent)
if (!isset($data['perms'])) {
$data['perms'] = new clsCachedPermissions($data['current_id']);
}
while ($rs && !$rs->EOF)
{
if ($rs->fields['PermissionValue'] == 1) {
$data['perms']->AddAllow($rs->fields['PermissionConfigId'], $rs->fields['GroupId']);
}
else {
$data['perms']->AddDeny($rs->fields['PermissionConfigId'], $rs->fields['GroupId']);
}
$rs->MoveNext();
}
}
}
?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.5.20/admin/category/permcacheupdate.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.5
\ No newline at end of property
+1.5.20.1
\ No newline at end of property

Event Timeline