Changeset 183 for trunk/aktuality
- Timestamp:
- Mar 26, 2009, 8:51:40 PM (16 years ago)
- Location:
- trunk/aktuality
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/aktuality/index.php
r151 r183 31 31 { 32 32 if(array_key_exists('id', $_GET)) $Id = $_GET['id'] * 1; 33 $DbResult = $this->Database->query('SELECT `news`.*, `User`.`N ame` FROM `news` LEFT JOIN `User` ON `User`.`Id`=`news`.`User` WHERE `news`.`id`='.$Id);33 $DbResult = $this->Database->query('SELECT `news`.*, `User`.`Nick` FROM `news` LEFT JOIN `User` ON `User`.`Id`=`news`.`User` WHERE `news`.`id`='.$Id); 34 34 if($DbResult->num_rows > 0) 35 35 { 36 36 $Row = $DbResult->fetch_array(); 37 $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']).', '.$Row['Name'].$Row['author'].')</strong>'; 37 if($Row['Nick'] == '') $Author = $Row['author']; 38 else $Author = $Row['Nick']; 39 $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>'; 38 40 if($this->System->Modules['User']->User['Id'] == $Row['User']) 39 41 { … … 56 58 break; 57 59 case 'add': 58 59 60 60 $Output .= '<strong>Vložení nové aktuality:</strong><br />'; 61 if($Category == 2) $Output .= 'U inzerátů uvádějte co nejvíce informací ať případný zájemce ví co kupuje. Uvádějte kontaktní údaje jako Jméno, email, tel. číslo, ICQ. Dále navrženou cenu, detajlní popis předmětu nejlépe s odkazem na stránky výrobce. Pokud váš inzerát již není platný, připište do něj např. "Prodáno" pomocí editace.'; 62 $Output .= '<form enctype="multipart/form-data" action="?action=add2" method="post">'. 61 63 'Kategorie: <select name="category">'; 62 $DbResult = $this->Database->select('news_category', '*');63 while($DbRow = $DbResult->fetch_array())64 {65 if($this->System->Modules['User']->CheckPermission('News', 'Insert', 'Group', $DbRow['id']))66 {67 if($DbRow['id'] == $Category) $Selected = ' selected="1"'; else $Selected = '';68 $Output .= '<option value="'.$DbRow['id'].'"'.$Selected.'>'.$DbRow['caption'].'</option>';69 }70 }71 $Output .= '</select><br />'.64 $DbResult = $this->Database->select('news_category', '*'); 65 while($DbRow = $DbResult->fetch_array()) 66 { 67 if($this->System->Modules['User']->CheckPermission('News', 'Insert', 'Group', $DbRow['id'])) 68 { 69 if($DbRow['id'] == $Category) $Selected = ' selected="1"'; else $Selected = ''; 70 $Output .= '<option value="'.$DbRow['id'].'"'.$Selected.'>'.$DbRow['caption'].'</option>'; 71 } 72 } 73 $Output .= '</select><br />'. 72 74 'Nadpis:<br /><input type="text" size="54" name="title"><br /> 73 75 Obsah:<br /><textarea name="content" rows="20" cols="40"></textarea><br /> … … 103 105 104 106 $_POST['content'] = str_replace("\n",'<br />',$_POST['content']); 105 $this->Database->insert('news',array('category' => $Category, 'title' => $_POST['title'], 'content' => $_POST['content'], 'date' => 'NOW()', 'ip' => $RemoteAddr, 'enclosure' => $Enclosures, ' User' => $this->System->Modules['User']->User['Id']));107 $this->Database->insert('news',array('category' => $Category, 'title' => $_POST['title'], 'content' => $_POST['content'], 'date' => 'NOW()', 'ip' => $RemoteAddr, 'enclosure' => $Enclosures, 'author' => $this->System->Modules['User']->User['Nick'], 'User' => $this->System->Modules['User']->User['Id'])); 106 108 $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 />'; 107 109 $Output .= '<a href="index.php?category='.$_POST['category'].'">Zpět na seznam aktualit</a>'; … … 150 152 $Output .= '<br />Přílohy: '; 151 153 $Enclosures = explode(';', $Row['enclosure']); 152 foreach($Enclosures as $Enclosure)153 {154 if(file_exists($this->UploadedFilesFolder.$Enclosure)) unlink($this->UploadedFilesFolder.$Enclosure);155 }154 foreach($Enclosures as $Enclosure) 155 { 156 if(file_exists($this->UploadedFilesFolder.$Enclosure)) unlink($this->UploadedFilesFolder.$Enclosure); 157 } 156 158 } 157 159 $this->Database->query('DELETE FROM news WHERE id='.$_GET['id']); … … 171 173 172 174 //echo(GetRemoteAddress().','.$_SERVER['HTTP_X_FORWARDED_FOR'].'<br />'); 173 $DbResult = $this->Database->query('SELECT `news`.*, `User`.`N ame` FROM `news` LEFT JOIN `User` ON `User`.`Id`=`news`.`User` WHERE `category`='.$Category.' ORDER BY `news`.`id` DESC LIMIT '.($Page * $PerPage).','.$PerPage);175 $DbResult = $this->Database->query('SELECT `news`.*, `User`.`Nick` FROM `news` LEFT JOIN `User` ON `User`.`Id`=`news`.`User` WHERE `category`='.$Category.' ORDER BY `news`.`id` DESC LIMIT '.($Page * $PerPage).','.$PerPage); 174 176 while($Row = $DbResult->fetch_array()) 175 177 { 176 $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><a href="?action=view&id='.$Row['id'].'">'.$Row['title'].'</a> ('.HumanDate($Row['date']).', '.$Row['Name'].$Row['author'].')</strong>'; 178 if($Row['Nick'] == '') $Author = $Row['author']; 179 else $Author = $Row['Nick']; 180 $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><a href="?action=view&id='.$Row['id'].'">'.$Row['title'].'</a> ('.HumanDate($Row['date']).', '.$Author.')</strong>'; 177 181 if($this->System->Modules['User']->User['Id'] == $Row['User']) 178 182 { … … 185 189 $Output .= '<br />Přílohy: '; 186 190 $Enclosures = explode(';', $Row['enclosure']); 187 foreach($Enclosures as $Enclosure)191 foreach($Enclosures as $Enclosure) 188 192 { 189 190 }193 if(file_exists($this->UploadedFilesFolder.$Enclosure)) $Output .= ' <a href="'.$this->UploadedFilesFolder.$Enclosure.'">'.$Enclosure.'</a>'; 194 } 191 195 } 192 196 $Output .= '</div>'; -
trunk/aktuality/news.php
r155 r183 27 27 $Output .= '<a href="aktuality/index.php?action=add&category='.$Category.'">Přidat aktualitu</a> '; 28 28 $Output .= '</td></tr><tr><td colspan="2">'; 29 $DbResult = $Database->query('SELECT `news`.*, `User`.`N ame` FROM `news` LEFT JOIN `User` ON `User`.`Id`=`news`.`User` WHERE (`news`.`category`='.$Category.') AND (DATE_SUB(NOW(), INTERVAL '.$DaysAgo.' DAY) < `news`.`date`) ORDER BY `news`.`date` DESC LIMIT 0,'.$ItemCount);29 $DbResult = $Database->query('SELECT `news`.*, `User`.`Nick` FROM `news` LEFT JOIN `User` ON `User`.`Id`=`news`.`User` WHERE (`news`.`category`='.$Category.') AND (DATE_SUB(NOW(), INTERVAL '.$DaysAgo.' DAY) < `news`.`date`) ORDER BY `news`.`date` DESC LIMIT 0,'.$ItemCount); 30 30 //echo($Database->error.'<br />'); 31 31 //echo($Database->LastQuery.'<br />'); … … 38 38 while($Row = $DbResult->fetch_array()) 39 39 { 40 $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 cellspacing="0" cellpadding="0" style="padding: 0px; margin: 0px; font-size: small; color: red;" width="100%"><tr><td style="font-size: '.$FontSize.'pt"><strong>'.$Row['title'].'</strong></td><td align="right" style="font-size: '.$FontSize.'pt">'.$Row['Name'].$Row['author'].' ('.HumanDate($Row['date']).')</td></tr></table>'; 40 if($Row['Nick'] == '') $Author = $Row['author']; 41 else $Author = $Row['Nick']; 42 $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 cellspacing="0" cellpadding="0" style="padding: 0px; margin: 0px; font-size: small; color: red;" width="100%"><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>'; 41 43 $Output .= '<div id="new'.$Category.$Index.'" class="NewsTableItem">'.$Row['content']; 42 44 … … 45 47 $Output .= '<br />Přílohy: '; 46 48 $Enclosures = explode(';', $Row['enclosure']); 47 foreach($Enclosures as $Enclosure)48 {49 if(file_exists($UploadedFilesFolder.$Enclosure)) $Output .= ' <a href="'.$UploadedFilesFolder.$Enclosure.'">'.$Enclosure.'</a>';50 }49 foreach($Enclosures as $Enclosure) 50 { 51 if(file_exists($UploadedFilesFolder.$Enclosure)) $Output .= ' <a href="'.$UploadedFilesFolder.$Enclosure.'">'.$Enclosure.'</a>'; 52 } 51 53 } 52 53 $Output .= '</div></td></tr>'; 54 $Index = $Index + 1; 55 $FontSize = $FontSize - 1; 56 } 57 $Output .= '</table>'; 54 $Output .= '</div></td></tr>'; 55 $Index = $Index + 1; 56 $FontSize = $FontSize - 1; 57 } 58 $Output .= '</table>'; 58 59 } 59 60 $Output .= '</td></tr></table>'."\n\n"; -
trunk/aktuality/rss.php
r151 r183 88 88 89 89 echo(GenerateRSS(array( 90 'Title' => 'ZděchovNET- Aktuality',91 'Link' => 'http:// centrala.zdechov.net/',90 'Title' => $Config['Web']['Title'].' - Aktuality', 91 'Link' => 'http://'.$Config['Web']['Host'].'/', 92 92 'Description' => 'Aktuality komunitní počítačové sítě ZděchovNET', 93 'WebmasterEmail' => 'robie@centrum.cz',93 'WebmasterEmail' => $Config['Web']['AdminEmail'], 94 94 'Items' => $Items))); 95 95 ?> -
trunk/aktuality/rss_generator.php
r151 r183 1 1 <?php 2 3 include_once('../global.php');4 2 5 3 function GenerateRSS($Data)
Note:
See TracChangeset
for help on using the changeset viewer.