#1 (permalink)  
Old 08-06-2008, 06:06 PM
Registered User
 
Join Date: Jul 2004
Posts: 247
pagination error on online server

On my local server it works fine. But when I upload this file shows error:
Quote:
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in ...\searchLinkFiles\Paginated.php on line 11
PHP Code:
<?
/**
 * The intention of the Paginated class is to manage the iteration of records
 * based on a specified page number usually addressed by a get parameter in the query string
 * and to use a layout interface to produce number pages based on the amount of elements
 */
require_once "PageLayout.php";

class 
Paginated {

    private 
$rs;                              //result set .....line 11
    
private $pageSize;                      //number of records to display
    
private $pageNumber;                    //the page to be displayed
    
private $rowNumber;                     //the current row of data which must be less than the pageSize in keeping with the specified size
    
private $offSet;
    private 
$layout;

    function 
__construct($obj$displayRows 10$pageNum 1) {
        
$this->setRs($obj);
        
$this->setPageSize($displayRows);
        
$this->assignPageNumber($pageNum);
        
$this->setRowNumber(0);
        
$this->setOffSet(($this->getPageNumber() - 1) * ($this->getPageSize()));
    }

    
//implement getters and setters
    
public function setOffSet($offSet) {
        
$this->offSet $offSet;
    }

    public function 
getOffSet() {
        return 
$this->offSet;
    }


    public function 
getRs() {
        return 
$this->rs;
    }

    public function 
setRs($obj) {
        
$this->rs $obj;
    }

    public function 
getPageSize() {
        return 
$this->pageSize;
    }

    public function 
setPageSize($pages) {
        
$this->pageSize $pages;
    }

    
//accessor and mutator for page numbers
    
public function getPageNumber() {
        return 
$this->pageNumber;
    }

    public function 
setPageNumber($number) {
        
$this->pageNumber $number;
    }

    
//fetches the row number
    
public function getRowNumber() {
        return 
$this->rowNumber;
    }

    public function 
setRowNumber($number) {
        
$this->rowNumber $number;
    }

    public function 
fetchNumberPages() {
        if (!
$this->getRs()) {
            return 
false;
        }
        
        
$pages ceil(count($this->getRs()) / (float)$this->getPageSize());
        return 
$pages;
    }

    
//sets the current page being viewed to the value of the parameter
    
public function assignPageNumber($page) {
        if((
$page <= 0) || ($page $this->fetchNumberPages()) || ($page == "")) {
            
$this->setPageNumber(1);
        }
        else {
            
$this->setPageNumber($page);
        }
        
//upon assigning the current page, move the cursor in the result set to (page number minus one) multiply by the page size
        //example  (2 - 1) * 10
    
}

    public function 
fetchPagedRow() {
        if((!
$this->getRs()) || ($this->getRowNumber() >= $this->getPageSize())) {
            return 
false;
        }

        
$this->setRowNumber($this->getRowNumber() + 1);
        
$index $this->getOffSet();
        
$this->setOffSet($this->getOffSet() + 1);
        return 
$this->rs[$index];
    }

    public function 
isFirstPage() {
        return (
$this->getPageNumber() <= 1);
    }

    public function 
isLastPage() {
        return (
$this->getPageNumber() >= $this->fetchNumberPages());
    }

    
/**
     * <description>
     * @return PageLayout <description>
     */
    
public function getLayout() {
        return 
$this->layout;
    }

    
/**
     * <description>
     * @param PageLayout <description>
     */
    
public function setLayout(PageLayout $layout) {
        
$this->layout $layout;
    }

    
//returns a string with the base navigation for the page
    //if queryVars are to be added then the first parameter should be preceeded by a ampersand


    
public function fetchPagedNavigation($queryVars "") {
    
//public function fetchPagedNavigation($queryVars) {
        
return $this->getLayout()->fetchPagedLinks($this$queryVars);
    }
//end writeNavigation
}//end Paginated
//die( "Include die" );
?>
__________________
Gilgal's website:
Wheel Of God
Now easy to post scripture verses!
Portfolio
Reply With Quote

  #2 (permalink)  
Old 08-06-2008, 06:33 PM
curtiss's Avatar
Moderator
 
Join Date: May 2003
Posts: 1,438
Are you running PHP5 on your remote server?

If you're running PHP4, you're going to have to rewrite the whole function (or upgrade to PHP5), as classes and objects were not really implemented until PHP5. The constructs of classes in PHP4 are completely and totally different in PHP4.
__________________
I hate Internet Explorer! Anyone with me?
Reply With Quote
  #3 (permalink)  
Old 08-06-2008, 06:49 PM
Registered User
 
Join Date: Jul 2004
Posts: 247
Oh man what a nightmare...
__________________
Gilgal's website:
Wheel Of God
Now easy to post scripture verses!
Portfolio
Reply With Quote
  #4 (permalink)  
Old 08-07-2008, 08:02 AM
curtiss's Avatar
Moderator
 
Join Date: May 2003
Posts: 1,438
If you don't mind me asking, who are you using to host your Web site? I may know of a way to get PHP5 working on your server, depending on who's hosting it.
__________________
I hate Internet Explorer! Anyone with me?
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Zip From server.. yuppicide Off-Topic 0 07-01-2008 04:56 PM
live, online, auto-flash file generator on standard web server? Web Graphics and Flash 2 10-21-2007 10:48 PM
site works on one server – on another not rikardlassenius Programming and Scripting 2 01-18-2007 03:11 AM
Apache error under Win2000 ocoisadificil Servers 0 09-12-2006 09:54 AM
Importance of Website in Online Business pay786 Off-Topic 0 07-18-2006 06:22 AM


All times are GMT -5. The time now is 06:00 AM.

 
Bitrix
Clicky Web Analytics
CloudContacts
Maxtango


Subscribe to our feed | add to myYahoo!

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
© 1997-2007 HTMLCenter