News:

Want to get involved in developing SMF? Why not lend a hand on our GitHub!

Main Menu

Download System

Started by Texan78, May 15, 2012, 01:20:05 PM

Previous topic - Next topic

vbgamer45

Quote from: Texan78 on August 14, 2012, 12:04:44 PM
One other thing I would like to do that I just noticed is set default title to links when the thread is created. When a new download is submitted it creates a topic in a certain section of the forum I choose so there is support for that download. When it creates the link to the download in the topic it is the full URL. How would it be possible to set a default title so instead of it showing like this...



It would show like this with a default link title?



Now I found this in Downloads2.php and tried to change it to this.

// Create the post
require_once($sourcedir . '/Subs-Post.php');

$showpostlink = '[url=' . $scripturl . '?action=downloads;sa=view;down=' . $file_id . ']Download Script[/url]';


But it doesn't change anything.

How would I go about making that happen? Where do I need to look? Should be as simple as setting the default text correct?

-Thanks
There might be more than one place you need to update check all parts for the createpost function.
Community Suite for SMF - Grow your forum with 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

Texan78

#21
Ok got it sorted out.

That line of code was the correct line that needed to be modified. I replace this...

$showpostlink = '[url]' . $scripturl . '?action=downloads;sa=view;down=' . $file_id . '[/url]';

With this, and then defined the language in the language file.

$showpostlink = '[url=' . $scripturl . '?action=downloads;sa=view;down=' . $file_id . ']' . $txt['link_name'] . '[/url]';

So that issue is done. Would it be possible to place a link on the downloads page of the support topic it creates? If so how would I go about that and where do I need to look?

One more other minor issue. I am trying to rid some errors from my logs and this one is pretty much the only one I am getting.

Quotehttp://www.wxconnection.com/index.php?action=downloads;cat=10
8: Undefined index:
File: /home4/mesquiu0/public_html/wxconnection/Sources/Downloads2.php
Line: 213

Which is this line of code.



'name' => $context['']


Here is the full code with that line.


// Link Tree
$context['linktree'][] = array(
'url' => $scripturl . '?action=downloads;cat=' . $cat,
'name' => $context['']


Looks like the language file isn't defined. Is that correct and if not what should it be or how can I fix that error?

-Thanks!

Texan78

This isn't defined and it is throwing errors in the logs. Whats should it be?

'name' => $context['']

-Thanks


vbgamer45

That part 'name' => $context[''] shouldn't be empty like that it is missing a part.
Community Suite for SMF - Grow your forum with 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

Texan78

What should it be? It's not defined out of the box.

vbgamer45

It should be

// Link Tree
$context['linktree'][] = array(
'url' => $scripturl . '?action=downloads;cat=' . $cat,
'name' => $context['downloads_cat_name']
);
Community Suite for SMF - Grow your forum with 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

Texan78

Thank you VB, that appears to have resolved the issue in early testing. I will keep a eye on it and see if the problem arises again.

-Thanks

Advertisement: