- Timestamp:
- Dec 8, 2008, 11:06:23 AM (16 years ago)
- Location:
- lists
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
lists/SystemList.php
r26 r28 9 9 $Database->query('CREATE TABLE IF NOT EXISTS `'.$Parameters['TableName'].'` ( 10 10 `Id` int(11) NOT NULL auto_increment, 11 `ItemId` int(11) NOT NULL,12 `Author` int(11) NOT NULL,13 `ValidTimeFrom` datetime default NULL,14 `ValidTimeTo` datetime default NULL,15 `CreationTime` datetime default NULL,16 `DeletionTime` datetime default NULL,17 11 PRIMARY KEY (`Id`) 18 12 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;'); 19 $Database->query('ALTER TABLE `'.$Parameters['TableName'].'` ADD INDEX ( `ItemId` );');20 13 //echo($Database->LastQuery); 21 14 } … … 25 18 global $Database; 26 19 27 $DbResult = $Database->query('SELECT `TableName` FROM `'.$Parameters['ListTableName'].'` WHERE I temId='.$Parameters['ItemId'].' ORDER BY `Id` DESC LIMIT 1,1');20 $DbResult = $Database->query('SELECT `TableName` FROM `'.$Parameters['ListTableName'].'` WHERE Id='.$Parameters['Id']); 28 21 $DbRow = $DbResult->fetch_assoc(); 29 22 if($DbRow['TableName'] != $Parameters['TableName']) 30 23 $Database->query('RENAME TABLE `'.$DbRow['TableName'].'` TO `'.$Parameters['TableName'].'`'); 31 24 } 25 26 function ApplySQLToItems($SQL) 27 { 28 global $Database; 29 30 $DbResult = $Database->query('SELECT `TableName` FROM `SystemList`'); 31 while($DbRow = $DbResult->fetch_assoc()) 32 { 33 $Database->query(str_replace('`TableName`', '`'.$DbRow['TableName'].'`', $SQL)); 34 } 35 } 32 36 } 33 37 -
lists/SystemListItem.php
r27 r28 7 7 global $Database; 8 8 9 $Database->query('UPDATE SystemListItem AS Table1 SET Sequence = (SELECT COUNT(*) FROM (SELECT * FROM SystemListItem) AS Table2 WHERE ( Table1.ItemId = Table2.ItemId) AND ((Table2.Sequence < Table1.Sequence) OR ((Table1.Sequence = Table2.Sequence) AND (Table2.Id < Table1.Id))))');9 $Database->query('UPDATE SystemListItem AS Table1 SET Sequence = (SELECT COUNT(*) FROM (SELECT * FROM SystemListItem) AS Table2 WHERE ((Table2.Sequence < Table1.Sequence) OR ((Table1.Sequence = Table2.Sequence) AND (Table2.Id < Table1.Id))))'); 10 10 } 11 11 … … 15 15 16 16 //print_r($Parameters); 17 $DbResult = $Database->query('SELECT DbDataType FROM SystemType WHERE I temId='.$Parameters['Type'].' ORDER BY Id DESC LIMIT 1');17 $DbResult = $Database->query('SELECT DbDataType FROM SystemType WHERE Id='.$Parameters['Type']); 18 18 //echo($Database->LastQuery); 19 19 $DbRow = $DbResult->fetch_assoc(); 20 $DbResult = $Database->query('SELECT TableName FROM SystemList WHERE I temId='.$Parameters[$Parameters['Column']].' ORDER BY Id DESC LIMIT 1');20 $DbResult = $Database->query('SELECT TableName FROM SystemList WHERE Id='.$Parameters[$Parameters['Column']]); 21 21 //echo($Database->LastQuery); 22 22 $DbRow2 = $DbResult->fetch_assoc(); -
lists/include.php
r24 r28 5 5 include('lists/SystemListItem.php'); 6 6 7 define('ListSystemLogId', 20);7 define('ListSystemLogId', 59); 8 8 9 9 ?>
Note:
See TracChangeset
for help on using the changeset viewer.