XFileSharing Pro - Change Default Upload Type?

Message
Author
sharing1
Posts: 6
Joined: Nov 04, 2011 12:41 pm

Change Default Upload Type?

#1 Postby sharing1 » Nov 04, 2011 12:45 pm

I wanna use flash upload instead of normal upload as main upload how can i do that?

i searched the forum but couldnt find anything just a thread where the admin say its already answered

sharing1
Posts: 6
Joined: Nov 04, 2011 12:41 pm

#2 Postby sharing1 » Nov 05, 2011 1:46 pm

nobody?

PowerChaos
Posts: 521
Joined: Dec 19, 2009 5:12 pm

#3 Postby PowerChaos » Nov 06, 2011 12:05 am

i can not find it eather , so probaly it does not exist or we search wrong

anyway
here is your solution

open upload.html
search for this text

Code: Select all


<div id="utmodes">
<input type="radio" name="ut" value="file" onClick="changeUploadType('file')" id="r_file" checked><label for="r_file"><TMPL_VAR lang_file_upload></label>   
<TMPL_IF mmff><input type="radio" name="ut" value="ff" onClick="changeUploadType('ff')" id="r_ff"><label for="r_ff"><TMPL_VAR lang_upload_flash></label>   </TMPL_IF>
<input type="radio" name="ut" value="url" onClick="changeUploadType('url')" id="r_url"><label for="r_url"><TMPL_VAR lang_url_upload></label>   
<TMPL_IF mmrr><input type="radio" name="ut" value="rs" onClick="changeUploadType('rs')" id="r_rs"><label for="r_rs"><TMPL_VAR lang_free_rs_leech></label></TMPL_IF>
<TMPL_IF mmtt>   <input type="radio" name="ut" value="tt" onClick="changeUploadType('tt')" id="r_tt"><label for="r_tt"><TMPL_VAR lang_form_torrent></label></TMPL_IF>
</div>
now to change your default then just look at this text

Code: Select all

<input type="radio" name="ut" value="file" onClick="changeUploadType('file')" id="r_file" checked>
do you see the end of it ??
it says Checked

Code: Select all

 id="r_file" checked
remove that text "checked" and place it on the flash or other other upload you like
so you get like this

Code: Select all

<input type="radio" name="ut" value="file" onClick="changeUploadType('file')" id="r_file"><label for="r_file"><TMPL_VAR lang_file_upload></label>   
<TMPL_IF mmff><input type="radio" name="ut" value="ff" onClick="changeUploadType('ff')" id="r_ff" checked><label for="r_ff"><TMPL_VAR lang_upload_flash></label>   </TMPL_IF>
and then your default upload will always be the upload methode that you putted checked on

please note , DO NOT CHECK 2 THINGS AT THE SAME TIME
so be sure to check your code and that only 1 line contains "checked"

Greetings From PowerChaos

sharing1
Posts: 6
Joined: Nov 04, 2011 12:41 pm

#4 Postby sharing1 » Nov 06, 2011 8:36 am

not working

new code is looking like this

Code: Select all

<div id="utmodes">
<input type="button" value="<TMPL_VAR lang_file_upload>" onClick="changeUploadType('file')" id="r_file" class="active">
<TMPL_IF mmff>
<input type="button" value="<TMPL_VAR lang_upload_flash>" onClick="changeUploadType('ff')" id="r_ff"> 
</TMPL_IF>
<input type="button" value="<TMPL_VAR lang_url_upload>" onClick="changeUploadType('url')" id="r_url"> 
<TMPL_IF mmrr>
<input type="button" value="<TMPL_VAR lang_free_rs_leech>" onClick="changeUploadType('rs')" id="r_rs">

</TMPL_IF>
<TMPL_IF mmtt>
<input type="button" value="<TMPL_VAR lang_form_torrent>" onClick="changeUploadType('tt')" id="r_tt" style="margin:0">
</TMPL_IF>
</div>
and if you change active than u have just a differrent font color but it appears the normal upload

nyan
Posts: 163
Joined: Oct 28, 2010 8:01 pm

#5 Postby nyan » Nov 06, 2011 1:46 pm

a quick dirty way to do this would be to put
<script type="text/javascript">
changeUploadType('ff');
</script>
at the bottom of upload_form.html

PowerChaos
Posts: 521
Joined: Dec 19, 2009 5:12 pm

#6 Postby PowerChaos » Nov 06, 2011 2:08 pm

Code: Select all

id="r_file" checked  

Code: Select all

 Checked
checked = selected button

Code: Select all

Class = Active 
that part is just CSS -> shows a color if it is selected

Code: Select all

<input type="button" value="<TMPL_VAR lang_file_upload>" onClick="changeUploadType('file')" id="r_file" class="active" checked> 
thats how it need to look

that is just basic html for forms ... and the upload form is .. a form

Greetings From PowerChaos

sharing1
Posts: 6
Joined: Nov 04, 2011 12:41 pm

#7 Postby sharing1 » Nov 06, 2011 6:15 pm

like i said its not working..i already tried these simple things as first step

but the other solution is working maybe not pretty but it does the work..thanks

nyan
Posts: 163
Joined: Oct 28, 2010 8:01 pm

#8 Postby nyan » Nov 06, 2011 9:37 pm

PowerChaos wrote:
that is just basic html for forms ... and the upload form is .. a form

Greetings From PowerChaos
The form isn't a single form.
There are 2 to 4 forms, depending on your mods, which all are loaded.
By default one form-div is displayed via display:block; or the visibility style. the rest are display:none (or visibility:none);
via javascript you can then change the style attributes with document.divname.element.style.display = block, none;
this is what the changeuploadtype function does.
If you want to do it in a clean way you can swap around these block's and none's but it's quite some effort to figure it all out (it's in xupload.js in my xfs 1.5)