Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function get_news($id = '') {
- if($nid != ""):
- $id = mysql_real_escape_string($id);
- $sql = "SELECT * FROM `newsITEMS` WHERE nid = '$id'";
- $return = '<p class="content"><a href="index.php?section=news">Tilbage til Nyhederne!</a></p>';
- else:
- // get news items tho get latest 5 news :) that way we dont get our front page spammed with old news.....
- $sql = "SELECT * FROM `newsITEMS` WHERE `published` = 1 ORDER BY nid DESC LIMIT 0, 5 ";
- endif;
- $res = mysql_query($sql) or die(mysql_error());
- if(mysql_num_rows($res) != 0):
- while($row = mysql_fetch_assoc($res)) {
- echo '<table>';
- echo '<tr>';
- echo '<td class="date" style="text-align: left; font-size: 12pt; " >';
- echo '<p class="date">';
- // SLAM CODE ON! SLAM CODE ON! SLAM CODE ON! SLAM CODE ON!
- $nid=$row['nid'];
- $date = $row['date'];
- list($year, $month, $day) = split('[-.-]', $date);
- if ($month=='01')
- {
- $month = 'JAN';
- }
- elseif ($month=='02')
- {
- $month = 'FEB';
- }
- elseif ($month=='03')
- {
- $month = 'MAR';
- }
- elseif ($month=='04')
- {
- $month = 'APR';
- }
- elseif ($month=='05')
- {
- $month = 'MAJ';
- }
- elseif ($month=='06')
- {
- $month = 'JUN';
- }
- elseif ($month=='07')
- {
- $month = 'JUL';
- }
- elseif ($month=='08')
- {
- $month = 'AUG';
- }
- elseif ($month=='09')
- {
- $month = 'SEP';
- }
- elseif ($month=='10')
- {
- $month = 'OKT';
- }
- elseif ($month=='11')
- {
- $month = 'NOV';
- }
- elseif ($month=='12')
- {
- $month = 'DEC';
- }
- //SLAM CODE OFF! SLAM CODE OFF! SLAM CODE OFF! SLAM CODE OFF!
- echo '<font size="24"><b>'.$day.'</b></font>';
- echo '<span class="date"><b>'.$month.'</span></b>';
- echo '<span class="readON"><a href="?p=news&id='.$nid.'">READ</a></span>';
- echo '</td>';
- echo '<td class="news">';
- echo $row['intro'];
- echo '</td>';
- echo '</tr>';
- echo '</table>';
- echo '<img src="gfx/fooSPACER.png" style="margin-top:20px; margin-bottom:5px;">';
- }
- else:
- echo '<p> Uh Oh!, Der er ikke nogen nyheder lige nu.</p>';
- endif;
- echo $return;
- }
Advertisement
Add Comment
Please, Sign In to add comment