SimplePortal

Customization => Blocks and Modifications => Block Requests => Topic started by: Burke Knight on November 07, 2008, 07:48:09 PM

Title: Block for Downloads System 1.1.4
Post 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. :)
Title: Re: Block for Downloads System 1.1.4
Post by: Xindows on April 09, 2009, 03:59:11 PM
I need to i'm use version Downloads System 1.1.5.1   :nervous-happy:
Title: Re: Block for Downloads System 1.1.4
Post by: Nathaniel on April 09, 2009, 08:19:55 PM
Moved to the Block Request Board.
Title: Re: Block for Downloads System 1.1.4
Post by: Nickawompus on April 16, 2009, 10:41:42 AM
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
Title: Re: Block for Downloads System 1.1.4
Post by: evilhunter on April 27, 2009, 09:04:44 AM
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
Title: Re: Block for Downloads System 1.1.4
Post by: Blue on May 07, 2009, 10:35:40 PM
How do you want your block? Like a list of Random Downloads?
Title: Re: Block for Downloads System 1.1.4
Post by: Nickawompus on May 31, 2009, 07:58:35 AM
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
Title: Re: Block for Downloads System 1.1.4
Post by: Gurbet_42 on June 03, 2009, 06:21:42 PM
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

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,
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>';
}

Title: Re: Block for Downloads System 1.1.4
Post by: Nickawompus on June 05, 2009, 07:16:31 PM
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
Title: Re: Block for Downloads System 1.1.4
Post by: LP on October 30, 2009, 02:13:46 PM
Updated for SMF 2.0

Code: [Select]
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>';
}
Title: Re: Block for Downloads System 1.1.4
Post by: Winny on February 17, 2010, 08:27:22 AM
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.
Title: Re: Block for Downloads System 1.1.4
Post by: Sentinel [AF] on March 22, 2010, 06:02:55 AM
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.

Code: (Gets Latest 4 Submissions from database - Change LIMIT for amount) [Select]
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>';


Code: (Gets 4 Random files from database - Change LIMIT for amount) [Select]
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 :)
Title: Re: Block for Downloads System 1.1.4
Post by: Dermot on May 05, 2010, 02:02:03 AM

Just what i was looking for, thank you  ;)
Title: Re: Block for Downloads System 1.1.4
Post by: yield on May 22, 2010, 05:07:47 PM
Hi!

I tried the code posted by Sentinel and got the following error when previewing the block

Quote
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

Quote
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..
Title: Re: Block for Downloads System 1.1.4
Post by: Sentinel [AF] on May 28, 2010, 09:53:20 AM
Hi!

I tried the code posted by Sentinel and got the following error when previewing the block

Quote
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

Quote
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 !?
SimplePortal 2.3.8 © 2008-2024, SimplePortal