Changeset 542


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.
Location:
trunk/Modules
Files:
6 edited

Legend:

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

    r533 r542  
    2727  $Date = TimeToMysqlDateTime(strtotime($Date));
    2828 
    29   $Query = 'SELECT Id FROM News WHERE (`Title`="'.$Database->real_escape_string($Title).'") AND (`Category`='.$Category.') AND (`Content` = "'.$Database->real_escape_string($Description).'") AND (`Link` = "'.$Database->real_escape_string($Link).'")';
    30   $DbResult = $Database->query($Query);
     29  $Query = 'SELECT Id FROM News WHERE (`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).'")';
     30  $DbResult = $System->Database->query($Query);
    3131  if($DbResult->num_rows == 0)
    3232  {
    33     $Database->insert('News', array('Title' => $Title, 'Date' => $Date, 'Author' => $Author, 'Category' => $Category, 'Content' => $Description, 'Link' => $Link));
    34     echo($Database->insert_id.',');
     33    $System->Database->insert('News', array('Title' => $Title, 'Date' => $Date, 'Author' => $Author, 'Category' => $Category, 'Content' => $Description, 'Link' => $Link));
     34    echo($System->Database->insert_id.',');
    3535  }
    3636}
  • 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}
  • trunk/Modules/News/ImportTvBeskyd.php

    r533 r542  
    3131  //echo('Link: '.$Link.'<br><hr>');
    3232 
    33   $DbResult = $Database->select('News', 'Id', '`Title`="'.$Database->real_escape_string($Title).'" AND `Category`='.$Category);
    34   //echo($Database->LastQuery);
     33  $DbResult = $System->Database->select('News', 'Id', '`Title`="'.$System->Database->real_escape_string($Title).'" AND `Category`='.$Category);
     34  //echo($System->Database->LastQuery);
    3535  if($DbResult->num_rows == 0)
    3636  {
    37     $Database->insert('News', array('Title' => $Title, 'Date' => 'NOW()', 'Author' => $Author, 'Category' => $Category, 'Content' => $Description, 'Link' => $Link));
    38     echo($Database->insert_id.',');
     37    $System->Database->insert('News', array('Title' => $Title, 'Date' => 'NOW()', 'Author' => $Author, 'Category' => $Category, 'Content' => $Description, 'Link' => $Link));
     38    echo($System->Database->insert_id.',');
    3939  }
    4040}
  • trunk/Modules/News/ImportZdechovCzNews.php

    r533 r542  
    3535  */
    3636
    37   $DbResult = $Database->select('News', 'Id', '`Title`="'.$Database->real_escape_string($Title).'" AND `Date`="'.$Date.'" AND `Category`='.$Category);
    38   //echo($Database->LastQuery);
     37  $DbResult = $System->Database->select('News', 'Id', '`Title`="'.$System->Database->real_escape_string($Title).'" AND `Date`="'.$Date.'" AND `Category`='.$Category);
     38  //echo($System->Database->LastQuery);
    3939  if($DbResult->num_rows == 0)
    4040  {
    41     $Database->insert('News', array('Title' => $Title, 'Date' => $Date, 'Author' => $Author, 'Category' => $Category, 'Content' => $Description, 'Link' => $Link));
    42     echo($Database->insert_id.',');
     41    $System->Database->insert('News', array('Title' => $Title, 'Date' => $Date, 'Author' => $Author, 'Category' => $Category, 'Content' => $Description, 'Link' => $Link));
     42    echo($System->Database->insert_id.',');
    4343  }
    4444}
  • trunk/Modules/News/ImportZdechovCzRecords.php

    r533 r542  
    3535  */
    3636
    37   $DbResult = $Database->select('News', 'Id', '`Title`="'.$Database->real_escape_string($Title).'" AND `Date`="'.$Date.'" AND `Category`='.$Category);
    38   //echo($Database->LastQuery);
     37  $DbResult = $System->Database->select('News', 'Id', '`Title`="'.$System->Database->real_escape_string($Title).'" AND `Date`="'.$Date.'" AND `Category`='.$Category);
     38  //echo($System->Database->LastQuery);
    3939  if($DbResult->num_rows == 0)
    4040  {
    41     $Database->insert('News', array('Title' => $Title, 'Date' => $Date, 'Author' => $Author, 'Category' => $Category, 'Content' => $Description, 'Link' => $Link));
    42     echo($Database->insert_id.',');
     41    $System->Database->insert('News', array('Title' => $Title, 'Date' => $Date, 'Author' => $Author, 'Category' => $Category, 'Content' => $Description, 'Link' => $Link));
     42    echo($System->Database->insert_id.',');
    4343  }
    4444}
  • trunk/Modules/Search/Search.php

    r541 r542  
    2323    foreach($this->System->ModuleManager->Modules['Search']->Items as $Item)
    2424    {
    25       $Output .= '<strong>'.$Item['Name'].'</strong><br/>';
    2625      $Columns = '';
    2726      $Condition = '';
     
    3534      $DbResult = $this->Database->Select($Item['Table'], $Columns, $Condition.' LIMIT '.
    3635        $this->System->ModuleManager->Modules['Search']->MaxItemCount);
    37       echo($this->Database->LastQuery);
     36      if($DbResult->num_rows > 0) $Output .= '<strong>'.$Item['Name'].'</strong><br/>';
    3837      while($Row = $DbResult->fetch_assoc())
    3938      {
Note: See TracChangeset for help on using the changeset viewer.