News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Download System

Started by SMFHacks.com Team, October 31, 2007, 06:55:37 PM

Previous topic - Next topic

Özgür



Download System Little Pretty Url Support


Find in PrettyUrls-Filters.php
?>
Add Before:
function pretty_downloads_filter($urls)
{
global $boardurl, $scripturl;

// downloads cats
$pattern = '~' . $scripturl . '(.*)action=downloads;cat=([^;]+)~S';
$replacement = $boardurl . '/downloads/category/$2/';
$replacement .= (strpos($replacement, '?') === false ? '?' : ';') . (isset($PHPSESSID[0]) ? $PHPSESSID[0] : '') . ';' . (isset($sesc[0]) ? $sesc[0] : '') . (isset($fragment[0]) ? $fragment[0] : '');
foreach ($urls as $url_id => $url)
if (!isset($url['replacement']))
if (preg_match($pattern, $url['url']))
$urls[$url_id]['replacement'] = preg_replace($pattern, $replacement, $url['url']);


// items
$pattern = '~' . $scripturl . '(.*)sa=view;down=([^;]+)~S';
$replacement = $boardurl . '/downloads/$2/';
$replacement .= (strpos($replacement, '?') === false ? '?' : ';') . (isset($PHPSESSID[0]) ? $PHPSESSID[0] : '') . ';' . (isset($sesc[0]) ? $sesc[0] : '') . (isset($fragment[0]) ? $fragment[0] : '');
foreach ($urls as $url_id => $url)
if (!isset($url['replacement']))
if (preg_match($pattern, $url['url']))
$urls[$url_id]['replacement'] = preg_replace($pattern, $replacement, $url['url']);

return $urls;
}

You go to your site.com/forum/index.php?action=admin;area=pretty;sa=filters and find this code     }
}
from last line.
And add between these line for this
(example :     } code code code....
}
)
,
"downloads": {
        "description": "downloads",
        "enabled": 0,
        "filter": {
            "priority": 5,
            "callback": "pretty_downloads_filter"
        },
        "rewrite": {
            "priority": 5,
            "rule": [
                "RewriteRule ^downloads/([^/]+)/?$ index.php?action=downloads;sa=view;down=$1 [L,QSA]",
                "RewriteRule ^downloads/category/([^/]+)/?$ index.php?action=downloads;cat=$1 [L,QSA]"
            ]
        },
        "title": "downloads modu pretty url"
    }


And go to pretty settings and enable this filter and run pretty maintenance.
So Long

SoLoGHoST

Quote from: <<Anadolu>> on April 04, 2009, 02:54:37 PM
SoLoGHoST  thank you.

You're very welcome, and be sure to check out my Cool Categories Add-On for this MOD, will post the URL when complete.  Just about done it!  But you can see it in action here ==> GRAPHICS MAYHEM  and  TEST SITE

Eric_WP

Thanks a lot heinander, that was exactly what I was looking for!

louislam123

Hi, I don't know if this has already been asked, but is there a way to specify which extensions are allowed to be uploaded, and limit the max filesize?
AnimuHQ- Gaming | Anime | Entertainment

vbgamer45

Quote from: louislam123 on April 09, 2009, 02:57:27 AM
Hi, I don't know if this has already been asked, but is there a way to specify which extensions are allowed to be uploaded, and limit the max filesize?
Max filesize yes.  File extensions no.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

SoLoGHoST

Oh, reminds me, also fixed the problem of creating empty downloads.  This would occur if say, your host was not set up for uploads bigger than, say 5 MB for instance.  And well, you have the Downloads System set at a max filesize of 10MB.  When users would try to upload a file bigger than 5 MB, say 7 MB, since it is smaller than the max filesize set in Downloads System, it will generate a Download, tho, when trying to download the file, it will take you to an empty page.  Well, fixed this so that it just generates an error when Adding the Download, that way there are no empty Downloads floating around by accident or whatever.

Will post up when fully completed.  Working on a new layout for it, will look kinda like Windows Live Gallery default layout for gadgets.  So there will be 3 layouts in all when complete.

Bulqr4eto

How can I make the download system to have Parse function, anyone have any ideas ? :(

vbgamer45

Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Bulqr4eto

I mean to have like here

"Manual Instllation" -> Choose Your Version etc.

I really need this, because I`m making support site for SMF in my language

Bulqr4eto

And how can I make an image function. So I can upload demos of the files ? Thanks

And I have problem with the Cool Addon

When I try to open my category it show me

Unknown column 'layout' in 'field list'
File: /usr/local/apache2/htdocs/rado/smf-bg.info/Sources/Downloads2.php
Line: 1732

Anyone can help ?

vbgamer45

Not part of the default install of the download system.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Bulqr4eto

Yes, I read now the hole topic and I know :D as for the cool addon can someone help, when I try to put it it show me:

Unknown column 'layout' in 'field list'
File: /usr/local/apache2/htdocs/rado/smf-bg.info/Sources/Downloads2.php
Line: 397


And Line 397  is ...

WHERE ID_CAT = $cat LIMIT 1");


and after it its ...

$row1 = $smcFunc['db_fetch_assoc']($dbresult1);

$context['downloads_cat'] = $row1['ID_CAT'];

$context['downloads_cat_name'] = $row1['title'];

$context['downloads_sortby'] = $row1['sortby'];

$context['downloads_orderby'] = $row1['orderby'];

$context['downloads_cat_norate'] = $row1['disablerating'];

if ($context['downloads_cat_norate'] == '')

$context['downloads_cat_norate'] = 0;

$context['downloads_cat_layout'] = $row1['layout'];

if ($context['downloads_cat_layout'] == '')

$context['downloads_cat_layout'] = 0;

$smcFunc['db_free_result']($dbresult1);

SoLoGHoST

You have to read the .txt file included and copy install.php to your root SMF directory and run it from a browser in the root of your SMF directory, once this is done all problems should dissappear.  Then delete install.php.

SoLoGHoST

Quote from: Bulqr4eto on April 15, 2009, 09:40:53 AM
And how can I make an image function. So I can upload demos of the files ? Thanks

And I have problem with the Cool Addon

When I try to open my category it show me

Unknown column 'layout' in 'field list'
File: /usr/local/apache2/htdocs/rado/smf-bg.info/Sources/Downloads2.php
Line: 1732

Anyone can help ?

Image Screenshots available in the next update of the Cool Categories Layout, which will be renamed to Multiple Category Layouts, or something else, haven't decided on the name yet, as it does more than just category layouts, way more.

Bulqr4eto

Thanks for the response, and yes I read the .txt and run the install.php everything was great ... it showed me that everything is imported and after that ... I open the index.php?action=downloads and everything was the same, then I try to open one category and It show me this error and I still dunno how to fix it :( probably I will wait untill ur next version of this great addon :)

Bulqr4eto

SoLoGHost: I try the new Cool Addon u put but it show me again error :( and I did everything in the readme.txt

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 '' at line 17
File: /usr/local/apache2/htdocs/rado/smf-bg.info/Sources/Downloads2.php
Line: 761

SoLoGHoST

Ok, seems that there is a php error, probably something simple and easy to fix, though, I would just open Downloads2.php and look at line 17, probably something as stupid as failing to place a ; at the end of the line or something else just as stupid as that.

In any case, all errors fixed in this new update which will be available momentarilly at Graphics Mayhem, called "ENHANCED DOWNLOADS SYSTEM AddOn".  Will post up some pics of it in a few, brb.

SoLoGHoST

Ok, you can NOW get the NEW UPDATE called, ENHANCED Downloads System Addon (Screenshot shows most of the new changes and functions, but there are so many great things about this update, can't fit them all on 1 page ;))

Some Pics in full view...
Moved Layout to Editing of Download Categories...


Individually Setting the Layout for each Category by clicking on [Edit] link


You can now also specify a default layout type when creating categories, by default, when you install this MOD this setting in your Downloads Configuration is set to Full View, but you can change and it will change it for all categories...


You can also now move the Page Blocks on the index page of downloads around to the left, right, top, and bottom areas, and also you can set the order in which they are in from top to bottom.  You can have it expanded by default, or not expanded by default also...


Added a new layout called, Small Tables, and looks like this:


You can set how many rows per page for the Small Tables Layout in Downloads Config...


You can set how big the Screenshot Image will be (Viewed in Full Layout Category, and Downloads View Page), if screenshot being uploaded is bigger than dimensions set here, it will be resized to dimensions here keeping same aspect ratio


And you can also Add a Cool Reflection Effect to your uploaded Screenshots for each of your downloads, Screenshot URL taken out, as this was just me playing with that option.  All images will be coming directly from your server, unless the [ img ] bbc code tag is being used.  Will fix this in next update perhaps:


Thumbnails for Page Blocks (Recent Downloads, Top Rated, Top Downloads, Most Commented, & Most Viewed) get shown if the user has selected to upload a Screenshot image when adding the download, otherwise, more info about the download is shown.

And Many Many More Features...

ENJOY!!! :)

SoLoGHoST

Oh, and bytheway, no need to remove the other version, this will just replace the Cool Category's Addon, if installed.  This also fixes problem with the Downloads System MOD not being able to update posts that are linked to a board, if the user edits a download.  Uses modifyPost() function for this.  Creates new post if board is selected for that Category using bbc code, that way, you can edit it and reapply it easily.

You can see the ENHANCED DOWNLOADS SYSTEM AddOn in Action at Graphics Mayhem or Test Site

Download here => ENHANCED DOWNLOADS SYSTEM AddOn for the Downloads System MOD

Advertisement: