Changeset 306
- Timestamp:
- Jan 30, 2011, 8:56:26 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/aktuality/import_tv_beskyd.php
r251 r306 9 9 $StartLink = 'url="'; 10 10 $Category = 13; 11 $Author = ' dviproduction.cz';11 $Author = 'Automat'; 12 12 13 13 //$Content = addslashes(ToUTF8(file_get_contents($SourceURL), 'win1250')); … … 26 26 // $Link = substr($Link, 0, strpos($Link, '?')); // Remove URL parameters 27 27 // $Link = substr($Link, 0, strrpos($Link, '/')).substr($Link, strrpos($Link, '/')); // Insert month between folder and filename 28 $Description .= '<br><a href="'.$Link.'">Video</a>';29 28 30 29 //echo('Title: '.$Title.'<br>'); … … 36 35 if($DbResult->num_rows == 0) 37 36 { 38 $Database->insert('News', array('Title' => $Title, 'Date' => 'NOW()', 'Author' => $Author, 'Category' => $Category, 'Content' => $Description ));37 $Database->insert('News', array('Title' => $Title, 'Date' => 'NOW()', 'Author' => $Author, 'Category' => $Category, 'Content' => $Description, 'Link' => $Link)); 39 38 echo($Database->insert_id.','); 40 39 } -
trunk/aktuality/import_zdechov_cz_aktuality.php
r196 r306 9 9 $StartDate = 'vloženo: '; 10 10 $Category = 12; 11 $Author = 'Automat'; 11 12 12 13 $Content = addslashes(ToUTF8(file_get_contents($SourceURL), 'win1250')); … … 35 36 if($DbResult->num_rows == 0) 36 37 { 37 $Database->insert('News', array('Title' => $Title, 'Date' => $Date, 'Author' => 'zdechov.cz', 'Category' => $Category, 'Content' => addslashes($Description)));38 $Database->insert('News', array('Title' => $Title, 'Date' => $Date, 'Author' => $Author, 'Category' => $Category, 'Content' => addslashes($Description), 'Link' => $Link)); 38 39 echo($Database->insert_id.','); 39 40 } -
trunk/aktuality/import_zdechov_cz_zapisy.php
r196 r306 8 8 $StartLink = '<a href=..'; 9 9 $Category = 11; 10 $Author = 'Automat'; 10 11 11 12 $Content = addslashes(ToUTF8(file_get_contents($SourceURL), 'win1250')); … … 21 22 $Link = substr($Link, 0, strpos($Link, '?')); // Remove URL parameters 22 23 $Link = substr($Link, 0, strrpos($Link, '/')).$DateParts[1].substr($Link, strrpos($Link, '/')); // Insert month between folder and filename 23 $Description = ' <a href="'.$Link.'">Odkaz</a>';24 $Description = ''; 24 25 25 26 /* … … 34 35 if($DbResult->num_rows == 0) 35 36 { 36 $Database->insert('News', array('Title' => $Title, 'Date' => $Date, 'Author' => 'zdechov.cz', 'Category' => $Category, 'Content' => $Description));37 $Database->insert('News', array('Title' => $Title, 'Date' => $Date, 'Author' => $Automat, 'Category' => $Category, 'Content' => $Description), 'Link' => $Link); 37 38 echo($Database->insert_id.','); 38 39 } -
trunk/aktuality/index.php
r302 r306 47 47 } 48 48 $Output .= '</div><div class="Content">'.$News->ModifyContent($Row['Content']).'<br />'; 49 if($Row['Link'] != '') $Output .= '<br/><a href="'.$Row['Link'].'">Odkaz</a>'; 49 50 if($Row['Enclosure'] != '') 50 51 { … … 77 78 'Nadpis:<br /><input type="text" size="54" name="title"><br /> 78 79 Obsah:<br /><textarea name="content" rows="20" cols="40"></textarea><br /> 80 Odkaz:<br /><input type="text" size="54" name="link"><br /> 79 81 Přílohy (Max. velikost souboru 1 MB):<br /><input type="hidden" name="MAX_FILE_SIZE" value="1000000"> 80 82 <input name="enclosure1" size="38" type="file"><br /> … … 108 110 109 111 $_POST['content'] = str_replace("\n",'<br />',$_POST['content']); 110 $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['Name'], 'User' => $this->System->Modules['User']->User['Id'] ));112 $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['Name'], 'User' => $this->System->Modules['User']->User['Id'], 'Link' => $_POST['link'])); 111 113 $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 />'; 112 114 $Output .= '<a href="index.php?category='.$_POST['category'].'">Zpět na seznam aktualit</a>'; … … 125 127 'Nadpis:<br /><input type="text" size="54" name="title" value="'.$Row['Title'].'"><br />'. 126 128 'Obsah:<br /><textarea name="content" rows="20" cols="40">'.$Row['Content'].'</textarea><br />'. 129 'Odkaz:<br /><input type="text" size="54" name="link"><br />'. 127 130 '<input type="hidden" name="category" value="'.$Category.'"><br />'. 128 131 '<input type="submit" value="Uložit">'. … … 192 195 } 193 196 $Output .= '</div><div class="Content">'.$News->ModifyContent($Row['Content']).'<br />'; 197 if($Row['Link'] != '') $Output .= '<br/><a href="'.$Row['Link'].'">Odkaz</a>'; 194 198 if($Row['Enclosure'] != '') 195 199 { -
trunk/aktuality/news.php
r305 r306 69 69 $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>'; 70 70 $Output .= '<div id="new'.$Category.$Index.'" class="NewsTableItem">'.$this->ModifyContent($Row['Content']); 71 if($Row['Link'] != '') $Output .= '<br/><a href="'.$Row['Link'].'">Odkaz</a>'; 71 72 72 73 if($Row['Enclosure'] != '') -
trunk/global.php
r303 r306 489 489 } 490 490 491 function strip_cdata($string) 492 { 493 preg_match_all('/<!\[cdata\[(.*?)\]\]>/is', $string, $matches); 494 return str_replace($matches[0], $matches[1], $string); 495 } 496 497 function html2txt($document) 498 { 499 $search = array('@<script[^>]*?>.*?</script>@si', // Strip out javascript 500 '@<[\/\!]*?[^<>]*?>@si', // Strip out HTML tags 501 '@<style[^>]*?>.*?</style>@siU', // Strip style tags properly 502 '@<![\s\S]*?--[ \t\n\r]*>@' // Strip multi-line comments including CDATA 503 ); 504 $text = preg_replace($search, '', $document); 505 return $text; 506 } 507 491 508 ?>
Note:
See TracChangeset
for help on using the changeset viewer.