|
From: Frank S. <lan...@us...> - 2005-08-21 13:28:16
|
Update of /cvsroot/pn-commerce/pn-commerce In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27227 Modified Files: common.php pnadmin.php pnadminapi.php pnuser.php Log Message: moved api load to common.php function Index: pnadminapi.php =================================================================== RCS file: /cvsroot/pn-commerce/pn-commerce/pnadminapi.php,v retrieving revision 1.183 retrieving revision 1.184 diff -C2 -d -r1.183 -r1.184 *** pnadminapi.php 8 Aug 2005 19:39:11 -0000 1.183 --- pnadminapi.php 21 Aug 2005 13:28:04 -0000 1.184 *************** *** 48,56 **** function pncAdminAPIModURL($Module,$Section,$Function,$Args=array()) { ! if (!pnModAPILoad('pncommerce', 'user')) ! { ! return showerrorpage("unable to load pnuserapi", __FILE__, __LINE__); ! ! } return pnModAPIFunc ('pncommerce', 'user','pncModURL', array( --- 48,52 ---- function pncAdminAPIModURL($Module,$Section,$Function,$Args=array()) { ! pncloadapi('user', __FILE__, __LINE__); return pnModAPIFunc ('pncommerce', 'user','pncModURL', array( *************** *** 89,100 **** $pluginname = substr($pluginname, 2, strlen($pluginname) - 2); if (pnSecAuthAction(0, 'pncommerce::plugin', "$type:$pluginname:", ACCESS_COMMENT)) { ! if (pnModAPILoad ('pncommerce', $pluginname)) { ! // if (empty($pluginstates[$pluginname]))$pluginstates[$pluginname] = _PCSS_UNINITIALIZED; ! // if (($args['onlyactive'] == false) || ($pluginstates[$pluginname] != _PCSS_UNINITIALIZED)) { ! $info = pnModAPIFunc('pncommerce', $pluginname, 'info'); ! if($info<>false || $allplugins==true) { ! $plugins[$pluginname] = array('info' => $info, ! 'name' => $pluginname); ! } } } --- 85,95 ---- $pluginname = substr($pluginname, 2, strlen($pluginname) - 2); if (pnSecAuthAction(0, 'pncommerce::plugin', "$type:$pluginname:", ACCESS_COMMENT)) { ! pncloadapi($pluginname, __FILE__, __LINE__); ! // if (empty($pluginstates[$pluginname]))$pluginstates[$pluginname] = _PCSS_UNINITIALIZED; ! // if (($args['onlyactive'] == false) || ($pluginstates[$pluginname] != _PCSS_UNINITIALIZED)) { ! $info = pnModAPIFunc('pncommerce', $pluginname, 'info'); ! if($info<>false || $allplugins==true) { ! $plugins[$pluginname] = array('info' => $info, ! 'name' => $pluginname); } } *************** *** 277,281 **** 'DefaultCurrencySymbol' => pnModGetVar('pncommerce', 'DefaultCurrencySymbol')); } ! /** * Converts a country specific formatted number within a string into --- 272,276 ---- 'DefaultCurrencySymbol' => pnModGetVar('pncommerce', 'DefaultCurrencySymbol')); } ! /** * Converts a country specific formatted number within a string into *************** *** 288,308 **** */ function pncommerce_adminapi_convertToNumber($args) ! { extract($args); ! $decimalDelimiter = pnModGetVar('pncommerce', 'DecimalDelimiter'); $thousandsSeparator = pnModGetVar('pncommerce', 'ThousandsSeparator'); ! ! // Extract the numeric part with a regular expression: // Divide the string into four parts: // 1. everything non numeric // 2. at least one digit and all following digits and thousands // separators (can be empty for values like "$ .12" ! // 3. the fractional part: decimal delimiter and following digits and // thousands separators (can be empty for values like "$ 42") // 4. all the rest // At the end we use the second and third part. // All separators and delimiters have to be in character classes because ! // because in regular expressions they can become wildcards $value = ereg_replace('([^0-9' . $decimalDelimiter . ']*)' . // non numeric '([0-9]+[0-9' . $thousandsSeparator . ']*)*' . // integer --- 283,303 ---- */ function pncommerce_adminapi_convertToNumber($args) ! { extract($args); ! $decimalDelimiter = pnModGetVar('pncommerce', 'DecimalDelimiter'); $thousandsSeparator = pnModGetVar('pncommerce', 'ThousandsSeparator'); ! ! // Extract the numeric part with a regular expression: // Divide the string into four parts: // 1. everything non numeric // 2. at least one digit and all following digits and thousands // separators (can be empty for values like "$ .12" ! // 3. the fractional part: decimal delimiter and following digits and // thousands separators (can be empty for values like "$ 42") // 4. all the rest // At the end we use the second and third part. // All separators and delimiters have to be in character classes because ! // because in regular expressions they can become wildcards $value = ereg_replace('([^0-9' . $decimalDelimiter . ']*)' . // non numeric '([0-9]+[0-9' . $thousandsSeparator . ']*)*' . // integer *************** *** 312,316 **** $value); // remove thousands separators ! if ($thousandsSeparator != $decimalDelimiter) { $value = str_replace($thousandsSeparator, "", $value); --- 307,311 ---- $value); // remove thousands separators ! if ($thousandsSeparator != $decimalDelimiter) { $value = str_replace($thousandsSeparator, "", $value); *************** *** 325,330 **** { $result = (int)$value; ! } ! else { $result = (double)$value; --- 320,325 ---- { $result = (int)$value; ! } ! else { $result = (double)$value; *************** *** 710,729 **** // $itemsTable = $pntable[pncommerce_items]; ! if (!pnModAPILoad( 'pncommerce', 'user' ) ) ! { ! return showerrorpage("unable to load pnuserapi", __FILE__, __LINE__); - } - $sql = "UPDATE $itemsTable SET scheme_id='".pnVarPrepForStore($Scheme_ID)."', ! ItemSKU='".pnVarPrepForStore($ItemSKU)."', ItemName='".pnVarPrepForStore($ItemName)."', ! ItemDescription='".pnVarPrepForStore($ItemDescription)."', ! ItemCost='".pnVarPrepForStore($ItemCost)."', Weight='".pnVarPrepForStore($Weight)."', ! Category='".pnVarPrepForStore($CategoryID)."', ItemQuantity='".pnVarPrepForStore($QuantityOnHand)."',VATID='".pnVarPrepForStore($VATID)."', ! IgnoreQuantity='".pnVarPrepForStore($IgnoreQuantity)."', TaxExempt='".pnVarPrepForStore($TaxExempt)."' WHERE ItemID='".pnVarPrepForStore($ItemID)."'"; --- 705,723 ---- // $itemsTable = $pntable[pncommerce_items]; ! pncloadapi('user', __FILE__, __LINE__); ! ! $ItemCost = number_format($ItemCost, 3, '.', '');//ereg_replace( ",", ".", $ItemCost ); ! $Weight = number_format($Weight, 4, '.', '');//ereg_replace( ",", ".", $Weight ); $sql = "UPDATE $itemsTable SET scheme_id='".pnVarPrepForStore($Scheme_ID)."', ! ItemSKU='".pnVarPrepForStore($ItemSKU)."', ItemName='".pnVarPrepForStore($ItemName)."', ! ItemDescription='".pnVarPrepForStore($ItemDescription)."', ! ItemCost='".pnVarPrepForStore($ItemCost)."', Weight='".pnVarPrepForStore($Weight)."', ! Category='".pnVarPrepForStore($CategoryID)."', ItemQuantity='".pnVarPrepForStore($QuantityOnHand)."',VATID='".pnVarPrepForStore($VATID)."', ! IgnoreQuantity='".pnVarPrepForStore($IgnoreQuantity)."', TaxExempt='".pnVarPrepForStore($TaxExempt)."' WHERE ItemID='".pnVarPrepForStore($ItemID)."'"; *************** *** 1091,1097 **** function pncommerce_adminapi_ArticleDelete($args) { ! if (!pnModAPILoad('pncommerce', 'user')) { ! return showerrorpage("unable to load pnuserapi", __FILE__, __LINE__); ! } extract($args); list($catID)=pnModAPIFunc('pncommerce','user','readfromdb', array('table' => 'items', 'fields' => array('category'), 'required' => array('itemid', $ItemID)) ); --- 1085,1090 ---- function pncommerce_adminapi_ArticleDelete($args) { ! pncloadapi('user', __FILE__, __LINE__); ! extract($args); list($catID)=pnModAPIFunc('pncommerce','user','readfromdb', array('table' => 'items', 'fields' => array('category'), 'required' => array('itemid', $ItemID)) ); *************** *** 1261,1269 **** extract($Thumbnails); ! if (!pnModAPILoad('pncommerce', 'user')) ! { ! return showerrorpage("unable to load pnuserapi", __FILE__, __LINE__); ! ! } list($catID)=pnModAPIFunc('pncommerce','user','readfromdb', array('table' => 'items', 'fields' => array('category'), 'required' => array('itemid', $itemID)) ); --- 1254,1258 ---- extract($Thumbnails); ! pncloadapi('user', __FILE__, __LINE__); list($catID)=pnModAPIFunc('pncommerce','user','readfromdb', array('table' => 'items', 'fields' => array('category'), 'required' => array('itemid', $itemID)) ); *************** *** 1399,1407 **** $Thumbnails = pncommerce_adminapi_getConfigThumbnail(); extract($Thumbnails); ! if (!pnModAPILoad('pncommerce', 'user')) ! { ! return showerrorpage("unable to load pnuserapi", __FILE__, __LINE__); ! ! } list($catID)=pnModAPIFunc('pncommerce','user','readfromdb', array('table' => 'items', 'fields' => array('category'), 'required' => array('itemid', $itemID)) ); --- 1388,1392 ---- $Thumbnails = pncommerce_adminapi_getConfigThumbnail(); extract($Thumbnails); ! pncloadapi('user', __FILE__, __LINE__); list($catID)=pnModAPIFunc('pncommerce','user','readfromdb', array('table' => 'items', 'fields' => array('category'), 'required' => array('itemid', $itemID)) ); *************** *** 1451,1458 **** extract($args); ! if (!pnModAPILoad('pncommerce', 'user')) ! { ! return false; ! } $result = pnModAPIFunc( 'pncommerce', 'user', 'readfromDBpreformat', array('sql' => "SELECT CategoryID, Category, CatParent FROM ".pnConfigGetVar('prefix')."_pncommerce_category")); --- 1436,1440 ---- extract($args); ! pncloadapi('user', __FILE__, __LINE__); $result = pnModAPIFunc( 'pncommerce', 'user', 'readfromDBpreformat', array('sql' => "SELECT CategoryID, Category, CatParent FROM ".pnConfigGetVar('prefix')."_pncommerce_category")); *************** *** 1571,1579 **** } ! if (!pnModAPILoad('pncommerce', 'user')) ! { ! return showerrorpage("unable to load pnuserapi", __FILE__, __LINE__); ! ! } $result = pnModAPIFunc( 'pncommerce', 'user', 'readfromDBpreformat', array('sql' => "SELECT CategoryID, Category, CatParent FROM ".pnConfigGetVar('prefix')."_pncommerce_category")); --- 1553,1557 ---- } ! pncloadapi('user', __FILE__, __LINE__); $result = pnModAPIFunc( 'pncommerce', 'user', 'readfromDBpreformat', array('sql' => "SELECT CategoryID, Category, CatParent FROM ".pnConfigGetVar('prefix')."_pncommerce_category")); *************** *** 1639,1647 **** } ! if (!pnModAPILoad('pncommerce', 'user')) ! { ! return showerrorpage("unable to load pnuserapi", __FILE__, __LINE__); ! ! } $result = pnModAPIFunc( 'pncommerce', 'user', 'readfromDBpreformat', array('sql' => "SELECT ItemID, ItemName, ItemSKU FROM ".pnConfigGetVar('prefix')."_pncommerce_items WHERE ItemSKU REGEXP \"^[^\%]\" ORDER BY ItemName")); --- 1617,1621 ---- } ! pncloadapi('user', __FILE__, __LINE__); $result = pnModAPIFunc( 'pncommerce', 'user', 'readfromDBpreformat', array('sql' => "SELECT ItemID, ItemName, ItemSKU FROM ".pnConfigGetVar('prefix')."_pncommerce_items WHERE ItemSKU REGEXP \"^[^\%]\" ORDER BY ItemName")); *************** *** 1677,1685 **** { $errormsg = array(); ! if (!pnModAPILoad('pncommerce', 'user')) ! { ! return showerrorpage("unable to load pnuserapi", __FILE__, __LINE__); ! ! } if( !is_numeric($args['CategorySequence']) ) --- 1651,1655 ---- { $errormsg = array(); ! pncloadapi('user', __FILE__, __LINE__); if( !is_numeric($args['CategorySequence']) ) *************** *** 1745,1752 **** { extract($args); ! if (!pnModAPILoad('pncommerce', 'user')){ ! return showerrorpage("unable to load pnuserapi", __FILE__, __LINE__); ! ! } $CName=pnModAPIFunc( 'pncommerce', 'user','GetCategoryName',array('CategoryID'=>$catID)); if (!pnSecAuthAction(0, --- 1715,1719 ---- { extract($args); ! pncloadapi('user', __FILE__, __LINE__); $CName=pnModAPIFunc( 'pncommerce', 'user','GetCategoryName',array('CategoryID'=>$catID)); if (!pnSecAuthAction(0, *************** *** 1838,1846 **** function pncommerce_adminapi_CategoryStore($args) { ! if (!pnModAPILoad('pncommerce', 'user')) ! { ! return showerrorpage("unable to load pnuserapi", __FILE__, __LINE__); ! ! } if (!pnSecAuthAction(0, 'pncommerce::category', --- 1805,1809 ---- function pncommerce_adminapi_CategoryStore($args) { ! pncloadapi('user', __FILE__, __LINE__); if (!pnSecAuthAction(0, 'pncommerce::category', *************** *** 1924,1932 **** { extract ($args); ! if (!pnModAPILoad('pncommerce', 'user')) ! { ! return showerrorpage("unable to load pnuserapi", __FILE__, __LINE__); ! ! } if (!pnSecAuthAction(0, --- 1887,1891 ---- { extract ($args); ! pncloadapi('user', __FILE__, __LINE__); if (!pnSecAuthAction(0, *************** *** 1991,1998 **** { extract ($args); ! if (!pnModAPILoad('pncommerce', 'user')){ ! return showerrorpage("unable to load pnuserapi", __FILE__, __LINE__); ! ! } if (!pnSecAuthAction(0, 'pncommerce::', "::", ACCESS_ADMIN)) --- 1950,1954 ---- { extract ($args); ! pncloadapi('user', __FILE__, __LINE__); if (!pnSecAuthAction(0, 'pncommerce::', "::", ACCESS_ADMIN)) *************** *** 2058,2066 **** function pncommerce_adminapi_getSingleCategoryTree($args) { ! if (!pnModAPILoad('pncommerce', 'user')) ! { ! return showerrorpage("unable to load pnuserapi", __FILE__, __LINE__); - } $result=array(); //first find all top level categories --- 2014,2019 ---- function pncommerce_adminapi_getSingleCategoryTree($args) { ! pncloadapi('user', __FILE__, __LINE__); $result=array(); //first find all top level categories *************** *** 2157,2165 **** extract($args); //starttime, $endtime ! if (!pnModAPILoad('pncommerce', 'user')) ! { ! return showerrorpage("unable to load pnuserapi", __FILE__, __LINE__); ! ! } if (!pnSecAuthAction(0, 'pncommerce::', "::", ACCESS_ADMIN)) { --- 2110,2114 ---- extract($args); //starttime, $endtime ! pncloadapi('user', __FILE__, __LINE__); if (!pnSecAuthAction(0, 'pncommerce::', "::", ACCESS_ADMIN)) { *************** *** 2407,2414 **** { extract( $args ); ! if (!pnModAPILoad('pncommerce', 'user')) ! { ! return false; ! } if ( $ParentID ) --- 2356,2360 ---- { extract( $args ); ! pncloadapi('user', __FILE__, __LINE__); if ( $ParentID ) *************** *** 2487,2502 **** function pncommerce_adminapi_rebuildOrderedQuantity() { ! if (!pnModAPILoad('pncommerce', 'user')) ! { ! return showerrorpage("unable to load pnuserapi", __FILE__, __LINE__); ! } if (!pnSecAuthAction(0, 'pncommerce::', "::", ACCESS_ADMIN)) { return showerrorpage(_PNC_NOAUTH, __FILE__, __LINE__); } ! // Array to store itemIDs and their ordered quantities $orderedItems = array(); ! // get the number of orders in the db $ordercount = pnModAPIFunc('pncommerce', 'user', 'gethighidfromDB', --- 2433,2446 ---- function pncommerce_adminapi_rebuildOrderedQuantity() { ! pncloadapi('user', __FILE__, __LINE__); ! if (!pnSecAuthAction(0, 'pncommerce::', "::", ACCESS_ADMIN)) { return showerrorpage(_PNC_NOAUTH, __FILE__, __LINE__); } ! // Array to store itemIDs and their ordered quantities $orderedItems = array(); ! // get the number of orders in the db $ordercount = pnModAPIFunc('pncommerce', 'user', 'gethighidfromDB', *************** *** 2534,2538 **** } } ! // update the QuantityOrdered in the items table foreach($orderedItems as $itemId => $quantity) --- 2478,2482 ---- } } ! // update the QuantityOrdered in the items table foreach($orderedItems as $itemId => $quantity) *************** *** 2568,2576 **** $usercolumn = &$pntable['users_column']; ! if( !pnModAPILoad( 'pncommerce', 'user' ) ) ! { ! return showerrorpage("unable to load pnuserapi", __FILE__, __LINE__); ! ! } // read the groups --- 2512,2516 ---- $usercolumn = &$pntable['users_column']; ! pncloadapi('user', __FILE__, __LINE__); // read the groups *************** *** 2660,2668 **** } ! if( !pnModAPILoad( 'pncommerce', 'user' ) ) ! { ! return showerrorpage("unable to load pnuserapi", __FILE__, __LINE__); ! ! } // read the group membership for $uid --- 2600,2604 ---- } ! pncloadapi('user', __FILE__, __LINE__); // read the group membership for $uid *************** *** 2782,2790 **** { extract( $args ); ! if( !pnModAPILoad( 'pncommerce', 'user' ) ) ! { ! return showerrorpage("unable to load pnuserapi", __FILE__, __LINE__); - } if (!pnSecAuthAction(0, 'pncommerce::', "::", ACCESS_ADMIN)) { --- 2718,2723 ---- { extract( $args ); ! pncloadapi('user', __FILE__, __LINE__); if (!pnSecAuthAction(0, 'pncommerce::', "::", ACCESS_ADMIN)) { *************** *** 2871,2875 **** foreach( $modsequence as $modseq ) { ! pnModAPILoad( 'pncommerce', $modseq ); $newfm = array(); $newfm['name'] = $modseq; --- 2804,2808 ---- foreach( $modsequence as $modseq ) { ! pncloadapi($modseq, __FILE__, __LINE__); $newfm = array(); $newfm['name'] = $modseq; *************** *** 3091,3099 **** if(is_array($unserialized))$property['config']=$unserialized; ! if(pnModAPILoad('pncommerce', $property['type'])) { ! $property['info'] = pnModAPIFunc('pncommerce', $property['type'], 'info'); ! } else { ! return showerrorpage('unable to load ' . $property['type'] . ' api', __FILE__, __LINE__); ! } array_push($properties, $property); $result->MoveNext(); --- 3024,3030 ---- if(is_array($unserialized))$property['config']=$unserialized; ! pncloadapi($property['type'], __FILE__, __LINE__); ! $property['info'] = pnModAPIFunc('pncommerce', $property['type'], 'info'); ! array_push($properties, $property); $result->MoveNext(); *************** *** 3123,3133 **** foreach($properties as $property) { ! if(pnModAPILoad('pncommerce', $property['type'])) { ! $property['object_id']=$args['object_id']; ! $property=pnModAPIFunc('pncommerce', $property['type'], 'newdata', array('property' => $property)); ! pncommerce_adminapi_propertydataAdd($property); ! } else { ! return showerrorpage('unable to load ' . $property['name'] . 'api', __FILE__, __LINE__); ! } } --- 3054,3061 ---- foreach($properties as $property) { ! pncloadapi($property['type'], __FILE__, __LINE__); ! $property['object_id']=$args['object_id']; ! $property=pnModAPIFunc('pncommerce', $property['type'], 'newdata', array('property' => $property)); ! pncommerce_adminapi_propertydataAdd($property); } Index: pnuser.php =================================================================== RCS file: /cvsroot/pn-commerce/pn-commerce/pnuser.php,v retrieving revision 1.280 retrieving revision 1.281 diff -C2 -d -r1.280 -r1.281 *** pnuser.php 30 Mar 2005 19:33:42 -0000 1.280 --- pnuser.php 21 Aug 2005 13:28:04 -0000 1.281 *************** *** 49,53 **** $smarty =& new pnRender('pncommerce'); $smarty->caching = false; ! return $smarty->fetch( 'pncommerce_shop_inactive.html' ); } return false; --- 49,53 ---- $smarty =& new pnRender('pncommerce'); $smarty->caching = false; ! return $smarty->fetch( 'pncommerce_shop_inactive.html' ); } [...1244 lines suppressed...] ! pncloadapi('user', __FILE__, __LINE__); ! $ret =pncommerce_user_ActiveShop(); if($ret){return $ret;} ! $input = pnVarCheckFromInput( 'directbuy' ); if( $input['errormsg'] != false ) *************** *** 2318,2322 **** addlogmessage( _PNC_LOG_GENERAL, "entering directbuy" ); ! $ItemSKU = $input['values']['ItemSKU']; $ItemQuantity = $input['values']['ItemQuantity']; --- 2219,2223 ---- addlogmessage( _PNC_LOG_GENERAL, "entering directbuy" ); ! $ItemSKU = $input['values']['ItemSKU']; $ItemQuantity = $input['values']['ItemQuantity']; Index: pnadmin.php =================================================================== RCS file: /cvsroot/pn-commerce/pn-commerce/pnadmin.php,v retrieving revision 1.267 retrieving revision 1.268 diff -C2 -d -r1.267 -r1.268 *** pnadmin.php 20 Aug 2005 08:13:29 -0000 1.267 --- pnadmin.php 21 Aug 2005 13:28:04 -0000 1.268 *************** *** 48,55 **** function pncAdminModURL($Module, $Section, $Function, $Args=array()) { ! if (!pnModAPILoad('pncommerce', 'user')) ! { ! return showerrorpage("unable to load pnuserapi", __FILE__, __LINE__); ! } return pnModAPIFunc( 'pncommerce', 'user','pncModURL', array( 'Module'=>$Module, --- 48,52 ---- function pncAdminModURL($Module, $Section, $Function, $Args=array()) [...1119 lines suppressed...] ! $newproperty = pnModAPIFunc('pncommerce', $newtype, 'newdata', array('property' => $newproperty)); ! pnModAPIFunc('pncommerce', 'admin', 'propertyAdd', $newproperty); ! pnModAPIFunc('pncommerce', 'admin', 'recalculatepropertiessortorder', array('scheme_id' => $scheme_id)); } pnRedirect(pnModURL('pncommerce', 'admin', 'editscheme', array('schemeid' => (int)$scheme_id))); *************** *** 3308,3314 **** return showerrorpage(_PNC_NOAUTH, __FILE__, __LINE__); } ! if(!pnModAPILoad('pncommerce', 'admin')) { ! return showerrorpage("unable to load pnadminapi", __FILE__, __LINE__); ! } list($dir, $scheme_id, $property_id) = pnVarCleanFromInput('dir', 'scheme_id', 'property_id'); --- 3168,3172 ---- return showerrorpage(_PNC_NOAUTH, __FILE__, __LINE__); } ! pncloadapi('admin', __FILE__, __LINE__); list($dir, $scheme_id, $property_id) = pnVarCleanFromInput('dir', 'scheme_id', 'property_id'); Index: common.php =================================================================== RCS file: /cvsroot/pn-commerce/pn-commerce/common.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** common.php 17 Mar 2005 13:19:41 -0000 1.10 --- common.php 21 Aug 2005 13:28:03 -0000 1.11 *************** *** 15,19 **** // // Date of revision $Date$ ! // // ---------------------------------------------------------------------- // LICENSE --- 15,19 ---- // // Date of revision $Date$ ! // // ---------------------------------------------------------------------- // LICENSE *************** *** 97,101 **** // add the message to the log addlogmessage( "", $error_text . " in file " . $file . " at line " . $line); ! $pnr =& new pnRender('pncommerce'); $pnr->caching = false; --- 97,101 ---- // add the message to the log addlogmessage( "", $error_text . " in file " . $file . " at line " . $line); ! $pnr =& new pnRender('pncommerce'); $pnr->caching = false; *************** *** 165,169 **** echo "</pre>"; } else echo "<pre>" . $data . "</pre>"; ! } /** --- 165,169 ---- echo "</pre>"; } else echo "<pre>" . $data . "</pre>"; ! } /** *************** *** 186,190 **** if(isset($tablename)) { $columnname = $tablename . '_column'; ! if( !array_key_exists($tablename, $pntables) || !array_key_exists($columnname, $pntables) ) {return false; } return array($dbconn, &$pntables[$tablename], &$pntables[$columnname]); --- 186,190 ---- if(isset($tablename)) { $columnname = $tablename . '_column'; ! if( !array_key_exists($tablename, $pntables) || !array_key_exists($columnname, $pntables) ) {return false; } return array($dbconn, &$pntables[$tablename], &$pntables[$columnname]); *************** *** 210,214 **** /** ! * pncExecuteSQL * executes an sql command and returns the result, shows error if necessary * --- 210,214 ---- /** ! * pncExecuteSQL * executes an sql command and returns the result, shows error if necessary * *************** *** 245,255 **** function is_serialized( $string ) { ! if( @unserialize( $string ) == "" ) ! { return false; } return true; ! } } ?> \ No newline at end of file --- 245,261 ---- function is_serialized( $string ) { ! if( @unserialize( $string ) == "" ) { return false; } return true; ! } } + function pncloadapi($api = 'user', $file = __FILE__, $line = __LINE__) + { + if(!pnModAPILoad('pncommerce', $api)) { + return showerrorpage('unable to load pn' . $api . 'api', $file, $line); + } + return; + } ?> \ No newline at end of file |