Kann mir ein vielleicht die lastnews so ändern das er es so anzeigt?? (ich bekomms nicht gebacken!)

Hier kann eine Notiz zum Merk-Eintrag hinzugefügt werden (optional)
Geschlossen |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | <?php defined ( 'main' ) or die ( 'no direct access' ); $abf = 'SELECT * FROM prefix_koms where cat = "NEWS" ORDER BY id DESC LIMIT 5' ; $erg = db_query( $abf ); while ( $row = db_fetch_object( $erg )) { $user = $row ->name; $umbruch =50; $stringname = $row ->text; if ( strlen ( $stringname )> $umbruch ) $stringname = substr ( $stringname ,0,( $umbruch -3)). "..." ; echo ' <table width= "100%" cellspacing= "0" cellpadding= "0" height= "13" > <tr><td>von:<b> '.$user.' </b><br><a href= "?newsextended-'.$row->uid.'" > '.$stringname.' </a><br><br></td></tr> </table>'; } ?> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | <?php defined ( 'main' ) or die ( 'no direct access' ); $abf = 'SELECT * FROM prefix_koms where cat = "NEWS" ORDER BY id DESC LIMIT 5' ; $erg = db_query( $abf ); while ( $row = db_fetch_object( $erg )) { $user = $row ->name; $umbruch =50; $stringname = $row ->text; if ( strlen ( $stringname )> $umbruch ) $stringname = substr ( $stringname ,0,( $umbruch -3)). "..." ; echo ' <table width= "100%" cellspacing= "0" cellpadding= "0" height= "13" > <tr><td>von:<b> '.$user.' </b><br><a class = "box" href= "index.php?news-'.$row->news_id.'" > '.$row->news_title.' </a><br><br></td></tr> </table>'; } ?> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | <?php defined ( 'main' ) or die ( 'no direct access' ); $abf = 'SELECT news_title as title, news_autor as autor, news_id as id, DATE_FORMAT(a.news_time, '%d.%m.%Y' ) as datum, FROM prefix_news WHERE news_recht >= '.$_SESSION[' authright '].' ORDER BY news_time DESC LIMIT 0,5'; $erg = db_query( $abf ); echo '<table border="0" width="100%" cellspacing="0" cellpadding="0">' ; while ( $row = db_fetch_object( $erg )) { echo '<tr>' ; echo '<td rowspan="2" align="center">Newsbild</td>' ; echo '<td colspan="2"><a class="box" href="index.php?news-' . $row ->id. '">' .(( strlen ( $row ->title)<30) ? $row ->title : substr ( $row ->title,0,27). '...' ). '</a></td>' ; echo '</tr>' ; echo '<tr>' ; echo '<td>Autor: ' . $row ->username. '</td>' ; echo '<td>Datum: ' . $row ->datum. '</td>' ; echo '</tr>' ; } echo '</table>' ; ?> |
1 | $row->username |
1 | $row->autor |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | <?php defined ( 'main' ) or die ( 'no direct access' ); $abf = "SELECT news_title as title, news_autor as autor, news_id as id, DATE_FORMAT(news_time, '%d.%m.%Y' ) as datum, FROM prefix_news WHERE news_recht >= '.$_SESSION[' authright '].' ORDER BY news_time DESC LIMIT 0,5"; $erg = db_query( $abf ); echo '<table border="0" width="100%" cellspacing="0" cellpadding="0">' ; while ( $row = db_fetch_object( $erg )) { echo '<tr>' ; echo '<td rowspan="2" align="center">Newsbild</td>' ; echo '<td colspan="2"><a class="box" href="index.php?news-' . $row ->id. '">' .(( strlen ( $row ->title)<30) ? $row ->title : substr ( $row ->title,0,27). '...' ). '</a></td>' ; echo '</tr>' ; echo '<tr>' ; echo '<td>Autor: ' . $row ->autor. '</td>' ; echo '<td>Datum: ' . $row ->datum. '</td>' ; echo '</tr>' ; } echo '</table>' ; ?> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | <?php defined ( 'main' ) or die ( 'no direct access' ); $abf = 'SELECT a.news_kat as kate, DATE_FORMAT(a.news_time, "%d.%m.%Y - %H:%i" ) as datum, a.news_title as title, a.news_id as id, b.name as username, b.id as userid FROM prefix_news as a LEFT JOIN prefix_user as b ON a.user_id = b.id WHERE news_recht >= '.$_SESSION[' authright '].' ORDER BY a.news_time DESC LIMIT 0,5'; $erg = db_query( $abf ); echo '<table border="0" width="100%" cellspacing="0" cellpadding="0">' ; while ( $row = db_fetch_object( $erg )) { echo '<tr>' ; echo '<td rowspan="2" align="center">Newsbild</td>' ; echo '<td colspan="2"><a class="box" href="index.php?news-' . $row ->id. '">' .(( strlen ( $row ->title)<30) ? $row ->title : substr ( $row ->title,0,27). '...' ). '</a></td>' ; echo '</tr>' ; echo '<tr>' ; echo '<td>Autor: <a href="?user-details-' . $row ->userid. '">' . $row ->username. '</a></td>' ; echo '<td>Datum: ' . $row ->datum. '</td>' ; echo '</tr>' ; } echo '</table>' ; ?> |
Geschlossen | ||
![]() |
Zurück zu HTML, PHP, SQL,... |