logo
Home XtGem- Templates- XtScript- bottom
Xtgems blog filelist and paged content functions
can use paging customised by a special Xtscript function
The xtscript custom paging function is called once for each page in the content
it must go in a code block ABOVE the function being paged
Show in textarea
<!--parser:xtscript-->
# Paging function
function paging_template $url;$page;$active_page;$total_pages;
    
# Only one page so exit
if $total_pages == 1
return
endif

# Paging container
if $page == 1
print <div class="custom_paging">
    
# First page button    
if $page == $active_page
print <span>&laquo;</span>
elseif $page == 1
print <a href="$url">&laquo;</a>
endif

# Previous four pages buttons
if ($page+1) == $active_page or ($page+2) == $active_page or ($page+3) == $active_page or ($page+4) == $active_page
print <a href="$url">$page</a>
endif

# Current page button
if $page == $active_page 
print <span>$page</span>
endif

# Next four pages buttons
if ($page-1) == $active_page or ($page-2) == $active_page  or ($page-3) == $active_page or ($page-4) == $active_page
print <a href="$url">$page</a>
endif

# Last page button
if not $page == $total_pages
goto @skip
endif
if $page==$active_page
print <span>&raquo;</span></div>
else
print <a href="$url">&raquo;</a></div>
endif  
@skip   
endfunction
<!--/parser:xtscript-->
Show in textarea
Reload
Paged content function
Test page 1
*
«123»

Filelist function
20th.mid
3D_GOLD_NOKIA.sis
BOOKOSBI.TTF
BlueCrystal.nth
Crazy_Frog-740.mp3
Powered by XtGem
About us Contact Forum topÂ