Changeset 659
- Timestamp:
- May 29, 2014, 11:59:39 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/Version.php
r658 r659 1 1 <?php 2 2 3 $Revision = 65 8; // Subversion revision3 $Revision = 659; // Subversion revision 4 4 $DatabaseRevision = 657; // SQL structure revision 5 5 $ReleaseTime = strtotime('2014-05-25'); -
trunk/Common/Database.php
r634 r659 8 8 var $PDOStatement; 9 9 var $num_rows = 0; 10 10 11 11 function fetch_assoc() 12 12 { 13 13 return($this->PDOStatement->fetch(PDO::FETCH_ASSOC)); 14 14 } 15 15 16 16 function fetch_array() 17 17 { … … 36 36 var $ShowSQLError; 37 37 var $ShowSQLQuery; 38 38 39 39 function __construct() 40 { 40 { 41 41 $this->Type = 'mysql'; // mysql, pgsql 42 42 $this->ShowSQLError = false; … … 44 44 $this->Functions = array('NOW()', 'CURDATE()', 'CURTIME()', 'UUID()'); 45 45 } 46 46 47 47 function Connect($Host, $User, $Password, $Database) 48 { 48 { 49 49 if($this->Type == 'mysql') $ConnectionString = 'mysql:host='.$Host.';dbname='.$Database; 50 50 else if($this->Type == 'pgsql') $ConnectionString = 'pgsql:dbname='.$Database.';host='.$Host; … … 59 59 } 60 60 } 61 61 62 62 function Disconnect() 63 63 { 64 64 unset($this->PDO); 65 65 } 66 66 67 67 function Connected() 68 68 { 69 69 return(isset($this->PDO)); 70 70 } 71 71 72 72 function select_db($Database) 73 73 { 74 74 $this->query('USE `'.$Database.'`'); 75 75 } 76 76 77 77 function query($Query) 78 78 { 79 79 if(!$this->Connected()) throw new Exception('Not connected to database'); 80 80 $this->LastQuery = $Query; 81 if($this->ShowSQLQuery == true) 81 if($this->ShowSQLQuery == true) 82 82 echo('<div style="border-bottom-width: 1px; border-bottom-style: solid; padding-bottom: 3px; padding-top: 3px; font-size: 12px; font-family: Arial;">'.$Query.'</div>'."\n"); 83 83 $Result = new DatabaseResult(); … … 91 91 $this->Error = $this->PDO->errorInfo(); 92 92 $this->Error = $this->Error[2]; 93 if(($this->Error != '') and ($this->ShowSQLError == true)) 93 if(($this->Error != '') and ($this->ShowSQLError == true)) 94 94 echo('<div><strong>SQL Error: </strong>'.$this->Error.'<br />'.$Query.'</div>'); 95 95 throw new Exception('SQL Error: '.$this->Error.', Query: '.$Query); 96 96 } 97 return($Result); 97 return($Result); 98 98 } 99 99 100 100 function select($Table, $What = '*', $Condition = 1) 101 { 102 return($this->query('SELECT '.$What.' FROM `'.$this->Prefix.$Table.'` WHERE '.$Condition)); 101 { 102 return($this->query('SELECT '.$What.' FROM `'.$this->Prefix.$Table.'` WHERE '.$Condition)); 103 103 } 104 104 105 105 function delete($Table, $Condition) 106 106 { 107 $this->query('DELETE FROM `'.$this->Prefix.$Table.'` WHERE '.$Condition); 108 } 109 107 $this->query('DELETE FROM `'.$this->Prefix.$Table.'` WHERE '.$Condition); 108 } 109 110 110 function insert($Table, $Data) 111 111 { … … 115 115 { 116 116 $Name .= ',`'.$Key.'`'; 117 if(!in_array($Value, $this->Functions)) 117 if(!in_array($Value, $this->Functions)) 118 118 { 119 119 if(is_null($Value)) $Value = 'NULL'; … … 124 124 $Name = substr($Name, 1); 125 125 $Values = substr($Values, 1); 126 $this->query('INSERT INTO `'.$this->Prefix.$Table.'` ('.$Name.') VALUES('.$Values.')'); 126 $this->query('INSERT INTO `'.$this->Prefix.$Table.'` ('.$Name.') VALUES('.$Values.')'); 127 127 $this->insert_id = $this->PDO->lastInsertId(); 128 128 } 129 129 130 130 function update($Table, $Condition, $Data) 131 131 { … … 133 133 foreach($Data as $Key => $Value) 134 134 { 135 if(!in_array($Value, $this->Functions)) 135 if(!in_array($Value, $this->Functions)) 136 136 { 137 137 if(is_null($Value)) $Value = 'NULL'; … … 140 140 $Values .= ', `'.$Key.'`='.$Value; 141 141 } 142 $Values = substr($Values, 2); 142 $Values = substr($Values, 2); 143 143 $this->query('UPDATE `'.$this->Prefix.$Table.'` SET '.$Values.' WHERE ('.$Condition.')'); 144 144 } 145 145 146 146 function replace($Table, $Data) 147 147 { … … 150 150 foreach($Data as $Key => $Value) 151 151 { 152 if(!in_array($Value, $this->Functions)) 152 if(!in_array($Value, $this->Functions)) 153 153 { 154 154 if(is_null($Value)) $Value = 'NULL'; … … 164 164 //echo($this->error().'<br>'); 165 165 } 166 166 167 167 function charset($Charset) 168 168 { 169 169 $this->query('SET NAMES "'.$Charset.'"'); 170 170 } 171 171 172 172 function real_escape_string($Text) 173 173 { 174 174 return(addslashes($Text)); 175 175 } 176 176 177 177 public function __sleep() 178 178 { … … 188 188 { 189 189 if($Time == NULL) return(NULL); 190 else return(date('Y-m-d H:i:s', $Time)); 190 else return(date('Y-m-d H:i:s', $Time)); 191 191 } 192 192 … … 194 194 { 195 195 if($Time == NULL) return(NULL); 196 else return(date('Y-m-d', $Time)); 196 else return(date('Y-m-d', $Time)); 197 197 } 198 198 … … 200 200 { 201 201 if($Time == NULL) return(NULL); 202 else return(date('H:i:s', $Time)); 202 else return(date('H:i:s', $Time)); 203 203 } 204 204 205 205 function MysqlDateTimeToTime($DateTime) 206 206 { 207 if($DateTime == '') return(NULL); 207 if($DateTime == '') return(NULL); 208 208 $Parts = explode(' ', $DateTime); 209 $DateParts = explode('-', $Parts[0]); 209 $DateParts = explode('-', $Parts[0]); 210 210 $TimeParts = explode(':', $Parts[1]); 211 $Result = mktime($TimeParts[0], $TimeParts[1], $TimeParts[2], $DateParts[1], $DateParts[2], $DateParts[0]); 212 return($Result); 211 $Result = mktime($TimeParts[0], $TimeParts[1], $TimeParts[2], $DateParts[1], $DateParts[2], $DateParts[0]); 212 return($Result); 213 213 } 214 214 … … 216 216 { 217 217 if($Date == '') return(NULL); 218 return(MysqlDateTimeToTime($Date.' 0:0:0')); 218 return(MysqlDateTimeToTime($Date.' 0:0:0')); 219 219 } 220 220 … … 222 222 { 223 223 if($Time == '') return(NULL); 224 return(MysqlDateTimeToTime('0000-00-00 '.$Time)); 225 } 224 return(MysqlDateTimeToTime('0000-00-00 '.$Time)); 225 } -
trunk/Common/Form/Types/DateTime.php
r616 r659 10 10 { 11 11 global $MonthNames; 12 12 13 13 if($Item['Value'] == 0) return(''); 14 14 if((strtolower($Item['Value']) == 'now') or (strtolower($Item['Value']) == '')) $Item['Value'] = time(); 15 15 $Parts = getdate($Item['Value']); 16 16 $Output = $Parts['mday'].'.'.$Parts['mon'].'.'.$Parts['year'].' '. 17 $Parts['hours'].':'.$Parts['minutes'].':'.$Parts['seconds'];17 sprintf('%02d', $Parts['hours']).':'.sprintf('%02d', $Parts['minutes']).':'.sprintf('%02d', $Parts['seconds']); 18 18 return($Output); 19 19 } … … 25 25 if(($Item['Value'] !== null) and ((strtolower($Item['Value']) == 'now') or (strtolower($Item['Value']) == ''))) $Item['Value'] = time(); 26 26 $Parts = getdate($Item['Value']); 27 27 28 28 $Output = ''; 29 29 $Style = ''; … … 43 43 $Item['Name'].'-day\');toggle(\''.$Item['Name'].'-month\');toggle(\''.$Item['Name'].'-year\');"/>'; 44 44 } 45 45 46 46 // Hour 47 47 $Output .= '<select name="'.$Item['Name'].'-hour" id="'.$Item['Name'].'-hour" '.$Style.'>'; … … 106 106 return(MysqlDateTimeToTime($Item['Value'])); 107 107 } 108 108 109 109 function OnSaveDb($Item) 110 { 110 { 111 111 if($Item['Value'] == null) return(null); 112 112 else return(date('Y-m-d H:i:s', $Item['Value'])); -
trunk/Common/Form/Types/File.php
r577 r659 9 9 var $DirectoryId; 10 10 var $TempName; 11 11 12 12 function DetectMimeType() 13 13 { … … 18 18 return($Result); 19 19 } 20 20 21 21 function GetSize($Item) 22 22 { … … 24 24 if(file_exists($FileName)) $Result = filesize($FileName); 25 25 else $Result = 0; 26 return($Result); 26 return($Result); 27 27 } 28 28 29 29 function GetFullName() 30 30 { 31 31 $ParentId = $this->Directory; 32 while($Paren Id != null)32 while($ParentId != null) 33 33 { 34 34 $DbResult = $this->Database->select('FileDirectory', '*', 'Id='.$ParentId); … … 36 36 $Path .= $DbRow['Name'].'/'; 37 37 $ParentId = $DbRow['Parent']; 38 } 38 } 39 39 $Result = $this->UploadFileFolder.'/'.$Path.$File->Name; 40 40 return($Result); 41 41 } 42 42 43 43 function GetExt() 44 44 { 45 45 return(substr($this->Name, 0, strpos($this->Name, '.') - 1)); 46 46 } 47 47 48 48 function Delete() 49 49 { 50 50 if(file_exists($this->GetFullName())) unlink($this->GetFullName()); 51 51 } 52 52 53 53 function GetContent() 54 54 { … … 64 64 var $FileDownloadURL; 65 65 var $DirectoryId; 66 66 67 67 function __construct($FormManager) 68 68 { … … 71 71 $this->DirectoryId = null; 72 72 } 73 73 74 74 function OnView($Item) 75 75 { … … 99 99 { 100 100 $File->Name = $UploadFile['name']; 101 $File->Size = $UploadFile['size']; 101 $File->Size = $UploadFile['size']; 102 102 $File->TempName = $UploadFile['tmp_name']; 103 103 } … … 105 105 return($File); 106 106 } 107 107 108 108 function OnLoadDb($Item) 109 109 { … … 120 120 return($File); 121 121 } 122 122 123 123 function OnSaveDb($Item) 124 124 { 125 125 if(!is_object($Item['Value'])) $Item['Value'] = new DbFile(); 126 126 $File = &$Item['Value']; 127 $Properties = array('Name' => $File->Name, 127 $Properties = array('Name' => $File->Name, 128 128 'Size' => $File->GetSize(), 'Directory' => $File->Directory); 129 129 $DbResult = $this->Database->select('File', '*', 'Id='.$File->Id); … … 131 131 { 132 132 $DbRow = $DbResult->fetch_assoc(); 133 if($File->TempName != '') 133 if($File->TempName != '') 134 134 { 135 135 $FileName = $File->GetFullName(); … … 137 137 } 138 138 $this->Database->update('File', 'Id='.$File->Id, $Properties); 139 } else 139 } else 140 140 { 141 141 $this->Database->insert('File', $Properties); … … 145 145 SystemMessage('Nahrání souboru', 'Cílová složka není dostupná!'); 146 146 } 147 147 148 148 } -
trunk/Common/Form/Types/Time.php
r616 r659 13 13 $TimeParts = getdate($Item['Value']); 14 14 15 $Output = $TimeParts['hours'].':'.$TimeParts['minutes'].':'.$TimeParts['seconds'];15 $Output = sprintf('%02d', $TimeParts['hours']).':'.sprintf('%02d', $TimeParts['minutes']).':'.sprintf('%02d', $TimeParts['seconds']); 16 16 return($Output); 17 17 } … … 24 24 $Output = ''; 25 25 $Style = ''; 26 if(array_key_exists('Null', $Item) and $Item['Null']) 26 if(array_key_exists('Null', $Item) and $Item['Null']) 27 27 { 28 if($Item['Value'] != null) 28 if($Item['Value'] != null) 29 29 { 30 30 $Checked = ' checked="1"'; 31 31 $Style = 'style="display:inline;"'; 32 } else 32 } else 33 33 { 34 34 $Checked = ''; 35 $Style = 'style="display:none;"'; 35 $Style = 'style="display:none;"'; 36 36 } 37 37 $Output .= '<input type="checkbox" name="'.$Item['Name'].'-null"'.$Checked.' onclick="toggle(\''. 38 $Item['Name'].'-hour\');toggle(\''.$Item['Name'].'-minute\');toggle(\''.$Item['Name'].'-second\');"/>'; 38 $Item['Name'].'-hour\');toggle(\''.$Item['Name'].'-minute\');toggle(\''.$Item['Name'].'-second\');"/>'; 39 39 } 40 40 41 41 // Hour 42 42 $Output .= '<select name="'.$Item['Name'].'-hour" id="'.$Item['Name'].'-hour" '.$Style.'>'; … … 68 68 function OnLoad($Item) 69 69 { 70 if(!array_key_exists($Item['Name'].'-null', $_POST) and array_key_exists('Null', $Item) and ($Item['Null'] == true)) return(null); 70 if(!array_key_exists($Item['Name'].'-null', $_POST) and array_key_exists('Null', $Item) and ($Item['Null'] == true)) return(null); 71 71 return(mktime($_POST[$Item['Name'].'-hour'], $_POST[$Item['Name'].'-minute'], $_POST[$Item['Name'].'-second'])); 72 72 } -
trunk/Common/Form/Types/Type.php
r623 r659 24 24 include(dirname(__FILE__).'/MacAddress.php'); 25 25 include(dirname(__FILE__).'/Image.php'); 26 include(dirname(__FILE__).'/TimeDiff.php'); 26 27 27 28 class Type … … 58 59 'IPv6Address' => array('Name' => 'IPv6Address', 'Class' => 'IPv6Address', 'ParentType' => '', 'Parameters' => array()), 59 60 'Image' => array('Name' => 'Image', 'Class' => 'Image', 'ParentType' => '', 'Parameters' => array()), 61 'TimeDiff' => array('Name' => 'TimeDiff', 'Class' => 'TimeDiff', 'ParentType' => 'Integer', 'Parameters' => array()), 60 62 ); 61 63 } … … 72 74 } else return($TypeName); 73 75 } 74 76 75 77 function IsHidden($TypeName) 76 78 { … … 90 92 $Type = $this->TypeDefinitionList[$ParentType]; 91 93 } else $Type = array(); 92 94 93 95 $Type['Name'] = $Name; 94 96 $Type['Class'] = $Name; … … 104 106 // TODO: remove dependent types 105 107 } 106 108 107 109 function GetTypeDefinition($TypeName) 108 110 { -
trunk/Common/Global.php
r655 r659 346 346 function GetRemoteAddress() 347 347 { 348 if(array_key_exists('HTTP_X_FORWARDED_FOR',$_SERVER)) $IP = $_SERVER['HTTP_X_FORWARDED_FOR'] ; 349 else if(array_key_exists('REMOTE_ADDR', $_SERVER)) $IP = $_SERVER['REMOTE_ADDR']; 348 if(array_key_exists('REMOTE_ADDR', $_SERVER)) $IP = $_SERVER['REMOTE_ADDR']; 350 349 else $IP = '0.0.0.0'; 351 350 return($IP); -
trunk/Modules/NetworkConfigLinux/Generators/DNS.php
r618 r659 9 9 $BaseDomain = 'zdechov.net'; 10 10 $Now = getdate(); 11 $I = floor(($Now['hours'] * 60 * 60 + $Now['minutes'] * 60 + $Now['seconds']) / (24 * 60 * 60) * 100); 11 $I = floor(($Now['hours'] * 60 * 60 + $Now['minutes'] * 60 + $Now['seconds']) / (24 * 60 * 60) * 100); 12 12 $Serial = date('Ymd', time()).$I; 13 13 $MinimumTime = 7200; … … 192 192 193 193 // Domain alias 194 $DbResult = $System->Database->query('SELECT NetworkDomainAlias.* FROM `NetworkDomainAlias`'); 194 $DbResult = $System->Database->query('SELECT NetworkDomainAlias.* FROM `NetworkDomainAlias`'); 195 195 // JOIN `NetworkDevice` ON NetworkDomainAlias.Target LIKE NetworkDevice.Name AND NetworkInterface.ExternalIP != ""'); 196 196 while($Alias = $DbResult->fetch_assoc()) -
trunk/Modules/NetworkConfigRouterOS/NetworkConfigRouterOS.php
r658 r659 34 34 'Interface' => array('Type' => 'TNetworkInterface', 'Caption' => 'Rozhraní', 'Default' => '', 'ReadOnly' => true), 35 35 'State' => array('Type' => 'Boolean', 'Caption' => 'Stav', 'Default' => '', 'ReadOnly' => true), 36 'Duration' => array('Type' => 'Time ', 'Caption' => 'Trvání', 'Default' => '', 'ReadOnly' => true,37 'SQL' => 'TIME DIFF(`Time`,'.36 'Duration' => array('Type' => 'TimeDiff', 'Caption' => 'Trvání', 'Default' => '', 'ReadOnly' => true, 37 'SQL' => 'TIMESTAMPDIFF(SECOND, `Time`, '. 38 38 '(SELECT `Time` FROM `NetworkInterfaceUpDown` AS `TA` WHERE (`TA`.`Time` > `TX`.`Time`) '. 39 39 'AND (`TA`.`Interface`=`TX`.`Interface`) ORDER BY `TA`.`Time` LIMIT 1))'), -
trunk/Modules/News/NewsPage.php
r614 r659 14 14 $this->UploadedFilesFolder = $this->System->ModuleManager->Modules['News']->UploadedFilesFolder; 15 15 if(count($this->System->PathItems) > 1) 16 { 16 { 17 17 if($this->System->PathItems[1] == 'subscription') return($this->ShowSubscription()); 18 18 else if($this->System->PathItems[1] == 'rss') return($this->ShowRSS()); … … 20 20 } else return($this->ShowMain()); 21 21 } 22 22 23 23 function ShowView() 24 24 { … … 52 52 foreach($Enclosures as $Enclosure) 53 53 { 54 if(file_exists($this->UploadedFilesFolder.$Enclosure)) 54 if(file_exists($this->UploadedFilesFolder.$Enclosure)) 55 55 $Output .= ' <a href="'.$this->System->Link('/'.$this->UploadedFilesFolder.$Enclosure).'">'.$Enclosure.'</a>'; 56 56 } … … 61 61 return($Output); 62 62 } 63 63 64 64 function ShowAdd() 65 65 { … … 78 78 if($this->System->User->CheckPermission('News', 'Insert', 'Group', $DbRow['Id'])) 79 79 { 80 if($DbRow['Id'] == $Category['Id']) $Selected = ' selected="1"'; 80 if($DbRow['Id'] == $Category['Id']) $Selected = ' selected="1"'; 81 81 else $Selected = ''; 82 82 $Output .= '<option value="'.$DbRow['Id'].'"'.$Selected.'>'.$DbRow['Caption'].'</option>'; … … 96 96 return($Output); 97 97 } 98 98 99 99 function ShowAdd2() 100 100 { … … 122 122 } 123 123 $Enclosures = substr($Enclosures, 1); 124 124 125 125 $_POST['content'] = str_replace("\n",'<br />',$_POST['content']); 126 126 $this->Database->insert('News', array('Category' => $Category['Id'], 'Title' => $_POST['title'], 127 127 'Content' => $_POST['content'], 'Date' => 'NOW()', 'IP' => $RemoteAddr, 128 'Enclosure' => $Enclosures, 'Author' => $this->System->User->User['Name'], 128 'Enclosure' => $Enclosures, 'Author' => $this->System->User->User['Name'], 129 129 'User' => $this->System->User->User['Id'], 'Link' => $_POST['link'])); 130 130 $Output .= 'Aktualita přidána!<br />Pokud budete chtít vaši aktualitu smazat, klikněte na odkaz Smazat v seznamu všech aktualit v kategorii.<br /><br />'; … … 134 134 return($Output); 135 135 } 136 136 137 137 function ShowEdit() 138 138 { … … 159 159 return($Output); 160 160 } 161 161 162 162 function ShowUpdate() 163 163 { 164 164 $Output = ''; 165 $RemoteAddr = GetRemoteAddress(); 165 $RemoteAddr = GetRemoteAddress(); 166 166 $Category = $this->GetCategory(); 167 167 if($this->System->User->CheckPermission('News', 'Insert', 'Group', $Category['Id'])) … … 175 175 { 176 176 $_POST['content'] = str_replace("\n", '<br />', $_POST['content']); 177 $this->Database->update('News', 'Id='.$_POST['id'], array('Title' => $_POST['title'], 177 $this->Database->update('News', 'Id='.$_POST['id'], array('Title' => $_POST['title'], 178 178 'Content' => $_POST['content'], 'Link' => $_POST['link'])); 179 179 $Output .= 'Aktualita uložena!<br />'; … … 184 184 return($Output); 185 185 } 186 186 187 187 function ShowDelete() 188 188 { … … 197 197 // TODO: Make upload using general File class 198 198 if($Row['Enclosure'] != '') 199 { 199 { 200 200 $Output .= '<br />Přílohy: '; 201 201 $Enclosures = explode(';', $Row['Enclosure']); … … 211 211 return($Output); 212 212 } 213 213 214 214 function ShowList() 215 215 { … … 226 226 $Output .= '<strong>Seznam aktualit kategorie '.$Category['Caption'].':</strong><div style="font-size: small;">'; 227 227 $Output .= PagesList('?category='.$Category['Id'].'&page=', $Page, $PageMax, $PerPage); 228 228 229 229 $DbResult = $this->Database->query('SELECT `News`.*, `User`.`Name` FROM `News` '. 230 230 'LEFT JOIN `User` ON `User`.`Id`=`News`.`User` WHERE `Category`='.$Category['Id'].' ORDER BY `News`.`Id` DESC LIMIT '.($Page * $PerPage).','.$PerPage); … … 249 249 foreach($Enclosures as $Enclosure) 250 250 { 251 if(file_exists($this->UploadedFilesFolder.$Enclosure)) 251 if(file_exists($this->UploadedFilesFolder.$Enclosure)) 252 252 $Output .= ' <a href="'.$this->System->Link('/'.$this->UploadedFilesFolder.$Enclosure).'">'.$Enclosure.'</a>'; 253 253 } … … 260 260 return($Output); 261 261 } 262 262 263 263 function GetCategory() 264 264 { … … 267 267 if(array_key_exists('category', $_POST)) $Category['Id'] = $_POST['category'] * 1; 268 268 //if(is_null($Category)) throw new Exception('Kategorie neurčena'); 269 else 269 else 270 270 { 271 271 $DbResult = $this->Database->select('NewsCategory', '*', '`Id`='.$Category['Id'].' ORDER BY `Sequence`'); … … 275 275 return($Category); 276 276 } 277 277 278 278 function ShowMain() 279 279 { 280 $Output = ''; 280 $Output = ''; 281 281 if(array_key_exists('action',$_GET)) $Action = $_GET['action']; 282 282 else $Action = ''; … … 290 290 return($Output); 291 291 } 292 292 293 293 function ShowSubscription() 294 { 294 { 295 295 if(array_key_exists('build', $_GET)) 296 296 { … … 302 302 $Select = $this->System->Config['Web']['RootFolder'].'/aktuality/rss/?select='.substr($Select, 1); 303 303 $Output = 'Výsledný RSS kanál: <a href="'.$Select.'">'.$Select.'</a>'; 304 } else 304 } else 305 305 { 306 306 $Output = 'Vytvořte si vlastní RSS kanál, díky kterému budete moci automaticky sledovat novinky pomocí vaší RSS čtečky. Informace o technologii RSS a programech pro čtení kanálů najdete např. <a href="http://www.lupa.cz/clanky/prehled-rss-ctecek/">zde</a><br />'. … … 314 314 $Output.= '<input type="submit" value="Sestavit"/>'. 315 315 '</form>'; 316 } 317 return($Output); 318 } 319 316 } 317 return($Output); 318 } 319 320 320 function ShowRSS() 321 321 { … … 332 332 $CategoryName = ''; 333 333 334 // Prepare WHERE condition 335 if(array_key_exists('select', $_GET)) 334 // Prepare WHERE condition 335 if(array_key_exists('select', $_GET)) 336 336 { 337 337 $Where = ''; … … 339 339 foreach($Parts as $Part) 340 340 { 341 $Where .= 'OR (`Category`='.($Part * 1).')'; 341 $Where .= 'OR (`Category`='.($Part * 1).')'; 342 342 } 343 343 $Where = substr($Where, 2); … … 354 354 // Update news from discussion forum 355 355 /* 356 $ForumCategory = 4; 356 $ForumCategory = 4; 357 357 $Database->select_db('forum'); 358 358 $DbResult = $Database->query('SELECT posts.post_time, posts_text.post_subject, posts_text.post_text, users.username, topics.topic_title FROM posts JOIN posts_text ON posts.post_id = posts_text.post_id JOIN users ON users.user_id = posts.poster_id JOIN topics ON topics.topic_id= posts.topic_id ORDER BY post_time DESC LIMIT '.$NewsCount); … … 361 361 while($Row = $DbResult->fetch_array()) 362 362 { 363 $Row['post_text'] = StrTr($Row['post_text'], "\x8A\x8D\x8E\x9A\x9D\x9E", "\xA9\xAB\xAE\xB9\xBB\xBE"); 364 $Row['post_text'] = str_replace("\n","<br>", $Row['post_text']); 365 $Row['post_subject'] = StrTr($Row['post_subject'], "\x8A\x8D\x8E\x9A\x9D\x9E", "\xA9\xAB\xAE\xB9\xBB\xBE"); 366 $Row['topic_title'] = StrTr($Row['topic_title'], "\x8A\x8D\x8E\x9A\x9D\x9E", "\xA9\xAB\xAE\xB9\xBB\xBE"); 367 $Index = $Index + 1; 368 363 $Row['post_text'] = StrTr($Row['post_text'], "\x8A\x8D\x8E\x9A\x9D\x9E", "\xA9\xAB\xAE\xB9\xBB\xBE"); 364 $Row['post_text'] = str_replace("\n","<br>", $Row['post_text']); 365 $Row['post_subject'] = StrTr($Row['post_subject'], "\x8A\x8D\x8E\x9A\x9D\x9E", "\xA9\xAB\xAE\xB9\xBB\xBE"); 366 $Row['topic_title'] = StrTr($Row['topic_title'], "\x8A\x8D\x8E\x9A\x9D\x9E", "\xA9\xAB\xAE\xB9\xBB\xBE"); 367 $Index = $Index + 1; 368 369 369 $Title = $Row['topic_title'].'-'.$Row['post_subject']; 370 370 $Content = $Row['post_text']; … … 374 374 //echo('category='.$ForumCategory.' AND title="'.addslashes($Title).'" AND content="'.addslashes($Content).'" AND author="'.addslashes($Author).'" AND date="'.$Date.'"'); 375 375 $DbResult2 = $Database->select('news', '*', 'category='.$ForumCategory.' AND title="'.addslashes($Title).'" AND content="'.addslashes($Content).'" AND author="'.addslashes($Author).'" AND date="'.$Date.'"'); 376 if($DbResult2->num_rows == 0) //echo('.'); else echo('x'); 376 if($DbResult2->num_rows == 0) //echo('.'); else echo('x'); 377 377 $Database->insert('news', array('category' => $ForumCategory, 'title' => $Title, 'content' => $Content, 'author' => $Author, 'date' => $Date)); 378 //echo($Date); 378 //echo($Date); 379 379 $Database->select_db('forum'); 380 380 } … … 388 388 $EnclosuresText = ''; 389 389 if($Row['Enclosure'] != '') 390 { 390 { 391 391 $EnclosuresText .= '<br />Přílohy: '; 392 392 $Enclosures = explode(';', $Row['Enclosure']); 393 393 foreach($Enclosures as $Enclosure) 394 394 { 395 if(file_exists($this->UploadedFilesFolder.$Enclosure)) 396 $EnclosuresText .= ' <a href="'.$this->System->Link('/aktuality/'.$ UploadedFilesFolder.$Enclosure).'">'.$Enclosure.'</a>';395 if(file_exists($this->UploadedFilesFolder.$Enclosure)) 396 $EnclosuresText .= ' <a href="'.$this->System->Link('/aktuality/'.$this->UploadedFilesFolder.$Enclosure).'">'.$Enclosure.'</a>'; 397 397 } 398 398 } … … 409 409 $RSS = new RSS(); 410 410 $RSS->Title = $this->System->Config['Web']['Title'].' - Aktuality'; 411 $RSS->Link = 'http://'.$this->System->Config['Web']['Host'].'/'; 412 $RSS->Description = 'Aktuality '.$this->System->Config['Web']['Description']; 413 $RSS->WebmasterEmail = $this->System->Config['Web']['AdminEmail']; 411 $RSS->Link = 'http://'.$this->System->Config['Web']['Host'].'/'; 412 $RSS->Description = 'Aktuality '.$this->System->Config['Web']['Description']; 413 $RSS->WebmasterEmail = $this->System->Config['Web']['AdminEmail']; 414 414 $RSS->Items = $Items; 415 return($RSS->Generate()); 416 } 415 return($RSS->Generate()); 416 } 417 417 } -
trunk/block/index.php
r578 r659 1 1 <?php 2 2 3 include_once('../ Common/System.php');3 include_once('../Application/System.php'); 4 4 5 5 class BlockPage extends Page … … 29 29 $DbResult = $this->Database->select('Member', '*', 'Id='.$Device['Member']); 30 30 $Member = $DbResult->fetch_array(); 31 31 32 32 if($Member['Blocked'] == 1) 33 33 { … … 35 35 } else $Output .= $this->Reasons[0]; 36 36 } else $Output .= $this->Reasons[4]; 37 37 38 38 $Output .= '<br/><br/>V případě problémů kontaktujte technickou podporu na telefonu 737785792<br/><br/>'; 39 39 $Output .= '</body></html>';
Note:
See TracChangeset
for help on using the changeset viewer.