X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   pages and page numbers (https://forum.x-cart.com/showthread.php?t=14700)

jds580s 06-21-2005 04:45 AM

pages and page numbers
 
I'm currently transfering stores between hosts with a custom template that I built last year.

Everything looks good on the old site, but it's running incrediblly slow, especially updating products, thus the server switch.

The page numbers on the old site worked as I thought they should but on the new site I'm getting huge numbers of pages that don't exists. The template and php files were a direct copy from the working store, and everything else seems to be working fine.

This is X-cart 4.0.5 on linux

original page: http://yarnsmith.co.uk/xcart/home.php?cat=3 (slow)
new page: http://160.79.206.160/xcart/home.php?cat=3
(I am currently returning the values for all the smarty page number variables for reference)

My process on the transfer to the new server was this...
Create new database
upload with phpmyadmin
copy xcart files
manually update the config file
manually update the auth.php with new path
backup old site from xcart admin
find and replace all old local server path names with the new ones
go into the new xcart admin and restore the database

It seemed to work just fine... other than this strange problem.

Any ideas?

my navagation.tpl file looks like this
Code:

{* $Id: navigation.tpl,v 1.14 2004/06/24 13:09:51 max Exp $ *}
{if $total_pages gt 2}


Total Pages: {$total_pages}
Start Page: {$start_page}

navigation_page: {$navigation_page}

total_pages: {$total_pages}

total_super_pages: {$total_super_pages}

current_super_page: {$current_super_page}

start_page: {$start_page}




{section name=page loop=$total_pages start=$start_page}
{if %page.first%}
{if $navigation_page gt 1}
<<{*** Beginning Arrow ***}
{/if}
{/if}
{if %page.index% eq $navigation_page}
{if %page.index% eq %page.last%}
 {%page.index%}{*** Current Page is Last Page ***}
{else}
 <span class="current_page_number">{%page.index%}</span> •{*** Current Page ***}
{/if}
{else}

{if $navigation_page eq %page.last%}
 {%page.index%}{*** Last Additional Page ***}
{else}

 {%page.index%} •{*** Additional Pages ***}
{/if}
{/if}
{if %page.last%}
{math equation="pages-1" pages=$total_pages assign="total_pages_minus"}
{if $navigation_page lt $total_super_pages*$config.Appearance.max_nav_pages}
 &gt;&gt;{*** Ending Arrow ***}
{/if}
{/if}
{/section}
{if $current_super_page lt $total_super_pages}
[img]{$ImagesDir}/rarrow_2.gif[/img]
{/if}
{/if}

and navigation.php looks like this though I didn't modify it
Code:

#
# $Id: navigation.php,v 1.14 2004/03/05 07:03:25 svowl Exp $
#

if ( !defined('XCART_SESSION_START') ) { header("Location: ../"); die("Access denied"); }

if (empty($page)) $page=1;

$first_page = $objects_per_page*($page-1);

#
# $total_super_pages - how much groups of pages exists
#
$total_super_pages = (($total_nav_pages-1) / ($config["Appearance"]["max_nav_pages"] ? $config["Appearance"]["max_nav_pages"] : 1));

#
# $current_super_page - current group of pages
#
$current_super_page = ceil($page / $config["Appearance"]["max_nav_pages"]);

#
# $start_page - start page number in the list of navigation pages
#
$start_page = $config["Appearance"]["max_nav_pages"] * ($current_super_page - 1);

#
# $total_pages - the maximum number of pages to display in the navigation bar
# plus $start_page
$total_pages = ($total_nav_pages>$config["Appearance"]["max_nav_pages"] ? $config["Appearance"]["max_nav_pages"]+1 : $total_nav_pages) + $start_page;

#
# Cut off redundant pages from the tail of navigation bar
#
if ($total_pages > $total_nav_pages)
        $total_pages = $total_nav_pages;
       
if ($page > 1 and $page >= $total_pages) {
        $page = $total_pages - 1;
        $first_page = $objects_per_page*($page-1);
}

$smarty->assign("navigation_page", $page);
$smarty->assign("total_pages", $total_pages);
$smarty->assign("total_super_pages", $total_super_pages);
$smarty->assign("current_super_page", $current_super_page);
$smarty->assign("start_page", $start_page + 1);


Thanks for any help that can be offered!

Justin

balinor 06-30-2005 06:06 PM

Still having issues or did you get this fixed?

jds580s 06-30-2005 06:12 PM

Thanks for the reply,

Yes with some help from the smarty forum I was able to find out that it was because the host was running an old version of PHP

http://www.phpinsider.com/smarty-forum/viewtopic.php?t=5583&highlight=

I got the host to switch servers to a more up-to-date one.

Things are working just as I had hoped now.

Justin

balinor 06-30-2005 06:14 PM

Excellent...sorry I didn't get a chance to respond sooner, not many other people answering posts around here anymore :(


All times are GMT -8. The time now is 05:50 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.