Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4214
Latest: thatsjustit
New This Month: 5
New This Week: 3
New Today: 0
Stats
Total Posts: 42792
Total Topics: 7455
Most Online Today: 77
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 28
Total: 28

Author Topic: most popular categories doesnt work  (Read 2434 times)

0 Members and 1 Guest are viewing this topic.

Offline fussilet

  • Theme Master
  • Full Member
  • ****
  • Posts: 103
    • View Profile
most popular categories doesnt work
« on: November 01, 2019, 04:57:01 pm »
hi all and smfhacks team


this code used to work properly
Code: [Select]
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 c.ID_CAT = BÖLÜM
AND f.approved = '1'
AND f.ID_MEMBER = m.ID_MEMBER
ORDER BY f.ID_FILE DESC
LIMIT 35",__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>';
}

but it doesn't work now for smf 2.0.15

can you help me pls

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16234
    • View Profile
Re: most popular categories doesnt work
« Reply #1 on: November 01, 2019, 07:08:18 pm »
Use something linke
Code: [Select]
$request = $smcFunc['db_query']('', "SELECT f.ID_FILE, f.ID_MEMBER, f.date, f.ID_CAT, f.title AS ftitle, f.totaldownloads,
c.title, m.real_name, m.ID_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 c.ID_CAT = BÖLÜM
AND f.approved = '1'
AND f.ID_MEMBER = m.ID_MEMBER
ORDER BY f.ID_FILE DESC
LIMIT 35");
while($row = $smcFunc['db_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>';
}

?>
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline fussilet

  • Theme Master
  • Full Member
  • ****
  • Posts: 103
    • View Profile
Re: most popular categories doesnt work
« Reply #2 on: November 02, 2019, 07:33:44 am »
thank for repling but it doesnt work

Code: [Select]
global $db_prefix, $scripturl;

$request = $smcFunc['db_query']('', "SELECT f.ID_FILE, f.ID_MEMBER, f.date, f.ID_CAT, f.title AS ftitle, f.totaldownloads,
c.title, m.real_name, m.ID_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 c.ID_CAT = 3
AND f.approved = '1'
AND f.ID_MEMBER = m.ID_MEMBER
ORDER BY f.ID_FILE DESC
LIMIT 35");
while($row = $smcFunc['db_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>';
}

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16234
    • View Profile
Re: most popular categories doesnt work
« Reply #3 on: November 02, 2019, 08:34:03 am »
What's the error?
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline fussilet

  • Theme Master
  • Full Member
  • ****
  • Posts: 103
    • View Profile
Re: most popular categories doesnt work
« Reply #4 on: November 02, 2019, 01:39:37 pm »

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16234
    • View Profile
Re: most popular categories doesnt work
« Reply #5 on: November 02, 2019, 01:43:28 pm »
Try
Code: [Select]
global  $smcFunc, $scripturl;


$request = $smcFunc['db_query']('', "SELECT f.ID_FILE, f.ID_MEMBER, f.date, f.ID_CAT, f.title AS ftitle, f.totaldownloads,
c.title, m.real_name, m.ID_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 c.ID_CAT = 3
AND f.approved = '1'
AND f.ID_MEMBER = m.ID_MEMBER
ORDER BY f.ID_FILE DESC
LIMIT 35");
while($row = $smcFunc['db_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>';
}
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline fussilet

  • Theme Master
  • Full Member
  • ****
  • Posts: 103
    • View Profile
Re: most popular categories doesnt work
« Reply #6 on: November 02, 2019, 02:51:42 pm »
thank you so much Lord

 

Related Topics

  Subject / Started by Replies Last post
1 Replies
4418 Views
Last post November 12, 2007, 10:17:19 pm
by SMFHacks
43 Replies
19604 Views
Last post March 17, 2011, 08:44:22 pm
by Jimmie
9 Replies
6422 Views
Last post December 19, 2010, 12:01:09 am
by vkot
1 Replies
3437 Views
Last post July 25, 2013, 04:35:23 pm
by SMFHacks
1 Replies
2091 Views
Last post November 26, 2014, 04:19:21 pm
by SMFHacks

+- Recent Topics

prettyurls - TroubleShooting.wiki by SMFHacks
Today at 01:49:35 pm

Download Gallery Option by SMFHacks
March 23, 2023, 09:34:02 am

Lost attachments by pete
March 22, 2023, 10:24:17 am

Additional Permissions by mickjav
March 18, 2023, 05:21:23 am

[Mod]Discord Web Hooks by SMFHacks
March 17, 2023, 08:48:30 am

Site upgrade to 2.1 by SMFHacks
March 12, 2023, 08:51:19 am

Theme/CSS design wanted by mickjav
March 11, 2023, 12:10:11 pm

Category Images by Anmer
March 10, 2023, 06:20:04 am

DownloadsPro - Topic Link by Anmer
March 08, 2023, 03:18:05 pm

Bulk File Import by SMFHacks
March 08, 2023, 07:56:23 am

Powered by EzPortal