rick_powell85 Posted June 10, 2010 Share Posted June 10, 2010 Hey, I just noticed that the web paths that I gave in my last post are not displaying correctly. Basically, the image paths on internal pages are like: /catalog/index.php/images/store_logo.png When the should be like: /catalog/images/store_logo.png Rick Quote Link to comment Share on other sites More sharing options...
♥FWR Media Posted June 10, 2010 Author Share Posted June 10, 2010 Hey, I just noticed that the web paths that I gave in my last post are not displaying correctly. Basically, the image paths on internal pages are like: /catalog/index.php/images/store_logo.png When the should be like: /catalog/images/store_logo.png Rick Please post the code that is creating this link. Quote Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work. Link to comment Share on other sites More sharing options...
rick_powell85 Posted June 11, 2010 Share Posted June 11, 2010 Which folder do you want me to post the code from? Quote Link to comment Share on other sites More sharing options...
AndreasPi Posted June 12, 2010 Share Posted June 12, 2010 I am experiencing a strange problem after upgrading to PHP 5.3, the category listing is not working anymore. Whenever I click to a category link, it transfers me back to main page, showing me the URL of the SEO site in the browsers adress row. Anyone got an idea? Quote Link to comment Share on other sites More sharing options...
Guest Posted June 13, 2010 Share Posted June 13, 2010 Hi Robert, I have a quick question for you. I have installed Kiss MT and SEO URLs 5 and both seem to be working fine except one button. (yes this is a template monster problem) So, here is the code for the buttons in the products_new.php file: $p_details = '<a href="' . tep_href_link('product_info.php?products_id='.$p_id) . '">'.tep_image_button("button_details.gif").'</a>'; $p_buy_now = '<a href="'.tep_href_link("products_new.php","action=buy_now&products_id=".$p_id).'">'.tep_image_button('button_add_to_cart1.gif').'</a>'; On the 'homepage' when you click on a product image listed in the products_new.php it takes you to the product_info page. When you click the 'Details' Button it states "Product Not Found". So the question is, why does Ultimate SEO's not like that button ? I appreciate your help. Chris Quote Link to comment Share on other sites More sharing options...
♥FWR Media Posted June 13, 2010 Author Share Posted June 13, 2010 (edited) Hi Robert, I have a quick question for you. I have installed Kiss MT and SEO URLs 5 and both seem to be working fine except one button. (yes this is a template monster problem) So, here is the code for the buttons in the products_new.php file: $p_details = '<a href="' . tep_href_link('product_info.php?products_id='.$p_id) . '">'.tep_image_button("button_details.gif").'</a>'; $p_buy_now = '<a href="'.tep_href_link("products_new.php","action=buy_now&products_id=".$p_id).'">'.tep_image_button('button_add_to_cart1.gif').'</a>'; On the 'homepage' when you click on a product image listed in the products_new.php it takes you to the product_info page. When you click the 'Details' Button it states "Product Not Found". So the question is, why does Ultimate SEO's not like that button ? I appreciate your help. Chris Hi Chris the following is correct .. $p_details = '<a href="' . tep_href_link( FILENAME_PRODUCT_INFO, 'products_id=' . $p_id ) . '">' . tep_image_button( 'button_details.gif' ) . '</a>'; $p_buy_now = '<a href="' . tep_href_link( FILENAME_PRODUCTS_NEW, 'action=buy_now&products_id=' . $p_id ) . '">' . tep_image_button( 'button_add_to_cart1.gif' ) . '</a>'; Edited June 13, 2010 by FWR Media Quote Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work. Link to comment Share on other sites More sharing options...
Guest Posted June 13, 2010 Share Posted June 13, 2010 (edited) Hi Chris the following is correct .. $p_details = '<a href="' . tep_href_link( FILENAME_PRODUCT_INFO, 'products_id=' . $p_id ) . '">' . tep_image_button( 'button_details.gif' ) . '</a>'; $p_buy_now = '<a href="' . tep_href_link( FILENAME_PRODUCTS_NEW, 'action=buy_now&products_id=' . $p_id ) . '">' . tep_image_button( 'button_add_to_cart1.gif' ) . '</a>'; Hi Robert, Unfortunately I get the same result with that code, says product not found when you click the details button. However, when you click on the product image it goes to the product info page. Another note, the add to cart button works. *** Actually it might be KissMT. When I disable Ultimate SEO, I still get the Product not found error. *** Do you have any other suggestions ? Chris Edited June 13, 2010 by DunWeb Quote Link to comment Share on other sites More sharing options...
♥FWR Media Posted June 13, 2010 Author Share Posted June 13, 2010 Hi Robert, Unfortunately I get the same result with that code, says product not found when you click the details button. However, when you click on the product image it goes to the product info page. Another note, the add to cart button works. *** Actually it might be KissMT. When I disable Ultimate SEO, I still get the Product not found error. *** Do you have any other suggestions ? Chris Well what link is the details button showing when you hover it? Quote Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work. Link to comment Share on other sites More sharing options...
Guest Posted June 13, 2010 Share Posted June 13, 2010 Well what link is the details button showing when you hover it? Hi Robert, It shows http://www.mysite.com/product_info.php Chris Quote Link to comment Share on other sites More sharing options...
♥FWR Media Posted June 13, 2010 Author Share Posted June 13, 2010 (edited) Hi Robert, It shows http://www.mysite.com/product_info.php Chris In which case chris the following: - $p_details = '<a href="' . tep_href_link( FILENAME_PRODUCT_INFO, 'products_id=' . $p_id ) . '">' . tep_image_button( 'button_details.gif' ) . '</a>'; Is not the code producing the link. USU5 will produce an seo url or revert to the standard tep_href_link() function if that product id is inexistant, nothing in between. Try this .. create a new file in shop root named fwrtest.php .. containing .. <?php $products_id = 'x'; $test_href = '<a href="' . tep_href_link( FILENAME_PRODUCT_INFO, 'products_id=' . $products_id ) . '">' . tep_image_button( 'button_details.gif' ) . '</a>'; include_once 'includes/application_top.php'; echo $test_href . PHP_EOL; include_once 'includes/application_bottom.php'; ?> Change the $products_id to one where you know the details button is not working, then browse to this file. Let me know how it goes please. Edited June 13, 2010 by FWR Media Quote Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work. Link to comment Share on other sites More sharing options...
Guest Posted June 13, 2010 Share Posted June 13, 2010 Hi Robert, This is the error message Fatal error: Call to undefined function tep_href_link() in /home/content/78/6072378/html/fwrtest.php on line 4 Chris Quote Link to comment Share on other sites More sharing options...
Winterburn Posted June 14, 2010 Share Posted June 14, 2010 Hi Robert, This is the error message Fatal error: Call to undefined function tep_href_link() in /home/content/78/6072378/html/fwrtest.php on line 4 Chris Hi, Chris. I have encountered this error today and with some digging, I was able to find out how to solve it. 1. Check what your FILENAME_NEW_PRODUCTS is. (mine is new_products.php under catalog/includes/modules/new_products.php). 2. Find occurrences of these two: tep_href_link('product_info.php?products_id='.$p_id) tep_href_link("products_new.php","action=buy_now&products_id=".$p_id) and replace them with this: tep_href_link( FILENAME_PRODUCT_INFO, 'products_id=' . $p_id ) tep_href_link( FILENAME_PRODUCTS_NEW, 'action=buy_now&products_id=' . $p_id ) Your 'Details' button will then have the right linking. I also suggest that you do that for all product_info occurrences on the website. You can search the site for such occurrences by having SSH access and going to your catalog folder (e.g. ~/public_html/store) and typing the following command: grep -r "product_info.php" . | cut -f1 -d':' | uniq This will show you the files that needs editing. I think it's standard practice to use tep_href_link as it is suggested by osC, with the format <filename, parameters> and not <filename?parameter1=value.. >. Quote Link to comment Share on other sites More sharing options...
Guest Posted June 14, 2010 Share Posted June 14, 2010 Hi, Chris. I have encountered this error today and with some digging, I was able to find out how to solve it. 1. Check what your FILENAME_NEW_PRODUCTS is. (mine is new_products.php under catalog/includes/modules/new_products.php). 2. Find occurrences of these two: tep_href_link('product_info.php?products_id='.$p_id) tep_href_link("products_new.php","action=buy_now&products_id=".$p_id) and replace them with this: tep_href_link( FILENAME_PRODUCT_INFO, 'products_id=' . $p_id ) tep_href_link( FILENAME_PRODUCTS_NEW, 'action=buy_now&products_id=' . $p_id ) Your 'Details' button will then have the right linking. I also suggest that you do that for all product_info occurrences on the website. You can search the site for such occurrences by having SSH access and going to your catalog folder (e.g. ~/public_html/store) and typing the following command: grep -r "product_info.php" . | cut -f1 -d':' | uniq This will show you the files that needs editing. I think it's standard practice to use tep_href_link as it is suggested by osC, with the format <filename, parameters> and not <filename?parameter1=value.. >. Hi Robert, I appreciate the extra effort in helping me solve this mystery. I would never have figured that out. It works and I will search for the other files to make the replacements. Again, thank you for the help. Chris Quote Link to comment Share on other sites More sharing options...
Lucy Fox Posted June 14, 2010 Share Posted June 14, 2010 Hi there. When I choose a manufacturer from my list it accesses it with no issues, however, if I access manufacturers again and choose the 'Please Select' option, it takes me to the FWR Media Page not found. Do you know why this is, and if so, what file i can edit? many thanks. Quote Link to comment Share on other sites More sharing options...
♥FWR Media Posted June 14, 2010 Author Share Posted June 14, 2010 Hi there. When I choose a manufacturer from my list it accesses it with no issues, however, if I access manufacturers again and choose the 'Please Select' option, it takes me to the FWR Media Page not found. Do you know why this is, and if so, what file i can edit? many thanks. Hi Are you using the added file in the replacements folder? Quote Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work. Link to comment Share on other sites More sharing options...
Lucy Fox Posted June 14, 2010 Share Posted June 14, 2010 Hi Are you using the added file in the replacements folder? No - should I be? Quote Link to comment Share on other sites More sharing options...
♥FWR Media Posted June 14, 2010 Author Share Posted June 14, 2010 No - should I be? Possibly yes. there are two drawbacks to the standard manufacturers dropdown. 1) As you found "Please Select" produces index.php?manufacturers_id= which is of course an inexistant manufacturer ( and why therefore USU5 correctly shows a 404 not found page ). 2) Every selection creates a 301 redirect to the seo url, with Google suggesting it is starting to follow such dropdowns this is not really a good idea. The file in "replacements" changes this operation and cures these issues. Quote Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work. Link to comment Share on other sites More sharing options...
Lucy Fox Posted June 14, 2010 Share Posted June 14, 2010 Possibly yes. there are two drawbacks to the standard manufacturers dropdown. 1) As you found "Please Select" produces index.php?manufacturers_id= which is of course an inexistant manufacturer ( and why therefore USU5 correctly shows a 404 not found page ). 2) Every selection creates a 301 redirect to the seo url, with Google suggesting it is starting to follow such dropdowns this is not really a good idea. The file in "replacements" changes this operation and cures these issues. Ok thanks, I haven't edited my manufacturers.php file since my original install. Would simply 'replacing' it with this new file change much else? I annoyingly don't have the skill to tell what else it will change immediately. Quote Link to comment Share on other sites More sharing options...
mfi Posted June 14, 2010 Share Posted June 14, 2010 I have also installed ULTIMATE Seo Urls 5 by FWR media. I did not see any SEO friendly urls. I have read all the documentation, everything looks fine. I have installed it on my localhost. Store is on root folder. Following is the .htaccess file. Any help will be appreciated. # BOF: MOD - Ultimate SEO URLs ## SEO Url's .htaccess file ## If you want to use the Apache Mod-Rewrite method for SEO URL's ## NOTE: This requires that you are on an apache web server with mod_rewrite enabled. <IfModule mod_rewrite.c> Options +FollowSymLinks RewriteEngine On # Change "catalog" to your catalog directory name: RewriteBase / ## If installed to the base home/root directory, uncomment the below code only: RewriteBase / RewriteRule ^(.*)-p-(.*).html$ product_info.php?products_id=$2&%{QUERY_STRING} RewriteRule ^(.*)-c-(.*).html$ index.php?cPath=$2&%{QUERY_STRING} RewriteRule ^(.*)-m-([0-9]+).html$ index.php?manufacturers_id=$2&%{QUERY_STRING} RewriteRule ^(.*)-pi-([0-9]+).html$ popup_image.php?pID=$2&%{QUERY_STRING} RewriteRule ^(.*)-t-([0-9]+).html$ articles.php?tPath=$2&%{QUERY_STRING} RewriteRule ^(.*)-a-([0-9]+).html$ article_info.php?articles_id=$2&%{QUERY_STRING} RewriteRule ^(.*)-pr-([0-9]+).html$ product_reviews.php?products_id=$2&%{QUERY_STRING} RewriteRule ^(.*)-pri-([0-9]+).html$ product_reviews_info.php?products_id=$2&%{QUERY_STRING} RewriteRule ^(.*)-i-([0-9]+).html$ information.php?info_id=$2&%{QUERY_STRING} </ifModule> # EOF: MOD - Ultimate SEO URLs Quote Link to comment Share on other sites More sharing options...
♥FWR Media Posted June 14, 2010 Author Share Posted June 14, 2010 I have also installed ULTIMATE Seo Urls 5 by FWR media. I did not see any SEO friendly urls. I have read all the documentation, everything looks fine. I have installed it on my localhost. Store is on root folder. Following is the .htaccess file. Any help will be appreciated. # BOF: MOD - Ultimate SEO URLs ## SEO Url's .htaccess file ## If you want to use the Apache Mod-Rewrite method for SEO URL's ## NOTE: This requires that you are on an apache web server with mod_rewrite enabled. <IfModule mod_rewrite.c> Options +FollowSymLinks RewriteEngine On # Change "catalog" to your catalog directory name: RewriteBase / ## If installed to the base home/root directory, uncomment the below code only: RewriteBase / RewriteRule ^(.*)-p-(.*).html$ product_info.php?products_id=$2&%{QUERY_STRING} RewriteRule ^(.*)-c-(.*).html$ index.php?cPath=$2&%{QUERY_STRING} RewriteRule ^(.*)-m-([0-9]+).html$ index.php?manufacturers_id=$2&%{QUERY_STRING} RewriteRule ^(.*)-pi-([0-9]+).html$ popup_image.php?pID=$2&%{QUERY_STRING} RewriteRule ^(.*)-t-([0-9]+).html$ articles.php?tPath=$2&%{QUERY_STRING} RewriteRule ^(.*)-a-([0-9]+).html$ article_info.php?articles_id=$2&%{QUERY_STRING} RewriteRule ^(.*)-pr-([0-9]+).html$ product_reviews.php?products_id=$2&%{QUERY_STRING} RewriteRule ^(.*)-pri-([0-9]+).html$ product_reviews_info.php?products_id=$2&%{QUERY_STRING} RewriteRule ^(.*)-i-([0-9]+).html$ information.php?info_id=$2&%{QUERY_STRING} </ifModule> # EOF: MOD - Ultimate SEO URLs The only help that can be given is that you haven't installed it properly. Most likely you missed changing the function tep_href_link() in includes/functions/html_output.php or you'd be getting a ton of errors. Quote Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work. Link to comment Share on other sites More sharing options...
mfi Posted June 14, 2010 Share Posted June 14, 2010 (edited) Thanks for your reply. I used Drop on Top option, did not change any code manually. Currently, urls are looking like this: http://localhost/catalog/index.php/hardware-c-1?osCsid=lgc6p2c5ma18b1ls6ep4qg8m04 I want to display it like: http://localhost/catalog/index.php/hardware.html or for sub categories: http://localhost/catalog/index.php/hardware/cd-rom-drives.html Edited June 14, 2010 by mfi Quote Link to comment Share on other sites More sharing options...
♥FWR Media Posted June 14, 2010 Author Share Posted June 14, 2010 I did not see any SEO friendly urls. They ARE seo urls, what you meant to post is that you have seo urls but they have persistent osCsid ( session_id ). This is normal on a local server as "localhost" is not a valid domain and therefore cookies will not be stored by the browser, therefore you get a persistent session in the querystring. Read back in this support topic I posted how to get sessions working on a local PC ( somewhere ). Quote Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work. Link to comment Share on other sites More sharing options...
mfi Posted June 14, 2010 Share Posted June 14, 2010 OK will check it out. Can I get rid of p and the product number? For example (p-22) in the following url: http://localhost/catalog/product_info.php/unreal-tournament-p-22?osCsid=hqv9a5qtq0elc2ogr2nd4qnq57 Quote Link to comment Share on other sites More sharing options...
♥FWR Media Posted June 14, 2010 Author Share Posted June 14, 2010 (edited) Can I get rid of p and the product number? For example (p-22) in the following url: http://localhost/catalog/product_info.php/unreal-tournament-p-22?osCsid=hqv9a5qtq0elc2ogr2nd4qnq57 No .. something has to tell osCommerce to load the page for .. e.g. products_id=22 which is exactly what -p-22 does. There is a contribution that does rely solely on text but it is a very bad idea in my opinion as text only is not a reliable target. Edited June 14, 2010 by FWR Media Quote Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work. Link to comment Share on other sites More sharing options...
nafri Posted June 16, 2010 Share Posted June 16, 2010 (edited) hi i been trying to use the dev module to create a module for extra_info_pages contrib. instead of the name of the page title in addres bar i am getting.. http://www.mysite.com/-q-15.html .. the page title is Shipping & Returns. here is the code of what i have done. <?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_Information.php 105 2009-11-29 11:13:08Z Rob $: Full Details */ class Usu_extra_info_pages extends aDataMap { const MARKER = '-q-'; // Could for example be -c- or -l- etc. const DEPENDENCY = 'pages_id'; // _GET key like e.g. cPath or lPath etc. const FILENAME = 'extra_info_pages.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 = true; // 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_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_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->information_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 } } ?> In htaccess i have added RewriteRule ^(.*)-q-([0-9]+).html$ extra_info_pages.php?pages_id=$2&%{QUERY_STRING} this is the code from extra info pages $infopageid = (int)$HTTP_GET_VARS['pages_id']; $page_query = tep_db_query("select p.pages_id, p.status, s.pages_title, s.pages_html_text from " . TABLE_PAGES . " p LEFT JOIN " .TABLE_PAGES_DESCRIPTION . " s on p.pages_id = s.pages_id where s.language_id = '" . (int)$languages_id . "' and p.pages_id = $infopageid"); $page_check = tep_db_fetch_array($page_query); $breadcrumb->add($page_check[pages_title], tep_href_link('info_pages.php?pages_id=' . $infopageid)); I know i missing something but dont know what.if any body ahs an idea please do let me know. regards nafri Edited June 16, 2010 by nafri Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.