SimplePortal
Customization => Blocks and Modifications => Block Requests => Topic started by: Burke Knight on November 07, 2008, 07:48:09 PM
-
Hello,
I need a block for Downloads System 1.1.4 if anyone would be so kind to make one. :)
I'm running SMF 2.0 Beta 4 with SimplePortal Classic 2.0.5
Thank you. :)
-
I need to i'm use version Downloads System 1.1.5.1 :nervous-happy:
-
Moved to the Block Request Board.
-
This would be a great block, maybe just like the recent gallery additions block.
I'm using:
SMF 1.1.8
SimplePortal 2.2
Downloads System 1.1.4
Thanks in advance
-
I would also like to know how this can be made for
SMF: 2.0 RC1
SP: 2.2
Download System: 1.1.5.1
-
How do you want your block? Like a list of Random Downloads?
-
I would use it as Latest Downloads but random list would work also. Same thing as the gallery block would be cool.
Thanks in advance
Steve
-
This would be a great block, maybe just like the recent gallery additions block.
I'm using:
SMF 1.1.8
SimplePortal 2.2
Downloads System 1.1.4
Thanks in advance
Try this
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 35",__FILE__,__LINE__);
while($row = mysql_fetch_assoc($request)) {
echo '<table width="100%" cellpadding="2" cellspacing="0">
<tr>
<td valign="top" class="smalltext">', sp_embed_image('dot'), ' <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>';
}
-
Works great, thank you, thank you, thank you :D
It's in the left block
linky to my board (http://www.askytasky.com/newwoofboard/index.php)
:applause: ;D
-
Updated for SMF 2.0
global $db_prefix, $scripturl, $smcFunc;
$request = $smcFunc['db_query']('',"SELECT f.ID_FILE, f.ID_MEMBER, f.date, f.ID_CAT, f.title AS ftitle,
c.title, m.real_Name, 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 35");
while($row = $smcFunc['db_fetch_assoc']($request)) {
echo '<table width="100%" cellpadding="2" cellspacing="0">
<tr>
<td valign="top" class="smalltext">', sp_embed_image('dot'), ' <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>';
}
-
Hmm...
I just saw this post, I'm using the download system pro.
I'll be trying to find a way showing the image too.
-
I've modified the blocks for the SMF 2.X code posted about 2 posts up & fixed the totaldownloads bit as you forgot to add * "f.totaldownloads" to the query so it wasn't showing up in the results.
Both these codes are neatened versions for using in a side block as they correctly display title & downloads at top and a link with shortened subject code on download name with smalltext floatleft download count with smalltext floatright.
check the attached screenshot.
global $db_prefix, $scripturl, $smcFunc;
$request = $smcFunc['db_query']('',"SELECT f.ID_FILE, f.ID_MEMBER, f.date, f.ID_CAT, f.totaldownloads, f.title AS ftitle,
c.title, m.real_Name, 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 4");
echo '
<table border="0" cellpadding="1" cellspacing="0" width="100%" colspan="2">
<tr>
<th style="text-align: left;">Title</td>
<th colspan="2" style="text-align: right;">Downloads</td>
</tr>';
while($row = $smcFunc['db_fetch_assoc']($request)) {
echo '
<tr>
<td><a href="',$scripturl,'?action=downloads;sa=view;id=',$row['ID_FILE'],'" title="',$row['ftitle'],'">'. shorten_subject($row['ftitle'], 20) .'</a></td>
<td style="text-align: right;">',$row['totaldownloads'],'</td>
</tr>';
};
echo '
</table>';
global $db_prefix, $scripturl, $smcFunc;
$request = $smcFunc['db_query']('',"SELECT f.ID_FILE, f.ID_MEMBER, f.date, f.ID_CAT, f.totaldownloads, f.title AS ftitle,
c.title, m.real_Name, 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 RAND()
LIMIT 4");
echo '
<table border="0" cellpadding="1" cellspacing="0" width="100%" colspan="2">
<tr>
<th style="text-align: left;">Title</td>
<th colspan="2" style="text-align: right;">Downloads</td>
</tr>';
while($row = $smcFunc['db_fetch_assoc']($request)) {
echo '
<tr>
<td><a href="',$scripturl,'?action=downloads;sa=view;id=',$row['ID_FILE'],'" title="',$row['ftitle'],'">'. shorten_subject($row['ftitle'], 20) .'</a></td>
<td style="text-align: right;">',$row['totaldownloads'],'</td>
</tr>';
};
echo '
</table>';
I'm still running SMF 2.04b but I assume the code should still work for all versions of 2.X.
ez :)
-
Just what i was looking for, thank you ;)
-
Hi!
I tried the code posted by Sentinel and got the following error when previewing the block
Fatal error: Function name must be a string in /afs/[...]/web/Sources/PortalBlocks.php(3444) : eval()'d code on line 3
and the following when adding the block
Syntax error in block code. Please check the code.
Any clue?
Using SMF 1.1.11 and SP 2.3.2.
Thanks
Edit
Just noticed that this topic is for DS 1.1.4 and I'm using 1.1.5... maybe that's the cause..
-
Hi!
I tried the code posted by Sentinel and got the following error when previewing the block
Fatal error: Function name must be a string in /afs/[...]/web/Sources/PortalBlocks.php(3444) : eval()'d code on line 3
and the following when adding the block
Syntax error in block code. Please check the code.
Any clue?
Using SMF 1.1.11 and SP 2.3.2.
Thanks
Edit
Just noticed that this topic is for DS 1.1.4 and I'm using 1.1.5... maybe that's the cause..
other problem might be because I use SMF 2.X.
possibly !?