Results 1 to 5 of 5

Thread: Virtual Pagination script v2.0 + Smarty

  1. #1
    Join Date
    Feb 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Virtual Pagination script v2.0 + Smarty

    1) Script Title: Virtual Pagination script v2.0

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...pagination.htm

    3) Describe problem:

    i try to use Virtual Pagination script v2.0 with smarty http://smarty.net/ ....

    My site index a lot of content, so i have a lot of pages....

    I insert the Virtual Pagination script v2.0 successfully...but i have a "display trouble"

    the scipt work...but he display my pages number VERTICALLY and not HORIZONTALLY

    *****************************

    Here is the an example (using Demo #3 of the Virtual Pagination script v2.0) :
    http://zaebb.biz/ddl/search-new.php (pagination on the footer)

    here is the codes i use :

    javascript (untouch) : http://zaebb.biz/pagination/virtualpaginate.js

    css : http://zaebb.biz/pagination/virtualpaginate.css

    code use in my tpl file :
    Code:
    <div style="text-align:center">
    {foreach item=pagenumber from=$pagenumbers name="pagenumbers"}
    	{assign var="iteration" value=$smarty.foreach.pagenumbers.iteration}
    	{if $activepagenumber eq $iteration}
    <span class="activepage">{$iteration}</span>
    	{else}
    		{if $q or $t}
            <div class="virtualpage hidepiece" align="center" style="text-align:center">
    		<a class="page" href="search.php?a={$iteration}{if $q}&q={$q|escape}{/if}{if $t}&t={$t|escape}{/if}">{$iteration}</a>
            </div>
    		<a></a>
    		{else}
            <div class="virtualpage hidepiece" align="center" style="text-align:center">
    		<a class="page" href="page{$iteration}.htm">{$iteration}</a>
            </div>
    		{/if}
    	{/if}
    {/foreach}
    
    <div id="gallerypaginate" class="paginationstyle" style="text-align:center">
    <a href="#" rel="previous">Prev</a> <span class="flatview"></span> <a href="#" rel="next">Next</a>
    </div>
    
    {literal}
    <script type="text/javascript">
    
    var gallery=new virtualpaginate({
    	piececlass: "virtualpage", //class of container for each piece of content
    	piececontainer: 'div', //container element type (ie: "div", "p" etc)
    	pieces_per_page: 10, //Pieces of content to show per page (1=1 piece, 2=2 pieces etc)
    	defaultpage: 0, //Default page selected (0=1st page, 1=2nd page etc). Persistence if enabled overrides this setting.
    	persist: false //Remember last viewed page and recall it when user returns within a browser session?
    })
    
    gallery.buildpagination(["gallerypaginate"])
    
    </script>
    {/literal}
    *****************************

    Here is the an example (using Demo #5 of the Virtual Pagination script v2.0) :
    http://zaebb.biz/ddl/search-new2.php (pagination on the footer)

    here is the codes i use :

    javascript (untouch) : http://zaebb.biz/pagination/virtualpaginate.js

    css : http://zaebb.biz/pagination/virtualpaginate.css

    code use in my tpl file :
    Code:
    <div style="text-align:center">
    {foreach item=pagenumber from=$pagenumbers name="pagenumbers"}
    	{assign var="iteration" value=$smarty.foreach.pagenumbers.iteration}
    	{if $activepagenumber eq $iteration}
    <span class="activepage">{$iteration}</span>
    	{else}
    		{if $q or $t}
            <div class="virtualpage hidepiece" align="center" style="text-align:center">
    		<a class="page" href="search.php?a={$iteration}{if $q}&q={$q|escape}{/if}{if $t}&t={$t|escape}{/if}">{$iteration}</a>
            </div>
    		<a></a>
    		{else}
            <div class="virtualpage hidepiece" align="center" style="text-align:center">
    		<a class="page" href="page{$iteration}.htm">{$iteration}</a>
            </div>
    		{/if}
    	{/if}
    {/foreach}
    
    <div id="galleryselect" class="paginationstyle" align="center">
    <a href="#" rel="previous">Prev</a> <select style="width: 120px"></select> <a href="#" rel="next">Next</a>
    </div>
    
    {literal}
    <script type="text/javascript">
    
    var gallery=new virtualpaginate({
    	piececlass: "virtualpage",
    	piececontainer: 'div',
    	pieces_per_page: 10,
    	defaultpage: 0,
    	persist: false
    })
    
    gallery.buildpagination(["galleryselect"])
    
    </script>
    {/literal}
    Thanks in advance for any Help !!!

    Best Regards
    Last edited by Twey; 02-09-2009 at 11:31 AM. Reason: Fix links.

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    At a guess, you want the <div> around the whole thing:
    Code:
            <div class="virtualpage hidepiece" align="center" style="text-align:center">
    {foreach item=pagenumber from=$pagenumbers name="pagenumbers"}
    	{assign var="iteration" value=$smarty.foreach.pagenumbers.iteration}
    	{if $activepagenumber eq $iteration}
    <span class="activepage">{$iteration}</span>
    	{else}
    		{if $q or $t}
    		<a class="page" href="search.php?a={$iteration}{if $q}&q={$q|escape}{/if}{if $t}&t={$t|escape}{/if}">{$iteration}</a>
    		{else}
    		<a class="page" href="page{$iteration}.htm">{$iteration}</a>
    		{/if}
    	{/if}
    {/foreach}
            </div>
    What does this have to do with Smarty? Absolutely nothing.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Feb 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation @ Twey

    @ Twey : Thanks for your quick reply...but, i've already try...and it's not working....

    with your code, virtual pagination will not be apply, exactly like my original code...the pages are display like here :
    Code:
    http://zaebb.biz/ddl/search.php
    Any other ideas ?

  4. #4
    Join Date
    Feb 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation

    @ Twey: maybe, you're right about smarty....

    Can the trouble come from the javascript file ?

    How to "force" the pages to be display HORIZONTALLY ?

    Any idea are more than WELCOME !!!!

    Thanks for helping

  5. #5
    Join Date
    Feb 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation

    any idea ?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •