RegisterRegister    SearchSearch   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

AJAX upload progress bar

File sharing script

File mirror script

Newsletter script
How to set max length for file names ?

 
Post new topic   Reply to topic    SibSoft Ltd Forum Index -> XFileSharing Pro
View previous topic :: View next topic  
Author Message
crownin



Joined: 26 Dec 2010
Posts: 48

PostPosted: Jan 12, 2011 3:09 pm    Post subject: How to set max length for file names ? Reply with quote

How to set max length for file names ?

Thanks.
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 22 Mar 2006
Posts: 1283

PostPosted: Jan 13, 2011 8:59 am    Post subject: Reply with quote

There's no such functionality.
Back to top
View user's profile Send private message Send e-mail
ankurs



Joined: 10 Mar 2009
Posts: 605

PostPosted: Jan 13, 2011 10:03 am    Post subject: Reply with quote

admin wrote:
There's no such functionality.

can this be added in future version ?

or can characters be limited while displaying on download page
Back to top
View user's profile Send private message
crownin



Joined: 26 Dec 2010
Posts: 48

PostPosted: Jan 13, 2011 12:26 pm    Post subject: Reply with quote

isn't there any simple code for it ? because it is a must that you can limit characters.. it looks really unprofessional at download pages..
Back to top
View user's profile Send private message
nyan



Joined: 28 Oct 2010
Posts: 121

PostPosted: Jan 13, 2011 7:08 pm    Post subject: Reply with quote

copy the javascript code that checks for banned filetypes and use .length
http://www.tizag.com/javascriptT/javascript-string-length.php
Back to top
View user's profile Send private message
crownin



Joined: 26 Dec 2010
Posts: 48

PostPosted: Jan 15, 2011 12:50 pm    Post subject: Reply with quote

Could you please tell me where to put the code exactly ? Because I can't find it by myself... i'm noob ..

Last edited by crownin on Feb 05, 2011 11:07 am; edited 1 time in total
Back to top
View user's profile Send private message
crownin



Joined: 26 Dec 2010
Posts: 48

PostPosted: Feb 05, 2011 11:07 am    Post subject: Reply with quote

Bump... still no answers...
Back to top
View user's profile Send private message
krazyloads



Joined: 05 Oct 2010
Posts: 27

PostPosted: Feb 06, 2011 11:18 am    Post subject: Reply with quote

Hi,

If you need to display a limited number of characters it can be done using Jquery



Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

    <title>untitled</title>
    <style type="text/css" media="screen">
        .hide{
                display: none;
        }
    </style>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
    <script type="text/javascript" charset="utf-8">
        $(function(){
                var $elem = $('p');             // The element or elements with the text to hide
                var $limit = 10;                // The number of characters to show
                var $str = $elem.html();        // Getting the text
                var $strtemp = $str.substr(0,$limit);   // Get the visible part of the string
                $str = $strtemp + '<span class="hide">' + $str.substr($limit,$str.length) + '</span>';  // Recompose the string with the span tag wrapped around the hidden part of it
                $elem.html($str);               // Write the string to the DOM
        })
    </script>

</head>
<body>
<p>Some random line........</p>
</body>
</html>
Back to top
View user's profile Send private message
crownin



Joined: 26 Dec 2010
Posts: 48

PostPosted: Feb 06, 2011 6:06 pm    Post subject: Reply with quote

krazyloads wrote:
Hi,

If you need to display a limited number of characters it can be done using Jquery



Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

    <title>untitled</title>
    <style type="text/css" media="screen">
        .hide{
                display: none;
        }
    </style>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
    <script type="text/javascript" charset="utf-8">
        $(function(){
                var $elem = $('p');             // The element or elements with the text to hide
                var $limit = 10;                // The number of characters to show
                var $str = $elem.html();        // Getting the text
                var $strtemp = $str.substr(0,$limit);   // Get the visible part of the string
                $str = $strtemp + '<span class="hide">' + $str.substr($limit,$str.length) + '</span>';  // Recompose the string with the span tag wrapped around the hidden part of it
                $elem.html($str);               // Write the string to the DOM
        })
    </script>

</head>
<body>
<p>Some random line........</p>
</body>
</html>


hi krazyloads thanks for helping me on this mate Wink

I have tried to put this code into download0.html but nothing happens :

Quote:
<style type="text/css" media="screen">
.hide{
display: none;
}
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" charset="utf-8">
$(function(){
var $elem = $('p'); // The element or elements with the text to hide
var $limit = 10; // The number of characters to show
var $str = $elem.html(); // Getting the text
var $strtemp = $str.substr(0,$limit); // Get the visible part of the string
$str = $strtemp + '<span class="hide">' + $str.substr($limit,$str.length) + '</span>'; // Recompose the string with the span tag wrapped around the hidden part of it
$elem.html($str); // Write the string to the DOM
})
</script>


Im sorry i'm a newbie at this, Could you please explain me step by step what to do or could I maybe have your email so I could contact you on messenger, That would be way easier. Thanks ! Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    SibSoft Ltd Forum Index -> XFileSharing Pro All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2001, 2005 phpBB Group