Ignore:
Timestamp:
Jun 2, 2013, 9:14:50 PM (12 years ago)
Author:
chronos
Message:
  • Opraveno: Import aktualit z jiných webů se odkazoval na dřívější globální proměnnou $Database.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/News/ImportObecHovezi.php

    r533 r542  
    2828 
    2929 
    30   $DbResult = $Database->select('News', 'Id', '(`Title`="'.$Database->real_escape_string($Title).'") AND (`Category`='.$Category.') AND (`Content` = "'.$Database->real_escape_string($Description).'") AND (`Link` = "'.$Database->real_escape_string($Link).'")');
    31   //echo($Database->LastQuery);
     30  $DbResult = $System->Database->select('News', 'Id', '(`Title`="'.$System->Database->real_escape_string($Title).'") AND (`Category`='.$Category.') AND (`Content` = "'.$System->Database->real_escape_string($Description).'") AND (`Link` = "'.$System->Database->real_escape_string($Link).'")');
     31  //echo($System->Database->LastQuery);
    3232  if($DbResult->num_rows == 0)
    3333  {
    34     $Database->insert('News', array('Title' => $Title, 'Date' => $Date, 'Author' => $Author, 'Category' => $Category, 'Content' => $Description, 'Link' => $Link));
    35     echo($Database->insert_id.',');
     34    $System->Database->insert('News', array('Title' => $Title, 'Date' => $Date, 'Author' => $Author, 'Category' => $Category, 'Content' => $Description, 'Link' => $Link));
     35    echo($System->Database->insert_id.',');
    3636  }
    3737}
     
    5959  //echo('Link: '.$Link.'<br><hr>');
    6060 
    61   $Link = $Database->real_escape_string($Link);
    62   $Title = $Database->real_escape_string($Title);
     61  $Link = $System->Database->real_escape_string($Link);
     62  $Title = $System->Database->real_escape_string($Title);
    6363  $Description = strip_cdata($Description);
    6464  $Description = strip_tags($Description);
     
    6666  $Description = str_replace("\n", '<br>', $Description);
    6767  $Description = str_replace("\r", '', $Description);
    68   $Description = $Database->real_escape_string($Description);
     68  $Description = $System->Database->real_escape_string($Description);
    6969 
    70   $DbResult = $Database->select('News', 'Id', '(`Title`="'.$Title.'") AND (`Category`='.$Category.') AND (`Content` = "'.$Description.'") AND (`Link` = "'.$Link.'")');
    71   //echo($Database->LastQuery);
     70  $DbResult = $System->Database->select('News', 'Id', '(`Title`="'.$Title.'") AND (`Category`='.$Category.') AND (`Content` = "'.$Description.'") AND (`Link` = "'.$Link.'")');
     71  //echo($System->Database->LastQuery);
    7272  if($DbResult->num_rows == 0)
    7373  {
    74     $Database->insert('News', array('Title' => $Title, 'Date' => 'NOW()', 'Author' => $Author, 'Category' => $Category, 'Content' => $Description, 'Link' => $Link));
    75     echo($Database->insert_id.',');
     74    $System->Database->insert('News', array('Title' => $Title, 'Date' => 'NOW()', 'Author' => $Author, 'Category' => $Category, 'Content' => $Description, 'Link' => $Link));
     75    echo($System->Database->insert_id.',');
    7676  }
    7777}
Note: See TracChangeset for help on using the changeset viewer.