Changeset 462


Ignore:
Timestamp:
Mar 1, 2009, 3:42:55 PM (16 years ago)
Author:
amun
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/beta/inc/html.php

    r461 r462  
    6262  <meta name=\"keywords\" content=\"".$this->CfgChck("keywords")."\" />
    6363  <link rel=\"stylesheet\" type=\"text/css\" href=\"styles/style.css\" />
    64   <script type=\"text/javascript\" src=\"styles/global.js\"></script>
    6564  <!--[if IE]><link rel=\"stylesheet\" type=\"text/css\" href=\"styles/ie.css\" /><![endif]-->
    6665  </head>
     
    208207      public function ShowNews ($kategorie)
    209208      {
    210                 global $db_webu;
    211                
    212209        if ($kategorie == "all")
    213210        {
     
    218215          $where = "WHERE `category` = '".$kategorie."'";
    219216        }
    220  mysql_connect($db_server, $db_user, $db_pass);
    221   mysql_select_db($db_webu);
    222   $limit = 5;
    223    
    224        
    225 $pocet = mysql_num_rows(mysql_query("SELECT id FROM `articles`".$where."ORDER BY `date` DESC;"));
    226 $offset = ($_GET["offset"] ? $_GET["offset"] : $pocet);
    227 
    228 if ($pocet != 0)
    229         {
    230                   mysql_query("SET NAMES 'utf8'");
    231 $result = mysql_query("SELECT * FROM articles $where ORDER BY date DESC, id DESC LIMIT $limit OFFSET " . ($pocet - $offset));
    232 while($row = mysql_fetch_array($result)){
    233  switch ($row["category"])
     217        $this -> db -> select_db($db_webu);
     218        $sql = $this -> db -> query("SELECT * FROM `articles`".$where."ORDER BY `date` DESC;");
     219        if ($sql -> num_rows > 0)
     220        {
     221        // TODO !!
     222          while ($row = $sql -> fetch_array())
     223          {
     224            switch ($row["category"])
    234225            {
    235226              case 1:
     
    267258              <tr>
    268259                <td>Sekce : <a href=\"?page=".$link."\">".$cat."</a></td>
    269                 <td>".$row["autor"]."</td>
     260                <td>Zork</td>
    270261              </tr>
    271262            </table>
    272263            <br />
    273264            ";
    274 }
    275 if ($offset < $pocet) {
    276     echo "<a href='$_SERVER[PHP_SELF]" . ($offset + $limit < $pocet ? "?offset=" . ($offset + $limit) : "") . "'>zpět</a>\n";
    277 }
    278 if ($offset > $limit) {
    279     echo "<a href='$_SERVER[PHP_SELF]?offset=" . ($offset - $limit) . "'>vpřed</a>\n";
    280 }
    281 
    282 
    283 
    284 
    285  
    286        
     265          }
    287266        }
    288267        else
Note: See TracChangeset for help on using the changeset viewer.