View Single Post
  #1  
Old 26th April 2010, 17:49
lovebeer's Avatar
lovebeer lovebeer is offline
Senior Member
 
Join Date: May 2009
Romania
Posts: 91
Default News Mod problem
Hi, i tried to install a news mod from tbdev.net put now the tabels from the index page are bigger
The mod is from here: [/U]http://www.tbdev.net/index.php?showt...0&hl=news&st=0

This is the code that I added in index after deleting the first one:
Code:
print("<h2>Recent news");
if (get_user_class() >= UC_ADMINISTRATOR)
 print(" - <font class=small>[<a class=altlink href=news.php><b>News page</b></a>]</font>");
print("</h2>\n");
$res = mysql_query("SELECT * FROM news WHERE ADDDATE(added, INTERVAL 45 DAY) > NOW() ORDER BY added DESC LIMIT 4") or sqlerr(__FILE__, __LINE__);
if (mysql_num_rows($res) > 0)
{
 print("<table width=100% border=1 cellspacing=0 cellpadding=10><tr><td class=text>\n<ul>");
 while($array = mysql_fetch_array($res))
 {
      $user = mysql_fetch_array(mysql_query("SELECT username FROM users WHERE id = $array[userid]")) or sqlerr();
?>
<div align=center>
 <table class=nobordermain width="80%"><tr><td>
 <table class=nobordermain width="100%">
 <tr>
 <?
 print("<td class=embedded width=100% colspan=2><b>" . gmdate("Y-m-d",strtotime($array['added'])) . " - " . $array['title'] . "</b>");
 if (get_user_class() >= UC_ADMINISTRATOR) {
 print(" - <font class=small>[<a class=altlink href=news.php?action=edit&newsid=" . $array['id'] . "><b>E</b></a>]</font>");
 print(" <font class=small>[<a class=altlink href=news.php?action=delete&newsid=" . $array['id'] . "><b>D</b></a>]</font>");
 }
 print("</td>");
 ?>
 </tr>
 <tr>
 <td class=embedded width="5%"><img src="pic/news/<?=$array['cat']?>.gif" width=32 height=32></td>
 <? 
 print("<td class=embedded width=95%>" . format_comment($array['body'],0) . "</td>");
 ?>
 </tr>
 <tr>
 <td class=embedded width="100%" colspan="2">
 <?
 print("<p align=right>- <a href=userdetails.php?id=" . $array['userid'] . ">$user[username]</a></p></td>");
 ?>
 </tr>
 </table>
 </td>
 </tr>
</table>
</div>
<br><br>
<?
 }
 print("</td></tr></table>\n");
}
The index page looks like this now:

Click the image to open in full size.


The page should look like this:

Click the image to open in full size.

How can I fix this?
Thanks in advance!
__________________

Reply With Quote