Jump to content

Gyakutsuki

♥Ambassador
  • Content count

    727
  • Joined

  • Last visited

  • Days Won

    15

Everything posted by Gyakutsuki

  1. Gyakutsuki

    Automatic Currency adjustment by continent

    Example you can do with this contribution You don't want to sell the product the same price on the differents continents, or country This contribution can do that. In currencies section on oscommerce, you can update your currencies or you can change also the amount of conversion. If a customer come from America and clic on french flag, it will see only the price in US and not in EURO. it's impossible for him to compare the price and see the difference Lot big site has this marketing approach. Also lot of persons don't see that, but lot of site change the price if they come with desktop or mobile phone. It consider to create a mobile phone website cost money, and it change the price in function. For example, with this contribution, you can modify the newsletter and send a specific newsletter by continent, country .... ==> that's another marketing approach. the marketing communication approach is not the same in england and America Another exemple, In oder, you can see the address on google map, ip informaton (there is another contribution on that) .... Just a little update this contrib and you can have a lot of informations on your customer for verification or to developp your marketing.
  2. Gyakutsuki

    Automatic Currency adjustment by continent

    in your configure.php : add this define('DIR_FS_CACHE', DIR_FS_CATALOG . 'cache/'); Don't forget to give 777 (recursive) in your geolocalisation directory
  3. Hi robert, my problem is the search in french (boxe search). For example the word supérieur is rewrite suprieur. The é is deleted. If i add é in $language_characters = 'äåæðëöøßþüÿÄÅÆÐËÖØÞÜé'; The research would be good, no ? function cleanseValueString( $string ) { $banned_string_pattern = '@GLOBALS|_REQUEST|base64_encode|UNION|%3C|%3E@i'; // Apply the whitelist // Multi language mod $language_characters = 'äåæðëöøßþüÿÄÅÆÐËÖØÞÜ'; $cleansed = preg_replace ( "/[^\s{}a-z0-9_\.\-@$language_characters]/i", "", urldecode ( $string ) ); // Remove banned words $cleansed = preg_replace ( $banned_string_pattern, '', $cleansed ); // Ensure that a clever hacker hasn't gained himself a naughty double hyphen -- after our cleansing return preg_replace ( '@[-]+@', '-', $cleansed ); } // end method
  4. Hi Robert, This function function cleanseValueString( $string ) { replace the old function function spro_cleanse_get_recursive( $get ) ? ??? when i try to search for example with a word supérieur ==> the research write suprieur with the new function Thank you very for this update and your work +
  5. Gyakutsuki

    pop up country

    Heelo, I try ti insert in my website a pop up country. When the customer arrive in my website, a pop up appear and the customer must choose if it want go in USA store, french store, ou canadian strore for example. My pb is the cookie, When i click on my webpage store, the pop up appear always or, this pop up must appear only one time, when the customer arrive on my website. there the code Do you have an idea with the cookie ? I think the pb is here. Thanks Regards, <script type="text/javascript"> $(function() { $("#modal_country_selector").dialog({ modal: true, draggable: false, stack: false, zIndex: 15000, width: 560, height: 400 }); }); function createCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else { var expires = ""; } document.cookie = name + "=" + value + expires + "; path=/"; } function selectLanguageData(lang, country) { var currentLanguage = 'CA'; if (lang == currentLanguage) { createCookie('country_bind', country, 10); $("#modal_country_selector").dialog("close"); $("#modal_country_selector").dialog("destroy"); } else { if (country == 'USA') { //location.href = '/boutique/index.php?language=en'; return true; } else { if (lang == 'FR') { return true; //location.href = '/boutique/index.php?language=fr'; } else { return true; //location.href = '/boutique/'; } } } return false; } </script> <style> .popup_countries { background: url("/logo.jpg") no-repeat scroll 0 0 transparent; border: 1px solid #000000; font-family: "Trebuchet MS",Arial,Helvetica,sans-serif; height: 360px; position: relative; text-align: left; text-transform: uppercase; width: 540px; } .popup_countries .text_mark1 { color: #646464; font-size: 12px; height: 33px; left: 0; line-height: 33px; overflow: hidden; position: absolute; text-align: center; top: 82px; width: 269px; } .popup_countries .text_mark2 { color: #646464; font-size: 12px; height: 33px; line-height: 33px; overflow: hidden; position: absolute; right: 0; text-align: center; top: 82px; width: 270px; } .popup_countries .lng_sel { color: #000000; font-size: 14px; font-weight: bold; } .popup_countries .lng_sel a { color: #000000; text-decoration: none; } .popup_countries .lng_sel a:hover { color: #000000; text-decoration: underline; } .popup_countries .lng_sel1 { left: 0; position: absolute; text-align: center; top: 149px; width: 179px; } .popup_countries .lng_sel2 { left: 100px; position: absolute; text-align: center; top: 149px; width: 180px; } .popup_countries .lng_sel3 { left : 200px; position: absolute; right: 0; text-align: center; top: 148px; width: 179px; } .popup_countries .lng_sel4 { left : 300px; position: absolute; right: 0; text-align: center; top: 148px; width: 179px; } </style> <div style="display: block; z-index: 1502; outline: 0px none; position: absolute; height: auto; width: 540px; top: 182px; left: 424px;" class="ui-dialog ui-widget ui-widget-content ui-corner-all ui-resizable" tabindex="-1" role="dialog" aria-labelledby="ui-dialog-title-modal_country_selector"><div class="ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix"><span class="ui-dialog-title" id="ui-dialog-title-modal_country_selector"> </span><a href="#" class="ui-dialog-titlebar-close ui-corner-all" role="button"><span class="ui-icon ui-icon-closethick">close</span></a></div><div style="width: auto; min-height: 0px; height: 360px;" id="modal_country_selector" class="ui-dialog-content ui-widget-content"> <div class="popup_countries"> <div class="text_mark1">CHOISIR VOTRE PAYS ET VOTRE LANGUE</div> <div class="text_mark2">SELECT YOUR COUNTRY AND LANGUAGE</div> <div class="lng_sel lng_sel1"><a onclick=" return selectLanguageData('CA', 'CAN')" href="http://www.site.com/boutique/index.php?language=en"><img width="55" height="33" alt="" src="/boutique/sources/image/icons/icon-canada.gif"/></a><br/><a onclick=" return selectLanguageData('CA', 'CAN')" href="http://www.site.com/boutique/index.php?language=en">English</a></div> <div class="lng_sel lng_sel2"><a onclick=" return selectLanguageData('FR', 'CAN')" href="http://www.site.com/boutique/"><img width="55" height="33" alt="" src="/boutique/sources/image/icons/icon-canada.gif"/></a><br/><a onclick=" return selectLanguageData('FR', 'CAN')" href="http://www.site.com/">Français</a></div> <div class="lng_sel lng_sel3"><a onclick=" return selectLanguageData('CA', 'CAN')" href="http://www.site.com/boutique/index.php?language=en"><img width="55" height="33" alt="" src="/boutique/sources/image/icons/icon-usa.gif"/></a><br/><a onclick=" return selectLanguageData('CA', 'CAN')" href="http://www.site.com/boutique/index.php?language=en">English</a></div> <div class="lng_sel lng_sel4"><a onclick=" return selectLanguageData('FR', 'FR')" href="http://www.site.fr"><img width="55" height="33" alt="" src="/boutique/sources/image/icons/icon-canada.gif"/></a><br/><a onclick=" return selectLanguageData('FR', 'FR')" href="http://www.site.fr/">Français</a></div> </div></div><div class="ui-resizable-handle ui-resizable-n"/><div class="ui-resizable-handle ui-resizable-e"/><div class="ui-resizable-handle ui-resizable-s"/><div class="ui-resizable-handle ui-resizable-w"/><div class="ui-resizable-handle ui-resizable-se ui-icon ui-icon-gripsmall-diagonal-se ui-icon-grip-diagonal-se" style="z-index: 1001;"/><div class="ui-resizable-handle ui-resizable-sw" style="z-index: 1002;"/><div class="ui-resizable-handle ui-resizable-ne" style="z-index: 1003;"/><div class="ui-resizable-handle ui-resizable-nw" style="z-index: 1004;"/></div><div class="ui-widget-overlay" style="width: 1388px; height: 1005px; z-index: 1501;"/>
  6. Hello, I try to develop a mega menu, you can see the screen in attachment. my problem is the text. I am not strong in css. i think this contribution can be usefull if it works correctly. yo must adapt in function. The screen shot How to install : Before you must download this jquery script : http://www.geektantra.com/2010/05/jquery-megamenu-2/ the demo is here : http://www.geektantra.com/projects/jquery-megamenu-2/ now in your header.php: $header .= '<script type="text/javascript" src="'ext/javascript/jquery_megamenu_2_1/javascripts/jquery.megamenu.js" /></script>' . "\n"; $header .= '<script type="text/javascript">' . "\n"; $header .= 'jQuery(document).ready(function(){'; $header .= 'jQuery(".megamenu").megamenu({'; $header .= 'activate_action: "mouseover",'; $header .= 'deactivate_action: "mouseleave",'; $header .= 'show_method: "slideDown",'; $header .= 'hide_method: "slideUp",'; $header .= 'justify: "left",'; $header .= 'enable_js_shadow: false,'; $header .= 'shadow_size: 3,'; $header .= 'mm_timeout: 250'; $header .= '});'; $header .= '});' . "\n"; $header .= '</script>' . "\n"; echo $header; Now the stylesheet : <style> /* jQuery MegaMenu Plugin Author: GeekTantra Author URI: [url="http://www.geektantra.com"]http://www.geektantra.com[/url] */ div.searchMegaDropDown { float:right; padding-right:5px; padding-top:10px; padding-bottom:7px; background-color: #a39993; } div.hr, span.hr{ height: 3px; width:100%; background: #b43079; } div.hr hr { display: none; } div.backgroundPageDropDown { background-color: #a39993; height:43px; } div.PageDropDown { float:left; background-color: #a39993; } ul.megamenu { background-color: #a39993; margin: 0px auto; padding: 5px 0px 5px 0px; list-style: none; display: none; width:720px } ul.megamenu li.mm-item { background-color: #a39993; border-right: 1px solid #dadada; padding: 0 68px 0 68px; /* ecart entre les liens de categories */ } ul.megamenu li { margin: 0; padding: 0; } ul.megamenu li.clear-fix { float: none; clear: both; margin: 0; padding: 0; height: 0; font-size: 0; line-height: 0; } ul.megamenu a.mm-item-link:link, ul.megamenu a.mm-item-link:visited { position: relative; display: inline-block; color: #FFF; padding: 8px 16px; /* changer ici pour l'image et l'espacer */ margin: 0 0 0 0; text-decoration: none; text-transform:uppercase; z-index: 600; font-size: 14px; font-weight:bold; } ul.megamenu a.mm-item-link-hover:link { background:url("../../../../../image/template/karawan2011/imy_con_menu_dropdown.gif") no-repeat !important; background-position:left !important; } ul.megamenu a.mm-item-link-hover:visited { width:500px; } ul.megamenu div.mm-item-content { background-color: #c7bbb8; padding: 0px; margin-top:-8px; position: absolute; border: 4px solid #7e736f; z-index: 600; left:0 !important; /* ne pas supprimer */ } .mm-js-shadow { background-color: #555; position: absolute; z-index: 600; } .mm-content-base { background-color: #eae6e4; position: relative; padding: 10px; height:305px; /* hauteur du tableau */ z-index: 600; } #list-content, #list-content ul { margin: 0px; padding-left: 10px; margin-top:10px; } #list-content li { margin: 0px; padding: 10px 20px 20px 20px; } #paragraph-content li{ margin: 0px; padding: 0px; width: 50%; /* Important concernalt les liens des sous catégories niveau 1 */ font-size:14px; font-weight:bold; /* padding-bottom: 50px; espace entre les liens */ } #paragraph-content, #quote-content { text-align: left; /* padding-bottom: 50px; espace entre les paragraphes */ } .megacolumn { width: 860px; /* lageur du tableau */ float: left; } .megacolumnSubSubCategories { width: 310px; float:left; } .megacolumn-content { padding: 10px 0 10px; color:#78615A !important; width: 110%; float:none !important; font-size:14px!important; } .megacolumn-content p { padding-bottom:10px!important; text-align:left; } #mega_c1, #mega_c2 { padding-top:10px; /* border-right: 1px dotted #000; overflow: hidden; */ } .megawrapper { width: 860px; float:left; } /* ****************************** MULTI CSS **********************************/ .megawapperImage1 { width: 860px; height:305px; float:left; background:url("../../../../../image/template/karawan2011/my_image_1.png") no-repeat scroll 710px 200px !important; } .megawapperImage2 { width: 860px; height:305px; float:left; background:url("../../../../../image/template/karawan2011/my_image_2.png") no-repeat scroll 710px 100px !important; } .megawapperImage3 { width: 860px; height:200px; float:left; background:url("../../../../../image/template/karawan2011/my_image3.png") no-repeat scroll 710px 5px !important; } .megawrapper ul { /* background-image: none; */ position: relative; top: auto; padding-bottom: 10px; } .megawrapper ul li { /* background-color: transparent;*/ } .megawrapper ul li a{ height: 1%; position: relative; } .megawrapper ul li a:hover { height: 1%; position: relative; width:100%; } /* sous sous catégorie */ .megawrapperSubSubCategories { /* background-position: bottom; background-repeat: repeat-x; padding-top: 15px; width: 860px; float:left; */ } .megawrapperSubSubCategories ul a{ font-size:12px; text-transform:none; color: #78615A !important; font-weight:normal; font-family:Arial, Helvetica, sans-serif; } .megawrapperSubSubCategories li a{ font-size:12px; text-transform:none; color: #78615A !important; font-weight:normal; font-family:Arial, Helvetica, sans-serif; } .megawrapperSubSubCategories ul li a:hover { color: #78615A !important; font-size:12px; font-weight:normal; font-family:Arial, Helvetica, sans-serif; } </style> Now the script in yoour header or a files : // Create the root unordered list function tep_make_catsf_ullist($rootcatid = 0, $maxlevel = 4){ global $idname_for_menu, $cPath_array, $show_full_tree, $languages_id; $show_full_tree = true; $idname_for_menu = 'megamenu'; // see superfish.css $classname_for_selected = ''; // see superfish.css $classname_for_parent = ''; //see superfish.css // Global Variables $GLOBALS['this_level'] = 0; // Modify category query if not fetching all categories (limit to root cats and selected subcat tree) if (!$show_full_tree) { $parent_query = 'AND (c.parent_id = "0"'; if (isset($cPath_array)) { $cPath_array_temp = $cPath_array; foreach($cPath_array_temp AS $key => $value) { $parent_query .= ' OR c.parent_id = "'.$value.'"'; } unset($cPath_array_temp); } $parent_query .= ')'; } else { $parent_query = ''; } $result = tep_db_query('select c.categories_id, cd.categories_name, c.parent_id from ' . TABLE_CATEGORIES . ' c, ' . TABLE_CATEGORIES_DESCRIPTION . ' cd where c.categories_id = cd.categories_id and c.virtual_categories = 0 and cd.language_id="' . (int)$languages_id .'" '.$parent_query.' order by sort_order, cd.categories_name '); while ($row = tep_db_fetch_array($result)) { $table[$row['parent_id']][$row['categories_id']] = $row['categories_name']; } $output .= '<ul class="'.$idname_for_menu.'">'; // categorie sf_mmenu $output .= '<li>'; $output .= tep_make_catsf_ulbranch($rootcatid, $table, 0, $maxlevel); // Close off nested lists for ($nest = 0; $nest <= $GLOBALS['this_level']; $nest++) { $output .= '</li>'; $output .= '</ul>'; } return $output; } // Create the branches of the unordered list function tep_make_catsf_ulbranch($parcat, $table, $level, $maxlevel) { global $cPath_array, $classname_for_selected, $classname_for_parent, $valCpathCss; $list = $table[$parcat]; while(list($key,$val) = each($list)){ if ($GLOBALS['this_level'] != $level) { if ($GLOBALS['this_level'] < $level) { $output .= "\n"; $output .= '<ul id="paragraph-content">'; $output .= '<li class="list-content">'; $output .= '<div>'; if ($GLOBALS['this_level'] == 0) { $output .= '<div class="megawrapper">'; $output .= '<div class="megawapperImage'.$valCpathCss.'">'; $output .= '<div id="mega_c2" class="megacolumn-content">'; } if ($GLOBALS['this_level'] == 1) { $output .= '<div class="megawrapperSubSubCategories" style=" padding-top:10px !important; width:500px !important; margin-left:-90px !important; padding-bottom:10px !important; border-right: 1px solid #bfb9b7 !important; font-weight:bold !important; font-size:12px !important; font-weight:bold !important; font-size:12px !important; " >'; $output .= '<div style="">'; $output .= '<div style=" ">'; } if ($GLOBALS['this_level'] == 2) { $output .= '<div style=" margin-left:-70px!important; padding-top:10px!important; width:275px!important; /* padding-top:10px!important; padding-bottom:10px!important; float:none!important; */ " >'; $output .= '<div>'; $output .= '<div>'; } else { $output .= ''; } $output .= '<ul>'; } else { for ($nest = 1; $nest <= ($GLOBALS['this_level'] - $level); $nest++) { $output .= '</div>'; $output .= '</div>'; $output .= '</div>'; $output .= '</div>'; $output .= '</li>'; $output .= '</ul>'; } // end for } // end if $GLOBALS['this_level'] = $level; } // end if if (isset($cPath_array) && in_array($key, $cPath_array) && $classname_for_selected) { $this_cat_class = ' class="'.$classname_for_selected.'"'; } else { $this_cat_class = ''; } // $output .= '<li class="cat_lev_'.$level.'"><a href="'; $output .= '<li><a href="'; // affichage du lien if (!$level) { unset($GLOBALS['cPath_set']); $GLOBALS['cPath_set'][0] = $key; $cPath_new = 'cPath=' . $key; $valCpathCss = implode("_", array_slice($GLOBALS['cPath_set'], 0, ($level+1))); } else { $GLOBALS['cPath_set'][$level] = $key; $cPath_new = 'cPath=' . implode("_", array_slice($GLOBALS['cPath_set'], 0, ($level+1))); } if (tep_has_category_subcategories($key) && $classname_for_parent) { $this_parent_class = ' class="'.$classname_for_parent.'"'; } else { $this_parent_class = ''; } // entete couleur du menu $output .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '"'.$this_parent_class.' >'.$val; if (SHOW_COUNTS == 'true') { $products_in_category = tep_count_products_in_category($key); if ($products_in_category > 0) { $output .= ' (' . $products_in_category . ')'; } } $output .= '</a>'; if (!tep_has_category_subcategories($key)) { $output .= '</li>'; } if ((isset($table[$key])) AND (($maxlevel > $level + 1) OR ($maxlevel == '0'))) { $output .= tep_make_catsf_ulbranch($key,$table,$level + 1,$maxlevel); } } // End while loop return $output; } // Initialize HTML and info_box class if displaying inside a box // Generate a bulleted list (uses configuration options above) $categories_string = tep_make_catsf_ullist(); $header_template = '<!-- header template megamenu start -->'; $header_template .= '<div class="clear"></div>'; $header_template .= '<div class="backgroundPageDropDown">'; $header_template .= '<div class="PageDropDown" >'; $header_template .= $categories_string; // display the categories $header_template .= '</div>'; // end PageDropDown $header_template .= '<div class="searchMegaDropDown">'; $header_template .= tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get'); $header_template .= tep_image_submit('button_quick_find.png', MODULE_BOXES_SEARCH_BOX_TITLE, 'align="top"') . ' '. tep_draw_input_field('keywords', '', 'size="60" maxlength="30" style="width: 90px;"') . tep_draw_hidden_field('search_in_description', '1') . tep_hide_session_id() . tep_image_submit('button_quick_find_ok.png', MODULE_BOXES_SEARCH_BOX_TITLE, 'align="top"') .'</a>'; $header_template .= '</form>'; $header_template .= '</div>'; // end search $header_template .= '</div>'; // end backgroundPageDropDown $header_template .= '<div class="clear" style="padding-top:0; padding-bottom:0;"></div>'; $header_template .= '<div class="hr"></div>' . "\n"; $header_template .= '<!-- header template megamenu end -->' . "\n"; echo $header_template; that's all. It must work.
  7. MVS Shipping Cost Estimator work with 2.3 ?
  8. Gyakutsuki

    Ship cost in shopping cart for osc 2.3

    Are you sure ? I don't think it work for 2.3.
  9. Gyakutsuki

    ULTIMATE Seo Urls 5 - by FWR Media

    Hello, I wish knwon if you had seen a problem with the box search with your contribution usu. This is for the french language if I insert in search box : baptème, after validate, write that : baptme ====> è desepear but in a search box but the è is ok /advanced_search_result.php?x=0&y=0&keywords=baptème&search_in_description=1 if in url I change : è by è I found my product. I try on oscommerce with no contribution the url is correct and the search is ok also. Have you seen this pb ? Thank you Loic
  10. Gyakutsuki

    Automatic products tab

    Hello, I try to develop a new product tab module. All i seen is manual. If in my description I have <h3> then the tab is created automaticly it does'nt work again fine, but if you can help me, i think it will be a good contriburion. delete line 135 : <?php echo stripslashes($product_info['products_description']); ?> <style> .rte { color: black; text-align: left; } .clear { clear: both; } /*couleur onglet*/ #more_info_tabs li a.selected { background-color: #B5A432; color: #FFFFFF; } #more_info_tabs li a { border-left: 1px solid #FFFFFF; color: #FFFFFF; height: auto; padding: 7px 20px !important; } ul.idTabsShort li a.selected { border: medium none; color: black; padding: 5px 15px 9px 0; } ul.idTabs li a.selected { height: auto; padding-left: 0; } ul.idTabsShort li a { border: medium none; color: #999999; font-weight: normal; padding: 8px 12px 9px 0 !important; width: auto; } ul.idTabs li a { color: #0066CC; display: block !important; font-weight: bold; height: 10px; text-align: center; text-decoration: none; text-transform: uppercase; } ul.idTabsShort li { line-height: 15px !important; } ul.idTabsShort { border-style: solid none dotted; } ul.idTabs { list-style-type: none; } </style> <?php $products_description = stripslashes($product_info['products_description']); $products_description_content .= '<script type="text/javascript">jQuery(document).ready(function () { jQuery(\'#idTab1\').remove(); jQuery(\'#more_info_tab_more_info\').parent().remove(); });</script>' . "\n"; // tab menu $return = ""; $first = true; if (strpos($desc, '<h3>') !== FALSE) { $cut = explode('<h3>', trim($desc)); foreach ($cut as $k => $part) { if (trim($part) != "") { if (strpos($part, "</h3>") !== FALSE) { $t = substr($part, 0, strpos($part, '</h3>')); $return .= '<li><a href="#idTab100' . $k . '"' . ($first ? 'class="selected"' : '' ) . '>' . $t . '</a></li>' . "\n"; $first = false; } } } } // content menu in the tab $return1 = ""; $desc = $products_description; if (strpos($desc, '<h3>') !== FALSE) { $cut = explode('<h3>', trim($desc)); foreach ($cut as $k => $part) { if (trim($part) != "") { if (strpos($part, "</h3>") !== FALSE) { $r = substr($part, strpos($part, '</h3>') + 5); $return1 .= '<div id="idTab100' . $k . '" class="rte">' . $r . '</div>' . "\n"; } } } } // $products_description_content .= '<div class="clear" id="more_info_block">' . "\n"; $products_description_content .= '<div id="more_info_block">' . "\n"; $products_description_content .= '<ul class="idTabs idTabsShort" id="more_info_tabs">' . "\n"; $products_description_content .= ' '.$return . $return1 . "\n"; $products_description_content .= '</ul>' . "\n"; $products_description_content .= '</div>' . "\n"; // $products_description_content .= '</div>' . "\n"; echo $products_description_content; ?> Regards
  11. Gyakutsuki

    ULTIMATE Seo Urls 5 - by FWR Media

    Hello, It's possible to tell where is my error. I created a new files blog_content.php (see an article) and create a new add on in pages_modules called blog_content.php When I want to see my article, I have a page not found : my original url : http://www.mysite.com/boutique/blog_content.php?blog_content_id=26 Thanks. Process : I write in ht access this line : RewriteRule ^([a-z0-9/-]+)-bl-([0-9]+).html$ blog_content.php [NC,L,QSA] and I write this module : class Blog_Content_Page_Module extends aPage_Modules { private static $_singleton = null; /** * Array of _GET key dependencies for this page * - marker is the seo url replacement for the dependent _GET key ( e.g. -c- replaces cPath ) * - query is the query used to extract the link text from the database * - to_replace is an array of texts that are to be replace with real values in the query * @example protected $dependencies = array( 'cPath' => array( 'marker' => '-c-', * @var array $dependencies */ // 'query' => "SELECT pd.blog_content_name FROM :TABLE_BLOG_CONTENT_DESCRIPTION pd INNER JOIN :TABLE_BLOG_CONTENT p ON pd.blog_content_id = p.blog_content_id WHERE pd.blog_content_id=':blog_content_id' AND pd.language_id=':languages_id' LIMIT 1", protected $dependencies = array( 'blog_content_id' => array( 'marker' => '-bl-', 'query' => "SELECT pd.blog_content_name FROM :TABLE_BLOG_CONTENT_DESCRIPTION pd where pd.blog_content_id=':blog_content_id' AND pd.language_id=':languages_id' LIMIT 1", 'to_replace' => array( ':TABLE_BLOG_CONTENT_DESCRIPTION', ':TABLE_BLOG_CONTENT', ':blog_content_id', ':languages_id' ) ) ); /** * The current dependency key extracted from the incoming parameters * * @var string $key - dependency key */ protected $key = null; /** * extracts the key => value pairs from the querystring in order to build a unique cache name for the loaded page * * @var array $cache_name_builder */ // protected $cache_name_builder = array( 'blog_content_id' => 1, 'reviews_id' => 1 ); // xxx = _GET key ( e.g. cPath ), you may want to add "page" if there are paging functions protected $cache_name_builder = array( 'blog_content_id' => 1); // xxx = _GET key ( e.g. cPath ), you may want to add "page" if there are paging functions /** * Class constructor * @access private */ private function __construct() { } // end constructor /** * Returns a singleton instance of this object * * @access public * @return Blog_Content_Page_Module */ public static function i() { if ( !self::$_singleton instanceof self ) { self::$_singleton = new self; } return self::$_singleton; } // end method /** * Retrieve the dependencies array for this page module * * @access public * @return array $dependencies */ public function retrieveDependencies() { return $this->dependencies; } /** * Acquire an array of single or multiple link texts from the query * this will be cached for later retrieval. * * @see Usu_Main::query() * @uses trim() * * @access protected * @return array array of link test */ protected function acquireLinkText() { $result = Usu_Main::i()->query( $this->query ); $text_array = tep_db_fetch_array( $result ); tep_db_free_result( $result ); if ( false === $text_array ) { return false; } $final_text_array = array(); foreach ( $text_array as $key => $text ) { if ( tep_not_null( trim( $text ) ) ) { $final_text_array[$key] = $text; } } // We will cache this result return $final_text_array; } /** * The main method of this class that receives input needed to build a link * then finally returns a fully built seo link if it has not previousluy returned false. * * @see Usu_Main::getVar() * @see Usu_Main::setVar() * @see aPage_Modules::stripPathToLastNumber() * @see aPage_Modules::setQuery() * @see aPage_Modules::unsetProperties() * @see aPage_Modules::getDependencyKey() * @see aPage_Modules::setAllParams() * @see aPage_Modules::validRequest() * @see aPage_Modules::returnFinalLink() * @param string $page - valid osCommerce page name * @param string $parameters - querystring parameters * @param bool $add_session_id - true / false * @param string $connection - NONSSL / SSL * @param array $extract - array of _GET keys to remove from the querystring or bool false to do nothing * @uses trigger_error() * @throws - triggers an error of type E_USER_WARNING for an incorrect or inexistant dependency key * @access public * @return bool false - forces the system to return the standard osCommerce link wrapper * @return string - fully built seo url */ public function buildLink( $page, $parameters, $add_session_id, $connection ) { $extract = array( 'blog_content_id' ); $this->setAllParams( $page, $parameters, $add_session_id, $connection, $extract ); if ( false === $this->validRequest() ) { $this->unsetProperties(); return false; } $this->key = $this->getDependencyKey(); /** * If the shop has issues it may pass in null values, in this case return false to force the standard osCommerce link wrapper */ if ( !array_key_exists( $this->key, $this->keys_index ) || !tep_not_null( $this->keys_index[$this->key] ) ) { return false; } // Switch statement where the correct query and query marker replacements to use are selected via the _GET key detected switch ( true ) { case $this->key == 'blog_content_id': // xxx = _GET key ( e.g. cPath ) // This array contains replacements for the to_replace array ( see the $dependencies array ) $this->setQuery( array( TABLE_BLOG_CONTENT_DESCRIPTION, TABLE_BLOG_CONTENT, $this->stripPathToLastNumber( $this->keys_index[$this->key] ), Usu_Main::i()->getVar( 'languages_id' ) ) ); break; default: trigger_error( __CLASS__ . '::' . __FUNCTION__ . ' Incorrect or inexistant dependency key.', E_USER_WARNING ); break; } // end switch $link_text = $this->acquireLinkText(); // If the query returned false then we return nothing and set $page_not_found to true forcing a 404 page Usu_Main::i()->setVar( 'page_not_found', false ); if ( false === $link_text ) { Usu_Main::i()->setVar( 'page_not_found', true ); $this->unsetProperties(); return; } // Return a fully built seo url return $this->returnFinalLink( Usu_Main::i() ->getVar( 'uri_modules', USU5_URLS_TYPE ) ->createLinkString( $this->page, Usu_Main::i() ->getVar( 'uri_modules', USU5_URLS_TYPE ) ->separateUriText( $this->linktext( $link_text ) ), $this->dependencies[$this->key]['marker'], $this->keys_index[$this->key] ) ); } // end method } // end class
  12. Gyakutsuki

    ULTIMATE Seo Urls 5 - by FWR Media

    Hi, I found a bug : process : create for example a category : bébé in french language and a category bébé in english language you need the add on character conversion installed If you are in french, there is no problem : bébé is write bebe If you are in english : bébé is write bébés Note I am in utf8 : How to solve this : copy the french.php conversion files and renome in english.php files put this file in character conversion directory. Now work fine. note : if you create a category or product in language and you have several other language in your site with the same name and character (for example in english the é character does'nt exist), you will an error. regards.
  13. Hello,

    I see your contribution navigationHistory remembering x number of pages v1.0

    It's interesting.

    just an information,

    I wish display the customer navigation correctly, your print_r($navigation) display all information with the array.

    How to display on the link of navigation history.

    Thanks

    loic

    +

  14. Gyakutsuki

    ULTIMATE Seo Urls 5 - by FWR Media

    Thank you very much Robert, works very fine.
  15. Gyakutsuki

    ULTIMATE Seo Urls 5 - by FWR Media

    Hello fw, is it possible to have a summary on the different modification on the latest code ? i see in this post differents little bug discover and you have include solutions. A little summary will be intereting occasionnaly. that's a suggestion.
  16. Gyakutsuki

    gallery_image_subdirectory_v1_0_1 (install PROBLEM)

    This module has been created only for the image gallery. You can try to customize this add on.
  17. Gyakutsuki

    gallery_image_subdirectory_v1_0_1 (install PROBLEM)

    Also : change tyhis categories.php // Gallery if (tep_not_null($new_dir)) { mkdir($path . $new_dir, 0755, true); $separator = '/'; } by // Gallery if (tep_not_null($new_dir) && !is_dir($new_dir)) { mkdir($root_images_dir . $new_dir, 0755, true); $separator = '/'; } and <?php // place allowed sub-dirs in array, non-recursive // Gallery $dir_array = array(); if ($handle = opendir($path)) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { if (is_dir($path.$file) && !in_array($file,$exclude_folders)) $dir_array[] = preg_replace("/\/\//si", "/", $file); } } closedir($handle); sort($dir_array); } else { echo '<tr><td>' .TEXT_PRODUCTS_DIRECTORY_DONT_EXIST . ' ' . $path .'<tr></td>'; } $drop_array[0] = array('id' => '', 'text' => TEXT_PRODUCTS_IMAGE_ROOT_DIRECTORY); foreach (tep_opendir($path) as $file) { if ($file['is_dir']) { $img_dir = substr($file['name'], strlen($path)); $drop_array[] = array('id' => $img_dir, 'text' => $img_dir); } } ?> by <?php // place allowed sub-dirs in array, non-recursive $dir_array = array(); foreach (tep_opendir($root_images_dir) as $file) { if ($file['is_dir']) { $img_dir = substr($file['name'], strlen($root_images_dir)); $drop_array[] = array('id' => $img_dir, 'text' => $img_dir); } } ?> i think that's all. i upload another update soon. Regards
  18. Gyakutsuki

    gallery_image_subdirectory_v1_0_1 (install PROBLEM)

    Hello, My txt is not perfectly clear. i insert another. 1 - insert this function in categories.php // gallery configuration // Gallery $exclude_folders = array(); // folders to exclude from adding new images $root_images_dir = DIR_FS_CATALOG_IMAGES .'products/' ; $new_dir = preg_replace('/[^a-zA-Z0-9_.-]/i', '_',$HTTP_POST_VAR['new_directory']); $dir = 'products/' . (tep_not_null($new_dir) ? $new_dir : $HTTP_POST_VAR['directory']); function tep_opendir($path) { $path = rtrim($path, '/') . '/'; $exclude_array = array('.', '..', '.DS_Store', 'Thumbs.db','.php', '_note'); $result = array(); if ($handle = opendir($path)) { while (false !== ($filename = readdir($handle))) { if (!in_array($filename, $exclude_array)) { $file = array('name' => $path . $filename, 'is_dir' => is_dir($path . $filename), 'writable' => is_writable($path . $filename)); $result[] = $file; if ($file['is_dir'] == true) { $result = array_merge($result, tep_opendir($path . $filename)); } } } closedir($handle); } return $result; } 2/ in sec dir, if you have deleted this function, re insert inside require('includes/application_top.php'); function tep_opendir($path) { $path = rtrim($path, '/') . '/'; $exclude_array = array('.', '..', '.DS_Store', 'Thumbs.db'); $result = array(); if ($handle = opendir($path)) { while (false !== ($filename = readdir($handle))) { if (!in_array($filename, $exclude_array)) { $file = array('name' => $path . $filename, 'is_dir' => is_dir($path . $filename), 'writable' => tep_is_writable($path . $filename)); $result[] = $file; if ($file['is_dir'] == true) { $result = array_merge($result, tep_opendir($path . $filename)); } } } closedir($handle); } return $result; } $whitelist_array = array(); 3 - Delete the same function in includes/functions/general.php (tep_opendir($path)
  19. Gyakutsuki

    ULTIMATE Seo Urls 5 - by FWR Media

    Hi, Thank you for this update, it's really interesting contribution. It work fine. I see a difference between the old contribution seo and the new on html generation on the first line code I think it's the contribution but i am not sure. When I edit the source we see in first the ligne <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> In the old there is no space in the first line: ex <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> In the new code the 3 spaces before the first line ...<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> If you generate a xml (google sitemap ou rss.php) it's does'nt work fine and you have an error xml generated because there is the space before the first line code. Erreur d'analyse XML : instruction de traitement XML ou texte pas au début d'une entité externe Emplacement : http:/mysite.com/boutique/google_sitemap_products.php Numéro de ligne 1, Colonne 3 : <?xml version="1.0" encoding="UTF-8"?> --^ ==> but you see the code generated in the source Source Generated ....<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"> Correct source <?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"> Could you look your code if you have the same problem. Just edit the source and look the first line in html code and xml code. Thank
  20. Gyakutsuki

    ULTIMATE Seo Urls 5 - by FWR Media

    Hello, There is a bug with memcache when you have several site in the same server dedicate. For example I have a site1 with : http://www.mysite1/product_name-p-1542.html another site 2 with : http://www.test/product_name-p-1542.html The result is when I am on site 1, I see the url of the site 2. regards.
  21. has not set their status

  22. Gyakutsuki

    ULTIMATE Seo Urls 5 - by FWR Media

    Ok memcache works fine
  23. 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
×