Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 4255
Latest: andreios
New This Month: 3
New This Week: 1
New Today: 0
Stats
Total Posts: 43259
Total Topics: 7518
Most Online Today: 202
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 185
Total: 185

Author Topic: How to add a download graphic button  (Read 827 times)

0 Members and 1 Guest are viewing this topic.

Offline Willm

  • Member
  • *
  • Posts: 4
    • View Profile
How to add a download graphic button
« on: February 18, 2022, 02:17:15 pm »
Where and what file can I put in the code for a graphic download button next to the download file links? [ Guests cannot view attachments ]

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: How to add a download graphic button
« Reply #1 on: February 18, 2022, 06:31:29 pm »
In the Pro Edition there is a setting
"Download Button Url: " under download configuration
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 Willm

  • Member
  • *
  • Posts: 4
    • View Profile
Re: How to add a download graphic button
« Reply #2 on: February 19, 2022, 12:35:42 pm »
Thanks, but I'm using the Download Mod version 2.3

Offline Willm

  • Member
  • *
  • Posts: 4
    • View Profile
Re: How to add a download graphic button
« Reply #3 on: February 19, 2022, 02:03:56 pm »
I managed to find a solution to my question about adding a graphic button to the file name.

Open Themes\default\Download2.1.template.php

Scroll down to line 1276

Find:

Code: [Select]
<tr class="windowbg2">
 <td align="center">';
 echo '<a href="' .  $scripturl . '?action=downloads;sa=downfile&id=', $context['downloads_file']['ID_FILE'], '">', ($context['downloads_file']['fileurl'] == '' ? $context['downloads_file']['orginalfilename'] : $txt['downloads_app_download']), '</a>';
 echo '
 </td>
 </tr>';

Replace with:

Code: [Select]
<tr class="windowbg2">
 <td align="center">';
            echo '<a class="button button_strip_add"';
 echo '<a href="' .  $scripturl . '?action=downloads;sa=downfile&id=', $context['downloads_file']['ID_FILE'], '">', ($context['downloads_file']['fileurl'] == '' ? $context['downloads_file']['orginalfilename'] : $txt['downloads_app_download']), '</a>';
 echo '
 </td>
 </tr>';

Be sure to back up your page before you make any changes.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: How to add a download graphic button
« Reply #4 on: February 19, 2022, 03:18:15 pm »
Glad you were able to figure it out.
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 Willm

  • Member
  • *
  • Posts: 4
    • View Profile
Re: How to add a download graphic button
« Reply #5 on: February 20, 2022, 03:58:34 pm »
Please disregard the previous code. This is a better code.

The previous code was producing some invalid HTML that literally only works by accident. So I cleaned up the code which gives the same results only it's a lot better with no invalid HTML errors.

Open Themes\default\Download2.1.template.php

Scroll down to line 1276

Find


Code: [Select]
echo '<a href="' .  $scripturl . '?action=downloads;sa=downfile&id=', $context['downloads_file']['ID_FILE'], '">', ($context['downloads_file']['fileurl'] == '' ? $context['downloads_file']['orginalfilename'] : $txt['downloads_app_download']), '</a>';

Replace with

           
Code: [Select]
            echo '<a class="button" href="' .  $scripturl . '?action=downloads;sa=downfile&id=', $context['downloads_file']['ID_FILE'], '">', ($context['downloads_file']['fileurl'] == '' ? $context['downloads_file']['orginalfilename'] : $txt['downloads_app_download']), '</a>';
           
Just by adding the class button to the same $scripturl line is all you need for this to work properly.             
Like Like x 1 View List

 

Related Topics

  Subject / Started by Replies Last post
2 Replies
4182 Views
Last post May 21, 2009, 09:27:05 pm
by SMFHacks
4 Replies
5052 Views
Last post May 23, 2009, 09:58:59 am
by Vincent Volmer
1 Replies
3687 Views
Last post December 06, 2009, 12:09:44 pm
by SMFHacks
3 Replies
2924 Views
Last post November 24, 2018, 09:08:55 pm
by SMFHacks
3 Replies
508 Views
Last post January 23, 2022, 07:32:43 am
by SMFHacks

+- Recent Topics

No thumbnails on new uploads by SMFHacks
March 27, 2024, 02:10:41 pm

Display the Contact Page for guests by SMFHacks
March 27, 2024, 10:55:43 am

is it possible to add support for odysee.com by fvlog19
March 21, 2024, 08:47:51 am

Request for admin notification by davejo
March 10, 2024, 01:31:59 am

I need help with torrent upload by Ineedsmfhelp
March 09, 2024, 10:01:13 pm

an idea for new mod (( content type with different display )) by SMFHacks
February 27, 2024, 01:36:27 pm

[Mod] RSS Feed Poster by SMFHacks
February 27, 2024, 11:57:18 am

find duplicate pictures by fvlog19
February 14, 2024, 02:22:40 pm

Error uploading video. by SMFHacks
February 08, 2024, 02:04:16 pm

Gallery icon as last added image by fvlog19
February 01, 2024, 01:04:56 pm

Powered by EzPortal