Changeset 306


Ignore:
Timestamp:
Jan 30, 2011, 8:56:26 PM (14 years ago)
Author:
george
Message:
  • Přidáno: RSS import pro obec hovězí a kino Vatra.
Location:
trunk
Files:
3 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/aktuality/import_tv_beskyd.php

    r251 r306  
    99$StartLink = 'url="';
    1010$Category = 13;
    11 $Author = 'dviproduction.cz';
     11$Author = 'Automat';
    1212
    1313//$Content = addslashes(ToUTF8(file_get_contents($SourceURL), 'win1250'));
     
    2626//  $Link = substr($Link, 0, strpos($Link, '?')); // Remove URL parameters
    2727//  $Link = substr($Link, 0, strrpos($Link, '/')).substr($Link, strrpos($Link, '/')); // Insert month between folder and filename
    28   $Description .= '<br><a href="'.$Link.'">Video</a>';
    2928
    3029  //echo('Title: '.$Title.'<br>');
     
    3635  if($DbResult->num_rows == 0)
    3736  {
    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));
    3938    echo($Database->insert_id.',');
    4039  }
  • trunk/aktuality/import_zdechov_cz_aktuality.php

    r196 r306  
    99$StartDate = 'vloženo: ';
    1010$Category = 12;
     11$Author = 'Automat';
    1112
    1213$Content = addslashes(ToUTF8(file_get_contents($SourceURL), 'win1250'));
     
    3536  if($DbResult->num_rows == 0)
    3637  {
    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));
    3839    echo($Database->insert_id.',');
    3940  }
  • trunk/aktuality/import_zdechov_cz_zapisy.php

    r196 r306  
    88$StartLink = '<a href=..';
    99$Category = 11;
     10$Author = 'Automat';
    1011
    1112$Content = addslashes(ToUTF8(file_get_contents($SourceURL), 'win1250'));
     
    2122  $Link = substr($Link, 0, strpos($Link, '?')); // Remove URL parameters
    2223  $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 = '';
    2425
    2526/*
     
    3435  if($DbResult->num_rows == 0)
    3536  {
    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);
    3738    echo($Database->insert_id.',');
    3839  }
  • trunk/aktuality/index.php

    r302 r306  
    4747            }
    4848            $Output .= '</div><div class="Content">'.$News->ModifyContent($Row['Content']).'<br />';
     49            if($Row['Link'] != '') $Output .= '<br/><a href="'.$Row['Link'].'">Odkaz</a>';
    4950            if($Row['Enclosure'] != '')
    5051            {
     
    7778    'Nadpis:<br /><input type="text" size="54" name="title"><br />
    7879    Obsah:<br /><textarea name="content" rows="20" cols="40"></textarea><br />
     80    Odkaz:<br /><input type="text" size="54" name="link"><br />
    7981    Přílohy (Max. velikost souboru 1 MB):<br /><input type="hidden" name="MAX_FILE_SIZE" value="1000000">
    8082    <input name="enclosure1" size="38" type="file"><br />
     
    108110
    109111          $_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']));
    111113          $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 />';
    112114          $Output .= '<a href="index.php?category='.$_POST['category'].'">Zpět na seznam aktualit</a>';
     
    125127          'Nadpis:<br /><input type="text" size="54" name="title" value="'.$Row['Title'].'"><br />'.
    126128          'Obsah:<br /><textarea name="content" rows="20" cols="40">'.$Row['Content'].'</textarea><br />'.
     129          'Odkaz:<br /><input type="text" size="54" name="link"><br />'.
    127130          '<input type="hidden" name="category" value="'.$Category.'"><br />'.
    128131          '<input type="submit" value="Uložit">'.
     
    192195            }
    193196            $Output .= '</div><div class="Content">'.$News->ModifyContent($Row['Content']).'<br />';
     197            if($Row['Link'] != '') $Output .= '<br/><a href="'.$Row['Link'].'">Odkaz</a>';
    194198            if($Row['Enclosure'] != '')
    195199            {
  • trunk/aktuality/news.php

    r305 r306  
    6969        $Output .= '<tr><td onclick="window.location=\'aktuality/index.php?action=view&amp;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>';
    7070        $Output .= '<div id="new'.$Category.$Index.'" class="NewsTableItem">'.$this->ModifyContent($Row['Content']);
     71        if($Row['Link'] != '') $Output .= '<br/><a href="'.$Row['Link'].'">Odkaz</a>';
    7172
    7273        if($Row['Enclosure'] != '')
  • trunk/global.php

    r303 r306  
    489489}
    490490
     491function strip_cdata($string)
     492{
     493  preg_match_all('/<!\[cdata\[(.*?)\]\]>/is', $string, $matches);
     494  return str_replace($matches[0], $matches[1], $string);
     495}
     496
     497function 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
    491508?>
Note: See TracChangeset for help on using the changeset viewer.