Changeset 55 for administrace
- Timestamp:
- Aug 21, 2007, 3:52:22 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
administrace/george/gm_news.php
r11 r55 1 <? 2 include_once('db.php'); 3 include('../../config.php'); 4 DB_Init($DatabaseHost, $DatabaseUser, $DatabasePassword, 'wow'); 5 //DB_Query('SET CHARACTER SET cp1250'); 1 <?php 2 $Database->select_db('wow'); 6 3 7 4 if(array_key_exists('action', $_GET)) … … 11 8 if(array_key_exists('message', $_POST) and array_key_exists('author', $_POST)) 12 9 { 13 DB_Insert('gm_news', array('time' => 'NOW()', 'author' => $_POST['author'], 'text' => $_POST['message']));10 $Database->insert('gm_news', array('time' => 'NOW()', 'author' => $_POST['author'], 'text' => $_POST['message'])); 14 11 echo('Zpráva byla pøidána!<br>Pokraèujte <a href="../master.php">zde</a>.'); 15 12 } else echo('Nebyly zadány poadováné údaje pro pøidání aktuality!'); 16 13 } else if($_GET['action'] == 'show_all') 17 14 { 18 DB_Select('gm_news', '*,UNIX_TIMESTAMP(time)', '1 ORDER BY time DESC');19 while($Row = DB_Row())15 $DbResult = $Database->select('gm_news', '*,UNIX_TIMESTAMP(time)', '1 ORDER BY time DESC'); 16 while($Row = $DbResult->fetch_array()) 20 17 { 21 18 echo('<span class="SpanAktuality">'.date('j.n.Y G:i', $Row['UNIX_TIMESTAMP(time)']).'</span> - '.$Row['author'].': '.$Row['text'].'<br>'); … … 23 20 } else echo('Neznámá akce!'); 24 21 } else { 25 DB_Select('gm_news', '*,UNIX_TIMESTAMP(time)', '1 ORDER BY time DESC LIMIT 0, 25');26 while($Row = DB_Row())22 $DbResult = $Database->select('gm_news', '*,UNIX_TIMESTAMP(time)', '1 ORDER BY time DESC LIMIT 0, 25'); 23 while($Row = $DbResult->fetch_array()) 27 24 { 28 25 echo('<span class="SpanAktuality">'.date('j.n.Y G:i', $Row['UNIX_TIMESTAMP(time)']).'</span> - '.$Row['author'].': '.$Row['text'].'<br>');
Note:
See TracChangeset
for help on using the changeset viewer.