Thread Rating:
  • 2 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Download System
RateU Offline
Administrator
*******
Posts: 2,349
Joined: Mar 2010
Post: #11
RE: Download System
Ah, yes. Thanks for the pointer, Lee.

05-07-2010 09:17 AM
Find all posts by this user Quote this message in a reply
wnd Offline
Junior Member
**
Posts: 8
Joined: May 2010
Post: #12
Wink RE: Download System
Here I am again, with the new download system, structure just like the plugin download system here!
  1. The first and only custom thread field we have to create, is for the file upload.
    1. Title: File Upload
    2. Key: fupload
    3. Description: Upload a file to the forum.
    4. Applicable Forums: any
    5. Input Field Type: file
    6. Valid File Extensions: any
    7. Maximum File Size: any
    8. Editable by / Required Field?: Everyone (required)
    9. Display Order: 2
  2. Now, create a new template, named: download_postbit_first

    PHP Code:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    {$ignore_bit}
    <a name="pid{$post['pid']}" id="pid{$post['pid']}"></a>
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="{$post_extra_style} {$post_visibility}" id="post_{$post['pid']}">
    	<tbody>
    		<tr>
    			<td colspan=2 class="tcat">
    				<div class="float_left smalltext">
    					{$post['postdate']}, {$post['posttime']} <span id="edited_by_{$post['pid']}">{$post['editedmsg']}</span>
    				</div>
    				{$post['posturl']}
    			</td>
    		</tr>
    
    		<tr>
    			<td class="trow1 {$unapproved_shade}">
    				<table cellspacing="0" cellpadding="0" border="0" style="width: 100%;">
    					<tr>
    						<td class="post_avatar" width="1" style="{$post['avatar_padding']}">
    							{$post['useravatar']}
    						</td>
    						<td class="post_author">
    							<strong><span class="largetext">{$post['profilelink']}</span></strong> {$post['onlinestatus']}<br />
    							<span class="smalltext">
    								{$post['usertitle']}<br />
    								{$post['userstars']}
    								{$post['groupimage']}
    							</span>
    						</td>
    						<td class="smalltext post_author_info" width="165">
    							{$post['user_details']}
    						</td>
    					</tr>
    				</table>
    			</td>
    			<td rowspan=3 class="trow1" style="white-space: nowrap; width: 10%; vertical-align: top;" border=1> 
    				<div style="overflow: hidden; width: 100%;"> 
    					<if $mybb->user['uid'] then>
    						<div style="text-align: center;"><strong>Download: <a href="{$GLOBALS['threadfields']['fupload']['url']}">{$GLOBALS['threadfields']['fupload']['filename']}</a></strong></div>
    					<else>
    						<div style="text-align: center;">Download: {$GLOBALS['threadfields']['fupload']['filename']}</strong></div>
    						<div class="smalltext" style="text-align: center;">
    						<em>You must login to download this file.</em>
    						</div>
    					</if>
    					<div class="smalltext" style="text-align: center;"> 
    						Size: {$GLOBALS['threadfields']['fupload']['filesize_friendly']}<br />
    						MD5 Hash: {$GLOBALS['threadfields']['fupload']['md5hash']}<br />
    						Downloads: {$GLOBALS['threadfields']['fupload']['downloads_friendly']}<br /> 
    						Last Updated: {$GLOBALS['threadfields']['fupload']['update_date']}, {$GLOBALS['threadfields']['fupload']['update_time']}<br /> 
    						Uploaded: {$GLOBALS['threadfields']['fupload']['upload_date']}, {$GLOBALS['threadfields']['fupload']['upload_time']}<br />
    
    					</div>
    				</div> 
    			</td>
    		</tr>
    
    		<tr>
    			<td class="trow2 post_content {$unapproved_shade}">
    				<span class="smalltext"><strong>{$post['icon']}{$post['subject']} {$post['subject_extra']}</strong></span>
    
    				<div class="post_body" id="pid_{$post['pid']}">
    					{$post['message']}
    				</div>
    				{$post['attachments']}
    				{$post['signature']}
    
    				<div class="post_meta" id="post_meta_{$post['pid']}">
    				{$post['iplogged']}
    				</div>
    			</td>
    		</tr>
    
    		<tr>
    			<td class="trow1 post_buttons {$unapproved_shade}">
    				<div class="author_buttons float_left">
    					{$post['button_email']}{$post['button_pm']}{$post['button_www']}{$post['button_find']}
    				</div>
    				<div class="post_management_buttons float_right">{$post['button_edit']}{$post['button_quickdelete']}{$post['button_quote']}{$post['button_multiquote']}{$post['button_report']}{$post['button_warn']}{$post['button_reply_pm']}{$post['button_replyall_pm']}{$post['button_forward_pm']}{$post['button_delete_pm']}
    				</div>
    			</td>
    		</tr>
    	</tbody>
    </table>

  3. Now, create a new template, named: download_postbit_first_classic

    PHP Code:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    {$ignore_bit}
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="{$post_extra_style} {$post_visibility}" id="post_{$post['pid']}">
    	<tr>
    		<td class="{$altbg}" width="15%" valign="top" style="white-space: nowrap; text-align: center;"><a name="pid{$post['pid']}" id="pid{$post['pid']}"></a>
    		<strong><span class="largetext">{$post['profilelink']}</span></strong> {$post['onlinestatus']}<br />
    		<span class="smalltext">
    			{$post['usertitle']}<br />
    			{$post['userstars']}
    			{$post['groupimage']}
    			{$post['useravatar']}<br />
    			{$post['user_details']}
    		</span>
    	</td>
    	<td class="{$altbg}" valign="top">
    		<table width="100%">
    			<tr><td>{$post['posturl']}<span class="smalltext"><strong>{$post['icon']}{$post['subject']} {$post['subject_extra']}</strong></span>
    			<br />
    			<div id="pid_{$post['pid']}" style="padding: 5px 0 5px 0;">
    				{$post['message']}
    			</div>
    			{$post['attachments']}
    			{$post['signature']}
    			<div style="text-align: right; vertical-align: bottom;" id="post_meta_{$post['pid']}">
    				<div id="edited_by_{$post['pid']}">{$post['editedmsg']}</div>
    				{$post['iplogged']}
    			</div>
    			</td>
    			</tr>
    			</table>
    	</td>
    	<td rowspan=2 class="{$altbg}" width="15%" valign="top" style="white-space: nowrap; text-align: center;"> 
    		<div style="overflow: hidden; width: 100%;"> 
    			<if $mybb->user['uid'] then>
    				<div style="text-align: center;"><strong>Download: <a href="{$GLOBALS['threadfields']['fupload']['url']}">{$GLOBALS['threadfields']['fupload']['filename']}</a></strong></div>
    			<else>
    				<div style="text-align: center;">Download: {$GLOBALS['threadfields']['fupload']['filename']}</strong></div>
    				<div class="smalltext" style="text-align: center;">
    				<em>You must login to download this file.</em>
    				</div>
    			</if>
    			<div class="smalltext" style="text-align: center;"> 
    				Size: {$GLOBALS['threadfields']['fupload']['filesize_friendly']}<br />
    				MD5 Hash: {$GLOBALS['threadfields']['fupload']['md5hash']}<br />
    				Downloads: {$GLOBALS['threadfields']['fupload']['downloads_friendly']}<br /> 
    				Last Updated: {$GLOBALS['threadfields']['fupload']['update_date']}, {$GLOBALS['threadfields']['fupload']['update_time']}<br /> 
    				Uploaded: {$GLOBALS['threadfields']['fupload']['upload_date']}, {$GLOBALS['threadfields']['fupload']['upload_time']}<br />
    			</div>
    		</div> 
    	</td>
    </tr>
    <tr>
    	<td class="{$altbg}" style="white-space: nowrap; text-align: center; vertical-align: middle;"><span class="smalltext">{$post['postdate']} {$post['posttime']}</span></td>
    	<td class="{$altbg}" style="vertical-align: middle;">
    		<table width="100%" border="0" cellpadding="0" cellspacing="0">
    			<tr valign="bottom">
    				<td align="left" ><span class="smalltext">{$post['button_email']}{$post['button_pm']}{$post['button_www']}{$post['button_find']}</span></td>
    				<td align="right">{$post['button_edit']}{$post['button_quickdelete']}{$post['button_quote']}{$post['button_multiquote']}{$post['button_report']}{$post['button_warn']}{$post['button_reply_pm']}{$post['button_replyall_pm']}{$post['button_forward_pm']}{$post['button_delete_pm']}</td>
    			</tr>
    		</table>
    	</td>
    </tr>
    </table>

  4. Finally, for each forum in 4d, edit the settings to match:
    1. Template Prefix: download
    2. Show first post on every showthread page: yes



And then you should be done!

Please, check for errors and report them, as I just copied and pasted from my own forum.
05-17-2010 05:44 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,349
Joined: Mar 2010
Post: #13
RE: Download System
Thanks for sharing, wnd Smile It's great.

05-17-2010 04:26 PM
Find all posts by this user Quote this message in a reply
x-Treme Offline
Member
***
Posts: 68
Joined: May 2010
Post: #14
RE: Download System
wnd...this isn't working for me. I can add the thread with the file no problem, but it doesn't show on the showthread page.

Forum Freebies
05-29-2010 03:38 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,349
Joined: Mar 2010
Post: #15
RE: Download System
What is your template prefix for that forum?

05-29-2010 03:51 AM
Find all posts by this user Quote this message in a reply
x-Treme Offline
Member
***
Posts: 68
Joined: May 2010
Post: #16
RE: Download System
Found the problem...{$first_post} was missing from my showthread template.

Forum Freebies
05-29-2010 04:38 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,349
Joined: Mar 2010
Post: #17
RE: Download System
Ah... Great Smile

05-29-2010 05:11 AM
Find all posts by this user Quote this message in a reply
JonP Offline
Junior Member
**
Posts: 6
Joined: Jun 2010
Post: #18
RE: Download System
Wheres the Xthread options in forum settings?
06-25-2010 04:19 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,349
Joined: Mar 2010
Post: #19
RE: Download System
When you edit a forum, there is XThreads Options, just above Forum Permission.

06-25-2010 04:28 AM
Find all posts by this user Quote this message in a reply
Hitman Offline
Junior Member
**
Posts: 1
Joined: Jul 2010
Post: #20
RE: Download System
Hello, is there any option to add downloads to other languages? Smile

Contact for PM Wink
08-04-2010 11:17 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: