TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,911
  • Total Topics: 21,307
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 824
  • Total: 824

SMF Downloads block?

Started by Heero, March 09, 2008, 02:45:36 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Dragooon

oops
Use the fol. code
global $db_prefix, $scripturl;

$request = db_query("SELECT f.ID_FILE, f.ID_MEMBER, f.date, f.ID_CAT, f.title AS ftitle,
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 '<div style="margin:5px"><a href="',$scripturl,'?action=view;id=',$row['ID_FILE'],'">',$row['ftitle'],'</a> by <a href="',$scripturl,'?action=profile;u=',$row['mID_MEMBER'],'">',$row['realName'],'</a> in <a href="',$scripturl,'?action=viewc;id=',$row['ID_CAT'],'">',$row['title'],'</a></div>';
}

The previous ones didn't had a "limit" set to them so they would've shown all the uploads sent(I am sure you wouldn't want that :P)

JPDeni


Heero


fussilet

hello,
In the picture , can't you that pretend?


Dragooon

I said I am gonna do that "tomorrow", so now is the tomorrow and here is the code:
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 '<table width="100%" cellpadding="2" cellspacing="0">
<tr>
<td valign="top" class="smalltext"> <a href="',$scripturl,'?action=view;id=',$row['ID_FILE'],'">',$row['ftitle'],'</a></td>
<td valign="top" class="smalltext" align="right">',$row['totaldownloads'],'</td>
</tr>
</table>';
}

Now it *should* show like TP's Recent downloads block.

fussilet

thank you very much, You are one piece :up

Crip

#16
 
  • :up + up: + : up : ==>≥ :up: :D
I have become comfortably numb!

Cripzone | Crip's Free 2.0.2 Themes



fussilet


Crip

I have become comfortably numb!

Cripzone | Crip's Free 2.0.2 Themes



Dragooon

lol.....Glad it worked for you :D
It was just a *blind* shot, I don't even use that mod :P

This website is proudly hosted on Crocweb Cloud Website Hosting.