Changeset 236 for trunk/aktuality/news.php
- Timestamp:
- Jul 29, 2009, 7:22:20 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 }
Note:
See TracChangeset
for help on using the changeset viewer.