vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Integration with vBulletin - Starcraft 2 Replay Uploader (https://vborg.vbsupport.ru/showthread.php?t=256213)

jdelator 12-29-2010 10:00 PM

Starcraft 2 Replay Uploader
 
1 Attachment(s)
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 https://vborg.vbsupport.ru/external/2010/12/1.gif https://vborg.vbsupport.ru/external/2010/12/2.gif https://vborg.vbsupport.ru/external/2010/12/3.gif
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

FreshFroot 12-31-2010 10:58 PM

Nice work! MOTM voted!

Xarwin 01-10-2011 12:33 AM

Awesome, thanks!

hossgher 03-10-2011 01:33 PM

When will you have a version for VB 4.1.1 / 4.X.X?

iMoEthos 10-08-2011 05:17 PM

Would this work for 4.1.5 Patch 1? Anyone help please?


All times are GMT. The time now is 07:12 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01058 seconds
  • Memory Usage 1,748KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete