PDA

View Full Version : Virtual Pagination script v2.0 + Smarty



satwarriors
02-09-2009, 10:02 AM
1) Script Title: Virtual Pagination script v2.0

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/virtualpagination.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 :

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

<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

Twey
02-09-2009, 11:34 AM
At a guess, you want the <div> around the whole thing:
<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.

satwarriors
02-09-2009, 12:03 PM
@ 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 :
http://zaebb.biz/ddl/search.php

Any other ideas ?

satwarriors
02-11-2009, 08:20 AM
@ 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 ;)

satwarriors
02-13-2009, 07:49 AM
any idea ? :rolleyes: