XFileSharing Pro - insert image in template

Message
Author
tendea
Posts: 71
Joined: Feb 28, 2013 9:59 pm

insert image in template

#1 Postby tendea » Mar 22, 2013 3:10 am

Hi, can you know how I can insert an image in upload_form.html after 'flash upload'?

I can put picture/text after normal upload and remote upload.. but i can't after 'flash upload'

someone can help me?

Jesse202
Posts: 246
Joined: May 07, 2010 6:24 pm

#2 Postby Jesse202 » Mar 22, 2013 12:12 pm

Show us what you mean, please.

tendea
Posts: 71
Joined: Feb 28, 2013 9:59 pm

#3 Postby tendea » Mar 22, 2013 3:05 pm

I would add this under 'flash upload' : <img src="etc etc"> but I can't find where put the code. I can with 'upload' and 'file remote' but not in flash mode.. :(

Jesse202
Posts: 246
Joined: May 07, 2010 6:24 pm

#4 Postby Jesse202 » Mar 22, 2013 4:21 pm

Ah I see. On said file you mentioned you'll see the following. I marked in bold where you can add it:
<script type="text/javascript">
var scriptData = {"sess_id" : "<TMPL_VAR sess_id>", "thumb_size": "250x250"};
function setScriptData(key, value) {
scriptData[key] = value;
$('#uploadify').uploadifySettings('scriptData', scriptData);
}
$(document).ready(function() {
$("#uploadify").uploadify({
'uploader' : '<TMPL_VAR site_url>/uploadify.swf',
'script' : '<TMPL_VAR srv_cgi_url>/up_flash.cgi',
'cancelImg' : '<TMPL_VAR site_url>/images/cancel.png',
'buttonImg' : '<TMPL_VAR site_url>/images/browse-files.png',
'width' : 130,
'queueID' : 'fileQueue',
'auto' : false,
'multi' : true,
'wmode' : 'transparent',
'scriptData' : scriptData,
'fileExt' : '<TMPL_VAR exts>',
'fileDesc' : 'Allowed files: <TMPL_VAR exts>',
'queueSizeLimit' : <TMPL_VAR max_upload_files>,
'sizeLimit' : <TMPL_VAR max_upload_filesize_bytes>,
'onSelectOnce' : function(){$('#fileQueue').show();$('#mfstart').show();},
'onOpen' : function(){$('#mfstart').hide();},
'onAllComplete' : function(){$('#fileQueue').hide();$('#mfstart').hide();},
'onComplete' : function(event, queueID, fileObj, response, data)
{
aa = response.split(':');
var code=aa[0];
var real=aa[1];
var dx=aa[2];
var fname=aa[3];
var ftype=aa[4];
<TMPL_IF link_format_0>
link_url='<TMPL_VAR site_url>/'+code+'/'+fname+'.html';
</TMPL_IF>
<TMPL_IF link_format_1>
link_url='<TMPL_VAR site_url>/'+code+'/'+fname+'.htm';
</TMPL_IF>
<TMPL_IF link_format_2>
link_url='<TMPL_VAR site_url>/'+code+'/'+fname;
</TMPL_IF>
<TMPL_IF link_format_3>
link_url='<TMPL_VAR site_url>/'+code+'.html';
</TMPL_IF>
<TMPL_IF link_format_4>
link_url='<TMPL_VAR site_url>/'+code+'.htm';
</TMPL_IF>
<TMPL_IF link_format_5>
link_url='<TMPL_VAR site_url>/'+code;
</TMPL_IF>

forum_code=''+fname+'';
html_code='<a href="'+link_url+'" target="_blank">'+fname+'<\/a>';
var img_code='';
if(ftype=='image')
{
img_url='<TMPL_VAR srv_htdocs_url>/i/'+dx+'/'+real+'_t.jpg';
img_code='<tr><td align=right><b>Preview:<\/b><\/td><td><img src="'+img_url+'"><\/td><\/tr>';
forum_code='[img]'+img_url+'[/img]';
html_code='<a href="'+link_url+'" target="_blank"><img src="'+img_url+'" border=0><\/a>';
}

$('#tblres').show();

$('#codes0').show();
$$('codes0t').value+=link_url+'\n';

$('#codes1').show();
$$('codes1t').value+=forum_code+' ';

$('#codes2').show();
$$('codes2t').value+=html_code+' ';

if(real && fname)
{
txt='<table cellspacing=0 cellpadding=2 class="result_slot" style="width:100%;margin-top:7px;">'+
'<tr><td align=right><b>File:<\/b><\/td><td><a href="'+link_url+'"><b>'+fname+'<\/b><\/a><\/td><\/tr>'+
img_code+
'<tr><td align=right><b>Direct Link:<\/b><\/td><td><input type="text" onFocus="copy(this);" style="width:99%" value="'+link_url+'"><\/td><\/tr>'+
'<tr><td align=right width=5% nowrap><b>Forum code:<\/b><\/td><td><input type="text" onFocus="copy(this);" style="width:99%" value="'+forum_code+'"><\/td><\/tr>'+
'<tr><td align=right><b>HTML code:<\/b><\/td><td><input type="text" onFocus="copy(this);" style="width:99%" value=\''+html_code+'\'><\/td><\/tr><\/table><br><img code goes here>';
}
else
{
txt='<table cellspacing=0 cellpadding=2 class="result_slot" style="margin-top:7px;">'+
'<tr><td align=right><b class="err">'+response+'<\/b><\/td><\/tr><\/table>';
}
$('#filesUploaded').append(txt);
}

});
});
</script>

tendea
Posts: 71
Joined: Feb 28, 2013 9:59 pm

#5 Postby tendea » Mar 22, 2013 8:32 pm

I'm sorry my friend but don't work like I want. I would that the picture show when i click on 'flash upload', not when i finish to upload.

Thank for you help for now.

tendea
Posts: 71
Joined: Feb 28, 2013 9:59 pm

#6 Postby tendea » Mar 22, 2013 8:45 pm

find.. is after:
<TMPL_VAR lang_up_to> <TMPL_VAR max_upload_filesize>

:) thank you

tendea
Posts: 71
Joined: Feb 28, 2013 9:59 pm

#7 Postby tendea » Mar 22, 2013 8:53 pm

or better here after style="display:none;" onClick='$("#uploadify").uploadifyUpload();'>

Jesse202
Posts: 246
Joined: May 07, 2010 6:24 pm

#8 Postby Jesse202 » Mar 23, 2013 3:12 pm

Ah. Thought you meant after upload when you said, "image in upload_form.html after flash upload"