amazOOP amazOOP
[ class tree: amazOOP ] [ index: amazOOP ] [ all elements ]

Procedural File: aq.lib.php

Source Location: /aq.lib.php



Page Details:

This file contains some methods that are used throughout the entire script.

All methods in this file are private since they are only meant to be used internally by the script. (Not that this means anything in PHP ;)




Tags:

Filesource:  Source Code for this file
  
Version:  0.3
  
License:  GNU General Public License
  
Copyright:  2004 (c) Mauricio Diaz Orlich
  
Author:  Mauricio Diaz <madd0@users.sourceforge.net>







IMAGE_ALTERNATIVES_0 [line 54]

IMAGE_ALTERNATIVES_0 =
If activated, the script will NOT look for any alternative images even if it is determined that the URL returned by Amazon points to a 1x1 pixel GIF.

The difference between using IMAGE_ALTERNATIVES_0 and IMAGE_AS_IS is that IMAGE_AS_IS will display the 1x1 pixel GIF returned by Amazon, while IMAGE_ALTERNATIVES_0 will display the "No image available" replacement.



[ Top ]



IMAGE_ALTERNATIVES_1 [line 62]

IMAGE_ALTERNATIVES_1 = 1
If activated, the script will try to look for an alternative image ONLY if the merchant name returned by Amazon (if a name was returned) is associated to a merchant code is the user's config/stores.inc.php.


[ Top ]



IMAGE_ALTERNATIVES_2 [line 69]

IMAGE_ALTERNATIVES_2 = 2
If activated, the script will try to look for an alternative image both at level 1 and by looking in all Amazon sites for an alternative.


[ Top ]



IMAGE_ALTERNATIVES_3 [line 76]

IMAGE_ALTERNATIVES_3 = 4
If activated, the script will try to look for an alternative image only if you have associated the product's manufactuerer with a Merchant ID in the stores.inc.php file.


[ Top ]



IMAGE_ALTERNATIVES_4 [line 83]

IMAGE_ALTERNATIVES_4 = 8
If activated, the script will try to look for an alternative image using ALL the store codes you have defined in file stores.inc.php. It goes without saying that this is the option that takes more time to execute.


[ Top ]



IMAGE_AS_IS [line 27]

IMAGE_AS_IS = 16
If activated, this indicates that the image URL returned by Amazon should be used even if it is only a 1x1 GIF.

This value is to be used in function getImage() together with one of the IMAGE_ALTERNATIVES_X values.



[ Top ]



IMAGE_NO_SIZE [line 44]

IMAGE_NO_SIZE = 32
If activated, this indicates that function getimagesize() should not be used.

Not using this function implies that any generated image tags will not have the width and height attributes, nor will these values be returned in the array returned by getImage().

In some server configurations, however, this may reduce execution time substantially.

This value is to be used in function getImage() together with one of the IMAGE_ALERNATIVES_0 values.



[ Top ]




getAmazoopConfig [line 164]

string|boolean getAmazoopConfig( string $var, [string $server = "auto"])

Gets the value of a variable from amazOOP's general configuration.

The general configuration variables are the ones defined in section 'General' of the Configurator, under the title that reads 'General Configuration'.

This function is mainly for internal use, however I have not declared it private because it might be of interest for some developers.




Tags:

Return:  The value of the requested variable.


Parameters

string   $var   The variable you wish to fetch. Valid values are:
  • 'address': the URL of the site's home (e.g. 'www.server.com', or 'www.shared.com/mysite')
  • 'path_to_script': absolute path to the script (e.g. 'c:\\path\\to\\site\\include\\amazoop\\', or '/var/www/html/amazoop/')
  • 'close_tag_character': returns ' />' or ' >' if configured to use XHTML or HTML respectively
  • 'file_separator': returns '\\' or '/' if configured to use Windows or *nix respectively
  • 'UTF-8_encode': determines whether data from Amazon should be UTF-8 encoded
  • 'open_links_in': 'new' or 'same' window
  • 'log_errors': true or false
  • 'log_requests': true or false
  • 'temporary_directory': absolute path to temporary directory
  • 'cache_directory': absolute path to cache directory
  • 'max_request_log_size': maximum size in lines of request log
  • 'max_error_log_size': maximum size in lines of error log
  • 'request_log_file': absolute path to request log
  • 'error_log_file': absolute path to error log
  • 'timestamp_file': absolute path to file containing timestamp
  • 'XML_template': absolute path to XML template
  • 'check_alternative_images': level of image checking (0-4)
string   $server   The server you want the variable for. Valid values are:
  • "auto": amazOOP determines which server it is running on and returns
the value for that server.
  • "test": the value for the test server is returned.
  • "def": the value for the definitive server is returned.
[ Top ]



getAssociateID [line 297]

string|boolean getAssociateID( string $locale)

Gets the associate ID for a specified locale.



Tags:

Return:  the requested ID or false if the requested locale is not valid. If the locale is valid, but no ID has been set, the ID of the developer is returned (think of it as a contribution).


Parameters

string   $locale   the locale for which you would like the associate ID.
[ Top ]



getBrowseNode [line 280]

string|boolean getBrowseNode( string $locale, string $category)

Gets the browse node corresponding to an amazOOP category.

This function is mainly for internal use, however I have not declared it private because it might be of interest for some developers.




Tags:

Return:  the browse node for the requested category, or false if the category doesn't exist.


Parameters

string   $locale   the country for which the category is defined.
string   $category   the amazOOP category for which you want to retrieve the browse node.
[ Top ]



getModeFromCatalog [line 730]

string getModeFromCatalog( string $catalog, string $locale)

Tries to guess the AWS mode corresponding to a catalog returned in a feed.

Used to guess the mode of a browse node obtained from a product's HeavyDetails::browseList.

WARNING!!! This is an experimental feature. Use it, tweak it, and send feedback!!!




Tags:

Return:  the AWS mode corresponding to a catalog


Parameters

string   $catalog   the catalog that should be converted
string   $locale   the locale for which you want the AWS mode. Important because modes are different in each locale.
[ Top ]



setAmazoopConfig [line 259]

void setAmazoopConfig( string $var, string $value, string $server)

Sets the value of a variable from amazOOP's general configuration.

The general configuration variables are the ones defined in section 'General' of the Configurator, under the title that reads 'General Configuration'.

Although I can't see an immediate use for this function, you can override the default configuration of the script, using this function. These changes, however, are only available to each instance of the script, and are lost once the script ends.




Parameters

string   $var   The variable you wish to set. Valid values are:
  • 'address': the URL of the site's home (e.g. 'www.server.com', or 'www.shared.com/mysite')
  • 'path_to_script': absolute path to the script (e.g. 'c:\\path\\to\\site\\include\\amazoop\\', or '/var/www/html/amazoop/')
  • 'close_tag_character': 'xhtml' and 'html', will return ' />' or ' >' respectively
  • 'file_separator': 'windows' or 'unix' will return '\\' or '/' respectively
  • 'UTF-8_encode': 'true' or 'false'
  • 'open_links_in': 'new' or 'same' window
  • 'log_errors': 'true' or 'false'
  • 'log_requests': 'true' or 'false'
  • 'temporary_directory': path to temporary directory, either relative from 'path_to_script' or absolute
  • 'cache_directory': path to cache directory, either relative from 'path_to_script' or absolute
  • 'max_request_log_size': maximum size in lines of request log
  • 'max_error_log_size': maximum size in lines of error log
  • 'request_log_file': path to request log, either relative from 'path_to_script' or absolute
  • 'error_log_file': path to error log, either relative from 'path_to_script' or absolute
  • 'timestamp_file': path to file containing timestamp, either relative from 'path_to_script' or absolute
  • 'XML_template': path to XML template, either relative from 'path_to_script' or absolute
  • 'check_alternative_images': level of image checking (0-4)
string   $value   The value you wish to set to $var. See the description of the $var parameter for a list of valid values.
string   $server   The server you want the variable for. Valid values are:
  • "test": the value for the test server is returned.
  • "def": the value for the definitive server is returned.
[ Top ]


 
Documentation generated on Sat, 21 Aug 2004 17:40:13 +0200 by phpDocumentor 1.3.0RC3
hosted by
SourceForge.net Logo