XFileSharing Free - Description box

Free version of Xfilesharing

Moderator: admin

Message
Author
Bassman
Posts: 20
Joined: Sep 07, 2007 10:24 am
Location: UK

Description box

#1 Postby Bassman » Mar 05, 2008 8:34 pm

Hi
After you browse to a file the description box appears, can this be made bigger, multiline if possible so it is more like a message box?

I use XlFilesharing standard not pro at the moment.

cheers

User avatar
PilgrimX182
Posts: 2182
Joined: Mar 22, 2006 1:39 pm
Location: UFO Lab
Contact:

#2 Postby PilgrimX182 » Mar 06, 2008 11:28 am

Just tested - this is possble.

Update xdescr style in main.css:

Code: Select all

.xdescr  {color: #aaa;vertical-align:top;}


then in xupload.js replace these 2 lines:

Code: Select all

var new_row_descr = document.createElement( 'input' );
new_row_descr.type = 'text';

with

Code: Select all

var new_row_descr = document.createElement( 'textarea' );

Bassman
Posts: 20
Joined: Sep 07, 2007 10:24 am
Location: UK

#3 Postby Bassman » Mar 06, 2008 12:03 pm

Thanks for your quick response.

I have made those changes thank you, is it possible to adjust the vertical size of the textarea to say 5 rows/lines etc.

Thanks for your help it is much appreciated.

User avatar
PilgrimX182
Posts: 2182
Joined: Mar 22, 2006 1:39 pm
Location: UFO Lab
Contact:

#4 Postby PilgrimX182 » Mar 06, 2008 12:22 pm

Easiest way is to set width/height in CSS.
Just edit this style:

Code: Select all

.fdescr {width: 300px;}

Bassman
Posts: 20
Joined: Sep 07, 2007 10:24 am
Location: UK

#5 Postby Bassman » Mar 06, 2008 1:47 pm

i thought that would be it, i just wanted to check that was the best way

Cheers man

Bassman
Posts: 20
Joined: Sep 07, 2007 10:24 am
Location: UK

#6 Postby Bassman » Mar 27, 2008 6:39 pm

Hi
After trying this for a while we now have some problems.
It would seem that if the user presses the return key, i.e inserts line breaks in the description text it causes the following problems.

1: The delete id is not valid- can't delete files now

2: Sometimes the password box appears on the download page even though no password has been entered.

3: On the downloads page, Downloads should display 0 at first, but now it has random text there, if you download the file and refresh the page it then shows 1, which is normal.

I have tried it with no line breaks in the description and it all works as normal, so it looks like its the line breaks.

My users do like the description box being more like a message box, but they are all using line breaks in the description, like this post is layed out etc.

Can we do anything about this?

Cheers

Bassman
Posts: 20
Joined: Sep 07, 2007 10:24 am
Location: UK

#7 Postby Bassman » Apr 01, 2008 4:32 pm

any ideas on this yet?

Ta

User avatar
PilgrimX182
Posts: 2182
Joined: Mar 22, 2006 1:39 pm
Location: UFO Lab
Contact:

#8 Postby PilgrimX182 » Apr 02, 2008 5:32 am

I guess you have txt files based XFS version. No such bug should be in SQL latest version.

In upload.cgi find

Code: Select all

$fhash{file_descr} = $cg->param("$k\_descr");

and add line below:

Code: Select all

$fhash{file_descr} =~ s/[\n\r]//g;

Bassman
Posts: 20
Joined: Sep 07, 2007 10:24 am
Location: UK

#9 Postby Bassman » Apr 02, 2008 12:18 pm

Hi Pilgrim thanks for your response.

I tried what you said and it removes the line breaks etc.

It still causes one problem only on the download page, the description has the spaces between the words removed where the line break was also.

message entered was:
Hi
just testing this line break thingy

cheers
bassman

on the success links page it looks like this after the line breaks have been removed

Hi just testing this line break thingy cheers bassman

on the download page it looks like this

Hijust testing this line break thingycheersbassman

nearly there though

thanks in advance for your help

User avatar
PilgrimX182
Posts: 2182
Joined: Mar 22, 2006 1:39 pm
Location: UFO Lab
Contact:

#10 Postby PilgrimX182 » Apr 03, 2008 8:32 am

replace

Code: Select all

$fhash{file_descr} =~ s/[\n\r]//g;

with

Code: Select all

$fhash{file_descr} =~ s/[\n\r]+/ /g;

Bassman
Posts: 20
Joined: Sep 07, 2007 10:24 am
Location: UK

#11 Postby Bassman » Apr 03, 2008 11:25 am

That worked thanks!

raicio
Posts: 2
Joined: Apr 16, 2008 12:15 pm

Making it mandatory

#12 Postby raicio » Apr 16, 2008 12:19 pm

Hello! I am quite satisfied about Xfilesharing, but it would really be great if I could make the Description field mandatory. Do you have any quick tips? Thanx

User avatar
PilgrimX182
Posts: 2182
Joined: Mar 22, 2006 1:39 pm
Location: UFO Lab
Contact:

#13 Postby PilgrimX182 » May 05, 2008 10:25 am

Oh sorry, I've abandoned this thread a bit, here goes quick hack:
in xupload.js find

Code: Select all

if(!checkExt(current))return false;

and add below:

Code: Select all

if(f1.elements[current.name+'_descr'].value==''){alert('Description required');return false;}

raicio
Posts: 2
Joined: Apr 16, 2008 12:15 pm

wonderful!

#14 Postby raicio » May 05, 2008 12:40 pm

works like a charm!

thank you very much


Return to “XFileSharing Free”

Who is online

Users browsing this forum: No registered users and 0 guests