Permalink
Browse files

Merge pull request #83 from djphil/patch-48

Update news.php
  • Loading branch information...
2 parents d6fc0c4 + c7f7d98 commit 094e1e215369e0849cadaba41c43153611342d95 @keverw keverw committed Apr 25, 2013
Showing with 59 additions and 59 deletions.
  1. +59 −59 www/sites/news/news.php
View
@@ -1,81 +1,81 @@
<div id="content">
- <div id="ContentHeaderLeft"><h5><?= SYSNAME ?></h5></div>
- <div id="ContentHeaderCenter"></div>
- <div id="ContentHeaderRight"><h5><? echo $webui_news; ?></h5></div>
+ <div id="ContentHeaderLeft"><h5><?php echo SYSNAME; ?></h5></div>
+ <div id="ContentHeaderCenter"></div>
+ <div id="ContentHeaderRight"><h5><?php echo $webui_news; ?></h5></div>
- <div class="clear"></div>
+ <div class="clear"></div>
- <div id="news">
- <div id="info"><p><? echo $webui_news; ?></p></div>
+ <div id="news">
+ <div id="info">
+ <p><?php echo $webui_news; ?></p>
+ </div>
-<?php
-
- $querypage = 0;
+ <?php
+ $querypage = 0;
if($_GET[pagenum] != "") {
- $querypage = cleanQuery($_GET[pagenum]);
- }
- $showNext = true;
- $DbLink = new DB;
- $DbLink->query("SELECT COUNT(*) from " . C_NEWS_TBL . $query);
-while (list($count) = $DbLink->next_record()) {
-if($querypage*5 + 5 > $count)
- $showNext = false;
-}
- ?>
-<!-- STYLE TO DO -->
- <div style="text-align: left; width: 50%; float: left;">
+ $querypage = cleanQuery($_GET[pagenum]);
+ }
+ $showNext = true;
+ $DbLink = new DB;
+ $DbLink->query("SELECT COUNT(*) from " . C_NEWS_TBL . $query);
+ while (list($count) = $DbLink->next_record()) {
+ if($querypage*5 + 5 > $count)
+ $showNext = false;
+ }
+ ?>
+ <!-- STYLE TO DO -->
+ <?php
+ if($querypage > 0) { ?>
+ <div style="text-align: left; width: 50%; float: left;">
+ <a href="<?php echo SYSURL; ?>index.php?page=news&pagenum=<?php echo $querypage - 1 ?>">Previous Page</a>
+ </div>
+ <?php } ?>
+
<?php
- if($querypage > 0) { ?>
- <a href="<?=SYSURL?>index.php?page=news&pagenum=<?=$querypage-1?>">Previous Page</a>
- <?php } ?>&nbsp;
- </div>
- <div style="text-align: right; width: 50%; float: left;">
- <?php
if($showNext) { ?>
- <a href="<?=SYSURL?>index.php?page=news&pagenum=<?=$querypage+1?>">Next Page</a>
- <?php } ?>&nbsp;
- </div>
-<!-- STYLE TO DO -->
-
- <table>
- <?
+ <div style="text-align: right; width: 50%; float: left;">
+ <a href="<?php echo SYSURL; ?>index.php?page=news&pagenum=<?php echo $querypage + 1 ?>">Next Page</a>
+ </div>
+ <?php } ?>
+ <!-- STYLE TO DO -->
+
+ <table>
+ <?php
$query = "";
if($_GET[scr] != "") {
$query = " where id='".cleanQuery($_GET[scr])."'";
}
+
$querypage = $querypage * 5;
$DbLink->query("SELECT id,title,message,time,user from " . C_NEWS_TBL . $query . " ORDER BY time DESC LIMIT $querypage,".($querypage+5));
$count = 0;
while (list($id, $title, $message, $time, $user) = $DbLink->next_record()) {
$count++;
-
if (strlen($title) > 92) {
$title = substr($title, 0, 92);
$title .= "...";
- }
- $TIMES = date("l M d Y", $time);
- ?>
-
- <tr>
- <td width="100"><div class="news_time"><b><?= $TIMES ?></b>
- </br></br>
- <b>By <?php echo $user;?>
- </div></td>
- <td><div class="news_title"><h3> <a href="<?=SYSURL?>index.php?page=news&scr=<?=$id?>" ><?=$title?></a></h3></div></td>
- </tr>
-
- <tr>
- <td></td>
- <td><div class="news_content"><?= $message ?></div></td>
- </tr>
+ }
+ $TIMES = date("l M d Y", $time);
+ ?>
- <tr>
- <td colspan="2"><hr /></td>
- </tr>
- <? } $DbLink->clean_results();
-
- $DbLink->close(); ?>
- </table>
- </div>
+ <tr>
+ <td>
+ <div class="news_title">
+ <h4><a href="<?php echo SYSURL?>index.php?page=news&scr=<?php echo $id; ?>" ><?php echo $title; ?></a></h4>
+ <div class="author"><?php echo $user; ?>: <?php echo $TIMES; ?></div>
+ <?php echo $message; ?>
+ </div>
+ </td>
+ </tr>
+
+ <?php }
+ $DbLink->clean_results();
+ $DbLink->close();
+ ?>
+ </table>
+ <div align="center">
+ <a href="<?php echo SYSURL; ?>sites/news/feeds.php" target="_blank" title="RSS" alt="RSS"><img src="<?php echo SYSURL; ?>images/icons/rss.gif" ></a>
+ </div>
+ </div>
</div>

0 comments on commit 094e1e2

Please sign in to comment.