Waplocus
Waplocus Not that sir.. i mean the 1 to print only the first path name example
in /a/b/c/d.... i want to print only a... Thanks
Graham
Waplocus var $x=1
var $offset=0
var $count=0
var $path= <xt:url type="path" />/
@loop
var $start = call strpos $haystack=$path;$needle=/;$offset=$offset
var $end= call strpos $haystack=$path;$needle=/;$offset=($start+1)
var $name=call substr $val=$path;$start=($start+1);$length=($end-$start-1)
var $offset=($start+1)
var $count=($count+1)
if $count < $x
goto @loop
endif
print $name
Copy code Increase the value of x for other parts of the path
Waplocus
Graham Please graham the variable is gotten from a url.... e.g
http://site.com/apps/individualdownloadpage?Name=Java_uc_min.jar....
in the individualdownloadpage i want to filter the file using the variable value in the url
<!--parser:xtscript-->
get_or_default Name;
var $list= <xt:filelist sort_type="name" sort_dir="" folder="/Images/Backgrounds/Navigations/NS_F" template=".file_name_parsed." per_page="1" filter="$Name"/>
print $list
<!--/parser:xtscript-->
Copy code ....
when there is no value in the "Name" variable in the url How can i print "No file name was found" in xtscript above... thanks.
Waplocus
Waplocus And also to exclude the pagination?.
Graham
Waplocus will look shortly just got to go out for a while
Waplocus
Graham Thanks sir... but it slows down page load.