<table width="100%" height="0%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr><?php define('yenisatir', '</tr><tr>'); // yenisatir means new rowglobal $database;$get_page = 4; // insert page_id here$query_settings = $database->query("SELECT posts_per_page FROM ".TABLE_PREFIX."mod_news_settings WHERE page_id=$get_page");$fetch_settings = $query_settings->fetchRow();$latest = $fetch_settings['posts_per_page']; // this calls the standard wb's post per page setting. So you can change latest news quantity by only changing your post per page setting. So, the quantities of post per page and latest news will be same.$query = "SELECT ".TABLE_PREFIX."mod_news_posts.post_id,".TABLE_PREFIX."mod_news_posts.short,".TABLE_PREFIX."mod_news_posts.title,".TABLE_PREFIX."mod_news_posts.link,".TABLE_PREFIX."mod_news_settings.num_cols FROM ".TABLE_PREFIX."mod_news_posts,".TABLE_PREFIX."mod_news_settings WHERE ".TABLE_PREFIX."mod_news_posts.page_id=$get_page AND ".TABLE_PREFIX."mod_news_posts.active=1 AND ".TABLE_PREFIX."mod_news_settings.page_id=$get_page ORDER BY position DESC LIMIT 0, $latest;";// If you want to make different the quantities of post per page and latest news, replace "$latest" with a number above to specify the latest news quantity$error = mysql_error();if (!$result = mysql_query($query)) {print "$error";exit;}$counter = 0;while($data = mysql_fetch_object($result)){ $title = $data->title; $short = $data->short; $id = $data->post_id; $link = $data->link; $num_cols = $data->num_cols; echo stripslashes('<td class="haber" align="left" valign="top"><div style="padding-bottom: 1px; font-weight: bold;" ><b><a href="'.$link.'">'.$title.'</a></b></div>'.$short.'</td>'); // If you didn't modified your WB to work with "safe mode on" (in other words if you are using default WB), replace .link. with .WB_URL.'/pages/'.$link.PAGE_EXTENSION. $counter = $counter+1; if($counter == $num_cols) // I've added a column setting in my news module similiar to gallery module's column setting. I can specify my column quantity from news' settings and latest news gets the number from there. If you didn't add (in other words if you are using default WB) replace $num_cols with a number to specify a column quantity { echo yenisatir; $counter = 0; }}?> </tr></table>
<?php global $database;$query = "SELECT post_id,title,group_id,link FROM ".TABLE_PREFIX."mod_news_posts ORDER BY position DESC LIMIT 0, 5;";$error = mysql_error();if (!$result = mysql_query($query)) {print "$error";exit;}while($data = mysql_fetch_object($result)){$title = $data->title;$id = $data->post_id;$link = $data->link;echo '<font class="nyttlink"><a href="'.WB_URL.$link.PAGE_EXTENSION.'">'.$title.'</font><br /><br /></a>';}?>
http://klaknav.sudurras.com/pages/templates/round/top1_2.jpg
// Specify the Group(id) you want to read the news from or 0 for all groups$group = 2; // Specify number of newsitems $limit=4;// Specify read more text$readmore = "Lees Verder"; // Specify Older news text$oldernews = "Oude items"; // Query for obtaining stuff from a group$query = "SELECT * FROM ".TABLE_PREFIX."mod_news_posts WHERE group_id = $group and active = 1 ORDER BY position DESC LIMIT 0, 10;";// Query for all groups ;)if ($group<1 ) { $query = "SELECT * FROM ".TABLE_PREFIX."mod_news_posts WHERE active = 1 ORDER BY position DESC LIMIT 0, 10;";}// No changes needed here, maybe for output!global $database;$result = $database->query($query);$total = $result->numRows(); // how many items are there?if ($total>1) { // at least 2 needed for 2 news items $data = $result->fetchRow() ; // get left item $data2 = $result->fetchRow() ; // get right item echo '<table width=100% border=0>'; echo '<tr><td width=50%><b>'.$data['title'].'</b></td><td></td></tr>'; echo '<tr><td>'.$data['content_short'].'</td><td></td></tr>'; echo '<tr><td><a href="'.WB_URL.PAGES_DIRECTORY.$data['link'].PAGE_EXTENSION.'">'.$readmore.'</a></td><td></td></tr>'; echo '<tr><td></td><td></td></tr>'; echo '<tr><td></td><td></td></tr>'; echo '<tr><td></td><td></td></tr>'; echo '<tr><td></td><td></td></tr>'; echo '<tr><td></td><td></td></tr>'; echo '<tr><td></td><td width=50%><b>'.$data2['title'].'</b></td></tr>'; echo '<tr><td></td><td>'.$data2['content_short'].'</td></tr>'; echo '<tr><td></td><td><a href="'.WB_URL.PAGES_DIRECTORY.$data2['link'].PAGE_EXTENSION.'">'.$readmore.'</a></td></tr>'; echo '</table>';}// Next show the restif ($total>2) { // are there any left?echo '<br><br><table><tr><td colspan=2><b>'.$oldernews.'</b></td></tr>';echo '<tr><td>Datum</td><td>Onderwerp</td></tr>';while ($data = $result->fetchRow()) { echo '<tr><td>'.strftime( "%d-%m-%Y",$data['posted_when']).'</td>'; echo '<td><a href="'.WB_URL.PAGES_DIRECTORY.$data['link'].PAGE_EXTENSION.'">'.$data['title'].'</a></td></tr>';}echo '</table>';}
<div id="sidelink"> </div></p><-- Login Box start --> <form name="login" action="http://w007be2b.dd15712.kasserver.com/account/login.php" method="post" class="login_table"> <h2>Login</h2> Username: <input type="text" name="username" style="text-transform: lowercase;" /> Password: <input type="password" name="password" /> <input type="submit" name="submit" value="Login" style="margin-top: 3px; text-transform: uppercase;" /> <a href="http://w007be2b.dd15712.kasserver.com/account/forgot.php">Forgot Details?</a> </form><-- Login Box End --><--News Box start --><?php// Specify the Group(id) you want to read the news from or 0 for all groups$group = 0; // Specify number of newsitems $limit=10;// Specify read more text$readmore = "Read more"; // Specify news text$news = "Latest News"; // Query for obtaining stuff from a group$query = "SELECT * FROM ".TABLE_PREFIX."mod_news_posts WHERE group_id = $group and active = 1 ORDER BY position DESC LIMIT 0, 10;";// Query for all groups ;)if ($group<1 ) { $query = "SELECT * FROM ".TABLE_PREFIX."mod_news_posts WHERE active = 1 ORDER BY position DESC LIMIT 0, 10;";}// No changes needed here, maybe for output!global $database;$result = $database->query($query);$total = $result->numRows(); // how many items are there?if ($total>1) { // at least 2 needed for 2 news items $data = $result->fetchRow() ; // get left item $data2 = $result->fetchRow() ; // get right item echo '<span style="font-size: 14px; color: #fff; display: block; font-weight: bold; border-bottom: 1px solid;">'.$news.'</span>'; echo '<p style="border-bottom: 1px solid #000; font-weight: bold; font-size: 12px; color: #fff;">'.$data['title'].'</p><p style="font-size: 12px; text-align: justify; color: #fff;">'.$data['content_short'].'<br /><a href="'.WB_URL.PAGES_DIRECTORY.$data['link'].PAGE_EXTENSION.'">'.$readmore.'</a></p>'; echo '<p style="border-bottom: 1px solid #000; font-weight: bold; font-size: 12px; color: #fff;">'.$data2['title'].'</p><p style="font-size: 12px; text-align: justify; color: #fff;">'.$data2['content_short'].'<br /><a href="'.WB_URL.PAGES_DIRECTORY.$data2['link'].PAGE_EXTENSION.'">'.$readmore.'</a></p>';}else { echo '<span style="font-size: 14px; display: block; font-weight: bold; border-bottom: 1px solid;">No News yet ...</span>';}?><-- News Box ends --></div>
<?php display_news_items(); ?>
<?php display_news_items($group_id, $max_news_items, $max_news_length, $header_text, $readmore_text, $no_news_text); ?>