Changeset 236
- Timestamp:
- Jul 29, 2009, 7:22:20 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/aktuality/index.php
r220 r236 30 30 else 31 31 { 32 $News = new News($this->Database); 32 33 if(array_key_exists('id', $_GET)) $Id = $_GET['id'] * 1; 33 34 $DbResult = $this->Database->query('SELECT `News`.*, `User`.`Name` FROM `News` LEFT JOIN `User` ON `User`.`Id`=`News`.`User` WHERE `News`.`Id`='.$Id); … … 37 38 if($Row['Name'] == '') $Author = $Row['Author']; 38 39 else $Author = $Row['Name']; 39 $Output .= '<div style="border: thin dotted #97ADFF; 40 $Output .= '<div style="border: thin dotted #97ADFF; background: #F6F7FF; margin-top: 5px; padding: 0px 5px 5px 5px;"><div style="padding-bottom: 1px; border-bottom-width: 1; border-bottom-style: solid; border-bottom-color: silver;"><strong>'.$Row['Title'].' ('.HumanDate($Row['Date']).', '.$Author.')</strong>'; 40 41 if($this->System->Modules['User']->User['Id'] == $Row['User']) 41 42 { … … 43 44 $Output .= ' <a href="index.php?action=edit&category='.$Category.'&id='.$Row['Id'].'">Editovat</a>'; 44 45 } 45 $Output .= '</div>'.$ Row['Content'].'<br />';46 $Output .= '</div>'.$News->ModifyContent($Row['Content']).'<br />'; 46 47 if($Row['Enclosure'] != '') 47 48 { 48 49 $Output .= '<br />Přílohy: '; 49 50 $Enclosures = explode(';', $Row['Enclosure']); 50 51 52 51 foreach($Enclosures as $Enclosure) 52 { 53 if(file_exists($this->UploadedFilesFolder.$Enclosure)) $Output .= ' <a href="'.$this->UploadedFilesFolder.$Enclosure.'">'.$Enclosure.'</a>'; 53 54 } 54 55 } … … 96 97 { 97 98 $Output .= 'Soubor '.basename($_FILES[$EnclosureName]['name']).' byl uložen na serveru.<br />'; 98 99 $Enclosures = $Enclosures.';'.basename($_FILES[$EnclosureName]['name']); 99 100 } else 100 101 { … … 139 140 $this->Database->update('News', 'Id='.$_POST['id'], array('Title' => $_POST['title'], 'Content' => $_POST['content'])); 140 141 $Output .= 'Aktualita uložena!<br />'; 141 142 $Output .= '<a href="index.php?category='.$Category.'">Zpět na seznam aktualit</a>'; 142 143 } else $Output .= 'Nelze měnit cizí aktualitu!<br />'; 143 144 } else $Output .= 'ID nenalezeno!'; … … 152 153 $Output .= '<br />Přílohy: '; 153 154 $Enclosures = explode(';', $Row['Enclosure']); 154 155 156 157 155 foreach($Enclosures as $Enclosure) 156 { 157 if(file_exists($this->UploadedFilesFolder.$Enclosure)) unlink($this->UploadedFilesFolder.$Enclosure); 158 } 158 159 } 159 160 $this->Database->query('DELETE FROM News WHERE Id='.$_GET['id']); … … 164 165 if($this->System->Modules['User']->CheckPermission('News', 'Display', 'Group', $Category)) 165 166 { 167 $News = new News($this->Database); 166 168 $PerPage = 20; 167 169 $DbResult = $this->Database->select('News', 'COUNT(*)', ' Category='.$Category); … … 185 187 $Output .= ' <a href="index.php?action=edit&category='.$Category.'&id='.$Row['Id'].'">Editovat</a>'; 186 188 } 187 $Output .= '</div>'.$ Row['Content'].'<br />';189 $Output .= '</div>'.$News->ModifyContent($Row['Content']).'<br />'; 188 190 if($Row['Enclosure'] != '') 189 191 { 190 192 $Output .= '<br />Přílohy: '; 191 193 $Enclosures = explode(';', $Row['Enclosure']); 192 193 194 foreach($Enclosures as $Enclosure) 195 { 194 196 if(file_exists($this->UploadedFilesFolder.$Enclosure)) $Output .= ' <a href="'.$this->UploadedFilesFolder.$Enclosure.'">'.$Enclosure.'</a>'; 195 197 } 196 198 } 197 199 $Output .= '</div>'; -
trunk/aktuality/news.php
r221 r236 12 12 var $NewsCountPerCategory = 3; 13 13 var $UploadedFilesFolder = 'aktuality/uploads/'; 14 15 function ModifyContent($Content) 16 { 17 $Result = ''; 18 19 // Make HTML link from URL 20 $I = 0; 21 while(strpos($Content, 'http://') !== false) 22 { 23 $I = strpos($Content, 'http://'); 24 if($Content{$I - 1} != '"') 25 { 26 $Result .= substr($Content, 0, $I); 27 $Content = substr($Content, $I); 28 if(strpos($Content, ' ') !== false) 29 $URL = substr($Content, 0, strpos($Content, ' ')); 30 else $URL = substr($Content, 0); 31 $Result .= '<a href="'.$URL.'">'.$URL.'</a>'; 32 $Content = substr($Content, strlen($URL)); 33 } else 34 { 35 $Result .= substr($Content, 0, $I + 1); 36 $Content = substr($Content, $I + 1); 37 } 38 } 39 $Result .= $Content; 40 return($Result); 41 } 14 42 15 43 function ShowNews($Category, $ItemCount, $DaysAgo) … … 41 69 else $Author = $Row['Name']; 42 70 $Output .= '<tr><td onclick="window.location=\'aktuality/index.php?action=view&id='.$Row['Id'].'\'" onmouseover="zobraz('."'new".$Category.$Index."'".')" style="cursor: pointer; margin: 0px;"><table class="NewsItemFrame"><tr><td style="font-size: '.$FontSize.'pt"><strong>'.$Row['Title'].'</strong></td><td align="right" style="font-size: '.$FontSize.'pt">'.$Author.' ('.HumanDate($Row['Date']).')</td></tr></table>'; 43 $Output .= '<div id="new'.$Category.$Index.'" class="NewsTableItem">'.$ Row['Content'];71 $Output .= '<div id="new'.$Category.$Index.'" class="NewsTableItem">'.$this->ModifyContent($Row['Content']); 44 72 45 73 if($Row['Enclosure'] != '') … … 47 75 $Output .= '<br />Přílohy: '; 48 76 $Enclosures = explode(';', $Row['Enclosure']); 49 50 51 52 77 foreach($Enclosures as $Enclosure) 78 { 79 if(file_exists($UploadedFilesFolder.$Enclosure)) $Output .= ' <a href="'.$UploadedFilesFolder.$Enclosure.'">'.$Enclosure.'</a>'; 80 } 53 81 } 54 82 $Output .= '</div></td></tr>'; … … 125 153 '<td align="center"><input type="text" size="2" name="NewsCategoryCount'.$I.'" value="'.$SettingItem['ItemCount'].'" />'. 126 154 '<input type="hidden" name="NewsCategoryId'.$I.'" value="'.$SettingItem['CategoryId'].'" /></td>'. 127 155 '<td align="center"><input type="text" size="3" name="NewsCategoryDaysAgo'.$I.'" value="'.$SettingItem['DaysAgo'].'" /></td></tr>'; 128 156 $I++; 129 157 } -
trunk/index.php
r233 r236 12 12 array('Finance', '/finance/', 'money.gif'), 13 13 array('Statistika', 'http://stat.zdechov.net/centrala/', 'chart.gif'), 14 array('Prohledat sdílení', '/share/', 'prohledavac_sdileni.gif', array('Share', 'Display')),14 //array('Prohledat sdílení', '/share/', 'prohledavac_sdileni.gif', array('Share', 'Display')), 15 15 array('Seznam uživatelů', '/userlist.php', 'comp.gif'), 16 16 array('Seznam počítačů', '/hostlist.php', 'comp.gif'), 17 array('Sdílení souborů', 'http://wiki.zdechov.net/index.php/DC_hub', 'prohledavac_sdileni.gif'), 17 18 array('Historie chatu', '/chat/history.php', 'sunrisechat.gif', array('Chat', 'Display')), 18 19 array('Webový chat', 'http://embed.mibbit.com/?server=game.zdechov.net%3A6667&channel=%23zdechov&forcePrompt=true&charset=utf-8', 'sunrisechat.gif'),
Note:
See TracChangeset
for help on using the changeset viewer.