XFileSharing Pro - How to set max length for file names ?

Powerfull XFileSharing version

Moderator: admin

Message
Author
crownin
Posts: 47
Joined: Dec 26, 2010 12:23 pm

How to set max length for file names ?

#1 Postby crownin » Jan 12, 2011 3:09 pm

How to set max length for file names ?

Thanks.

admin
Site Admin
Posts: 1801
Joined: Mar 22, 2006 12:32 pm

#2 Postby admin » Jan 13, 2011 8:59 am

There's no such functionality.

ankurs
Posts: 1054
Joined: Mar 10, 2009 2:34 am

#3 Postby ankurs » Jan 13, 2011 10:03 am

admin wrote:There's no such functionality.

can this be added in future version ?

or can characters be limited while displaying on download page

crownin
Posts: 47
Joined: Dec 26, 2010 12:23 pm

#4 Postby crownin » Jan 13, 2011 12:26 pm

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..

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

#5 Postby nyan » Jan 13, 2011 7:08 pm

copy the javascript code that checks for banned filetypes and use .length
http://www.tizag.com/javascriptT/javasc ... length.php

crownin
Posts: 47
Joined: Dec 26, 2010 12:23 pm

#6 Postby crownin » Jan 15, 2011 12:50 pm

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.

crownin
Posts: 47
Joined: Dec 26, 2010 12:23 pm

#7 Postby crownin » Feb 05, 2011 11:07 am

Bump... still no answers...

krazyloads
Posts: 27
Joined: Oct 05, 2010 12:53 pm

#8 Postby krazyloads » Feb 06, 2011 11:18 am

Hi,

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



Code: Select all

<!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>

crownin
Posts: 47
Joined: Dec 26, 2010 12:23 pm

#9 Postby crownin » Feb 06, 2011 6:06 pm

krazyloads wrote:Hi,

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



Code: Select all

<!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 ;)

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

<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 ! :)


Return to “XFileSharing Pro”

Who is online

Users browsing this forum: No registered users and 0 guests