Zorobz
12-11-2004, 10:45 AM
My "Latest Articles" module is functioning well.
i have already changed the templates abit to make them suck up less space and appear in one <TD> instead of new <TD> each article...
what i wanna do is to make the scroll, so it will take even less space.
but all my efforts have brought nothing...
these are the templates, if anything else is needed please say so.
adv_portal_articles:
<table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder" width="100%">
<tr>
<td class="tcat"><span class="smallfont"><strong>$vba_options[portal_blockbullet] Recent Articles</strong></span></td>
</tr>
<tr class="alt1">
<td class="$getbgrow" width="100%>
$articlesbits
</td>
</tr>
</table>
<br>
<br>
adv_portal_articlesbits:
<span class="smallfont"><b><a href=$vboptions[bburl]/article.php?a=$articleid>$title</a></b>   Author: <a href=$vboptions[bburl]/member.php?userid=$userid>$username</a>  <font color="#5f5f5f">$views views</font></span><br>
this is the PHP file "cmps_articles.php":
<?php
/* Performing SQL query */
$result = $DB_site->query("SELECT articleid, title, commentcount, articleusername, articleuserid, views
FROM " . TABLE_PREFIX . "article
WHERE open = '1'
ORDER BY articleid DESC LIMIT 10");
// loop through the reults of the query
while($result_array = mysql_fetch_array($result)) {
$title = $result_array["title"];
$articleid=$result_array["articleid"];
$username=$result_array["articleusername"];
$userid=$result_array["articleuserid"];
$commentcount=$result_array["commentcount"];
$views=$result_array["views"];
// $string .= "<li><a href=$vboptions[bburl]/article.php?a=$articleid>$title</a> <font size=-2 color=gray>by <a href=$vboptions[bburl]/member.php?userid=$userid>$username</a> ($views views)</font>";
$getbgrow = getrowcolor();
eval('$articlesbits .= "' . fetch_template('adv_portal_articlesbits') . '";');
}
eval('$home[$mods[\'modid\']][\'content\'] .= "' . fetch_template('adv_portal_articles') . '";');
?>
also, i would like to show the number of comments made. isnt that hard i believe.
i have already changed the templates abit to make them suck up less space and appear in one <TD> instead of new <TD> each article...
what i wanna do is to make the scroll, so it will take even less space.
but all my efforts have brought nothing...
these are the templates, if anything else is needed please say so.
adv_portal_articles:
<table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder" width="100%">
<tr>
<td class="tcat"><span class="smallfont"><strong>$vba_options[portal_blockbullet] Recent Articles</strong></span></td>
</tr>
<tr class="alt1">
<td class="$getbgrow" width="100%>
$articlesbits
</td>
</tr>
</table>
<br>
<br>
adv_portal_articlesbits:
<span class="smallfont"><b><a href=$vboptions[bburl]/article.php?a=$articleid>$title</a></b>   Author: <a href=$vboptions[bburl]/member.php?userid=$userid>$username</a>  <font color="#5f5f5f">$views views</font></span><br>
this is the PHP file "cmps_articles.php":
<?php
/* Performing SQL query */
$result = $DB_site->query("SELECT articleid, title, commentcount, articleusername, articleuserid, views
FROM " . TABLE_PREFIX . "article
WHERE open = '1'
ORDER BY articleid DESC LIMIT 10");
// loop through the reults of the query
while($result_array = mysql_fetch_array($result)) {
$title = $result_array["title"];
$articleid=$result_array["articleid"];
$username=$result_array["articleusername"];
$userid=$result_array["articleuserid"];
$commentcount=$result_array["commentcount"];
$views=$result_array["views"];
// $string .= "<li><a href=$vboptions[bburl]/article.php?a=$articleid>$title</a> <font size=-2 color=gray>by <a href=$vboptions[bburl]/member.php?userid=$userid>$username</a> ($views views)</font>";
$getbgrow = getrowcolor();
eval('$articlesbits .= "' . fetch_template('adv_portal_articlesbits') . '";');
}
eval('$home[$mods[\'modid\']][\'content\'] .= "' . fetch_template('adv_portal_articles') . '";');
?>
also, i would like to show the number of comments made. isnt that hard i believe.