Thanks Husmen[aslanbeg]
The block form, add into
demo: www.fussilet.com
global $db_prefix, $scripturl;
$request = db_query("SELECT f.ID_FILE, f.ID_MEMBER, f.date, f.ID_CAT, f.title AS ftitle, f.totaldownloads,
c.title, m.realName, m.ID_MEMBER AS mID_MEMBER
FROM {$db_prefix}down_file AS f, {$db_prefix}down_cat AS c, {$db_prefix}members AS m
WHERE f.ID_CAT = c.ID_CAT
AND f.approved = '1'
AND f.ID_MEMBER = m.ID_MEMBER
ORDER BY totaldownloads DESC
LIMIT 10",__FILE__,__LINE__);
while($row = mysql_fetch_assoc($request)) {
echo '<table width="100%" cellpadding="2" cellspacing="0">
<tr>
<td valign="top" class="smalltext"> <a href="',$scripturl,'?action=downloads;sa=view;id=',$row['ID_FILE'],'">',$row['ftitle'],'</a></td>
<td valign="top" class="smalltext" align="right">',$row['totaldownloads'],'</td>
</tr>
</table>';
}
thanks fussilet
thanks Husmen
can we not see downloads screen?
I thanks bro :)
really nice thanks ^^
how i can do something like this:
(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fimg205.imageshack.us%2Fimg205%2F8584%2Ficydv3.gif&hash=40a7c88a04fbcf54ff40a98966a465347ebd9b09)
I try this code:
echo '<table bgcolor="#DFE2E6" width="100%">
<tr>
<td colspan="2">Top 10 Nuevas Descargas</td>
<td colspan="2">Top 10 Mas Descargadas</td>
</tr><br>';
global $db_prefix, $scripturl;
$request = db_query("SELECT f.ID_FILE, f.ID_MEMBER, f.date, f.ID_CAT, f.title AS ftitle, f.totaldownloads,
c.title, m.realName, m.ID_MEMBER AS mID_MEMBER
FROM {$db_prefix}down_file AS f, {$db_prefix}down_cat AS c, {$db_prefix}members AS m
WHERE f.ID_CAT = c.ID_CAT
AND f.approved = '1'
AND f.ID_MEMBER = m.ID_MEMBER
ORDER BY f.ID_FILE DESC
LIMIT 5",__FILE__,__LINE__);
while($row = mysql_fetch_assoc($request)) {
echo '
<tr>
<td class="smalltext"><a href="',$scripturl,'?action=view;id=',$row['ID_FILE'],'">',$row['ftitle'],'</a></td>
<td class="smalltext" >',$row['totaldownloads'],'</td>
';
}
global $db_prefix, $scripturl;
$request = db_query("SELECT f.ID_FILE, f.ID_MEMBER, f.date, f.ID_CAT, f.title AS ftitle, f.totaldownloads,
c.title, m.realName, m.ID_MEMBER AS mID_MEMBER
FROM {$db_prefix}down_file AS f, {$db_prefix}down_cat AS c, {$db_prefix}members AS m
WHERE f.ID_CAT = c.ID_CAT
AND f.approved = '1'
AND f.ID_MEMBER = m.ID_MEMBER
ORDER BY totaldownloads DESC
LIMIT 5",__FILE__,__LINE__);
while($row = mysql_fetch_assoc($request)) {
echo '
<td class="smalltext"><a href="',$scripturl,'?action=downloads;sa=view;id=',$row['ID_FILE'],'">',$row['ftitle'],'</a></td>
<td class="smalltext" >',$row['totaldownloads'],'</td>
</tr>';
}
echo '</table>';
But i have some errors , someone can make something?
Although quite a old topic, I thought I might post this(This is totally untested, *hopes it works*).
Based on NIBIGO's request
echo '<table bgcolor="#DFE2E6" width="100%">
<tr>
<td>Top 10 Nuevas Descargas</td>
<td>Top 10 Mas Descargadas</td>
</tr>';
global $db_prefix, $scripturl;
$latest = array();
$top = array();
$request = db_query("SELECT f.ID_FILE, f.ID_MEMBER, f.date, f.ID_CAT, f.title AS ftitle, f.totaldownloads,
c.title, m.realName, m.ID_MEMBER AS mID_MEMBER
FROM {$db_prefix}down_file AS f, {$db_prefix}down_cat AS c, {$db_prefix}members AS m
WHERE f.ID_CAT = c.ID_CAT
AND f.approved = '1'
AND f.ID_MEMBER = m.ID_MEMBER
ORDER BY f.ID_FILE DESC
LIMIT 5",__FILE__,__LINE__);
while($row = mysql_fetch_assoc($request)) {
$latest[] = '<a href="'.$scripturl.'?action=view;id='.$row['ID_FILE'].'">'.$row['ftitle'].'</a> ('.timeformat($row['data']).')';
}
$request = db_query("SELECT f.ID_FILE, f.ID_MEMBER, f.date, f.ID_CAT, f.title AS ftitle, f.totaldownloads,
c.title, m.realName, m.ID_MEMBER AS mID_MEMBER
FROM {$db_prefix}down_file AS f, {$db_prefix}down_cat AS c, {$db_prefix}members AS m
WHERE f.ID_CAT = c.ID_CAT
AND f.approved = '1'
AND f.ID_MEMBER = m.ID_MEMBER
ORDER BY totaldownloads DESC
LIMIT 5",__FILE__,__LINE__);
while($row = mysql_fetch_assoc($request)) {
$top[] = '<a href="'.$scripturl.'?action=downloads;sa=view;id='.$row['ID_FILE'].'">'.$row['ftitle'].'</a> ('.timeformat($row['data']).')';
}
$max_count = max(array(count($top), count($latest)));
for($i = 0; $i < $max_count; $i ++);
{
echo '<tr><td>',isset($top[$i]) ? $top[$i] : '','</td></tr>';
echo '<tr><td>',isset($latest[$i]) ? $latest[$i] : '','</td></tr>';
}
echo '
</table>';
Thanks dragooon but i have this error:
Parse error: syntax error, unexpected ';', expecting ')' on line 34
Updated the code, try that.
thanks Sir ;)
I got the same error in the updated code Dragoon
Line 34
for($i = 0; $i < $max_count; $i ++;
should be
for($i = 0; $i < $max_count; $i ++);
Thanks for the code!
Yeah you are right, fixed my post, thanks :)
I try the new code but i only see a table with the "Top 10 Nuevas Descargas"
and "Top 10 Mas Descargadas " i dont see any download
Thanks
Are you trying this with TP's download manager or the mod SMF Downloads, because its for SMF Downloads.
Quote from: Dragooon on August 13, 2008, 10:29:21 AM
Are you trying this with TP's download manager or the mod SMF Downloads, because its for SMF Downloads.
SMF Downloads
Is it posible to make a block only with recently added downloads?
TP 0.9.8 has this already built in.
I was talking about Smf Download System...
The best answers to make a block for that system is to ask the one that made the mod for SMF,