MR_EXAMSOLUTION 2015-09-30 14:51
Pls eagle i need the full code of dis page both the result page @ http://weezywap.xtgem.com/search pls do help me i know it is made wit xtscript pls help.. THANKS!
-
·
- rated(0)
MAGIKLORD said to Mr_Examsolution 0n 2015-09-30 20:10
copy
<!--parser:xtscript-->
# Get the search query
get search
# Trim any spaces
var $search = call trim $val=$search
# No search query
if not $search
var $disable_js = //
goto @skip_1
endif
# Search query length check
var $len = call strlen $val=$search
if $len < 2
del $search
var $disable_js = //
print <b>Search query too short min 2 chars</b> <br />
goto @skip_1
endif
# Search query health check
# uncomment the next 3 lines to ban wildcards and negation in the search query
# var $neg = call strpos $haystack=#$search;$needle=-
# var $star = call strpos $haystack=#$search;$needle=*
# var $query = call strpos $haystack=#$search;$needle=?
var $dquot = call strpos $haystack=#$search;$needle="
var $squot = call strpos $haystack=#$search;$needle='
if $star or $query or $dquot or $squot or $neg==1
del $search
var $disable_js = //
print <b>Search query contains invalid chars</b> <br />
goto @skip_1
endif
# Set up the search
# Check for "anywhere"
get anywhere
if $anywhere
var $checked = checked="checked"
var $any = *
endif
# Filelist template that creates a javascript array
var $template = ['.file_name_parsed.','.file_url.','.file_size.','.file_datetime.','.file_mime.','.file_type.'],
# Filelist parameters
var $params = template="$template" filter="$any$search*" per_page="0"
# Filelist patterns
var $list1 = xt:filelist folder="/FOLDER_1" $params
var $list2 = xt:filelist folder="/FOLDER_2" $params
var $list3 = xt:filelist folder="/FOLDER_3" $params
var $list4 = xt:filelist folder="/FOLDER_4" $params
# Dummy array entry to use up the last , in the filelist template
var $dummy = ['dummy']
# skip_1 landing point
@skip_1
# The search form
print {{
<div class="search_form" id="srch">
<form action="<xt:url/>#srch" method="post">
<input type="search" name="search" value="$search" />
<input type="submit" value="Search" /><br />
Anywhere in filename <input type="checkbox" name="anywhere" value="1" $checked />
</form>
</div><br />}}
# The actual filelist functions are created outside the xtscript to avoid timeouts
# Create an array of the filelist arrays
<!--/parser:xtscript-->
<script type="text/javascript">
// Results array
{_$$disable_js|}var list=[<{_$$list1|}><{_$$list2|}><{_$$list3|}><{_$$list4|}>{_$$dummy|}];
<!--parser:xtscript-->
if $search
# Get page number
get_or_default results_page;0
# Results per page
var $per_page=5
# Create javascript
print {{list.length=list.length-1;
var length=list.length;
if (length){
var total_pages=Math.floor(}}
print {{list.length/$per_page);
var results_page=$results_page;
var search='$search';
var per_page=$per_page}}
print_raw {{;
var offset=(results_page*per_page);
var page_end=(offset + per_page);
if (page_end >= length)page_end=length;
// Output results
list.sort();
document.write('<div class="search_results">');
if (length >= 1)document.write('<div class="results_data">'+(offset+1)+' to '+page_end+' of ');
document.write( length+' Result');
if (length > 1) document.write('s');
document.write(' For "<span> '+search+' </span>"</div>');
for(i=offset;i < page_end;i++){
document.write('\
<div class="search_result">\
<div class="result_name">\
Name <span>'+list[i][0]+' <img src="http://xtgem.com/images/icons/mimes/'+list[i][5]+'.png" alt="*"/></span>\
</div>\
<div class="result_download_link">\
<a target="_BLANK" href="'+list[i][1]+'?__xt_download=1">Download</a> \
<a target="_BLANK" href="'+list[i][1]+'">Open</a>\
</div>\
<div class="result_url">\
Url <input type="text" value="'+list[i][1]+'" />\
</div>\
<div class="result_meta">\
Size <span>'+list[i][2]+'</span> \
Date <span>'+list[i][3]+'</span> \
Type <span>'+list[i][4]+'</span>\
</div>\
</div>');}
}}
# Pagination
var $common_part = document.write('<form style="display:inline" action="<xt:url />#srch" method="post"><input type="hidden" name="search" value="$search" /><input type="hidden" name="anywhere" value="$anywhere" /><input type="hidden" name="results_page" value="'+(results_page
print_raw {{
if (length > per_page){
document.write('<div class="results_pagination">');
if (offset > per_page){}}
print $common_part
print_raw {{-2)+'" /><span><input type="submit" value="'+(results_page-1)+'" /></span></form>');}
if (offset){}}
print $common_part
print_raw {{-1)+'" /><span><input type="submit" value="'+results_page+'" /></span></form>');}
document.write('<form style="display:inline"><span><input type="button" value="'+(results_page+1)+'" /></span></form>');
if (page_end < length){}}
print $common_part
print_raw {{+1)+'" /><span><input type="submit" value="'+(results_page+2)+'" /></span></form>');}
if (page_end < (length-per_page)){}}
print $common_part
print_raw {{+2)+'" /><span><input type="submit" value="'+(results_page+3)+'" /></span></form>');}
document.write('</div>');}
document.write('</div>');}}
# No search results
print } else {document.write('<div class="no_search_results"> No results for "<b>$search</b>"
print ;</div>');}
endif
<!--/parser:xtscript-->
</script>
Copy code
# Get the search query
get search
# Trim any spaces
var $search = call trim $val=$search
# No search query
if not $search
var $disable_js = //
goto @skip_1
endif
# Search query length check
var $len = call strlen $val=$search
if $len < 2
del $search
var $disable_js = //
print <b>Search query too short min 2 chars</b> <br />
goto @skip_1
endif
# Search query health check
# uncomment the next 3 lines to ban wildcards and negation in the search query
# var $neg = call strpos $haystack=#$search;$needle=-
# var $star = call strpos $haystack=#$search;$needle=*
# var $query = call strpos $haystack=#$search;$needle=?
var $dquot = call strpos $haystack=#$search;$needle="
var $squot = call strpos $haystack=#$search;$needle='
if $star or $query or $dquot or $squot or $neg==1
del $search
var $disable_js = //
print <b>Search query contains invalid chars</b> <br />
goto @skip_1
endif
# Set up the search
# Check for "anywhere"
get anywhere
if $anywhere
var $checked = checked="checked"
var $any = *
endif
# Filelist template that creates a javascript array
var $template = ['.file_name_parsed.','.file_url.','.file_size.','.file_datetime.','.file_mime.','.file_type.'],
# Filelist parameters
var $params = template="$template" filter="$any$search*" per_page="0"
# Filelist patterns
var $list1 = xt:filelist folder="/FOLDER_1" $params
var $list2 = xt:filelist folder="/FOLDER_2" $params
var $list3 = xt:filelist folder="/FOLDER_3" $params
var $list4 = xt:filelist folder="/FOLDER_4" $params
# Dummy array entry to use up the last , in the filelist template
var $dummy = ['dummy']
# skip_1 landing point
@skip_1
# The search form
print {{
<div class="search_form" id="srch">
<form action="<xt:url/>#srch" method="post">
<input type="search" name="search" value="$search" />
<input type="submit" value="Search" /><br />
Anywhere in filename <input type="checkbox" name="anywhere" value="1" $checked />
</form>
</div><br />}}
# The actual filelist functions are created outside the xtscript to avoid timeouts
# Create an array of the filelist arrays
<!--/parser:xtscript-->
<script type="text/javascript">
// Results array
{_$$disable_js|}var list=[<{_$$list1|}><{_$$list2|}><{_$$list3|}><{_$$list4|}>{_$$dummy|}];
<!--parser:xtscript-->
if $search
# Get page number
get_or_default results_page;0
# Results per page
var $per_page=5
# Create javascript
print {{list.length=list.length-1;
var length=list.length;
if (length){
var total_pages=Math.floor(}}
print {{list.length/$per_page);
var results_page=$results_page;
var search='$search';
var per_page=$per_page}}
print_raw {{;
var offset=(results_page*per_page);
var page_end=(offset + per_page);
if (page_end >= length)page_end=length;
// Output results
list.sort();
document.write('<div class="search_results">');
if (length >= 1)document.write('<div class="results_data">'+(offset+1)+' to '+page_end+' of ');
document.write( length+' Result');
if (length > 1) document.write('s');
document.write(' For "<span> '+search+' </span>"</div>');
for(i=offset;i < page_end;i++){
document.write('\
<div class="search_result">\
<div class="result_name">\
Name <span>'+list[i][0]+' <img src="http://xtgem.com/images/icons/mimes/'+list[i][5]+'.png" alt="*"/></span>\
</div>\
<div class="result_download_link">\
<a target="_BLANK" href="'+list[i][1]+'?__xt_download=1">Download</a> \
<a target="_BLANK" href="'+list[i][1]+'">Open</a>\
</div>\
<div class="result_url">\
Url <input type="text" value="'+list[i][1]+'" />\
</div>\
<div class="result_meta">\
Size <span>'+list[i][2]+'</span> \
Date <span>'+list[i][3]+'</span> \
Type <span>'+list[i][4]+'</span>\
</div>\
</div>');}
}}
# Pagination
var $common_part = document.write('<form style="display:inline" action="<xt:url />#srch" method="post"><input type="hidden" name="search" value="$search" /><input type="hidden" name="anywhere" value="$anywhere" /><input type="hidden" name="results_page" value="'+(results_page
print_raw {{
if (length > per_page){
document.write('<div class="results_pagination">');
if (offset > per_page){}}
print $common_part
print_raw {{-2)+'" /><span><input type="submit" value="'+(results_page-1)+'" /></span></form>');}
if (offset){}}
print $common_part
print_raw {{-1)+'" /><span><input type="submit" value="'+results_page+'" /></span></form>');}
document.write('<form style="display:inline"><span><input type="button" value="'+(results_page+1)+'" /></span></form>');
if (page_end < length){}}
print $common_part
print_raw {{+1)+'" /><span><input type="submit" value="'+(results_page+2)+'" /></span></form>');}
if (page_end < (length-per_page)){}}
print $common_part
print_raw {{+2)+'" /><span><input type="submit" value="'+(results_page+3)+'" /></span></form>');}
document.write('</div>');}
document.write('</div>');}}
# No search results
print } else {document.write('<div class="no_search_results"> No results for "<b>$search</b>"
print ;</div>');}
endif
<!--/parser:xtscript-->
</script>
Copy code
-
·
- rated(0)
MR_EXAMSOLUTION said to Lordeagle 0n 2015-09-30 21:33
Tanks magiklord, Eagle pls i need dat weezy's tag in his download page dat splits the name of the file when u click any of them it wil redirect to dat search page i search the app wil check box.. Pls tel me hw i wil do it..
-
·
- rated(0)
LORDEAGLE said to Mr_Examsolution 0n 2015-09-30 23:00
Copy the tags below
<div data-xtcontainer="container" class="xt_container" id="tag"></div>
<script>
var pageTitle = document.title;
tags = pageTitle.split(" ");
var target=document.getElementById('tag');
for (i=0;i<tags.length;i ){
var link= document.createElement("a");
link.setAttribute('href', 'http://eaglenet.xtgem.com/search?search=' tags[i])&anywhere=1;
link.setAttribute('class', 'xt_button');
var text = document.createTextNode(tags[i]);
link.appendChild(text);
target.appendChild(link);
}
</script>
Copy code
Read about the code @ http://forum.xtgem.com/index/__xt/making-tags-with-js/thread-oon8wg4ki2cqrt9e1e827sr8ak4om2guvx9i1.html?__xtforum_posts_page=1<script>
var pageTitle = document.title;
tags = pageTitle.split(" ");
var target=document.getElementById('tag');
for (i=0;i<tags.length;i ){
var link= document.createElement("a");
link.setAttribute('href', 'http://eaglenet.xtgem.com/search?search=' tags[i])&anywhere=1;
link.setAttribute('class', 'xt_button');
var text = document.createTextNode(tags[i]);
link.appendChild(text);
target.appendChild(link);
}
</script>
Copy code
-
·
- rated(0)
plz teach me how to use this search code it is not brigin out d result
-
·
- rated(0)
Make sure all the folders are well inserted finish.
-
·
- rated(0)
MR_EXAMSOLUTION said to Lordeagle 0n 2015-10-01 08:39
Eagle the tag code u gav me is nt showin or splitin anytin and the first code abov tel me the foldas i wil pt there and its nt linkin direct to my download page i wnt it to be linkin to my download page, lastly the code is 2much all cn't enter in my text box maximum of 5000 words.. Pls tel me exactly wat to do EAGLE!
-
·
- rated(0)
MAGIKLORD said to Mr_Examsolution 0n 2015-10-01 12:24
It is a matter of page title go to ur download page then option insert the code below .
EAGLE just drop for him the code u used in ur page search cos am still working for mine.
EAGLE just drop for him the code u used in ur page search cos am still working for mine.
-
·
- rated(0)
MR_EXAMSOLUTION said to MAGIKLORD 0n 2015-10-01 14:28
Tanks magik, pls eagle drop fr me urs the search result or u drop fr me the exact 1 weezy used pls eagle!
-
·
- rated(0)