Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

AJAX Attribute Manager support


Guest

Recommended Posts

 

 

Hello,

Open your admin/attributeManager/includes/attributeManagerGeneralFunctions.inc.php file and scroll down to row 38

 

Change this:

$attributeManager =& new attributeManagerAtomic(amGetSesssionVariable(AM_SESSION_VAR_NAME));

to this:

$attributeManager = new attributeManagerAtomic(amGetSesssionVariable(AM_SESSION_VAR_NAME));

 

And

 

 $attributeManager =& new attributeManagerInstant($_GET['products_id']);

 

To

 

 $attributeManager = new attributeManagerInstant($_GET['products_id']);

 

Its the =& operator that that needs to be just =

For some reason this operator is not supported anymore, and what the heck is it?

i know that = & is a assignment by reference but when they are stuck togeteher i dont know... Please some one explain http://www.oscommerce.com/forums//public/style_emoticons/default/wink.png[/img]

 

/Janne

I installed AJAX AttributeManager v2.8.10 I also have this problem when I edit a product. and your help solved my problem! Thank you very much!!

Link to comment
Share on other sites

  • 2 months later...

Hi Folks,

 

Just applied this contrib and came across this error:

 

Parse error: syntax error, unexpected T_ELSE in /(...)/admin/categories.php on line 753

 

Line 753 is marked in the code as "} else { <<Line 753 "

I´m using OsC 2.2MS2, I know it´s an old version but I was hoping some contribs will work anyway

 

 if (isset($HTTP_GET_VARS['pID'])) {
 echo tep_image_submit('button_update.gif', IMAGE_UPDATE);
 } else {
 echo tep_image_submit('button_insert.gif', IMAGE_INSERT);
 }
 echo '  <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($HTTP_GET_VARS['pID']) ? '&pID=' . $HTTP_GET_VARS['pID'] : '')) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>';
?></td>
 </tr>
</table></form>
<?php
}
} else { <<Line 753
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
 <tr>
 <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	 <tr>
	 <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
	 <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>
	 <td align="right"><table border="0" width="100%" cellspacing="0" cellpadding="0">
		 <tr>
		 <td class="smallText" align="right">

Edited by cszita
Link to comment
Share on other sites

  • 1 month later...

Hi all,I'm facing a real strange problem.I client gave me an osc 2.3.1 in order to update it to the latest version.I did it, till the v. 2.3.3.1But attribute manager is not coming up on edit product screen now, at all. Although I can see the div for the attribute manager(see attached photo), id is not loading at all. Strange thing is that if i edit the code in /admin/includes/template_top.php as a friend suggested few posts above,sometimes i get in attribute manager div, the index page of the admin panel!!!!Means that something is loading, but not the attribute manager. Instead i get what i wrote before...Any help is much appreciated. I can give acces to any who wants to chech my files.Thnkspost-323988-0-30035400-1378631751_thumb.png

Edited by xtrgeo
Link to comment
Share on other sites

Hi everybody,

 

I've got the same problem as xtrgeo, Ithink it has something to do with the mysql_ commands since these have been changed to mysqli_ and are also in the amDB.class.php file, but I'm not a coder and have no idea how to get this right.

 

If there's anybody who can help us out, it would be much appreciated.

 

Thanks in advance,

Addons installed on my website:

 

- Addons Installed

- Advanced Special Offer Discounts

- AJAX-Attribute Manager for osc 2.3.1

- Banner box v1.1.1

- Dutch Language Pack

- Extra Pages-info box with admin for OSC2.3

- German Language Pack

- Login Box

- Multi-language Support for Configuration

- Multiple products manager

- Order Editor

- OSC PDF Catalogue 2.1

- PDF-Datasheet

- product Field Groups

- Quickly Update Product Stock

- Unit of weight

- YAG (Yet another Guestbook)

Link to comment
Share on other sites

The Add-On seems to use hardcoded mysql_* functions in classes/amDB.class.php. Try the following changes to the file:

 

1. Change numFields() to:

 

function numFields($ref) {
return mysqli_field_count($ref);
}

 

2. Change fieldName() to:

 

function fieldName($ref,$offset) {
return mysqli_fetch_field_direct($ref,$offset);
}

 

3. Change getOne() to:

 

function getOne($strQuery) {
$res = amDB::query($strQuery);
if ($res && amDB::numRows($res))
return tep_db_result($res,0,0);
return false;
}

 

4. Change insertId() to:

 

function insertId($link = 'db_link' ) {
global $$link;
return tep_db_insert_id($$link);
}

 

5. At the end of the file just before the closing ?> PHP tag, add the following compatibility functions:

 

if ( !function_exists('mysqli_field_count') ) {
 function mysqli_field_count($result) {
   return mysql_num_fields($result);
 }
}

if ( !function_exists('mysqli_fetch_field_direct') ) {
 function mysqli_fetch_field_direct($result, $fieldnr) {
   return mysql_field_name($result, $fieldnr);
 }
}

 

The above is untested. If you wish to test it out and it works, please report back here and someone should also update the full Add-On package.

:heart:, osCommerce

Link to comment
Share on other sites

Hi Harald,

 

Thanks for the response.

I've tried this code, but unfortunately no luck My current version has "public static" in front of the functions which I believe came from an earlier update according to an error note.<p>




			
		

Addons installed on my website:

 

- Addons Installed

- Advanced Special Offer Discounts

- AJAX-Attribute Manager for osc 2.3.1

- Banner box v1.1.1

- Dutch Language Pack

- Extra Pages-info box with admin for OSC2.3

- German Language Pack

- Login Box

- Multi-language Support for Configuration

- Multiple products manager

- Order Editor

- OSC PDF Catalogue 2.1

- PDF-Datasheet

- product Field Groups

- Quickly Update Product Stock

- Unit of weight

- YAG (Yet another Guestbook)

Link to comment
Share on other sites

I wanted to add the code, but for some reason it doesn't work.

Edited by srirahandcraft

Addons installed on my website:

 

- Addons Installed

- Advanced Special Offer Discounts

- AJAX-Attribute Manager for osc 2.3.1

- Banner box v1.1.1

- Dutch Language Pack

- Extra Pages-info box with admin for OSC2.3

- German Language Pack

- Login Box

- Multi-language Support for Configuration

- Multiple products manager

- Order Editor

- OSC PDF Catalogue 2.1

- PDF-Datasheet

- product Field Groups

- Quickly Update Product Stock

- Unit of weight

- YAG (Yet another Guestbook)

Link to comment
Share on other sites

<?php
/*
==================================================================================================================
AJAX-AttributeManager-for-osc2.3.1-V2
==================================================================================================================
Addons installed in this file:
- Osc Version Upgrade from v2.3.3.1 to v2.3.3.2
==================================================================================================================

$Id: DB.class.php,v 1.0 21/02/06 Sam West$

osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com

Released under the GNU General Public License

Copyright © 2006 Kangaroo Partners
http://kangaroopartners.com
osc@[member='KangarooPartners'].com
*/

/**
* OSC Database functions wrapper - just in case they decide to release ms3 the moment i release this - he he
*/
class amDB {

/**
* @[member='author'] Sam West aka Nimmit - osc@[member='KangarooPartners'].com
* @package $strQuery sting - sql query string
* @[member='Return'] query reference
*/
public static function query($strQuery) {
return tep_db_query($strQuery);
}

/**
* Fetches the next array from a mysql query reference
* @[member='author'] Sam West aka Nimmit - osc@[member='KangarooPartners'].com
* @[member='param'] $ref - referece from a mysql query
* @[member='Return'] array
*/
public static function fetchArray($ref) {
return tep_db_fetch_array($ref);
}

/**
* Gets the field count from a mysql query reference
* @[member='author'] Tomasz Iwanow aka TomaszBG - [email protected]
* @[member='param'] $ref - referece from a mysql query
* @[member='Return'] int - number of fields in result
*/
public static function numFields($ref) {
return mysqli_field_count($ref);
}
/*function numFields($ref) {
return mysql_num_fields($ref);
}

/**
* Gets the field name from a mysql query reference
* @[member='author'] Tomasz Iwanow aka TomaszBG - [email protected]
* @[member='param'] $ref - referece from a mysql query
* @[member='param'] $offset - offset of a field
* @[member='Return'] string - name of the field
*/
public static function fieldName($ref,$offset) {
return mysqli_fetch_field_direct($ref,$offset);
}
/*function fieldName($ref,$offset) {
return mysql_field_name($ref,$offset);
}

/**
* Counts the number of results from a mysql query referece
* @[member='author'] Sam West aka Nimmit - osc@[member='KangarooPartners'].com
* @[member='param'] $ref - reference from a mysql query
* @[member='Return'] int - number of rows in result
*/
public static function numRows($ref) {
return tep_db_num_rows($ref);
}

/**
* peforms inserts / updates
* @[member='author'] Sam West aka Nimmit - osc@[member='KangarooPartners'].com
* @[member='param'] $strTable string tablename
* @[member='param'] $arrData array data to be inserted/ updated
* @[member='param'] $strAction sting - update / insert
* @[member='param'] $strParams string additonal where clauses
* @[member='Return'] void
*/
public static function perform($strTable,$arrData,$strAction='insert',$strParams='') {
return tep_db_perform($strTable,$arrData,$strAction,$strParams);
}

/**
* Returns a singular result from a mysql query
* @[member='param'] $strQuery string - mysql query
* @[member='Return'] mixed - first record, first row
*/
public static function getOne($strQuery) {
$res = amDB::query($strQuery);
if ($res && amDB::numRows($res))
return tep_db_result($res,0,0);
return false;
}

/*
function getOne($strQuery) {
$res = amDB::query($strQuery);
if ($res && amDB::numRows($res))
return mysql_result($res,0,0);
return false;
}

/**
* Returns all results from a mysql query
* @[member='author'] Sam West aka Nimmit - osc@[member='KangarooPartners'].com
* @[member='param'] $strQuery string - mysql query
* @[member='Return'] array - all results
*/
public static function getAll($strQuery) {
$res = amDB::query($strQuery);
$results = array();
while($row = amDB::fetchArray($res))
$results[] = $row;
return $results;
}

/**
* Prepares string for database input
* @[member='author'] Sam West aka Nimmit - osc@[member='KangarooPartners'].com
* @[member='param'] $str string
* @[member='Return'] void
*/
public static function input($str) {
return tep_db_prepare_input($str);
}

/**
* Returns placebo autoincrement value
* @[member='access'] public
* @[member='param'] $strTable string table name
* @[member='param'] $strField string field name
* @[member='Return'] mixed
*/
public static function getNextAutoValue($strTable,$strField) {
return (int)amDB::getOne("select max($strField) + 1 as next from $strTable limit 1");
}
/**
* Some contributions such as the Ultimate SEO URLs have there own
* database functions. This can cause the internal, last insert id to be
* wrong if the link id isn't included in the mysql_insert_id statement.
* For this reason i have not used the default osc function for this one as for some
* reason they haven't put the link in their wrapper function.
* @[member='author'] Sam West aka Nimmit - osc@[member='KangarooPartners'].com
* @[member='param'] $link sting - db link name
* @[member='Return'] void
*/
public static function insertId($link = 'db_link' ) {
global $$link;
return tep_db_insert_id($$link);
}
/*
function insertId($link = 'db_link' ) {
global $$link;
return mysql_insert_id($$link);
}*/
}
//////////////////////////////////////////////////////////////////////////////////////////////////
if ( !function_exists('mysqli_field_count') ) {
function mysqli_field_count($result) {
 return mysql_num_fields($result);
}
}

if ( !function_exists('mysqli_fetch_field_direct') ) {
function mysqli_fetch_field_direct($result, $fieldnr) {
 return mysql_field_name($result, $fieldnr);
}
}
?>

 

Ah, ok, now it worked.

Edited by srirahandcraft

Addons installed on my website:

 

- Addons Installed

- Advanced Special Offer Discounts

- AJAX-Attribute Manager for osc 2.3.1

- Banner box v1.1.1

- Dutch Language Pack

- Extra Pages-info box with admin for OSC2.3

- German Language Pack

- Login Box

- Multi-language Support for Configuration

- Multiple products manager

- Order Editor

- OSC PDF Catalogue 2.1

- PDF-Datasheet

- product Field Groups

- Quickly Update Product Stock

- Unit of weight

- YAG (Yet another Guestbook)

Link to comment
Share on other sites

After upgrading to osC 2.3.3.2 and applying the changes to amDB.class.php above, AttributeManager throws an error when adding options and values.

1062 - Duplicate entry '1-2' for key 'PRIMARY'
insert into products_options (products_options_id, language_id, products_options_name, products_options_track_stock) values ('1', '2', 'Vikt', '0')
[TEP STOP]

1062 - Duplicate entry '1-2' for key 'PRIMARY'
insert into products_options_values (products_options_values_id, language_id, products_options_values_name) values ('1', '2', 'Blå245')
[TEP STOP]

 

I.e. it seems that AttributeManager has a problem fetching the next auto increment value from the products_options and product_options_values tables. To fetch the new id's the functions in attributeManager.class.php call the amDB::getNextAutoValue() function in amDB.class.php, and id 0 is returned the $id is set to 1 resulting in the error above (if this entry already exists in the database).

 

Doing any changes in admin/includes/database.php is a bad idea so we'll have to work out what to change in amDB.class.php I guess...

Link to comment
Share on other sites

The problem lies in amDB::getOne() and the call to tep_db_result($res,0,0), changing the call to include the field 'next' fixes the problem, tep_db_result($res,0,'next'). Only amDB::getNextAutoValue() makes calls to getOne so this is OK for a quick fix, but maybe there is a more elegant solution?

Link to comment
Share on other sites

Hello there,

 

I'm also trying to fix the problem to my live shop(s).

I have applied the adjustments mentioned in earlier post but keep getting the folowing errors.

Any help would be very appreciated !

 

 

Strict Standards: Non-static method stopDirectAccess::makeSessionId() should not be called statically in /home/blokhut/domains/blokhutreus.nl/public_html/admin/attributeManager/classes/stopDirectAccess.class.php on line 35

 

Strict Standards: Non-static method stopDirectAccess::checkAuthorisation() should not be called statically in /home/blokhut/domains/blokhutreus.nl/public_html/admin/attributeManager/attributeManager.php on line 47

 

Strict Standards: Non-static method stopDirectAccess::makeSessionId() should not be called statically in /home/blokhut/domains/blokhutreus.nl/public_html/admin/attributeManager/classes/stopDirectAccess.class.php on line 62

 

Warning: Cannot modify header information - headers already sent by (output started at /home/blokhut/domains/blokhutreus.nl/public_html/admin/attributeManager/attributeManager.php:47) in /home/blokhut/domains/blokhutreus.nl/public_html/admin/attributeManager/attributeManager.php on line 72

Link to comment
Share on other sites

So far this has been my experience with the Attribute Manager.

 

First of all, I'm using osCommerce 2.3.3.2.

 

The Error Reporting set in admin/includes/application_top.php is :

 

error_reporting(E_ALL & ~E_NOTICE);

 

With it at that setting - I was getting all the error messages as mentioned in this post

 

[b]Strict Standards[/b]: Non-static method amDB::query())

 

http://www.oscommerce.com/forums/topic/195959-ajax-attribute-manager-support/page__st__1240#entry1669538

 

I noticed that all the functions in the amDB.class.php files did not have the "public static" in front of them and I applied the changes Harald suggested in this post

 

http://www.oscommerce.com/forums/topic/195959-ajax-attribute-manager-support/page__st__1240#entry1680763 -

 

that at first did not work for me till I copied and pasted the full file as supplied by srirahandcraft in this post

 

http://www.oscommerce.com/forums/topic/195959-ajax-attribute-manager-support/page__st__1240#entry1680809

 

That then took care of all the "Non-static method amDB::query" error messages and was left with only the following errors:

 

Strict standards: Non-static method stopDirectAccess::authorise()

Strict standards: Non-static method stopDirectAccess::makeSessionId()

Strict standards: Non-static method stopDirectAccess::checkAuthorisation()

Strict standards: Non-static method stopDirectAccess::makeSessionId()

 

I opened the stopDirectAccess.php file and changed the 4 functions which did not have "public static" to read as follows

 

public static function authorise($sessionVar) {
public static function deAuthorise($sessionVar) {
public static function checkAuthorisation($sessionVar) {
public static function makeSessionId() {

 

and that took care of those error messages.

 

But now .... if one clicks on the little green + button to add an additional option I get these errors -- you seem to get a set of errors for each option that you already have.

 

Warning: Illegal string offset 'id' in admin\includes\functions\html_output.php on line 330

Warning: Illegal string offset 'id' in admin\includes\functions\html_output.php on line 331

Warning: Illegal string offset 'text' in admin\includes\functions\html_output.php on line 335

 

and it also makes reference to the attributeManager\includes\attributeManagerPrompts.inc.php file - and this function tep_draw_pull_down_menu( ) - but now for the life of me - I have no idea of where to start looking for a fix for that.

 

the error only happens if you try to add a new option but not when you try add a new value.

 

Perhaps someone with more coding experience could find the fix for this.

"The doorstep to the temple of wisdom is a knowledge of our own ignorance."

Link to comment
Share on other sites

So far this has been my experience with the Attribute Manager.

 

First of all, I'm using osCommerce 2.3.3.2.

 

The Error Reporting set in admin/includes/application_top.php is :

 

error_reporting(E_ALL & ~E_NOTICE);

 

With it at that setting - I was getting all the error messages as mentioned in this post

 

[b]Strict Standards[/b]: Non-static method amDB::query())

 

http://www.oscommerce.com/forums/topic/195959-ajax-attribute-manager-support/page__st__1240#entry1669538

 

I noticed that all the functions in the amDB.class.php files did not have the "public static" in front of them and I applied the changes Harald suggested in this post

 

http://www.oscommerce.com/forums/topic/195959-ajax-attribute-manager-support/page__st__1240#entry1680763 -

 

that at first did not work for me till I copied and pasted the full file as supplied by srirahandcraft in this post

 

http://www.oscommerce.com/forums/topic/195959-ajax-attribute-manager-support/page__st__1240#entry1680809

 

That then took care of all the "Non-static method amDB::query" error messages and was left with only the following errors:

 

Strict standards: Non-static method stopDirectAccess::authorise()

Strict standards: Non-static method stopDirectAccess::makeSessionId()

Strict standards: Non-static method stopDirectAccess::checkAuthorisation()

Strict standards: Non-static method stopDirectAccess::makeSessionId()

 

I opened the stopDirectAccess.php file and changed the 4 functions which did not have "public static" to read as follows

 

public static function authorise($sessionVar) {
public static function deAuthorise($sessionVar) {
public static function checkAuthorisation($sessionVar) {
public static function makeSessionId() {

 

and that took care of those error messages.

 

But now .... if one clicks on the little green + button to add an additional option I get these errors -- you seem to get a set of errors for each option that you already have.

 

Warning: Illegal string offset 'id' in admin\includes\functions\html_output.php on line 330

Warning: Illegal string offset 'id' in admin\includes\functions\html_output.php on line 331

Warning: Illegal string offset 'text' in admin\includes\functions\html_output.php on line 335

 

and it also makes reference to the attributeManager\includes\attributeManagerPrompts.inc.php file - and this function tep_draw_pull_down_menu( ) - but now for the life of me - I have no idea of where to start looking for a fix for that.

 

the error only happens if you try to add a new option but not when you try add a new value.

 

Perhaps someone with more coding experience could find the fix for this.

 

If I set the error_reporting to in admin/incudes/application_top to E_ALL & E_ERROR the Illegal string offset errors disappear but adding a new option gives me this error

 

1048 - Column 'products_options_sort_order' cannot be null
insert into products_options (products_options_id, language_id, products_options_name, products_options_sort_order) values ('1', '1', 'test', null)

"The doorstep to the temple of wisdom is a knowledge of our own ignorance."

Link to comment
Share on other sites

This is what seems to be working for me on osCommerce 2.3.3.2 - Apache 2.4.4, PHP 5.4.16 and MySQL 5.6.12

 

IN admin/includes/application_top.php

 

error_reporting(E_ALL & E_ERROR);

 

IN admin/attributeManager/classes/amDB.php

 

<?php
/*
==================================================================================================================
AJAX-AttributeManager-for-osc2.3.1-V2
==================================================================================================================
Addons installed in this file:
- Osc Version Upgrade from v2.3.3.1 to v2.3.3.2
==================================================================================================================
$Id: DB.class.php,v 1.0 21/02/06 Sam West$
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Released under the GNU General Public License
Copyright © 2006 Kangaroo Partners
http://kangaroopartners.com
osc@[member='KangarooPartners'].com
*/
/**
* OSC Database functions wrapper - just in case they decide to release ms3 the moment i release this - he he
*/
class amDB {
/**
* @[member='author'] Sam West aka Nimmit - osc@[member='KangarooPartners'].com
* @package $strQuery sting - sql query string
* @[member='Return'] query reference
*/
public static function query($strQuery) {
return tep_db_query($strQuery);
}
/**
* Fetches the next array from a mysql query reference
* @[member='author'] Sam West aka Nimmit - osc@[member='KangarooPartners'].com
* @[member='param'] $ref - referece from a mysql query
* @[member='Return'] array
*/
public static function fetchArray($ref) {
return tep_db_fetch_array($ref);
}
/**
* Gets the field count from a mysql query reference
* @[member='author'] Tomasz Iwanow aka TomaszBG - [email protected]
* @[member='param'] $ref - referece from a mysql query
* @[member='Return'] int - number of fields in result
*/
public static function numFields($ref) {
return mysqli_field_count($ref);
}
/*function numFields($ref) {
return mysql_num_fields($ref);
}
/**
* Gets the field name from a mysql query reference
* @[member='author'] Tomasz Iwanow aka TomaszBG - [email protected]
* @[member='param'] $ref - referece from a mysql query
* @[member='param'] $offset - offset of a field
* @[member='Return'] string - name of the field
*/
public static function fieldName($ref,$offset) {
return mysqli_fetch_field_direct($ref,$offset);
}
/*function fieldName($ref,$offset) {
return mysql_field_name($ref,$offset);
}
/**
* Counts the number of results from a mysql query referece
* @[member='author'] Sam West aka Nimmit - osc@[member='KangarooPartners'].com
* @[member='param'] $ref - reference from a mysql query
* @[member='Return'] int - number of rows in result
*/
public static function numRows($ref) {
return tep_db_num_rows($ref);
}
/**
* peforms inserts / updates
* @[member='author'] Sam West aka Nimmit - osc@[member='KangarooPartners'].com
* @[member='param'] $strTable string tablename
* @[member='param'] $arrData array data to be inserted/ updated
* @[member='param'] $strAction sting - update / insert
* @[member='param'] $strParams string additonal where clauses
* @[member='Return'] void
*/
public static function perform($strTable,$arrData,$strAction='insert',$strParams='') {
return tep_db_perform($strTable,$arrData,$strAction,$strParams);
}
/**
* Returns a singular result from a mysql query
* @[member='param'] $strQuery string - mysql query
* @[member='Return'] mixed - first record, first row
*/
public static function getOne($strQuery) {
$res = amDB::query($strQuery);
if ($res && amDB::numRows($res))
return tep_db_result($res,0,'next');
return false;
}
/*
function getOne($strQuery) {
$res = amDB::query($strQuery);
if ($res && amDB::numRows($res))
return mysql_result($res,0,0);
return false;
}
/**
* Returns all results from a mysql query
* @[member='author'] Sam West aka Nimmit - osc@[member='KangarooPartners'].com
* @[member='param'] $strQuery string - mysql query
* @[member='Return'] array - all results
*/
public static function getAll($strQuery) {
$res = amDB::query($strQuery);
$results = array();
while($row = amDB::fetchArray($res))
$results[] = $row;
return $results;
}
/**
* Prepares string for database input
* @[member='author'] Sam West aka Nimmit - osc@[member='KangarooPartners'].com
* @[member='param'] $str string
* @[member='Return'] void
*/
public static function input($str) {
return tep_db_prepare_input($str);
}
/**
* Returns placebo autoincrement value
* @[member='access'] public
* @[member='param'] $strTable string table name
* @[member='param'] $strField string field name
* @[member='Return'] mixed
*/
public static function getNextAutoValue($strTable,$strField) {
return (int)amDB::getOne("select max($strField) + 1 as next from $strTable limit 1");
}
/**
* Some contributions such as the Ultimate SEO URLs have there own
* database functions. This can cause the internal, last insert id to be
* wrong if the link id isn't included in the mysql_insert_id statement.
* For this reason i have not used the default osc function for this one as for some
* reason they haven't put the link in their wrapper function.
* @[member='author'] Sam West aka Nimmit - osc@[member='KangarooPartners'].com
* @[member='param'] $link sting - db link name
* @[member='Return'] void
*/
public static function insertId($link = 'db_link' ) {
global $$link;
return tep_db_insert_id($$link);
}
/*
function insertId($link = 'db_link' ) {
global $$link;
return mysql_insert_id($$link);
}*/
}
//////////////////////////////////////////////////////////////////////////////////////////////////
if ( !function_exists('mysqli_field_count') ) {
function mysqli_field_count($result) {
	 return mysql_num_fields($result);
}
}
if ( !function_exists('mysqli_fetch_field_direct') ) {
function mysqli_fetch_field_direct($result, $fieldnr) {
	 return mysql_field_name($result, $fieldnr);
}
}
?>

 

In admin/attributeManager/classes/stopDirectAccess.class.php

 

<?php
/*
 $Id: stopDirectAccess.class.php,v 1.0 21/02/06 Sam West$
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com
 Released under the GNU General Public License

 Copyright © 2006 Kangaroo Partners
 http://kangaroopartners.com
 osc@[member='KangarooPartners'].com
*/
require_once('attributeManager/includes/attributeManagerSessionFunctions.inc.php');
/**
* Try and stop direct access to the script
* As far as i know there is no way for a remote user to set a session var without high jacking the session, in which case it doesn't really matter what this script does anyway.
* If there is i will have to rethink this
*/
class stopDirectAccess {

/**
 * Sets the global session variable
 * @[member='static'] authorise()
 * @[member='access'] public
 * @[member='author'] Sam West aka Nimmit - osc@[member='KangarooPartners'].com
 * @[member='param'] $sessionVar string session variable name
 * @[member='Return'] void
 */
public static function authorise($sessionVar) {
 amSessionRegister($sessionVar);
 $GLOBALS[$sessionVar] = stopDirectAccess::makeSessionId();
}

/**
 * deletes the global session variable
 * @[member='static'] deAuthorise()
 * @[member='access'] public
 * @[member='author'] Sam West aka Nimmit - osc@[member='KangarooPartners'].com
 * @[member='param'] $sessionVar string session variable name
 * @[member='Return'] void
 */
public static function deAuthorise($sessionVar) {
 amSessionUnregister($sessionVar);
}

/**
 * Checks the session var
 * @[member='static'] checkAuthorisation()
 * @[member='access'] public
 * @[member='author'] Sam West aka Nimmit - osc@[member='KangarooPartners'].com
 * @[member='param'] $sessionVar string session variable name
 * @[member='Return'] void
 */
public static function checkAuthorisation($sessionVar) {
 if(!amSessionIsRegistered($sessionVar))
  exit("Session not registered - You cant access this page directly");

 if($GLOBALS[$sessionVar] != stopDirectAccess::makeSessionId())
  exit("Session ids don't match - You cant access this page directly");

}

/**
 * makes encoded session var
 * @[member='static'] makeSessionId()
 * @[member='access'] public
 * @[member='author'] Sam West aka Nimmit - osc@[member='KangarooPartners'].com
 * @[member='Return'] void
 */
public static function makeSessionId() {
 return sha1(md5(AM_VALID_INCLUDE_PASSWORD));
}

}
?>

 

I've done quite a bit of testing and I havent received any further error messages.

"The doorstep to the temple of wisdom is a knowledge of our own ignorance."

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...

hi, i have this error in admin/categories.php

 

when i edit thid file to add atributte manager.

 

Warning: include(includes/languages/portugues/) [function.include]: failed to open stream: No such file or directory in /home/apopular/public_html/admin/includes/application_top.php on line 169
Warning: include(includes/languages/portugues/) [function.include]: failed to open stream: No such file or directory in /home/apopular/public_html/admin/includes/application_top.php on line 169
Warning: include() [function.include]: Failed opening 'includes/languages/portugues/' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/apopular/public_html/admin/includes/application_top.php on line 169

 

you can help me?

I did, helped or traslate.

http://addons.oscommerce.com/profile/104964

 

My english it´s só poor, but of you need help in portuguese, like shipping and payment that´s make a diference in brazil, come one,

Obrigado (thank´s)

 

Link to comment
Share on other sites

hi, good morning !!!!!!!!!!!!

 

i have this error in atributes manager , i'm using 2.2 oscommerce

 

Warning: include(includes/languages/portugues/) [function.include]: failed to open stream: No such file or directory in /home/apopular/public_html/admin/includes/application_top.php on line 169

Warning: include(includes/languages/portugues/) [function.include]: failed to open stream: No such file or directory in /home/apopular/public_html/admin/includes/application_top.php on line 169

Warning: include() [function.include]: Failed opening 'includes/languages/portugues/' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/apopular/public_html/admin/includes/application_top.php on line 169

 

anybody help me?

I did, helped or traslate.

http://addons.oscommerce.com/profile/104964

 

My english it´s só poor, but of you need help in portuguese, like shipping and payment that´s make a diference in brazil, come one,

Obrigado (thank´s)

 

Link to comment
Share on other sites

  • 4 weeks later...

hello to all after careful reading and research on the internet, unfortunately, I have to ask for advice in the forum:

I installed oscommerce-2.3.3.4

below I have installed AJAX-AttributeManager-V2.8.10

but always comes out this error:

1062 - Duplicate entry '1 -1 'for key' PRIMARY '
insert into products_options (products_options_id, language_id, products_options_name) values ​​('1 ', '1', 'Size')
[TEP STOP]

 

any idea what it is? no one has been able to fix the error?

there is some contribution with less hassle?

thanks

A.

Link to comment
Share on other sites

i have this error in atributes manager , i'm using 2.2 oscommerce

 

Warning: include(includes/languages/portugues/) [function.include]: failed to open stream: No such file or directory in /home/apopular/public_html/admin/includes/application_top.php on line 169

anybody help me?

The error is saying it can't find the language. It appears to be missing the name of the file so something may be wrong in your database. Try adding ?language=en to the url to see if that gets it to work.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...