Jump to content

Gyakutsuki

♥Ambassador
  • Content count

    727
  • Joined

  • Last visited

  • Days Won

    15

Everything posted by Gyakutsuki

  1. Gyakutsuki

    ULTIMATE Seo Urls 5 - by FWR Media

    Ok thank, I will change there the module created. <?php /** * * ULTIMATE Seo Urls 5 * * * @package Ultimate Seo Urls 5 * @license http://www.opensource.org/licenses/gpl-2.0.php GNU Public License * @link http://www.fwrmedia.co.uk * @copyright Copyright 2008-2009 FWR Media * @copyright Portions Copyright 2005 Bobby Easland * @author Robert Fisher, FWR Media, http://www.fwrmedia.co.uk * @lastdev $Author:: Rob $: Author of last commit * @lastmod $Date:: 2009-11-29 11:13:08 +0000 (Sun, 29 Nov 2009) $: Date of last commit * @version $Rev:: 105 $: Revision of last commit * @Id $Id:: Usu_Page_Manager.php 105 2009-11-29 11:13:08Z Rob $: Full Details */ class Usu_Pages_Manager extends aDataMap { const MARKER = '-pm-'; // Could for example be -c- or -l- etc. const DEPENDENCY = 'pages_id'; // _GET key like e.g. cPath or lPath etc. const FILENAME = 'page_manager.php'; // The filename define of the file where this code will be actioned public $dependency = self::DEPENDENCY; public $dependency_tags = array( self::MARKER => self::FILENAME ); // key value pair of tag (like e.g. -c-) => filename ( e.g. FILENAME_DEFAULT ) private $page_relations = array( self::FILENAME => 1 ); // Page relation for this module ( e.g. FILENAME_DEFAULT or FILENAME_LINKS ) private $markers = array( self::MARKER => self::DEPENDENCY ); // Markers as key value pair like -c- => cPath or perhaps -l- => lPath private $base_query; // Template query with placeholders ( :placeholder ) waiting for real values private $query; // The final query which will be $base_query but with the placeholders replaced with real values private $pages_title; // property populated in the acquire() method, there may be multiples of these, rename in line with the query results private $dependency_value; // Dependency value, so if the dependency was cPath and cPath = 27 then this value would be 27 private $installed = false; // Unless it is a core module $installed should only be true if the contribution is installed ( e.g. articles or links manager etc ) private $suppress_underscores = false; // Set to true Produce only base paths like -t-32 not parent paths like 3_5_23 public function __construct(){ if ( defined( 'FILENAME_PAGES' ) && defined( 'TABLE_PAGES_MANAGER_DESCRIPTION' ) ){ // The items with a colon : are placeholders which must match the $placeholders array in method acquire() $this->base_query = "SELECT pages_title FROM " . TABLE_PAGES_MANAGER_DESCRIPTION . " WHERE pages_id=':pages_id' AND language_id=':languages_id' LIMIT 1"; usu::$registry->merge( 'seo_pages', $this->page_relations ); usu::$registry->merge( 'markers', $this->markers ); usu::$registry->addPageDependency( array( self::FILENAME => self::DEPENDENCY ) ); /** * For modules which are optional ( like information pages etc) * we would check for the existance of certain defines and if present set $this->installed to true * e.g. for the links contribution we would use .. * if ( defined( 'FILENAME_LINKS' ) && defined( 'TABLE_LINK_CATEGORIES_DESCRIPTION' ) ) { * $this->installed = true; * } */ $this->installed = true; // xxx Hardcoded to true in this instance - see above comment. } } protected function acquire( $base_path, $full_path ) { $this->dependency_value = $full_path; // Full path perhaps with underscores /** * About placeholders * * The placeholders (items with a colon :) must match those in the query ( $this->base_query in the constructor ) */ $placeholders = array( ':pages_id', ':languages_id' ); // Do the below values need to be typecast? $values = array( (int)$base_path, (int)usu::$languages_id ); // xxx These values will replace the placeholders above in $this->base_query $this->query = str_replace( $placeholders, $values, $this->base_query ); // Replace the placeholders with actual values $result = usu::query( $this->query ); // Action the query $this->query = null; // Unset the query for future usage $row = tep_db_fetch_array( $result ); // Return the array of data ( or false if there are no results ) tep_db_free_result( $result ); // Housekeeping if ( false === $row ) { return false; // No results for the query so abort } /** * Values obtained from the query, these properties will populate the registry via the method getProperties() * Method $this->linkText() should be used here to convert the text into seo url format e.g. * my great product .. may become .. my-great-product * You may have more than one of these like .. * $this->parentname, $this->catname dependent on how many results you retrieve from your query */ $this->pages_title = $this->linkText( $row['pages_title'] ); // If the registry item doesn't exist as a key then set a blank array if ( false === isset( usu::$registry->{self::DEPENDENCY} ) ) { usu::$registry->{self::DEPENDENCY} = array(); } /** * Populate the registry with the properties we have set in this class */ usu::$registry->attach( self::DEPENDENCY, $this->dependency_value, $this->getProperties() ); } // End method protected function getProperties() { $properties = get_object_vars( $this ); // $properties becomes an array of all properties within this class unset( $properties['page_relations'] ); // Get rid of this key as it is not needed in the registry return $properties; } // End method private function get_full_path( $path ) { // Only used for modules that require paths with parents like .. 2_6_35 // See Usu_Categories.php for usage return $path; } // End method private function get_parents() { // Only used for modules that require paths with parents like .. 2_6_35 // See Usu_Categories.php for usage } // End method /** * Builds the seo url * * @param string $page - file name of the calling page e.g. index.php * @param array $valuepair - key => value pair array containing dependency(e.g. cPath) => value (e.g. 2_24_52) * @param string $url - $url passed by reference created by the method linkCreate() * @param array $added_qs - passed by reference containing key value pairs for _GET * @param string $parameters - Currently unused */ public function buildLink( $page, $valuepair, &$url, &$added_qs, $parameters ) { if ( ( $valuepair[0] != self::DEPENDENCY ) || ( false === array_key_exists( 1, $valuepair ) ) || ( false === $this->installed ) || !tep_not_null( $valuepair[1] ) ) { return false; // Either this module is not installed or the value pair does not meet our requirements so abort } $base_path = $valuepair[1]; // well it might be a single top level item if ( false === $this->suppress_underscores ) { if ( false !== strpos( $valuepair[1], '_' ) ) { // It is a path with parents? ( has underscores ) $base_path = ltrim( strrchr( $valuepair[1], '_' ), '_' ); // Grab the base path which is the number at the end of a path with parents ( e.g. 2_23_37_52 = 52 ) } } // Sanity check - if the $base_path is not numeric then we dump it if ( false === is_numeric( str_replace( '_', '', $base_path ) ) ) { trigger_error( __CLASS__ . ' Incorrect ' . self::DEPENDENCY . ' presented: ' . $valuepair[1], E_USER_WARNING ); return false; } // Get a full path with underscores from the database $full_path = $this->get_full_path( $base_path ); // If this item is not already in the registry we use the acquire() method to query for the data if ( !isset( usu::$registry->vars[self::DEPENDENCY][$full_path] ) ) { if ( false === $this->acquire( $base_path, $full_path ) ) { return false; // Looks like an invalid request so dump it } } else { usu::$performance['queries_saved']++; // Already in the registry so we saved one query } /** * About $reg_item * * We grab the array of data from the registry and place it in $reg_item for convenience * The data stored in the registry was set in the method acquire as properties of this class * These are then set in the registry using the method getProperties() * the specific array keys like $reg_item['catname'] will be specific and differ in each module */ $reg_item = array(); $reg_item = usu::$registry->vars[$valuepair[0]][$full_path]; /** * Set the link text from reg_item * e.g. $link_text = $reg_item['parentname'] . '-' . $reg_item['catname']; */ $link_text = $reg_item['pages_title']; // the property added in the acquire function this would have been set in the acquire method like $this->xxxname switch( true ){ case $page == self::FILENAME: $url = $this->linkCreate( self::FILENAME, $link_text, self::MARKER, $full_path ); break; default: // Add leftovers to the querystring _GET $added_qs[filter_var( $valuepair[0], FILTER_SANITIZE_STRING )] = usu::cleanse( $valuepair[1] ); break; } # end switch } } ?> I try the memcache and i have this error [size="1"]( ! ) Warning: Memcache::connect() [[url="http://test/boutique/memcache.connect"]memcache.connect[/url]]: Can't connect to localhost:11211, Connection refused (111) in /home/www/test/boutique/includes/modules/ultimate_seo_urls5/classes/Usu_Cache_Memcached.php on line [i]28[/i] Call Stack #TimeMemoryFunctionLocation 10.0010134256{main}( )../index.php[b]:[/b]0 20.0030375132require( [color="#00bb00"]'/home/www/ctest/boutique/includes/application_top.php'[/color] )../index.php[b]:[/b]21 30.03882152068usu->__construct( )../application_top.php[b]:[/b]346 40.03932176884usu->loadRegistry( )../usu.php[b]:[/b]71 50.03932177004usu->cacheSystem( )../usu.php[b]:[/b]176 60.03972211104Usu_Cache_Memcached->__construct( )../usu.php[b]:[/b]115 70.03972211432Memcache->connect( )../Usu_Cache_Memcached.php[b]:[/b]28 [/size] [size="1"] ( ! ) Warning: Could not connect to memcache server in /home/www/test/boutique/includes/modules/ultimate_seo_urls5/classes/Usu_Cache_Memcached.php on line [i]29[/i] Call Stack #TimeMemoryFunctionLocation 10.0010134256{main}( )../index.php[b]:[/b]0 20.0030375132require( [color="#00bb00"]'/home/www/test/boutique/includes/application_top.php'[/color] )../index.php[b]:[/b]21 30.03882152068usu->__construct( )../application_top.php[b]:[/b]346 40.03932176884usu->loadRegistry( )../usu.php[b]:[/b]71 50.03932177004usu->cacheSystem( )../usu.php[b]:[/b]176 60.03972211104Usu_Cache_Memcached->__construct( )../usu.php[b]:[/b]115 70.04022226140[url="http://www.php.net/trigger_error"]trigger_error[/url] ( )[/size] My configuration php.ini [b]memcache[/b] memcache supportenabled Version 3.0.1 Revision $Revision: 1.83.2.24 $ DirectiveLocal ValueMaster Value memcache.allow_failover11 memcache.chunk_size3276832768 memcache.default_port1121111211 memcache.hash_functioncrc32crc32 memcache.hash_strategyconsistentconsistent memcache.max_failover_attempts2020 memcache.protocolasciiascii memcache.redundancy11 memcache.session_redundancy22
  2. Gyakutsuki

    ULTIMATE Seo Urls 5 - by FWR Media

    I resolve my prob by this (work without seo) : $page_liste_box .= '<tr><td class="main"><a target="'.$page['links_target'].'" href="' . tep_href_link($link,'',NONSSL) . '">' . $page['pages_title'] . '</a></td></tr>'; become $page_liste_box .= '<tr><td class="main"><a target="'.$page['links_target'].'" href="' . $link . '">' . $page['pages_title'] . '</a></td></tr>'; but with seo it's does'nt work. An idea ? I create this module and I have updated my htaccess : <?php /** * * ULTIMATE Seo Urls 5 * * * @package Ultimate Seo Urls 5 * @license http://www.opensource.org/licenses/gpl-2.0.php GNU Public License * @link http://www.fwrmedia.co.uk * @copyright Copyright 2008-2009 FWR Media * @copyright Portions Copyright 2005 Bobby Easland * @author Robert Fisher, FWR Media, http://www.fwrmedia.co.uk * @lastdev $Author:: Rob $: Author of last commit * @lastmod $Date:: 2009-11-29 11:13:08 +0000 (Sun, 29 Nov 2009) $: Date of last commit * @version $Rev:: 105 $: Revision of last commit * @Id $Id:: Usu_Page_Manager.php 105 2009-11-29 11:13:08Z Rob $: Full Details */ class Usu_Pages_Manager extends aDataMap { const MARKER = '-pm-'; // Could for example be -c- or -l- etc. const DEPENDENCY = 'pages_id'; // _GET key like e.g. cPath or lPath etc. const FILENAME = FILENAME_PAGES; // The filename define of the file where this code will be actioned public $dependency = self::DEPENDENCY; public $dependency_tags = array( self::MARKER => self::FILENAME ); // key value pair of tag (like e.g. -c-) => filename ( e.g. FILENAME_DEFAULT ) private $page_relations = array( self::FILENAME => 1 ); // Page relation for this module ( e.g. FILENAME_DEFAULT or FILENAME_LINKS ) private $markers = array( self::MARKER => self::DEPENDENCY ); // Markers as key value pair like -c- => cPath or perhaps -l- => lPath private $base_query; // Template query with placeholders ( :placeholder ) waiting for real values private $query; // The final query which will be $base_query but with the placeholders replaced with real values private $pages_title; // property populated in the acquire() method, there may be multiples of these, rename in line with the query results private $dependency_value; // Dependency value, so if the dependency was cPath and cPath = 27 then this value would be 27 private $installed = false; // Unless it is a core module $installed should only be true if the contribution is installed ( e.g. articles or links manager etc ) private $suppress_underscores = false; // Set to true Produce only base paths like -t-32 not parent paths like 3_5_23 public function __construct(){ if ( defined( 'FILENAME_PAGES' ) && defined( 'TABLE_PAGES_MANAGER_DESCRIPTION' ) ){ // The items with a colon : are placeholders which must match the $placeholders array in method acquire() $this->base_query = "SELECT pages_title FROM " . TABLE_PAGES_MANAGER_DESCRIPTION . " WHERE pages_id=':pages_id' AND language_id=':languages_id' LIMIT 1"; usu::$registry->merge( 'seo_pages', $this->page_relations ); usu::$registry->merge( 'markers', $this->markers ); usu::$registry->addPageDependency( array( self::FILENAME => self::DEPENDENCY ) ); /** * For modules which are optional ( like information pages etc) * we would check for the existance of certain defines and if present set $this->installed to true * e.g. for the links contribution we would use .. * if ( defined( 'FILENAME_LINKS' ) && defined( 'TABLE_LINK_CATEGORIES_DESCRIPTION' ) ) { * $this->installed = true; * } */ $this->installed = true; // xxx Hardcoded to true in this instance - see above comment. } } protected function acquire( $base_path, $full_path ) { $this->dependency_value = $full_path; // Full path perhaps with underscores /** * About placeholders * * The placeholders (items with a colon :) must match those in the query ( $this->base_query in the constructor ) */ $placeholders = array( ':pages_id', ':languages_id' ); // Do the below values need to be typecast? $values = array( (int)$base_path, (int)usu::$languages_id ); // xxx These values will replace the placeholders above in $this->base_query $this->query = str_replace( $placeholders, $values, $this->base_query ); // Replace the placeholders with actual values $result = usu::query( $this->query ); // Action the query $this->query = null; // Unset the query for future usage $row = tep_db_fetch_array( $result ); // Return the array of data ( or false if there are no results ) tep_db_free_result( $result ); // Housekeeping if ( false === $row ) { return false; // No results for the query so abort } /** * Values obtained from the query, these properties will populate the registry via the method getProperties() * Method $this->linkText() should be used here to convert the text into seo url format e.g. * my great product .. may become .. my-great-product * You may have more than one of these like .. * $this->parentname, $this->catname dependent on how many results you retrieve from your query */ $this->pages_title = $this->linkText( $row['pages_title'] ); // If the registry item doesn't exist as a key then set a blank array if ( false === isset( usu::$registry->{self::DEPENDENCY} ) ) { usu::$registry->{self::DEPENDENCY} = array(); } /** * Populate the registry with the properties we have set in this class */ usu::$registry->attach( self::DEPENDENCY, $this->dependency_value, $this->getProperties() ); } // End method protected function getProperties() { $properties = get_object_vars( $this ); // $properties becomes an array of all properties within this class unset( $properties['page_relations'] ); // Get rid of this key as it is not needed in the registry return $properties; } // End method private function get_full_path( $path ) { // Only used for modules that require paths with parents like .. 2_6_35 // See Usu_Categories.php for usage return $path; } // End method private function get_parents() { // Only used for modules that require paths with parents like .. 2_6_35 // See Usu_Categories.php for usage } // End method /** * Builds the seo url * * @param string $page - file name of the calling page e.g. index.php * @param array $valuepair - key => value pair array containing dependency(e.g. cPath) => value (e.g. 2_24_52) * @param string $url - $url passed by reference created by the method linkCreate() * @param array $added_qs - passed by reference containing key value pairs for _GET * @param string $parameters - Currently unused */ public function buildLink( $page, $valuepair, &$url, &$added_qs, $parameters ) { if ( ( $valuepair[0] != self::DEPENDENCY ) || ( false === array_key_exists( 1, $valuepair ) ) || ( false === $this->installed ) || !tep_not_null( $valuepair[1] ) ) { return false; // Either this module is not installed or the value pair does not meet our requirements so abort } $base_path = $valuepair[1]; // well it might be a single top level item if ( false === $this->suppress_underscores ) { if ( false !== strpos( $valuepair[1], '_' ) ) { // It is a path with parents? ( has underscores ) $base_path = ltrim( strrchr( $valuepair[1], '_' ), '_' ); // Grab the base path which is the number at the end of a path with parents ( e.g. 2_23_37_52 = 52 ) } } // Sanity check - if the $base_path is not numeric then we dump it if ( false === is_numeric( str_replace( '_', '', $base_path ) ) ) { trigger_error( __CLASS__ . ' Incorrect ' . self::DEPENDENCY . ' presented: ' . $valuepair[1], E_USER_WARNING ); return false; } // Get a full path with underscores from the database $full_path = $this->get_full_path( $base_path ); // If this item is not already in the registry we use the acquire() method to query for the data if ( !isset( usu::$registry->vars[self::DEPENDENCY][$full_path] ) ) { if ( false === $this->acquire( $base_path, $full_path ) ) { return false; // Looks like an invalid request so dump it } } else { usu::$performance['queries_saved']++; // Already in the registry so we saved one query } /** * About $reg_item * * We grab the array of data from the registry and place it in $reg_item for convenience * The data stored in the registry was set in the method acquire as properties of this class * These are then set in the registry using the method getProperties() * the specific array keys like $reg_item['catname'] will be specific and differ in each module */ $reg_item = array(); $reg_item = usu::$registry->vars[$valuepair[0]][$full_path]; /** * Set the link text from reg_item * e.g. $link_text = $reg_item['parentname'] . '-' . $reg_item['catname']; */ $link_text = $reg_item['pages_title']; // the property added in the acquire function this would have been set in the acquire method like $this->xxxname switch( true ){ case $page == self::FILENAME: $url = $this->linkCreate( self::FILENAME, $link_text, self::MARKER, $full_path ); break; default: // Add leftovers to the querystring _GET $added_qs[filter_var( $valuepair[0], FILTER_SANITIZE_STRING )] = usu::cleanse( $valuepair[1] ); break; } # end switch } } ?>
  3. Gyakutsuki

    ULTIMATE Seo Urls 5 - by FWR Media

    I have now another pb. There my code $link = FILENAME_PAGES . '?pages_id=' . (int)$page['pages_id']; $page_liste_box .= '<tr><td class="main"><a target="'.$page['links_target'].'" href="' . tep_href_link($link,'',NONSSL) . '">' . $page['pages_title'] . '</a></td></tr>'; After i apply seo my code ?pages_id=' . (int)$page['pages_id'] is deleted Before page_manager.php?pages_id=4 Now page_manager.php == impossible to see the content. Do you delete something in your code ? Do you have an idea to resolve this. The seo rewriiting is not activate.
  4. Gyakutsuki

    ULTIMATE Seo Urls 5 - by FWR Media

    If you use the ut8 encoding, you need convert all files in /includes/caracter_conversion in ut8 because the encoding is in ISO. Thanl for your help Robert . I propose you to create in your add on a speciel directory in utf 8 for that
  5. Gyakutsuki

    ULTIMATE Seo Urls 5 - by FWR Media

    French caracter, just two modifications $char_convert = array('à' => 'a', 'â' => 'a', 'æ' => 'ae', 'ç' => 'c', 'é' => 'e', 'è' => 'e', 'ê' => 'e', 'ë' => 'e', 'î' => 'i', 'ï' => 'i', 'œ' => 'oe', 'ô' => 'o', 'ö' => 'o', 'ù' => 'u', 'û' => 'u', 'À' => 'A', 'Â' => 'A', 'Æ' => 'AE', 'Ç' => 'C', 'È' => 'E', 'É' => 'E', 'Ê' => 'E', 'Ë' => 'E', 'Î' => 'I', 'Ï' => 'I', 'Œ' => 'OE', 'Ô' => 'O', 'Ù' => 'U', 'Û' => 'U', 'ü' => 'u', 'ÿ' =>'y', '€' => 'Euros');
  6. Gyakutsuki

    ULTIMATE Seo Urls 5 - by FWR Media

    Ok it's not a pb, i look the french character. :lol:
  7. Gyakutsuki

    ULTIMATE Seo Urls 5 - by FWR Media

    <br /><br /><br /> Yes, I insert this package and my language is french. All is ok. The pb is the conversion utf8 the link in href balise. I ue debug module I see that on result Seo Urls: cache (filesytem) My product name is téstà3 http://....../boutique/téstà3-p-2.html http://....../boutique/téstà3-p-2.html http://....../boutique/téstà3-p-2.html If my latest post, the result is not the same. In my html code, the href has this http:......../boutique/téstà 3-p-2.html I need to decode all utf8 synthax (ex é) and change the decode (é = é) and a = e (your module extras/character_conversion_pack will the job). just a precision : database encoding : utf 8 and no latin1 charset in french is utf 8 and no iso-8859-1
  8. Gyakutsuki

    ULTIMATE Seo Urls 5 - by FWR Media

    Hello,<br /><br />Thanks for this great job.<br />My database is in utf8 and i have a pb with the href :(convert not enable in seo option that I don't wish):<br /><br />Exemple : <br /><br /> <br /> é = e <br /> http........./boutique/catégorie-c-1.html ==> that I see<br /> http......../boutique/categorie-c-1.html ==> good link <br /> <br /> téstà3 for a product<br /> http:......../boutique/téstà 3-p-2.html ==> that I see<br /> http:......../boutique/testa 3-p-2.html ==> that I see<br /> <br /> <br /> <br />Where in your code, I can implement the utf8 function for have a good link.<br />i have another pb also there is a space between testa and 3-p-2.html (téstà 3-p-2.html or testa 3-p-2.html)<br /><br />Thanks you
  9. Gyakutsuki

    Flat Attribute

    there the question concerning the Flat price add on Summary : add on : http://addons.oscommerce.com/info/6627 This module add a new prefix '=' on attribute product actually we have '+' and '-' (price+/-option)*qty now a flat price with this calcul (price *qty) + option beta version
  10. Gyakutsuki

    Flat Attribute

    There the code if ($attribute_price['price_prefix'] == '+') { $this->total += $qty * tep_add_tax($attribute_price['options_values_price'], $products_tax); } if ($attribute_price['price_prefix'] == '-') { $this->total -= $qty * tep_add_tax($attribute_price['options_values_price'], $products_tax); } // Flat price if ($attribute_price['price_prefix'] == '=') { $this->total += tep_add_tax($attribute_price['options_values_price'], $products_tax); }
  11. Gyakutsuki

    FedEx Direct 2.06 Support thread

    Hello, I try the latest fedex shipment 2.07 I have a fedex account I have meter id number The shipping is quebec(montreal) to quebec (montreal) I have changed // $this->server = 'gatewaybeta.fedex.com/GatewayDC'; $this->server = 'gatewaybeta.fedex.com:443/GatewayDC '; This url has been sent by fedex first test The tare weight is : 0 kg My product weight is : 3Kg My quantity is : 1 Fedex result : FEDEX (Total items: 2 pcs. Total weight: 4.2 kgs) i don't understand the weight calculation : 4.2 kg because I have 3kg for one products ? I don't understand why I have Total items: 2 pcs because i have only one product First Overnight 52.32EUR Priority (by 10:30AM, later for rural) 29.86EUR 2 Day Air 28.91EUR Ground Service (1 days) 14.69EUR second test The tare weight is : 0 kg My product weight is : 3Kg My quantity is :2 Fedex result : FEDEX (Total items: 4 pcs. Total weight: 8.4 kgs) i don't understand the weight calculation : 8.4 kg because I have 3kg x 2 qty for two products (same products)? I don't understand why i have Total items: 4 pcs because i have only 2 product the price result : First Overnight 83.38EUR Priority (by 10:30AM, later for rural) 47.48EUR 2 Day Air 46.13EUR Ground Service (1 days) 23.14EUR Thank for your help and answer
  12. Gyakutsuki

    SEO Assistant

    Hello, I test in this moment your contrib and I have different results on Google search position. For example if I try (with your code) erp oscommerce with http://www.e-imaginis.com I have this postion : position 39 ( 37 ) on google.com If I click a second time to test this world, I have : position 41 ( 40 ) If I click a third time to terminate the test : I have position 40 ( 38 ) If I put in comment your code /* case "Google": $filename = "http://www.google.com/search?as_q=$query". "&num={$hits_per_page}&hl=en&ie=UTF-8&btnG=Google+Search". "&as_epq=&as_oq=&as_eq=&lr=&as_ft=i&as_filetype=". "&as_qdr=all&as_nlo=&as_nhi=&as_occt=any&as_dt=i". "&as_sitesearch=&safe=images&start=$i"; */ and I replace by this : case "Google": $filename = "http://www.google.com/search?q=$query.'&hl=en&lr=&as_qdr=all&start=$i&sa=N'"; the results first test : position 41 ( 39 ) second test : position 37 ( 37 ) third test : position 38 ( 38 ) In reality my position is : 40 If I actualise Google, I have always the same position. If I try with oscommerce erp With your code : fisrt test : position 5 ( 5 ) second test : position 7 ( 6 ) third test : position 7 ( 6 ) With the other code : first test : position 7 ( 6 ) second test : position 7 ( 6 ) third test : position 7 ( 6 ) I remark that : More the url is far in google, more the result are randoms, see you can have no result the the url exist in google or the difference between google search result and your code is very different. The second code seems more stable than the first code (I think). My second question what is : {$hits_per_page} we see in for condition and your google url. My third question and last : How to write or found your url google code then the google code is that "http://www.google.com/search?q=$query.'&hl=en&lr=&as_qdr=all&start=$i&sa=N'"; in reality Your contribution is very interesting and congratulation. Thanks
  13. Gyakutsuki

    Newsletter & Subscribtion for MS2

    For my question if you <align="center"> in boxe/newsletter/php : Delete l
  14. Gyakutsuki

    Newsletter & Subscribtion for MS2

    Have you seen a pb with Internet 7 on the button "GO" on newsletter boxes. With firefox the script work fine but since IE7 appear the same script does'nt work with IE7.
  15. Gyakutsuki

    AJAX Attribute Manager support

    Hello, I try this contribution and it's very interesting. But it's impossbile to use the download function included in original attribut. What do you think to implement this function in this contibution ?
  16. Sorry for the 1.6 contribution, I created a new package with the modification. I test on simple ms2 and it work fine.
  17. Gyakutsuki

    WYSIWYG SPAW EDITOR Support Thread

    I installed Spaw, on Internet explorer (maxthon ...), it work fine but whan i use Firefox, I see the editor but it's impossible to write inside. Do yu have a solution ? normally spaw is compatible with Firefox when i see the site. on Mambo CMS, Spaw work fine with internet explorer and forefox. Do you have a solution ? Doy ou know if spaw work on maciinthosh ? ps : local installation
  18. Gyakutsuki

    Points/Rewards Module

    This code below is Ok but I use the coupon and when a client validate a coupon, I don't want the client use the redemption. How to do to realise that. I think it's important because, if you use the coupon + redemption, there is a problem. The client must, in my opinion, use the coupon only or the redemption only but not the 2 in the same time. <?php /* $Id: ot_redemptions.php,v 1 Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2002 osCommerce Released under the GNU General Public License */ class ot_redemptions { var $title, $output; function ot_redemptions() { $this->code = 'ot_redemptions'; $this->title = MODULE_ORDER_TOTAL_REDEMPTIONS_TITLE; $this->header = MODULE_ORDER_TOTAL_REDEMPTIONS_HEADER; $this->description = MODULE_ORDER_TOTAL_REDEMPTIONS_DESCRIPTION; $this->user_prompt = MODULE_ORDER_TOTAL_REDEMPTIONS_USER_PROMPT; $this->enabled = true; $this->sort_order = 800; //$this->include_shipping = MODULE_ORDER_TOTAL_GV_INC_SHIPPING; //$this->include_tax = MODULE_ORDER_TOTAL_GV_INC_TAX; //$this->calculate_tax = MODULE_ORDER_TOTAL_GV_CALC_TAX; //$this->credit_tax = MODULE_ORDER_TOTAL_GV_CREDIT_TAX; //$this->tax_class = MODULE_ORDER_TOTAL_GV_TAX_CLASS; //$this->show_redeem_box = MODULE_ORDER_TOTAL_GV_REDEEM_BOX; $this->credit_class = true; $this->checkbox = $this->user_prompt . '<input type="checkbox" onClick="submitFunction()" name="' . 'c' . $this->code . '">'; $this->output = array(); } function process() { global $order, $currencies; $order_total = $this->get_order_total(); // if($_SESSION['cot_redemptions']) if(!$_SESSION['cot_redemptions']) { $od_amount = $this->calculate_credit($order_total); // if ($this->calculate_tax != "none") { // $tod_amount = $this->calculate_tax_deduction($order_total, $od_amount, $this->calculate_tax); // $od_amount = $this->calculate_credit($order_total); // } $this->deduction = $od_amount; // if (($this->calculate_tax == "Credit Note") && (DISPLAY_PRICE_WITH_TAX != 'true')) { // $od_amount -= $tod_amount; // $order->info['total'] -= $tod_amount; // } // ############# calcul de la r?duction - Amount reduction $order->info['total'] = $order->info['total'] - $od_amount; // ############ Apparition de l'affichage Dysplay in checkout confirmation if ($od_amount > 0) { $this->output[] = array('title' => $this->title . ':', 'text' => '<b>' . $currencies->format($od_amount) . '</b>', 'value' => $sod_amount); }else{ $this->output[] = array('title' => '<font color=red><b>Vous n\avez pas assez acquis de points pour b?n?ficier d\'un rachat</b></font>', 'text' => '', 'value' => $sod_amount); } } } function selection_test() { global $customer_id, $order; if ($this->user_has_points($customer_id)) { for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { if (!(substr($order->products[$i]['model'], 0, 10) == 'REDEMPTION')) { // return false; return true; } } return true; } else { return false; } } function pre_confirmation_check($order_total) { $gv_payment_amount = 0; if (!$SESSION['cot_redemptions']) { $gv_payment_amount = $this->calculate_credit($order_total); } return $gv_payment_amount; } function use_credit_amount() { global $customer_id; $ptpoints = 0; !$_SESSION['cot_redemptions'] = false; $pt_query = tep_db_query("select points from customer_points where customer_id = '" . $customer_id . "'"); if ($pt_result = tep_db_fetch_array($pt_query)) { $ptpoints = $pt_result['points']; } if ($this->selection_test()) { $output_string .= ' <td align="right" class="main">'; $output_string .= '<b>' . $this->checkbox . '</b>' . '' . "\n"; $output_string .= "<br> Points valide = $ptpoints </td>\n"; } return $output_string; } function update_credit_account($i) { global $order, $customer_id, $insert_id, $REMOTE_ADDR; /************************************************************************ if (ereg('^GIFT', addslashes($order->products[$i]['model']))) { $gv_order_amount = ($order->products[$i]['final_price'] * $order->products[$i]['qty']); if ($this->credit_tax=='true') $gv_order_amount = $gv_order_amount * (100 + $order->products[$i]['tax']) / 100; // $gv_order_amount += 0.001; $gv_order_amount = $gv_order_amount * 100 / 100; if (MODULE_ORDER_TOTAL_GV_QUEUE == 'false') { // GV_QUEUE is true so release amount to account immediately $gv_query=tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . $customer_id . "'"); $customer_gv = false; $total_gv_amount = 0; if ($gv_result = tep_db_fetch_array($gv_query)) { $total_gv_amount = $gv_result['amount']; $customer_gv = true; } $total_gv_amount = $total_gv_amount + $gv_order_amount; if ($customer_gv) { $gv_update=tep_db_query("update " . TABLE_COUPON_GV_CUSTOMER . " set amount = '" . $total_gv_amount . "' where customer_id = '" . $customer_id . "'"); } else { $gv_insert=tep_db_query("insert into " . TABLE_COUPON_GV_CUSTOMER . " (customer_id, amount) values ('" . $customer_id . "', '" . $total_gv_amount . "')"); } } else { // GV_QUEUE is true - so queue the gv for release by store owner $gv_insert=tep_db_query("insert into " . TABLE_COUPON_GV_QUEUE . " (customer_id, order_id, amount, date_created, ipaddr) values ('" . $customer_id . "', '" . $insert_id . "', '" . $gv_order_amount . "', NOW(), '" . $REMOTE_ADDR . "')"); } } ******************************************************************************** **/ } function credit_selection() { global $customer_id, $currencies, $language; $selection_string = ''; /* $gv_query = tep_db_query("select coupon_id from " . TABLE_COUPONS . " where coupon_type = 'G' and coupon_active='Y'"); if (tep_db_num_rows($gv_query)) { $selection_string .= '<tr>' . "\n"; $selection_string .= ' <td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') .'</td>'; $selection_string .= ' <td class="main">' . "\n"; $image_submit = '<input type="image" name="submit_redeem" onClick="submitFunction()" src="' . DIR_WS_LANGUAGES . $language . '/images/buttons/button_redeem.gif" border="0" alt="' . IMAGE_REDEEM_VOUCHER . '" title = "' . IMAGE_REDEEM_VOUCHER . '">'; $selection_string .= TEXT_ENTER_GV_CODE . tep_draw_input_field('gv_redeem_code') . '</td>'; $selection_string .= ' <td align="right"' . $image_submit . '</td>'; $selection_string .= ' <td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') . '</td>'; $selection_string .= '</tr>' . "\n"; } */ return $selection_string; } function apply_credit() { global $order, $customer_id, $coupon_no, $insert_id; if (!$_SESSION['cot_redemptions']) { $gv_query = tep_db_query("select points from customer_points where customer_id = '" . $customer_id . "'"); $gv_result = tep_db_fetch_array($gv_query); $points_balance = $gv_result['points']; $con_query = tep_db_query("select configuration_value from configuration where configuration_key = 'DOLLAR_REDEEM_PER_POINT'"); $con_result=tep_db_fetch_array($con_query); $conf_points = $con_result['configuration_value']; $points_spent = $this->deduction/$conf_points; $points_balance = $points_balance - $points_spent; if($points_spent > 0) { $gv_update = tep_db_query("update customer_points set points = '" . $points_balance . "' where customer_id = '" . $customer_id . "'"); $gv_ins = tep_db_query("insert into customer_points_redeemed values (null, $customer_id, $points_spent, now(), $insert_id )"); } } return $this->deduction; } function collect_posts() { } function calculate_credit($amount) { global $customer_id, $order; $red_query=tep_db_query("select points from customer_points where customer_id = '" . $customer_id . "'"); $red_result=tep_db_fetch_array($red_query); $red_points = $red_result['points']; $con_query = tep_db_query("select configuration_value from configuration where configuration_key = 'DOLLAR_REDEEM_PER_POINT'"); $con_result= tep_db_fetch_array($con_query); $conf_points = $con_result['configuration_value']; $red_amount = $red_points * $conf_points; $save_total_cost = $amount; $full_cost = $save_total_cost - $red_amount; if ($full_cost <= 0) { $full_cost = 0; $red_amount = $save_total_cost; } else $red_amount = 0; return tep_round($red_amount,2); } function calculate_tax_deduction($amount, $od_amount, $method) { } function user_has_points($c_id) { $pt_query = tep_db_query("select points from customer_points where customer_id = '" . $c_id . "'"); if ($pt_result = tep_db_fetch_array($pt_query)) { if ($pt_result['points']>0) { return true; } } return false; } function get_order_total() { global $order; $order_total = $order->info['total']; $con_query = tep_db_query("select configuration_value from configuration where configuration_key = 'USE_POINTS_FOR_SHIPPING'"); $con_result=tep_db_fetch_array($con_query); $conf_use = $con_result['configuration_value']; //if ($conf_use == 'false') $order_total = $order_total - $order->info['tax']; if ($conf_use == 'false') $order_total = $order_total - $order->info['shipping_cost']; return $order_total; } function check() { if (!isset($this->check)) { $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'POINTS_PER_DOLLAR_PURCHASE'"); $this->check = tep_db_num_rows($check_query); } //return $this->check; return 1; } function keys() { // return array('MODULE_ORDER_TOTAL_GV_STATUS', 'MODULE_ORDER_TOTAL_GV_SORT_ORDER', 'MODULE_ORDER_TOTAL_GV_QUEUE', 'MODULE_ORDER_TOTAL_GV_INC_SHIPPING', 'MODULE_ORDER_TOTAL_GV_INC_TAX', 'MODULE_ORDER_TOTAL_GV_CALC_TAX', 'MODULE_ORDER_TOTAL_GV_TAX_CLASS', 'MODULE_ORDER_TOTAL_GV_CREDIT_TAX'); return array (); } function install() { tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Afficher le Total', 'MODULE_ORDER_TOTAL_GV_STATUS', 'true', 'Souhaitez vous afficher la valeur du coupon ?', '6', '1','tep_cfg_select_option(array(\'true\', \'false\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Ordre de Tri', 'MODULE_ORDER_TOTAL_GV_SORT_ORDER', '740', 'Affichage de l\'ordre d\'apparition.', '6', '2', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Queue Purchases', 'MODULE_ORDER_TOTAL_GV_QUEUE', 'true', 'Do you want to queue purchases of the Gift Voucher?', '6', '3','tep_cfg_select_option(array(\'true\', \'false\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function ,date_added) values ('Include Shipping', 'MODULE_ORDER_TOTAL_GV_INC_SHIPPING', 'true', 'Include Shipping in calculation', '6', '5', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function ,date_added) values ('Include Tax', 'MODULE_ORDER_TOTAL_GV_INC_TAX', 'true', 'Include Tax in calculation.', '6', '6','tep_cfg_select_option(array(\'true\', \'false\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function ,date_added) values ('Re-calculate Tax', 'MODULE_ORDER_TOTAL_GV_CALC_TAX', 'None', 'Re-Calculate Tax', '6', '7','tep_cfg_select_option(array(\'None\', \'Standard\', \'Credit Note\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_ORDER_TOTAL_GV_TAX_CLASS', '0', 'Use the following tax class when treating Gift Voucher as Credit Note.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function ,date_added) values ('Credit including Tax', 'MODULE_ORDER_TOTAL_GV_CREDIT_TAX', 'false', 'Add tax to purchased Gift Voucher when crediting to Account', '6', '8','tep_cfg_select_option(array(\'true\', \'false\'), ', now())"); } function remove() { } } ?>
  19. Gyakutsuki

    Buy_Two_Module

    When i have installed this contrbution, i have this problem.Could you help me ? Warning: Missing argument 4 for tep_set_bundle() in d:\wamp\www\client_b2b\ecom\boutique\includes\functions\buy_two_func.php on line 293 Warning: Cannot modify header information - headers already sent by (output started at d:\wamp\www\client_b2b\ecom\boutique\includes\functions\buy_two_func.php:293) in d:\wamp\www\client_b2b\ecom\boutique\includes\functions\general.php on line 155 The GD is installed and the version is Ok for this contribution
  20. Gyakutsuki

    Problem with Send Order HTML Email...

    try that : You have inserted PWA with { but you does'nt close }. the error is here. require(DIR_WS_MODULES . 'email/html_checkout_process.php'); $email_order = $html_email_order ; // lets start with the email confirmation if (EMAIL_USE_HTML == 'true') { $email_order; } else { Regards
  21. Gyakutsuki

    Flash discount

    There, insert your pb, your suggestion concerning this contribution Remember : this module has been created for a flash discount. We are ameliorated the special files. In admin/special.php => We are included a new column for a choice between a normal special and a flash discount. In catalog/product_info.php Included an image allowing to see the flash selling.
  22. Gyakutsuki

    Hide products from groups for B2BSuite

    To solve the bug when you create a product . open categorie and change . <?php // ############# Added Hide product from groups B2B suite ############### ?> <tr align="top"> <td> <? echo TEXT_HIDE_PRODUCTS_FROM_GROUP; ?></td> <td class="dataTableContent"> <table border="0" cellpadding="0" cellspacing="0"> <?php // Check which groups should be hidden - Problem RESOLVED BELOW (int)$HTTP_GET_VARS['pID'] $product_hide_from_group_query = tep_db_query("select products_hide_from_groups from ".TABLE_PRODUCTS." where products_id =". (int)$HTTP_GET_VARS['pID'] ); $hide_these_products = tep_db_fetch_array ($product_hide_from_group_query); $hide = explode(',',$hide_these_products['products_hide_from_groups']); $customers_group_query = tep_db_query("select distinct customers_group_id, customers_group_name from " . TABLE_CUSTOMERS_GROUPS . " where customers_group_id != '" . 0 . "' order by customers_group_id"); $i=1; while ($customers_group = tep_db_fetch_array($customers_group_query)) { foreach($hide as $h){ if($h == $customers_group['customers_group_id']){ $check_hidden = true; break; }else{ $check_hidden = false; } } #print the checkbox field echo '<tr class="dataTableContent"><td>'. ($i).'. '. tep_draw_checkbox_field('hide[' . ($i++) . ']', $customers_group['customers_group_id'] , $check_hidden) . ' ' . $customers_group['customers_group_name'].'</td></tr>'; }#End of while ?> </table> </td> </tr> <?php // ############# Hide product from groups B2B suite ############### ?> When you use B2Bsuite , you can not delete a product for the client not logged. Is it possible to insert this option. This contribution is very interesting but it works only with the dynamic group. It's interesting to develop for the static group in b2bsuite (client). Do you have an idea ?
  23. Gyakutsuki

    Flash discount

    Sorry for my english, try it you understood. in catalog you see : A Flsah box discount in product info, you see also the flash discount product You have access at a new files flash discount. you can insert for the flash promotion in admin, the start date and the end date with the hour, minutes and secondes.
×