Open Source Services

Development Services and Products for Open Source e-Commerce Sites

 
Welcome, Guest
Please Login or Register.    Lost Password?
Please log in or create an account to post your message.
Go to bottomPage: 1
TOPIC: Fatal error message
#494
Fatal error message 3 Years, 6 Months ago  
I am getting the following fatal error message on certain items.

Fatal error: Cannot redeclare getallpapsfilenames() (previously declared in /home/t/r/triextreme/public_html/tristore/catalog/includes/functions/paps_data_access.php:12) in /home/t/r/triextreme/public_html/tristore/catalog/includes/functions/paps_data_access.php on line 29

This is one of the items with the problem.

www.triextreme.com/tristore/catalog/prod...e-guadalupe-swimsuit

Any ideas how to fix the problem?

Regards

Andrew
AndyTri
Fresh Boarder
Posts: 3
graphgraph
User Offline Click here to see the profile of this user
Last Edit: 2008/07/24 20:44 By AndyTri.
The administrator has disabled public write access.
 
#508
Re:Fatal error message 3 Years, 6 Months ago  
Hi

Thanks for the query.

I have included below the catalog/includes/functions/paps_data_access.php file from the original distribution of PAPs version 0.7. Please check that you are using the same version before copying it into your file.

Code:


<?php
/*
  $Id: catalog/includes/functions/paps_data_access.php,v 1.0 20:57:52 Nick Carter-Bond Exp $

  by hanuman at Open Source Services
  Demo at http://www.lannathaicrafts.com/plywood-doubleroof-gilded-spirit-house-p-60.html
  Support and Forum at http://www.open-source-services.com/Forum/Product-Attribute-Pictures-PAPs-v0.5-for-osCommerce/
*/

    function getAllPapsFilenames() {

     $papsImageDir = DIR_FS_CATALOG . "images/paps";

     $arrAllFilenames = array();

     $allFileNames = array();
     $dirHandler = opendir($papsImageDir);

     while (false !== ($filename = readdir($dirHandler))) {
     if(($filename != '.') && ($filename != '..')) {
     $allFileNames[] = $filename;
     }
     }
    
     closedir($dirHandler);
    
     return $allFileNames;

    }
    
    function getHeadingSettings($attr_name, $model_no) {
    
     $query_raw = tep_db_query("select show_att_name, show_att_vals from " . TABLE_PAPS_HEADINGS . " where product_model ='" . $model_no . "' and attr_name ='" . $attr_name . "'");
     $query_results = tep_db_fetch_array($query_raw);
     $arr = array("san" => $query_results['show_att_name'], "sav" => $query_results['show_att_vals']);
     return $arr;
    }
    
    function getPicsPerRow($attr_name, $model_no) {
     $query_raw = tep_db_query("select pics_in_row from " . TABLE_PAPS_HEADINGS . " where product_model ='" . $model_no . "' and attr_name ='" . $attr_name . "'");
     $query_results = tep_db_fetch_array($query_raw);
     $arr = array("pics_no" => $query_results['pics_in_row']);
     return $arr;
    }
 
  function getImageWs($attr_name, $model_no) {
  $query_raw = tep_db_query("select thumb_w, large_w from " . TABLE_PAPS_HEADINGS . " where product_model ='" . $model_no . "' and attr_name ='" . $attr_name . "'");
     $query_results = tep_db_fetch_array($query_raw);
     $arr = array("t_w" => $query_results['thumb_w'], "m_w" => $query_results['large_w']);
     return $arr;
  }
?>



Have you edited any of the source files? If so, let me know which ones. Also, are you using more than one set of attribute pictures for that particular model? Thanks for the info.

Nick
hanuman
Moderator
Posts: 371
graph
User Offline Click here to see the profile of this user
Last Edit: 2008/07/25 12:10 By hanuman.
The administrator has disabled public write access.
 
#509
Re:Fatal error message 3 Years, 6 Months ago  
It is the lastest 0.7.0 package installed,

I have made no changes to any of your source code.

The items with the error have no attribute pictures attached.

Regards

Andrew
AndyTri
Fresh Boarder
Posts: 3
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#510
Re:Fatal error message 3 Years, 6 Months ago  
Hi

I just took a look at the html source of your product page and it look slike the PAPs code which you pasted in there is being executed more than once, thus creating the problem.

There can be only 2 reasons for this:

1) You have pasted the code from the 'product_info.paps.txt' into product_info.php twice - please check.

or

2) You have placed the code from the 'product_info.paps.txt' into a PHP 'for' or 'while' loop, which is executing that code more than once.

If you are not familiar with PHP I could check this for you if you send me your product_info.php file via email or paste it into your next post using the 'Code' button in the forum's text editor.

Cheers

Nick
hanuman
Moderator
Posts: 371
graph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#511
Re:Fatal error message 3 Years, 6 Months ago  
Sent code though email.

This error only happerns on some products and products with pap pictures display fine!!

Regards

Andrew
AndyTri
Fresh Boarder
Posts: 3
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
Go to topPage: 1