Changeset 189 for trunk/aktuality


Ignore:
Timestamp:
Apr 12, 2009, 5:40:08 PM (16 years ago)
Author:
george
Message:
  • Upraveno: Údaje uživatele jméno a příjmení bylo sloušeno do údaje Zobrazované jméno. Upraveny patřičné sloupce a odkazy ze skriptů.
  • Opraveno: Registrace nových uživatelů.
Location:
trunk/aktuality
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/aktuality/index.php

    r183 r189  
    3131        {
    3232          if(array_key_exists('id', $_GET)) $Id = $_GET['id'] * 1;
    33           $DbResult = $this->Database->query('SELECT `news`.*, `User`.`Nick` FROM `news` LEFT JOIN `User` ON `User`.`Id`=`news`.`User` WHERE  `news`.`id`='.$Id);
     33          $DbResult = $this->Database->query('SELECT `news`.*, `User`.`Name` FROM `news` LEFT JOIN `User` ON `User`.`Id`=`news`.`User` WHERE  `news`.`id`='.$Id);
    3434          if($DbResult->num_rows > 0)
    3535          {
    3636            $Row = $DbResult->fetch_array();
    37             if($Row['Nick'] == '') $Author = $Row['author'];
    38               else $Author = $Row['Nick'];
     37            if($Row['Name'] == '') $Author = $Row['author'];
     38              else $Author = $Row['Name'];
    3939            $Output .= '<div style="border: thin dotted #97ADFF;        background: #F6F7FF; margin-top: 5px; padding: 0px 5px 5px 5px;"><div style="padding-bottom: 1px; border-bottom-width: 1; border-bottom-style: solid; border-bottom-color: silver;"><strong>'.$Row['title'].' ('.HumanDate($Row['date']).', '.$Author.')</strong>';
    4040            if($this->System->Modules['User']->User['Id'] == $Row['User'])
     
    105105
    106106          $_POST['content'] = str_replace("\n",'<br />',$_POST['content']);
    107           $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['Nick'], 'User' => $this->System->Modules['User']->User['Id']));
     107          $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']));
    108108          $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 />';
    109109          $Output .= '<a href="index.php?category='.$_POST['category'].'">Zpět na seznam aktualit</a>';
     
    173173
    174174          //echo(GetRemoteAddress().','.$_SERVER['HTTP_X_FORWARDED_FOR'].'<br />');
    175           $DbResult = $this->Database->query('SELECT `news`.*, `User`.`Nick` FROM `news` LEFT JOIN `User` ON `User`.`Id`=`news`.`User` WHERE `category`='.$Category.' ORDER BY `news`.`id` DESC LIMIT '.($Page * $PerPage).','.$PerPage);
     175          $DbResult = $this->Database->query('SELECT `news`.*, `User`.`Name` FROM `news` LEFT JOIN `User` ON `User`.`Id`=`news`.`User` WHERE `category`='.$Category.' ORDER BY `news`.`id` DESC LIMIT '.($Page * $PerPage).','.$PerPage);
    176176          while($Row = $DbResult->fetch_array())
    177177          {
    178             if($Row['Nick'] == '') $Author = $Row['author'];
    179               else $Author = $Row['Nick'];
     178            if($Row['Name'] == '') $Author = $Row['author'];
     179              else $Author = $Row['Name'];
    180180            $Output .= '<div style="border: thin dotted #97ADFF; background: #F6F7FF; margin-top: 5px; padding: 0px 5px 5px 5px;"><div style="padding-bottom: 1px; border-bottom-width: 1; border-bottom-style: solid; border-bottom-color: silver;"><strong><a href="?action=view&id='.$Row['id'].'">'.$Row['title'].'</a> ('.HumanDate($Row['date']).', '.$Author.')</strong>';
    181181            if($this->System->Modules['User']->User['Id'] == $Row['User'])
  • trunk/aktuality/news.php

    r183 r189  
    2727      $Output .= '<a href="aktuality/index.php?action=add&amp;category='.$Category.'">Přidat aktualitu</a>&nbsp;';
    2828    $Output .= '</td></tr><tr><td colspan="2">';
    29     $DbResult = $Database->query('SELECT `news`.*, `User`.`Nick` FROM `news` LEFT JOIN `User` ON `User`.`Id`=`news`.`User` WHERE (`news`.`category`='.$Category.') AND (DATE_SUB(NOW(), INTERVAL '.$DaysAgo.' DAY) < `news`.`date`) ORDER BY `news`.`date` DESC LIMIT 0,'.$ItemCount);
     29    $DbResult = $Database->query('SELECT `news`.*, `User`.`Name` FROM `news` LEFT JOIN `User` ON `User`.`Id`=`news`.`User` WHERE (`news`.`category`='.$Category.') AND (DATE_SUB(NOW(), INTERVAL '.$DaysAgo.' DAY) < `news`.`date`) ORDER BY `news`.`date` DESC LIMIT 0,'.$ItemCount);
    3030    //echo($Database->error.'<br />');
    3131    //echo($Database->LastQuery.'<br />');
     
    3838      while($Row = $DbResult->fetch_array())
    3939      {
    40         if($Row['Nick'] == '') $Author = $Row['author'];
    41           else $Author = $Row['Nick'];
     40        if($Row['Name'] == '') $Author = $Row['author'];
     41          else $Author = $Row['Name'];
    4242        $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 cellspacing="0" cellpadding="0" style="padding: 0px; margin: 0px; font-size: small; color: red;" width="100%"><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>';
    4343        $Output .= '<div id="new'.$Category.$Index.'" class="NewsTableItem">'.$Row['content'];
Note: See TracChangeset for help on using the changeset viewer.