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

Recent

Welcome to TinyPortal. Please login or sign up.

June 16, 2024, 01:24:22 PM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,242
  • Total Topics: 21,223
  • Online today: 180
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 141
  • Total: 141

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.

G6Cad

I removed the color red code, hope it helps

Heero

Thanks G6,
Yet it shouldn't be
<a href="',$scripturl,'?action=downloads;sa=view;id=',$row['ID_FILE'],'">',$row['ftitle'],'[/URL]

It should be
<a href="',$scripturl,'?action=downloads;sa=view;id=',$row['ID_FILE'],'">',$row['ftitle'],'</a>

[/URL] = </a>

Well hmm ..
It still doesn't work over here :/

Error :
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND f.ID_CAT IN(1)' at line 1
File: /home/xxx/domains/domain.org/public_html/smf/Sources/Load.php(1770) : eval()'d code(209) : eval()'d code
Line: 11

Dragooon

That has NOTHING to do with that problem......
I'll work on it later, currently I am out of time.

Dragooon

This should work
global $db_prefix, $scripturl;
$cats = array();
$cat = implode(',',$cats);
$categories = '';
if(!empty($cats))
$categories = "AND f.ID_CAT IN($cat)";
$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
$categories
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=downloads;sa=view;id=',$row['ID_FILE'],'">',$row['ftitle'],'</a></td>
<td valign="top" class="smalltext" align="right">',$row['totaldownloads'],'</td>
</tr>
</table>';
}

Heero

Yeah it works!
Thanks Dragooon!

Dragooon

Glad it finally worked out :p
I think I should start testing my codes before posting :P

IchBin

Quote from: Dragooon on March 13, 2008, 08:36:51 AM
Glad it finally worked out :p
I think I should start testing my codes before posting :P
What a novel idea... lol

Dragooon

You mean "nobel"?
lol Thanks :P

Zetan

Nope.. I think he means >> "novel" << Adj. 2  :P

IchBin

Quote from: ZTN on March 13, 2008, 04:03:51 PM
Nope.. I think he means >> "novel" << Adj. 2  :P
Ding! Thats 10 points for Zetan!