- Timestamp:
- Mar 20, 2015, 10:22:50 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/News/News.php
r816 r828 28 28 function ShowBox() 29 29 { 30 $Output = '<strong> '.T('System changes').':</strong><div class="NewsBox">';31 $DbResult = $this->Database->query('SELECT `News`.`Time`, `User`.`Name`, `News`.`Text`,`News`.`Title` '.30 $Output = '<strong><a href="'.$this->System->Link('/news/').'">'.T('News').':</a></strong><div class="NewsBox">'; 31 $DbResult = $this->Database->query('SELECT `News`.`Time`, `User`.`Name`, `News`.`Text`,`News`.`Title`, `News`.`Id` '. 32 32 ' FROM `News` JOIN `User` ON `User`.`ID` = `News`.`User` ORDER BY `Time` DESC LIMIT 10'); 33 33 while($DbRow = $DbResult->fetch_assoc()) 34 $Output .= '<div><strong>'.$DbRow['Title'].' ('.HumanDate($DbRow['Time']).')</strong> <br />'.$DbRow['Text'].' ('.$DbRow['Name'].')</div>'; 35 $Output .= '<a href="'.$this->System->Link('/news/').'">'.T('All news').'</a>'; 34 { 35 $Output .= '<h4><a href="'.$this->System->Link('/news/?a=item&i='.$DbRow['Id']).'">'.$DbRow['Title'].'</a> ('.HumanDate($DbRow['Time']).')</h4>'. 36 ' <div>'.$DbRow['Text'].' ('.$DbRow['Name'].')</div>'; 37 } 36 38 $Output .= '</div>'; 37 39 return($Output); … … 70 72 else $Action = ''; 71 73 if($Action == 'add2') $Output = $this->SaveNew(); 72 if($Action == 'add') $Output = $this->ShowAddForm(); 74 else if($Action == 'add') $Output = $this->ShowAddForm(); 75 else if($Action == 'item') $Output = $this->ShowItem(); 73 76 else $Output = $this->ShowList(); 74 77 return($Output); … … 85 88 $Output .= ' <a href="?a=add">'.T('Add').'</a>'; 86 89 $Output .= '<div class="shoutbox">'; 87 $DbResult = $this->System->Database->query('SELECT `News`.`Time`, `News`.`Text`, `News`.`Title`, '.90 $DbResult = $this->System->Database->query('SELECT `News`.`Time`, `News`.`Text`, `News`.`Title`, `News`.`Id`, '. 88 91 '`User`.`Name` AS `User` FROM `News` JOIN `User` ON `User`.`Id`=`News`.`User` ORDER BY `News`.`Time` DESC '.$PageList['SQLLimit']); 89 92 while($Line = $DbResult->fetch_assoc()) 90 $Output .= '<div><strong>'.$Line['Title'].' ('.HumanDate($Line['Time']).')</strong><br/> '.$Line['Text'].' ('.$Line['User'].')</div>'; 93 { 94 $Output .= '<h4><a href="?a=item&i='.$Line['Id'].'">'.$Line['Title'].'</a> ('.HumanDate($Line['Time']).')</h4><div>'.$Line['Text'].' ('.$Line['User'].')</div>'; 95 } 91 96 $Output .= '</div>'.$PageList['Output']; 97 return($Output); 98 } 99 100 function ShowItem() 101 { 102 if(array_key_exists('i', $_GET)) 103 { 104 $Output = '<h3>'.T('News').'</h3>'; 105 $DbResult = $this->System->Database->query('SELECT `News`.`Time`, `News`.`Text`, `News`.`Title`, `News`.`Id`, '. 106 '`User`.`Name` AS `User` FROM `News` JOIN `User` ON `User`.`Id`=`News`.`User` WHERE `News`.`Id` = '.($_GET['i'] * 1)); 107 if($DbResult->num_rows == 1) 108 { 109 $Line = $DbResult->fetch_assoc(); 110 $Output .= '<h4>'.$Line['Title'].' ('.HumanDate($Line['Time']).')</h4><div>'.$Line['Text'].' ('.$Line['User'].')</div>'; 111 } else $Output = ShowMessage(T('Item not found'), MESSAGE_CRITICAL); 112 } else $Output = ShowMessage(T('Item not found'), MESSAGE_CRITICAL); 113 $Output .= '<br/><a href="'.$this->System->Link('/news/').'">'.T('All news').'</a>'; 92 114 return($Output); 93 115 } … … 129 151 $Items = array(); 130 152 $DbResult = $this->Database->query('SELECT UNIX_TIMESTAMP(`News`.`Time`) AS `UnixTime`, '. 131 '`News`.`Title`, `News`.`Time`, `User`.`Name`, `News`.`Text` '.153 '`News`.`Title`, `News`.`Time`, `User`.`Name`, `News`.`Text`, `News`.`Id` '. 132 154 'FROM `News` JOIN `User` ON `User`.`ID` = `News`.`User` ORDER BY `Time` DESC LIMIT 10'); 133 155 while($DbRow = $DbResult->fetch_assoc()) … … 136 158 ( 137 159 'Title' => $DbRow['Title'], 138 'Link' => 'http://'.$this->System->Config['Web']['Host'].$this->System->Link('/news/ '),160 'Link' => 'http://'.$this->System->Config['Web']['Host'].$this->System->Link('/news/?a=item&i='.$DbRow['Id']), 139 161 'Description' => $DbRow['Text'].' ('.$DbRow['Name'].')', 140 162 'Time' => $DbRow['UnixTime'], -
trunk/includes/Version.php
r827 r828 6 6 // and system will need database update. 7 7 8 $Revision = 82 7; // Subversion revision8 $Revision = 828; // Subversion revision 9 9 $DatabaseRevision = 811; // Database structure revision 10 $ReleaseTime = '2015-03- 08';10 $ReleaseTime = '2015-03-20'; -
trunk/style/style.css
r825 r828 272 272 border-bottom-width: 1px; 273 273 border-bottom-color: #e0e0e0; 274 padding: 5px; 274 padding: 0px; 275 } 276 277 .shoutbox h4 278 { 279 text-align: left; 280 margin: 5px 0px 0px 0px; 275 281 } 276 282 … … 355 361 } 356 362 363 .NewsBox h4 364 { 365 text-align: left; 366 margin: 5px 0px 0px 0px; 367 } 368 357 369 .Home 358 370 { … … 557 569 width: 25%; 558 570 } 571 572 .Form 573 { 574 margin-left: auto; 575 margin-right: auto; 576 } 577 578 .Form tr .Left 579 { 580 text-align: right; 581 font-weight: normal; 582 }
Note:
See TracChangeset
for help on using the changeset viewer.