Back to vBulletin 3.8 Add-ons

Starcraft 2 Replay Uploader
Mod Version: 1.00, by jdelator

vB Version: 3.8.7 Rating: (0 vote - 0 average) Installs: 2
Released: 31 Dec 2010 Last Update: Never Downloads: 0
Not Supported Template Edits Re-usable Code Translations  

Starcraft 2 Replay Uploader

Description

This modification will modify the vbulletin template to add visitors simple replay sharing on your forums. The button can upload many replay at the same time. Each uploaded replay will have the appropriate bbcode in the text box inserted automatically.

The replay upload button will be available whenever a registered member wants to create a new thread or post a reply (not a quick reply).

It is recommended that the board also use smilies for the the three terran races (:T:, :Z:, :P: ) in the same manner teamliquid.net does. Installation instructions can be found below.

The replays will be hosted at topreplays.com but will be available on your forum through download links.

Template installation

The template edits will need to be depending on where you want to add the feature.

The code needed

1. "newthread" Template (Forum) - When the member creates a new thread

Find: $attachmentoption
Below it paste the code.

2. "newreply" Template (Forum) - When the member creates a new reply to a thread (not quick reply)

Find: $attachmentoption
Below it paste the code.

3. "editpost" Template (Forum) - When the member is editing a post (not quick edit)

Find: $attachmentoption
Below it paste the code.

Code:
		   <script src="http://topreplays.com/Content/JS/swfobject.js" type="text/javascript"></script>
		   <script type="text/javascript">		
					function initupload()
					{
						var uploadKey = ""; //optional
						$('#uploadreplays').uploadify({
							'uploader': 'http://topreplays.com/Content/uploadify.swf',
							'script': 'http://topreplays.com/Replays/InsertJson',
							'cancelImg': 'http://topreplays.com/img/layout/error.png',
							'folder': '/_uploads',
							'multi': true,
							'scriptAccess' : 'always',
							'auto': true,
							'buttonText': 'Upload Replay',
							'scriptData': { 'UploadKey': uploadKey },
							'onComplete': function (event, queueID, fileObj, response, data) {
								var replay = jQuery.parseJSON(response);
								vB_Editor['vB_Editor_001'].insert_text(replay.TlCode + ' \n', replay.TlCode.length + 2, 0);
								$('#uploadreplays').val($('#uploadreplays').val); 
								return false;
							},
							'onAllComplete': function (event, queueID, fileObj, response, data) {
								return false;
							}
						});
					}
					/******** Load jQuery if not present *********/
					if (typeof jQuery === "undefined" || jQuery.fn.jquery !== '1.4.2') {
					    var jquery_tag = document.createElement('script');
					    jquery_tag.setAttribute("type","text/javascript");
					    jquery_tag.setAttribute("src",
					      "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js")
					    var script_tag = document.createElement('script');
					    script_tag.setAttribute("type","text/javascript");
					    script_tag.setAttribute("src",
					      "http://topreplays.com/Content/JS/jquery.uploadify.js")
					    script_tag.onload = initupload; // Run initupload() once jQuery has loaded
					    script_tag.onreadystatechange = function () { // Same thing but for IE
					      if (this.readyState == 'complete' || this.readyState == 'loaded') 
					      initupload();
					    }
					    document.getElementsByTagName("head")[0].appendChild(jquery_tag);
					    document.getElementsByTagName("head")[0].appendChild(script_tag);
					} else {
						initupload();
					}
		    </script>
				<fieldset class="fieldset">
			     	<legend>Upload Starcraft 2 Replay</legend>
			     	<div align="center">
						<input id="uploadreplays" name="uploadreplays" type="file" onmouseover="initupload()" /><br />
			     	</div>
				</fieldset>

Smilie installation

First go the add a single smilie menu (Admin Control Panel > Smilies > Add New Smilie > Add a Single Smilie)
Give it a Title
For text to replace choose of the races (:T:, :Z:, :P: )
For smilie image path give it a path relative to your vb installation (e.g. images/smilies/z.gif). You are free to choose the icons. Some example icons are
The rest of the options are up to you.

Demo

This modification is currently live at wcreplays.com/forums, feel free to experiment and use the modification on that website.

Version History
  • v1.0 - Initial Release

Download

No files for download.

Supporters / CoAuthors

  • jdelator

Screenshots

Click image for larger version
Name:	newreply.png
Views:	144
Size:	43.9 KB
ID:	125023   Click image for larger version
Name:	replay preview.jpg
Views:	136
Size:	66.0 KB
ID:	125024   Click image for larger version
Name:	replayupload.jpg
Views:	140
Size:	47.8 KB
ID:	125025  

Similar Mods

Starcraft 2 avatars vBulletin Avatar Sets

vblts.ru supports vBulletin®, 2022-2024